@eddyskywalker/dsh-chatgpt-subscription 0.32.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 +81 -0
- package/README.md +100 -111
- package/lib/client.js +4731 -1239
- package/lib/client.js.map +1 -1
- package/lib/index.js +11514 -3162
- 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 +18 -2
- package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
- package/lib/types/client/hub/hub-styles.d.ts.map +1 -1
- package/lib/types/client/hub/providers.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +4 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/minimax-code/VideoFormDialog.d.ts +46 -50
- package/lib/types/client/minimax-code/VideoFormDialog.d.ts.map +1 -1
- package/lib/types/client/minimax-code/locales.d.ts +80 -20
- package/lib/types/client/minimax-code/locales.d.ts.map +1 -1
- package/lib/types/client/minimax-code/styles.d.ts.map +1 -1
- package/lib/types/client/minimax-code/video-command-host.d.ts +17 -11
- package/lib/types/client/minimax-code/video-command-host.d.ts.map +1 -1
- package/lib/types/client/minimax-code/video-command-icon.d.ts +38 -0
- package/lib/types/client/minimax-code/video-command-icon.d.ts.map +1 -0
- package/lib/types/client/minimax-code/video-command.d.ts +53 -59
- package/lib/types/client/minimax-code/video-command.d.ts.map +1 -1
- package/lib/types/client/minimax-code/video-media-dropzone.d.ts +57 -0
- package/lib/types/client/minimax-code/video-media-dropzone.d.ts.map +1 -0
- package/lib/types/client/minimax-code/video-media-input.d.ts +173 -0
- package/lib/types/client/minimax-code/video-media-input.d.ts.map +1 -0
- package/lib/types/client/minimax-code/video-presets.d.ts +67 -0
- package/lib/types/client/minimax-code/video-presets.d.ts.map +1 -0
- package/lib/types/client/minimax-code/video-workspace.d.ts +41 -0
- package/lib/types/client/minimax-code/video-workspace.d.ts.map +1 -0
- 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/QoderComposerQuota.d.ts +41 -0
- package/lib/types/client/qoder/QoderComposerQuota.d.ts.map +1 -0
- package/lib/types/client/qoder/QoderSection.d.ts +36 -0
- package/lib/types/client/qoder/QoderSection.d.ts.map +1 -0
- package/lib/types/client/qoder/api.d.ts +4 -0
- package/lib/types/client/qoder/api.d.ts.map +1 -0
- package/lib/types/client/qoder/locales.d.ts +316 -0
- package/lib/types/client/qoder/locales.d.ts.map +1 -0
- package/lib/types/client/qoder/styles.d.ts +16 -0
- package/lib/types/client/qoder/styles.d.ts.map +1 -0
- package/lib/types/client/qoder/useQoderSection.d.ts +97 -0
- package/lib/types/client/qoder/useQoderSection.d.ts.map +1 -0
- 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 +34 -1
- 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/account-pool.d.ts +137 -0
- package/lib/types/host/qoder/account-pool.d.ts.map +1 -0
- package/lib/types/host/qoder/adapter.d.ts +158 -0
- package/lib/types/host/qoder/adapter.d.ts.map +1 -0
- package/lib/types/host/qoder/adopt.d.ts +146 -0
- package/lib/types/host/qoder/adopt.d.ts.map +1 -0
- package/lib/types/host/qoder/client.d.ts +301 -0
- package/lib/types/host/qoder/client.d.ts.map +1 -0
- package/lib/types/host/qoder/cosy.d.ts +173 -0
- package/lib/types/host/qoder/cosy.d.ts.map +1 -0
- package/lib/types/host/qoder/mapper.d.ts +235 -0
- package/lib/types/host/qoder/mapper.d.ts.map +1 -0
- package/lib/types/host/qoder/model-catalog.d.ts +231 -0
- package/lib/types/host/qoder/model-catalog.d.ts.map +1 -0
- package/lib/types/host/qoder/oauth.d.ts +134 -0
- package/lib/types/host/qoder/oauth.d.ts.map +1 -0
- package/lib/types/host/qoder/routes.d.ts +119 -0
- package/lib/types/host/qoder/routes.d.ts.map +1 -0
- package/lib/types/host/qoder/token-store.d.ts +280 -0
- package/lib/types/host/qoder/token-store.d.ts.map +1 -0
- package/lib/types/host/qoder/types.d.ts +257 -0
- package/lib/types/host/qoder/types.d.ts.map +1 -0
- package/lib/types/host/workbuddy/adapter.d.ts.map +1 -1
- package/lib/types/host/workbuddy/mapper.d.ts +1 -0
- package/lib/types/host/workbuddy/mapper.d.ts.map +1 -1
- package/lib/types/index.d.ts +15 -0
- 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 +332 -0
- package/lib/types/shared/qoder-contracts.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static facts about the OpenDesign subscription API.
|
|
3
|
+
*
|
|
4
|
+
* The upstream is the OpenDesign link gateway, an OpenAI-compatible endpoint
|
|
5
|
+
* fronting the models a plan's credits can spend. Authentication is a static
|
|
6
|
+
* API key in `Authorization: Bearer`, created in the OpenDesign Cloud console
|
|
7
|
+
* (workspace → API keys): there is no OAuth flow here and nothing expires.
|
|
8
|
+
*
|
|
9
|
+
* Evidence for every constant is in docs/opendesign-line-plan.md; the short
|
|
10
|
+
* version: the gateway host and its `/v1` OpenAI spelling come from the Cloud
|
|
11
|
+
* console's quick-setup bundle (it composes `{link}/v1` for OpenAI clients and
|
|
12
|
+
* recommends Chat Completions for DeepSeek Harness), and each protocol endpoint
|
|
13
|
+
* was probed unauthenticated and answered the expected 401 envelope.
|
|
14
|
+
*
|
|
15
|
+
* The model table below is transcribed from the public, unauthenticated price
|
|
16
|
+
* list — id spellings, display names where the pricing page publishes them, and
|
|
17
|
+
* USD-per-1M-token prices. It carries NO context windows: the gateway does not
|
|
18
|
+
* publish them to an API key, so a model's window is the line default until the
|
|
19
|
+
* user overrides it or a live catalog entry states one. The table is a fallback,
|
|
20
|
+
* not a ceiling: a model the live catalog discovers is adopted with what that
|
|
21
|
+
* listing published rather than hidden.
|
|
22
|
+
*/
|
|
23
|
+
export declare const PROVIDER_ID = "opendesign";
|
|
24
|
+
export declare const PROVIDER_NAME = "OpenDesign";
|
|
25
|
+
/**
|
|
26
|
+
* Default gateway base URL, OpenAI protocol spelling (the `/v1` suffix is part
|
|
27
|
+
* of it; the Anthropic spelling is the bare host and is not what this line
|
|
28
|
+
* speaks). Overridable per deployment and per account.
|
|
29
|
+
*/
|
|
30
|
+
export declare const DEFAULT_BASE_URL = "https://amr-link.open-design.ai/v1";
|
|
31
|
+
/** Public, unauthenticated price list; the shipped table's source. */
|
|
32
|
+
export declare const MODEL_PRICES_URL = "https://amr-api.open-design.ai/api/v1/public/model-prices";
|
|
33
|
+
/**
|
|
34
|
+
* The AMR control-plane base: device authorization and the wallet balance live
|
|
35
|
+
* under it. The device flow's contract is probed live (2026-10-21) and pinned
|
|
36
|
+
* by test/opendesign-oauth.test.ts; the wallet read's shape comes from the
|
|
37
|
+
* open-source daemon's reader (apps/daemon/src/integrations/vela-wallet.ts,
|
|
38
|
+
* nexu-io/open-design) plus issue #8870's field report.
|
|
39
|
+
*/
|
|
40
|
+
export declare const AMR_API_BASE = "https://amr-api.open-design.ai/api/v1";
|
|
41
|
+
/** Device-authorization endpoints under {@link AMR_API_BASE}. */
|
|
42
|
+
export declare const DEVICE_AUTHORIZATIONS_PATH = "/cli/device-authorizations";
|
|
43
|
+
export declare const WALLET_BALANCE_PATH = "/wallet/balance";
|
|
44
|
+
/**
|
|
45
|
+
* What the create call says about this client. The service stores host /
|
|
46
|
+
* profile / cliVersion per authorization (its console lists devices by them);
|
|
47
|
+
* the profile vocabulary is 'prod' | 'test' | 'feature-test' | 'local' per the
|
|
48
|
+
* open-source daemon, and this line only ever speaks to prod.
|
|
49
|
+
*/
|
|
50
|
+
export declare const DEVICE_CLIENT_PROFILE = "prod";
|
|
51
|
+
export declare const DEVICE_CLIENT_NAME = "dsh-chatgpt-subscription";
|
|
52
|
+
/** Conservative context capacity for a model no catalog describes. */
|
|
53
|
+
export declare const DEFAULT_CONTEXT_WINDOW = 128000;
|
|
54
|
+
/**
|
|
55
|
+
* Per-request output budget when the caller states none.
|
|
56
|
+
*
|
|
57
|
+
* A budget, not a ceiling: the harness reserves it as completion room before it
|
|
58
|
+
* compacts, so this decides how much of the window stays available. 64k keeps
|
|
59
|
+
* the reserve far below the compaction ratio while leaving room for a
|
|
60
|
+
* tool-calling agent's longest turn.
|
|
61
|
+
*/
|
|
62
|
+
export declare const DEFAULT_MAX_TOKENS = 64000;
|
|
63
|
+
/**
|
|
64
|
+
* Streams one account may keep open at once; `0` lifts the cap.
|
|
65
|
+
*
|
|
66
|
+
* The cheapest published plan states "10 concurrent tasks"
|
|
67
|
+
* (https://open-design.ai/pricing/, 2026-10-21), so 10 is the one entitlement
|
|
68
|
+
* every paid key definitely has; a deployment that knows its plan may raise it.
|
|
69
|
+
*/
|
|
70
|
+
export declare const DEFAULT_MAX_CONCURRENT_REQUESTS = 10;
|
|
71
|
+
/** Idle budget for one OpenDesign stream. */
|
|
72
|
+
export declare const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 300000;
|
|
73
|
+
/** How long a quota refusal keeps one account out of rotation. */
|
|
74
|
+
export declare const POOL_COOLDOWN_MS: number;
|
|
75
|
+
/**
|
|
76
|
+
* One published model entry.
|
|
77
|
+
*
|
|
78
|
+
* `contextWindow` and `maxTokens` are the VENDOR's published figures, not a
|
|
79
|
+
* promise about this gateway's clamp: no OpenDesign endpoint publishes a window
|
|
80
|
+
* to an API key (the control-plane catalog does, and the live sync prefers it).
|
|
81
|
+
* They are transcribed from this repository's already-sourced tables of the same
|
|
82
|
+
* vendor models — the command-code registry transcription
|
|
83
|
+
* (src/host/command-code/model-catalog.ts), the cline-pass table
|
|
84
|
+
* (src/host/cline-pass/types.ts), the Claude catalog
|
|
85
|
+
* (src/host/claude/model-catalog.ts) and the antigravity catalog
|
|
86
|
+
* (src/host/antigravity/types.ts) — because this line's fallback must not be a
|
|
87
|
+
* flat 128k for every model while those facts sit in the same repository.
|
|
88
|
+
* Per-model conflict resolution prefers the cline-pass table where the two
|
|
89
|
+
* disagree, since it is the OpenAI-chat gateway closest to this one. A live
|
|
90
|
+
* catalog entry and a user override both beat this table, so a clamp this
|
|
91
|
+
* transcription gets wrong costs one correction in the editor, not a permanent
|
|
92
|
+
* ceiling.
|
|
93
|
+
*
|
|
94
|
+
* `efforts` is the selectable reasoning ladder in DSH spelling (`none` is DSH's
|
|
95
|
+
* "do not think"; the command-code registry spells the same level `off` and it
|
|
96
|
+
* is translated here). An empty ladder with `reasoning: false` means no source
|
|
97
|
+
* publishes one for that model; a model with no row data at all keeps the
|
|
98
|
+
* line's default trio rather than being declared a non-reasoner.
|
|
99
|
+
*/
|
|
100
|
+
export interface OpenDesignModelMeta {
|
|
101
|
+
name: string;
|
|
102
|
+
/**
|
|
103
|
+
* USD per 1M tokens from the public price list. Shown, never fabricated: a
|
|
104
|
+
* model the price list does not carry simply has no figure.
|
|
105
|
+
*/
|
|
106
|
+
pricing?: {
|
|
107
|
+
input: number;
|
|
108
|
+
output: number;
|
|
109
|
+
};
|
|
110
|
+
/** The vendor's published context window; absent when no source documents one. */
|
|
111
|
+
contextWindow?: number;
|
|
112
|
+
/** The vendor's published output ceiling; absent when no source documents one. */
|
|
113
|
+
maxTokens?: number;
|
|
114
|
+
/**
|
|
115
|
+
* Selectable reasoning levels, least to greatest, in DSH spelling. Absent
|
|
116
|
+
* means "use the line default"; an empty array means the model exposes none.
|
|
117
|
+
*/
|
|
118
|
+
efforts?: readonly string[];
|
|
119
|
+
/**
|
|
120
|
+
* Whether the model takes an effort knob at all. Absent means yes; `false`
|
|
121
|
+
* marks the rows whose source publishes no ladder.
|
|
122
|
+
*/
|
|
123
|
+
reasoning?: boolean;
|
|
124
|
+
/** Accepted input modalities, as the source table declares them. */
|
|
125
|
+
input: readonly string[];
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* The subscription's models at release time, keyed by wire id.
|
|
129
|
+
*
|
|
130
|
+
* Id spellings and prices are transcribed from MODEL_PRICES_URL (fetched
|
|
131
|
+
* 2026-10-21, 37 entries, all chat models — the plan's image models are priced
|
|
132
|
+
* per call and are not in it). Display names use the pricing page's spelling
|
|
133
|
+
* where that page lists the model (https://open-design.ai/pricing/) and are
|
|
134
|
+
* derived from the id otherwise; the live catalog's own name wins once one is
|
|
135
|
+
* read. Windows, output caps, modalities and ladders come from the sibling
|
|
136
|
+
* tables named on {@link OpenDesignModelMeta}; the live control-plane catalog
|
|
137
|
+
* (which does publish `metadata.contextWindowTokens`) overrides them when read.
|
|
138
|
+
*/
|
|
139
|
+
export declare const MODEL_CATALOG: Readonly<Record<string, OpenDesignModelMeta>>;
|
|
140
|
+
/** Subscription models current at release time; the live catalog extends this. */
|
|
141
|
+
export declare const DEFAULT_MODELS: readonly string[];
|
|
142
|
+
/**
|
|
143
|
+
* The effort ladder a model with no published ladder is advertised with.
|
|
144
|
+
*
|
|
145
|
+
* The OpenAI trio every compatible gateway accepts; an input outside it is a
|
|
146
|
+
* 400 on some gateways, so the default stays deliberately small. A model whose
|
|
147
|
+
* own row publishes a ladder uses that instead.
|
|
148
|
+
*/
|
|
149
|
+
export declare const DEFAULT_EFFORTS: readonly string[];
|
|
150
|
+
/** Published entry for one model id, if the shipped table knows it. */
|
|
151
|
+
export declare function catalogEntry(model: string): OpenDesignModelMeta | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* One model as the live catalog describes it, after merging the shipped table,
|
|
154
|
+
* the last gateway listing and any per-model override.
|
|
155
|
+
*/
|
|
156
|
+
export interface OpenDesignModelInfo {
|
|
157
|
+
id: string;
|
|
158
|
+
displayName: string;
|
|
159
|
+
contextWindow: number;
|
|
160
|
+
maxTokens: number;
|
|
161
|
+
reasoning: boolean;
|
|
162
|
+
/** Selectable effort ladder; empty when the model exposes none. */
|
|
163
|
+
efforts: readonly string[];
|
|
164
|
+
input: readonly string[];
|
|
165
|
+
pricing?: {
|
|
166
|
+
input: number;
|
|
167
|
+
output: number;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
/** One model's metadata as the last gateway listing published it. */
|
|
171
|
+
export interface OpenDesignDiscoveredModel {
|
|
172
|
+
name?: string;
|
|
173
|
+
contextWindow?: number;
|
|
174
|
+
maxTokens?: number;
|
|
175
|
+
input?: string[];
|
|
176
|
+
reasoning?: boolean;
|
|
177
|
+
/** Selectable effort levels, when the listing publishes them. */
|
|
178
|
+
efforts?: string[];
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/host/opendesign/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,WAAW,eAAe,CAAA;AACvC,eAAO,MAAM,aAAa,eAAe,CAAA;AAEzC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,uCAAuC,CAAA;AAEpE,sEAAsE;AACtE,eAAO,MAAM,gBAAgB,8DAA8D,CAAA;AAE3F;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,0CAA0C,CAAA;AAEnE,iEAAiE;AACjE,eAAO,MAAM,0BAA0B,+BAA+B,CAAA;AACtE,eAAO,MAAM,mBAAmB,oBAAoB,CAAA;AAEpD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,SAAS,CAAA;AAC3C,eAAO,MAAM,kBAAkB,6BAA6B,CAAA;AAE5D,sEAAsE;AACtE,eAAO,MAAM,sBAAsB,SAAU,CAAA;AAE7C;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,QAAS,CAAA;AAExC;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,KAAK,CAAA;AAEjD,6CAA6C;AAC7C,eAAO,MAAM,8BAA8B,SAA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AM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAC5C;AAED,qEAAqE;AACrE,MAAM,WAAW,yBAAyB;IACxC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Qoder 线路的号池:共享 \`AccountPoolCore\` 之上的薄封装。
|
|
3
|
+
*
|
|
4
|
+
* 存储、序列化、可用性、轮转、429 冷却都由 \`src/host/common/account-pool.ts\` 管;
|
|
5
|
+
* 本文件只回答「Qoder 这条线的凭据长什么样、怎么刷新、身份怎么算、卡片怎么装配」。
|
|
6
|
+
*
|
|
7
|
+
* 与 step-code 号池的三处不同,各有理由:
|
|
8
|
+
*
|
|
9
|
+
* 1. **刷新钩子是活的。** Qoder 的 token 会过期(types.ts 文件头第 2 条),所以
|
|
10
|
+
* \`expiresAt\` / \`needsRefresh\` / \`refresh\` 三个钩子全部如实实现;
|
|
11
|
+
* 刷新失败按 401/403 → expired(这个账号要重登)、其余 → undefined(瞬时故障不判死)。
|
|
12
|
+
* 2. **两区可以同时在池里。** 区域是凭据的属性(计划 §1),去重键里必须带区域:
|
|
13
|
+
* 否则同一个 uid 在两个部署上会被合并成一行,然后那一行的凭据被拿去打另一个区的主机。
|
|
14
|
+
* 3. **adopt 快照可删。** 本插件只读 \`~/.qoder/.auth/user\`,从不写它;
|
|
15
|
+
* 删掉池里的一行只是删掉本插件自己的加密记录,用户的 qodercli 会话不动。
|
|
16
|
+
*/
|
|
17
|
+
import { AccountPoolCore, type PoolAccountShape, type PoolData } from '../common/account-pool.ts';
|
|
18
|
+
import type { CredentialStore } from '../token-store.ts';
|
|
19
|
+
import type { AccountRotationStrategy, PoolAccountQuotaDto } from '../../shared/account-pool-contracts.ts';
|
|
20
|
+
import type { QoderAccountSummaryDto, QoderQuotaSnapshotDto, QoderRegion, QoderStatusDto } from '../../shared/qoder-contracts.ts';
|
|
21
|
+
import { QODER_CLI_CREDENTIAL_SOURCE, type QoderCredentials, type QoderCredentialOrigin } from './token-store.ts';
|
|
22
|
+
/** 一个池内账号行。凭据整个随行存放;其余是卡片渲染用的非机密事实。 */
|
|
23
|
+
export interface QoderPoolAccount extends PoolAccountShape<QoderCredentials> {
|
|
24
|
+
/** 账号所属区域;由凭据自述,这里是给它做索引用。 */
|
|
25
|
+
region: QoderRegion;
|
|
26
|
+
/** 这份凭据的来源(设备流 / PAT / adopt),供卡片显示。 */
|
|
27
|
+
source: QoderCredentialOrigin;
|
|
28
|
+
}
|
|
29
|
+
/** 号池切片:共享摘要 + 本线路的区域与来源。 */
|
|
30
|
+
export type QoderAccountSummary = QoderAccountSummaryDto;
|
|
31
|
+
/** 本线路自己的加密号池文件。与凭据文件分开:池可以有多行,凭据文件只有主账号一份。 */
|
|
32
|
+
export declare function qoderPoolPath(): string;
|
|
33
|
+
/** keychain / Secret Service 的服务名。与其它线路各用各的,互不相干。 */
|
|
34
|
+
export declare const QODER_POOL_KEYCHAIN_SERVICE = "dsh-qoder-pool";
|
|
35
|
+
/**
|
|
36
|
+
* 身份:两个凭据什么时候是同一个上游账号。
|
|
37
|
+
*
|
|
38
|
+
* 组成是「区域 + uid」,两段都非机密,也都不随重新登录而变(Qoder 的 token 每次
|
|
39
|
+
* 兑换都可能换一把新的,拿 token 当键会让同一个账号每次登录都长成新账号,号池无限增长)。
|
|
40
|
+
*
|
|
41
|
+
* 没有 uid 时退回「区域 + accessToken 的 SHA-256 前 16 字节」:那是**指纹**,不是身份,
|
|
42
|
+
* 但它至少保证同一把 token 落到同一行;两段全空才返回 undefined,那时核心自己生成
|
|
43
|
+
* \`acc_<random>\`,把这一行**新增**而不是与某个无关凭据合并。
|
|
44
|
+
*/
|
|
45
|
+
export declare function qoderPoolIdentity(credentials: QoderCredentials): string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* 校验并归一化整份号池文档。
|
|
48
|
+
*
|
|
49
|
+
* 凭据重新过一遍 \`parseQoderCredentials\`,所以一行不可能装着一份 store 会拒绝写回的形状。
|
|
50
|
+
* 一行凭据读不通就**丢弃这一行**而不是整体报错——\`read()\` 会吞掉一次加载失败并回落,
|
|
51
|
+
* 抛错等于让一行坏数据带走整个池。
|
|
52
|
+
*/
|
|
53
|
+
export declare function parseQoderPoolData(value: unknown): PoolData<QoderPoolAccount>;
|
|
54
|
+
/**
|
|
55
|
+
* 额度快照 → 号池卡片渲染的形状。
|
|
56
|
+
*
|
|
57
|
+
* 只有 \`personal\` 桶进入账号卡的进度条:加购包与组织包是另一条性质的量
|
|
58
|
+
* (它们出现在线路级额度卡里,不在账号卡上)。桶是绝对量,卡片只认得百分比,
|
|
59
|
+
* 换算只在 \`total > 0\` 时做——total 为 0 或缺失的桶**不下发**,而不是画成 0%
|
|
60
|
+
* (「上游没报」与「一点没花」必须长得不一样)。
|
|
61
|
+
*
|
|
62
|
+
* \`windowDurationMins\` 传 null:Qoder 的额度是账号周期余额,没有一个诚实的
|
|
63
|
+
* 「窗口长度」可填,卡片按通用名渲染。\`resetsAt\` 用账号周期截止 \`expiresAt\`。
|
|
64
|
+
*/
|
|
65
|
+
export declare function qoderPoolQuota(snapshot: QoderQuotaSnapshotDto | null | undefined): PoolAccountQuotaDto | undefined;
|
|
66
|
+
/** 本线路号池的构造选项。全部可选:生产按池文件路径构造平台后端。 */
|
|
67
|
+
export interface QoderAccountPoolOptions {
|
|
68
|
+
/** 测试缝;生产按池文件路径构造平台后端(DPAPI / Keychain / SecretService)。 */
|
|
69
|
+
backend?: CredentialStore<PoolData<QoderPoolAccount>>;
|
|
70
|
+
/** 本池接受的账号数上限。 */
|
|
71
|
+
maxAccounts?: number;
|
|
72
|
+
/** 用户在设置里钉住的账号;钉住的账号冷却时自动让位给轮转(核心自己处理)。 */
|
|
73
|
+
preferAccountId?: () => string | null;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* 刷新失败的分类。
|
|
77
|
+
*
|
|
78
|
+
* 401/403 → \`'expired'\`(上游明说这把 token 不行了,这个账号要重登);
|
|
79
|
+
* 其余(网络故障、5xx、形状变了)→ undefined:瞬时故障不该把一个账号判死。
|
|
80
|
+
*/
|
|
81
|
+
export declare function qoderRefreshFailureStatus(error: unknown): 'expired' | 'invalid' | undefined;
|
|
82
|
+
/** 本线路的号池。凭据类型是本线路自己的,刷新钩子全部如实实现。 */
|
|
83
|
+
export declare class QoderAccountPool extends AccountPoolCore<QoderCredentials, QoderPoolAccount, QoderAccountSummary> {
|
|
84
|
+
constructor(options?: QoderAccountPoolOptions);
|
|
85
|
+
/**
|
|
86
|
+
* 把一份 adopt 快照收进号池。
|
|
87
|
+
*
|
|
88
|
+
* 快照已经跑过 \`adopt.ts\` 的解析(解密、字段、区域探测都已确认),这里只补来源标记;
|
|
89
|
+
* 账号仍以 \`qoderPoolIdentity\` 的身份落进池,重复 adopt 同一次登录只会更新同一行。
|
|
90
|
+
*/
|
|
91
|
+
addAdoptedCredential(adopted: {
|
|
92
|
+
readonly credentials: QoderCredentials;
|
|
93
|
+
readonly sourcePath?: string;
|
|
94
|
+
}, alias?: string): Promise<QoderPoolAccount>;
|
|
95
|
+
/**
|
|
96
|
+
* 适配器取下一个账号用的入口。
|
|
97
|
+
*
|
|
98
|
+
* 核心在这里做轮转、冷却、可用性判断与刷新;本方法只多给适配器一件事:
|
|
99
|
+
* 一次请求内换过账号时,把试过的账号排除掉。
|
|
100
|
+
*/
|
|
101
|
+
getEffectiveCredential(excludeIds?: ReadonlySet<string>, fetchFn?: typeof fetch): Promise<{
|
|
102
|
+
account: QoderPoolAccount;
|
|
103
|
+
credentials: QoderCredentials;
|
|
104
|
+
}>;
|
|
105
|
+
/**
|
|
106
|
+
* 一次额度读属于哪个账号,连同读它用的凭据。
|
|
107
|
+
*
|
|
108
|
+
* 写在这里而不是路由里,是因为它是线路形状的(同 step-code 的同名方法的理由):
|
|
109
|
+
* 快照要记在它描述的那一行名下,不会被一次轮转画到另一行名下。
|
|
110
|
+
*/
|
|
111
|
+
getQuotaReadTarget(fetchFn?: typeof fetch): Promise<{
|
|
112
|
+
accountId: string;
|
|
113
|
+
region: QoderRegion;
|
|
114
|
+
credentials: QoderCredentials;
|
|
115
|
+
}>;
|
|
116
|
+
}
|
|
117
|
+
/** 状态应答里的号池切片。 */
|
|
118
|
+
export interface QoderPoolStatus {
|
|
119
|
+
accounts: QoderAccountSummary[];
|
|
120
|
+
activeAccountId?: string;
|
|
121
|
+
rotationStrategy: AccountRotationStrategy;
|
|
122
|
+
/** 本进程是否装上了号池。 */
|
|
123
|
+
poolInstalled: boolean;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* 读状态应答的号池切片。
|
|
127
|
+
*
|
|
128
|
+
* 读不出来的号池不能带倒整张卡:连接那一半仍然值得渲染,只是账号列表是空的。
|
|
129
|
+
*/
|
|
130
|
+
export declare function qoderPoolStatus(pool: QoderAccountPool | undefined): Promise<QoderPoolStatus>;
|
|
131
|
+
/**
|
|
132
|
+
* 把池状态装配成 \`QoderStatusDto\` 的号池切片(**唯一**装配它的地方,
|
|
133
|
+
* 理由同 step-code 的 \`stepCodePoolStatusSlice\`)。
|
|
134
|
+
*/
|
|
135
|
+
export declare function qoderPoolStatusSlice(pool: QoderAccountPool | undefined): Promise<Pick<QoderStatusDto, 'accounts' | 'rotationStrategy' | 'activeAccountId'>>;
|
|
136
|
+
export { QODER_CLI_CREDENTIAL_SOURCE };
|
|
137
|
+
//# sourceMappingURL=account-pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-pool.d.ts","sourceRoot":"","sources":["../../../../src/host/qoder/account-pool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;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AgB,GAAG,SAAS,GACjC,OAAO,CAAC,eAAe,CAAC,CAY1B;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,gBAAgB,GAAG,SAAS,GACjC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,kBAAkB,GAAG,iBAAiB,CAAC,CAAC,CAOpF;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAA"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Qoder(订阅)线路的 DSH 适配器。
|
|
3
|
+
*
|
|
4
|
+
* 形状与 Step Code / GLM 同构(\`extends LlmAdapter\`:listModels / resolveModel /
|
|
5
|
+
* prepareCall / stream / catalog / credentialFor),但它**不碰任何协议细节**:
|
|
6
|
+
*
|
|
7
|
+
* - 请求体、流解析、用量与错误分类全部来自 \`./mapper.ts\`;
|
|
8
|
+
* - COSY 签名与 body 编码全部来自 \`./cosy.ts\`;
|
|
9
|
+
* - URL 与目录缓存全部来自 \`./client.ts\`;
|
|
10
|
+
* - 目录的归一化全部来自 \`./model-catalog.ts\`。
|
|
11
|
+
*
|
|
12
|
+
* 也就是说本文件只回答三件事:**这一行请求用哪个目录行**、**用哪把凭据**、
|
|
13
|
+
* **失败之后换不换账号**。任何一份签名、编码或 JSON 解析在这里出现第二遍,
|
|
14
|
+
* 就等于给线路造了第二条会漂移的真相。
|
|
15
|
+
*
|
|
16
|
+
* 三处刻意如此:
|
|
17
|
+
*
|
|
18
|
+
* 1. **凭据只在 \`credentialFor()\` 一处取。** 有号池时轮转(核心自己处理刷新),
|
|
19
|
+
* 没有池时读单凭据存储(无头 host 与测试的形态)。
|
|
20
|
+
* 2. **请求路径不联网。** 目录只读 \`client.ts\` 的进程内缓存,随包目录兜底;
|
|
21
|
+
* 实时目录是 \`/catalog/refresh\` 与登录/adopt 的产物。
|
|
22
|
+
* 3. **缓存用量在本进程累计。** 累计器住在本文件(流的末端是唯一知道用量帧的地方),
|
|
23
|
+
* \`/status\` 由 \`readQoderCacheStats()\` 读它;路由不另算第二套口径。
|
|
24
|
+
*/
|
|
25
|
+
import { LlmAdapter, type GenerateOptions, type LlmModelInfo, type LlmProviderInfo, type LlmResolvedModelInfo, type PreparedAdapterCall, type ResolvedRetryPolicy, type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
26
|
+
import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
|
|
27
|
+
import { type AttachmentImageReader } from '../common/request-images.ts';
|
|
28
|
+
import { clearCachedQoderModelCatalog, type QoderUpstreamCredential } from './client.ts';
|
|
29
|
+
import { type QoderModelEntry } from './model-catalog.ts';
|
|
30
|
+
import { QoderCredentialStore, QoderModelSettingsStore, type QoderPreferenceStore } from './token-store.ts';
|
|
31
|
+
import type { QoderAccountPool } from './account-pool.ts';
|
|
32
|
+
import { PROVIDER_ID, PROVIDER_NAME } from './types.ts';
|
|
33
|
+
import type { QoderCacheStatsDto, QoderRegion } from '../../shared/qoder-contracts.ts';
|
|
34
|
+
/**
|
|
35
|
+
* 这条路由的瞬时故障重试策略,与兄弟线路逐字一致。
|
|
36
|
+
*
|
|
37
|
+
* 刻意不在集合里:AUTH(被拒的 token 每次都一样,而它只能重新授权)、
|
|
38
|
+
* PROVIDER_ERROR(400 或套餐拒绝)、ABORTED(调用方自己取消)。
|
|
39
|
+
*/
|
|
40
|
+
export declare const QODER_RETRY_POLICY_CONFIG: {
|
|
41
|
+
mode: 'normal';
|
|
42
|
+
maxRetries: number;
|
|
43
|
+
retryableCodes: string[];
|
|
44
|
+
backoff: {
|
|
45
|
+
initialDelayMs: number;
|
|
46
|
+
maxDelayMs: number;
|
|
47
|
+
jitterRatio: number;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
/** 上游没有给 Retry-After 时,一次 429 按 5 分钟冷却。 */
|
|
51
|
+
export declare const QODER_POOL_COOLDOWN_MS: number;
|
|
52
|
+
/**
|
|
53
|
+
* 这个部署能调的模型:**进程内缓存优先、随包目录兜底,请求路径上绝不联网**。
|
|
54
|
+
*
|
|
55
|
+
* 实时目录由 \`/catalog/refresh\`、登录/adopt,以及 \`GET /status\` **应答背后**
|
|
56
|
+
* 的那次自动刷新产生(见 routes.ts);本函数自己一次请求都不发——
|
|
57
|
+
* 让每一次模型解析都去打上游只会把设置页变成一条压测。
|
|
58
|
+
*/
|
|
59
|
+
export declare function cachedQoderModelCatalog(region: QoderRegion): readonly QoderModelEntry[];
|
|
60
|
+
/**
|
|
61
|
+
* 一行的白名单该按哪一套规则收敛;**口径只有这一处**。
|
|
62
|
+
*
|
|
63
|
+
* 适配器的过滤(listModels)与状态面的勾选标记(getQoderStatus)都从这里读,
|
|
64
|
+
* 免得两边各写一份「兜底阶段要不要按白名单筛」而慢慢漂开。
|
|
65
|
+
*
|
|
66
|
+
* - 实时目录:按白名单收敛 + 过滤(上游下线一个模型后,那份残留 id 不该再占名额,
|
|
67
|
+
* 也不该让「已选 N / M」的分子大于目录条目数);
|
|
68
|
+
* - 兜底表:**不按白名单筛**,全部返回(它是能力占位,且与白名单不是同一套 id
|
|
69
|
+
* 词汇表——见 client.ts 的 qoderCatalogIsLive);
|
|
70
|
+
* - `[]`(用户明确全关)与 `null`(不过滤)在两种阶段下的含义都不变:全关就是全关。
|
|
71
|
+
*
|
|
72
|
+
* @param stored 用户存下来的选择(三态)。
|
|
73
|
+
* @param live 当前拿到的是实时目录(true)还是随包兜底表(false)。
|
|
74
|
+
* @param catalog 当前这一份目录(兜底阶段它只用来决定「有没有条目可给」)。
|
|
75
|
+
* @returns 收敛后的白名单;`null` = 不过滤。
|
|
76
|
+
*/
|
|
77
|
+
export declare function convergeQoderSelection(stored: readonly string[] | null, live: boolean, catalog: readonly QoderModelEntry[]): string[] | null;
|
|
78
|
+
/**
|
|
79
|
+
* 设置卡片渲染的模型总数(hub 概览用;取两区随包表的较大者)。
|
|
80
|
+
*
|
|
81
|
+
* ⚠ 它**不带区域**,所以只适合当「这条线路大概有几个模型」的量级读数。
|
|
82
|
+
* 需要与勾选收敛对齐时用 {@link cachedQoderModelCatalog}(按区取,分子分母同源)。
|
|
83
|
+
*/
|
|
84
|
+
export declare function qoderCatalogSize(): number;
|
|
85
|
+
/** 记下一次请求的用量(流读到终止帧之后调用)。 */
|
|
86
|
+
export declare function rememberQoderCacheUsage(usage: {
|
|
87
|
+
inputTokens: number;
|
|
88
|
+
outputTokens: number;
|
|
89
|
+
cacheReadTokens: number;
|
|
90
|
+
cacheWriteTokens: number;
|
|
91
|
+
}): void;
|
|
92
|
+
/**
|
|
93
|
+
* 卡片要的那份切片;**尚无样本时返回 undefined**。
|
|
94
|
+
*
|
|
95
|
+
* 「还没有样本」与「样本全都没命中」必须能被区分:契约里 \`cacheStats\` 是可选的,
|
|
96
|
+
* 客户端把缺失渲染成占位符、把 0 渲染成真实的 0%,所以这里绝不下发一个全 0 的对象。
|
|
97
|
+
*/
|
|
98
|
+
export declare function readQoderCacheStats(): QoderCacheStatsDto | undefined;
|
|
99
|
+
/** 一行请求要用的凭据:发请求只需要 client.ts 认得的那份切片。 */
|
|
100
|
+
export interface QoderPickedCredential {
|
|
101
|
+
/** 号池里的账号 id;无池(单凭据路径)时为 null。 */
|
|
102
|
+
accountId: string | null;
|
|
103
|
+
credentials: QoderUpstreamCredential;
|
|
104
|
+
}
|
|
105
|
+
export interface QoderAdapterOptions {
|
|
106
|
+
fetchFn?: typeof fetch;
|
|
107
|
+
attachments?: AttachmentImageReader;
|
|
108
|
+
/** 多账号号池;缺省走单凭据路径(无头 host 与测试)。 */
|
|
109
|
+
accountPool?: QoderAccountPool;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Qoder(订阅)线路的 LlmAdapter 实现。
|
|
113
|
+
*
|
|
114
|
+
* 请求面只有一个:COSY 签名的 SSE 对话端点(两区同一协议面,区域由凭据决定),
|
|
115
|
+
* 所以本文件里**没有**协议面判定——URL 由 client.ts 从凭据的区域得出。
|
|
116
|
+
*/
|
|
117
|
+
export declare class QoderAdapter extends LlmAdapter {
|
|
118
|
+
private readonly store;
|
|
119
|
+
private readonly modelSettings;
|
|
120
|
+
private readonly preferences;
|
|
121
|
+
private readonly accountPool;
|
|
122
|
+
private readonly options;
|
|
123
|
+
constructor(store?: QoderCredentialStore, modelSettings?: QoderModelSettingsStore, preferences?: QoderPreferenceStore, options?: QoderAdapterOptions);
|
|
124
|
+
providerInfo(provider: string): LlmProviderInfo;
|
|
125
|
+
providerRetryPolicy(): ResolvedRetryPolicy;
|
|
126
|
+
imageRequestPricing(): undefined;
|
|
127
|
+
imageRequestTarget(_provider: string, _model: string, image: ImageAttachmentRef): {
|
|
128
|
+
width: number;
|
|
129
|
+
height: number;
|
|
130
|
+
maxBytes: number;
|
|
131
|
+
};
|
|
132
|
+
private settings;
|
|
133
|
+
/** 这个部署的目录行(缓存优先,请求路径不联网)。 */
|
|
134
|
+
private catalog;
|
|
135
|
+
/**
|
|
136
|
+
* 这一行请求用哪份凭据。
|
|
137
|
+
*
|
|
138
|
+
* 有池时轮转(核心自己做刷新);没有池时读单凭据存储(无头 host 与测试的形态)。
|
|
139
|
+
*/
|
|
140
|
+
private credentialFor;
|
|
141
|
+
listModels(provider?: string): Promise<readonly LlmModelInfo[]>;
|
|
142
|
+
resolveModel(provider: string, model: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
|
|
143
|
+
prepareCall(provider: string, model: string, signal?: AbortSignal): Promise<PreparedAdapterCall>;
|
|
144
|
+
stream(options: GenerateOptions): AsyncIterable<StreamChunk>;
|
|
145
|
+
/**
|
|
146
|
+
* 一次请求的完整往返:选账号 → 定目录行 → 编码+签名 → 发 → 解析信封流。
|
|
147
|
+
*
|
|
148
|
+
* 账号轮转的循环只有一处:一次 429 或一次 AUTH 会把那个账号移出本次请求,
|
|
149
|
+
* 由另一个账号来发**同一份**请求体。没有池时这个循环只跑一次。
|
|
150
|
+
*
|
|
151
|
+
* 编码与签名的顺序是协议事实(inference-protocol.md §3-§4):先 JSON.stringify
|
|
152
|
+
* 一次拿到字节,codec 编码这同一份字节,签名覆盖编码后的字符串——任何中间的
|
|
153
|
+
* 一道 re-marshal 都会让签名的字节与发送的字节漂移。
|
|
154
|
+
*/
|
|
155
|
+
private requestStream;
|
|
156
|
+
}
|
|
157
|
+
export { clearCachedQoderModelCatalog, PROVIDER_ID, PROVIDER_NAME };
|
|
158
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../src/host/qoder/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACL,UAAU,EAIV,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;AAYrE,OAAO,EAAgC,KAAK,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAEtG,OAAO,EACL,4BAA4B,EAM5B,KAAK,uBAAuB,EAC7B,MAAM,aAAa,CAAA;AAEpB,OAAO,EAOL,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAA;AAY3B,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EAGvB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAEtF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,EAAE;IACtC,IAAI,EAAE,QAAQ,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,cA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盘事实全部来自 qodercli2api \`docs/oauth.md\` §4(格式由它的 frozen fixture
|
|
5
|
+
* \`credential.json\` 逐字节锁定,\`test/qoder-adopt.test.ts\` 用同一 fixture 驱动):
|
|
6
|
+
*
|
|
7
|
+
* - 路径:\`~/.qoder/.auth/machine_id\`(36 字符 UUID)与 \`~/.qoder/.auth/user\`;
|
|
8
|
+
* - 信封:strict standard padded Base64;明文是 UserInfo 的 UTF-8 JSON;
|
|
9
|
+
* - key:\`machine_id\` 前 16 个字符的 **raw UTF-8 字节**(不是 hex/base64 解码值);
|
|
10
|
+
* - cipher:AES-128-CBC,IV 与 key 相同,PKCS#7 严格校验;
|
|
11
|
+
* - 兼容:去除外围空白后以 \`{\` 开头的内容按明文 JSON 解析。
|
|
12
|
+
*
|
|
13
|
+
* ---------------------------------------------------------------------------
|
|
14
|
+
* 规则 1 —— 本模块永不写入。它是 reader,而且只是 reader。
|
|
15
|
+
* ---------------------------------------------------------------------------
|
|
16
|
+
* 不得创建、修改、移动或删除任何属于 qodercli 的文件。保证是**结构性**的:
|
|
17
|
+
* 本模块从 node:fs/promises **按名**只导入 readFile 与 stat 两个函数
|
|
18
|
+
* (与 step-code 的 adopt.ts 同一条规则、同一个理由)。
|
|
19
|
+
*
|
|
20
|
+
* ---------------------------------------------------------------------------
|
|
21
|
+
* 规则 2 —— 存在性与内容分成两个函数。
|
|
22
|
+
* ---------------------------------------------------------------------------
|
|
23
|
+
* \`qoderAdoptPresence()\` 便宜到可以在插件启动时调用,只 stat、从不 open;
|
|
24
|
+
* \`adoptQoderSignIn()\` 才是完整读取,且只在用户显式选择之后才被调用。
|
|
25
|
+
*
|
|
26
|
+
* ---------------------------------------------------------------------------
|
|
27
|
+
* 规则 3 —— 认不出来的形状永远给一个**值**,永远不给异常。
|
|
28
|
+
* ---------------------------------------------------------------------------
|
|
29
|
+
* 没有文件、读不了、解密失败、不是 JSON、里面没有 token、两区都不认——全部落在
|
|
30
|
+
* QoderAdoptResultDto 的 reason 枚举里。
|
|
31
|
+
*
|
|
32
|
+
* ---------------------------------------------------------------------------
|
|
33
|
+
* 规则 4 —— **区域不猜,是探出来的**。
|
|
34
|
+
* ---------------------------------------------------------------------------
|
|
35
|
+
* 区域是凭据的属性,而 qodercli 的凭据文件**不记录区域**(格式里没有这个字段)。
|
|
36
|
+
* 所以 adopt 拿解密后的 token 对两区的 userinfo 各探一次(只读 GET),哪区认
|
|
37
|
+
* 就是哪区;两区都不认(token 已失效或被撤销)归为 \`region-unresolved\`——
|
|
38
|
+
* 让用户重新登录,而不是替他决定一个必然 401 的区域(计划 §9 风险 5)。
|
|
39
|
+
*
|
|
40
|
+
* ---------------------------------------------------------------------------
|
|
41
|
+
* 规则 5 —— 快照,不是活凭据。
|
|
42
|
+
* ---------------------------------------------------------------------------
|
|
43
|
+
* adopt 进来的是一份**快照**:qodercli 那边之后的刷新不会流回来;本插件拿着
|
|
44
|
+
* 快照里的 refresh_token 走自己的刷新链,两边从此各刷各的。
|
|
45
|
+
*/
|
|
46
|
+
import { type QoderAdoptResultDto } from '../../shared/qoder-contracts.ts';
|
|
47
|
+
import { QODER_CLI_CREDENTIAL_SOURCE, type QoderCredentials } from './token-store.ts';
|
|
48
|
+
/** 显式指定 qodercli 凭据文件路径的环境变量(测试与嵌入式宿主的口子;非官方变量)。 */
|
|
49
|
+
export declare const QODER_AUTH_PATH_ENV = "QODER_CLI_AUTH_PATH";
|
|
50
|
+
/** 显式指定 qodercli machine_id 路径的环境变量(同上)。 */
|
|
51
|
+
export declare const QODER_MACHINE_ID_PATH_ENV = "QODER_CLI_MACHINE_ID_PATH";
|
|
52
|
+
/** qodercli 的家目录(HOME / USERPROFILE 再退到 os.homedir(),与兄弟线路同一口径)。 */
|
|
53
|
+
export declare function qoderCliHomeDir(env?: NodeJS.ProcessEnv): string;
|
|
54
|
+
/** qodercli 的凭据文件路径。 */
|
|
55
|
+
export declare function qoderCliAuthPath(env?: NodeJS.ProcessEnv): string;
|
|
56
|
+
/** qodercli 的 machine_id 文件路径。 */
|
|
57
|
+
export declare function qoderCliMachineIdFilePath(env?: NodeJS.ProcessEnv): string;
|
|
58
|
+
/** adopt 成功时带走的凭据:凭据 + 它是从哪个文件捡来的。 */
|
|
59
|
+
export interface QoderAdoptedCredential {
|
|
60
|
+
/** 池里的判别式,恒为 true。 */
|
|
61
|
+
readonly adopted: true;
|
|
62
|
+
/** 来源标识,供卡片与池记录。 */
|
|
63
|
+
readonly source: typeof QODER_CLI_CREDENTIAL_SOURCE;
|
|
64
|
+
/** 读到的确切路径,卡片可以把它显示给用户。 */
|
|
65
|
+
readonly sourcePath: string;
|
|
66
|
+
/** 本线路的凭据形态。 */
|
|
67
|
+
readonly credentials: QoderCredentials;
|
|
68
|
+
}
|
|
69
|
+
/** adopt 失败原因,直接取自冻结契约的 QoderAdoptResultDto['reason'],不另立一套。 */
|
|
70
|
+
export type QoderAdoptReason = NonNullable<QoderAdoptResultDto['reason']>;
|
|
71
|
+
/**
|
|
72
|
+
* 每个失败原因对应的一句可照做的下一步。
|
|
73
|
+
*
|
|
74
|
+
* 五个取值各自的下一步不同,所以分开写而不是拼一句「导入失败」。
|
|
75
|
+
*/
|
|
76
|
+
export declare const ADOPT_REASON_HINTS: Readonly<Record<QoderAdoptReason, string>>;
|
|
77
|
+
/** 解析一份已解密的 UserInfo 的结论:要么带凭据材料,要么带一个 reason。 */
|
|
78
|
+
export type QoderAdoptParse = {
|
|
79
|
+
readonly ok: true;
|
|
80
|
+
readonly material: QoderAdoptMaterial;
|
|
81
|
+
} | {
|
|
82
|
+
readonly ok: false;
|
|
83
|
+
readonly reason: QoderAdoptReason;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* 从 UserInfo 里读出的凭据材料(区域还没定:格式里没有这个字段,见规则 4)。
|
|
87
|
+
*/
|
|
88
|
+
export interface QoderAdoptMaterial {
|
|
89
|
+
accessToken: string;
|
|
90
|
+
refreshToken: string | null;
|
|
91
|
+
expiresAt: number;
|
|
92
|
+
uid: string | null;
|
|
93
|
+
email: string | null;
|
|
94
|
+
accountName: string | null;
|
|
95
|
+
organizationId: string | null;
|
|
96
|
+
organizationTags: string[];
|
|
97
|
+
dataPolicyAgreed: boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 把一份已解密的 UserInfo JSON 解析成凭据材料。
|
|
101
|
+
*
|
|
102
|
+
* 纯函数、导出:格式规则可以脱离文件系统与网络被测试。
|
|
103
|
+
*
|
|
104
|
+
* 字段逐字按 qodercli2api 的 fixture 与 pi-provider 的 UserInfo 形状读取,全部按
|
|
105
|
+
* 「可能缺失」处理(计划 §9 风险 5:这份载荷没有逐字 schema):
|
|
106
|
+
*
|
|
107
|
+
* - \`access_token\`(fixture 明文里有)优先,\`security_oauth_token\` 兜底
|
|
108
|
+
* (docs/oauth.md §6:OpenAPI 鉴权用 \`security_oauth_token ?? access_token\`);
|
|
109
|
+
* - \`refresh_token\`、\`uid\`、\`name\`、\`email\`、\`organization_id\`、
|
|
110
|
+
* \`organization_tags\`、\`data_policy_agreed\`、\`expire_time\` 都可能没有。
|
|
111
|
+
*/
|
|
112
|
+
export declare function parseQoderAdoptedUserInfo(value: unknown): QoderAdoptParse;
|
|
113
|
+
/**
|
|
114
|
+
* 本机有没有可导入的 qodercli 登录态(凭据文件 + machine_id 都在才算)。
|
|
115
|
+
*
|
|
116
|
+
* 启动路径安全:它**从不**打开候选文件去读(同 step-code adopt 的那条规则)。
|
|
117
|
+
*/
|
|
118
|
+
export declare function qoderAdoptPresence(env?: NodeJS.ProcessEnv): Promise<boolean>;
|
|
119
|
+
/** 一次 adopt 的结论:给卡片的切片 + (成功时)真正要落盘的凭据。 */
|
|
120
|
+
export interface QoderAdoptOutcome {
|
|
121
|
+
/** 卡片渲染用;不含任何凭据。 */
|
|
122
|
+
readonly result: QoderAdoptResultDto;
|
|
123
|
+
/** 成功时才有:带来源标记的凭据,交给号池或凭据存储落盘。 */
|
|
124
|
+
readonly adopted?: QoderAdoptedCredential;
|
|
125
|
+
/** 实际读到的文件(设置卡片要把它显示出来)。 */
|
|
126
|
+
readonly sourcePath?: string;
|
|
127
|
+
}
|
|
128
|
+
export interface QoderAdoptOptions {
|
|
129
|
+
/** 环境变量读取处;缺省 process.env,且**调用时**读取。 */
|
|
130
|
+
env?: NodeJS.ProcessEnv;
|
|
131
|
+
/** 区域探测的请求缝(测试注入 mock fetch)。 */
|
|
132
|
+
fetchFn?: typeof fetch;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* 只读导入本机 qodercli 登录态。
|
|
136
|
+
*
|
|
137
|
+
* **只在用户显式 opt in 之后调用**(见模块头规则 2)。永不抛出、永不拒绝。
|
|
138
|
+
*
|
|
139
|
+
* 区域探测(规则 4):拿解密后的 token 依次对 global、cn 的 userinfo 发只读 GET,
|
|
140
|
+
* 第一个认账的区域获胜;两区都不认 → \`region-unresolved\`。探测只认「请求成功」,
|
|
141
|
+
* 任何网络/鉴权失败都记为不认账——探测的目的是定位,不是诊断。
|
|
142
|
+
*/
|
|
143
|
+
export declare function adoptQoderSignIn(options?: QoderAdoptOptions): Promise<QoderAdoptOutcome>;
|
|
144
|
+
/** 只要那张给卡片的切片(不带走凭据)。 */
|
|
145
|
+
export declare function readQoderAdoptResult(options?: QoderAdoptOptions): Promise<QoderAdoptResultDto>;
|
|
146
|
+
//# sourceMappingURL=adopt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt.d.ts","sourceRoot":"","sources":["../../../../src/host/qoder/adopt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAMH,OAAO,EAEL,KAAK,mBAAmB,EAEzB,MAAM,iCAAiC,CAAA;AAQxC,OAAO,EAAsB,2BAA2B,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAMzG,oDAAoD;AACpD,eAAO,MAAM,mBAAmB,wBAAwB,CAAA;AAExD,4CAA4C;AA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