dsh-model-allowance 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/README.zh.md +4 -0
- package/client.js +353 -9
- package/lib/balance.js +39 -4
- package/lib/providers/deepseek.js +41 -3
- package/lib/providers/{kimi.js → kimi_coding.js} +2 -2
- package/lib/providers/{minimax.js → minimax_cn.js} +5 -5
- package/lib/providers/{opencode.js → opencode_go.js} +2 -2
- package/lib/providers/placeholder.js +580 -0
- package/lib/providers/{zhipu.js → zai.js} +5 -5
- package/lib/providers.js +85 -9
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
* Where DeepSeek's own console shows the same wallet this plugin reads.
|
|
23
23
|
* Verified 2026-11-06.
|
|
24
24
|
*/
|
|
25
|
-
const CONSOLE = 'https://platform.deepseek.com/
|
|
25
|
+
const CONSOLE = 'https://platform.deepseek.com/usage'
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* DeepSeek publishes its live platform status on a FlashCat status page.
|
|
@@ -48,8 +48,9 @@ const STATUS = Object.freeze({
|
|
|
48
48
|
* statutory holidays are off-peak all day; a working weekend stays a weekend
|
|
49
49
|
* under the rule, which names Monday to Friday.
|
|
50
50
|
*
|
|
51
|
-
* The holiday list
|
|
52
|
-
* 〔2025〕7号). Extend it when
|
|
51
|
+
* The holiday list covers the State Council's 2026 arrangement (国办发明电
|
|
52
|
+
* 〔2025〕7号) and 2027 arrangement (国办发明电〔2026〕10号). Extend it when
|
|
53
|
+
* the next year's notice is published.
|
|
53
54
|
*/
|
|
54
55
|
const SCHEDULE = defineSchedule({
|
|
55
56
|
timezone: 'Asia/Shanghai',
|
|
@@ -100,6 +101,43 @@ const SCHEDULE = defineSchedule({
|
|
|
100
101
|
'2026-10-05',
|
|
101
102
|
'2026-10-06',
|
|
102
103
|
'2026-10-07',
|
|
104
|
+
// ===== 2027年(国办发明电〔2026〕10号)=====
|
|
105
|
+
// 元旦
|
|
106
|
+
'2027-01-01',
|
|
107
|
+
'2027-01-02',
|
|
108
|
+
'2027-01-03',
|
|
109
|
+
// 春节
|
|
110
|
+
'2027-02-05',
|
|
111
|
+
'2027-02-06',
|
|
112
|
+
'2027-02-07',
|
|
113
|
+
'2027-02-08',
|
|
114
|
+
'2027-02-09',
|
|
115
|
+
'2027-02-10',
|
|
116
|
+
'2027-02-11',
|
|
117
|
+
'2027-02-12',
|
|
118
|
+
'2027-02-13',
|
|
119
|
+
// 清明节
|
|
120
|
+
'2027-04-03',
|
|
121
|
+
'2027-04-04',
|
|
122
|
+
'2027-04-05',
|
|
123
|
+
// 劳动节
|
|
124
|
+
'2027-05-01',
|
|
125
|
+
'2027-05-02',
|
|
126
|
+
'2027-05-03',
|
|
127
|
+
'2027-05-04',
|
|
128
|
+
'2027-05-05',
|
|
129
|
+
// 端午节
|
|
130
|
+
'2027-06-09',
|
|
131
|
+
// 中秋节
|
|
132
|
+
'2027-09-15',
|
|
133
|
+
// 国庆节
|
|
134
|
+
'2027-10-01',
|
|
135
|
+
'2027-10-02',
|
|
136
|
+
'2027-10-03',
|
|
137
|
+
'2027-10-04',
|
|
138
|
+
'2027-10-05',
|
|
139
|
+
'2027-10-06',
|
|
140
|
+
'2027-10-07',
|
|
103
141
|
],
|
|
104
142
|
note: { zh: '低谷时段 API 价格减半', en: 'API prices are halved off-peak' },
|
|
105
143
|
})
|
|
@@ -24,7 +24,7 @@ import { statuspageView } from './status.js'
|
|
|
24
24
|
* Kimi's plan usage lives under 我的 → 设置 → 订阅 in the web app, which is
|
|
25
25
|
* this route. Verified 2026-11-06.
|
|
26
26
|
*/
|
|
27
|
-
const CONSOLE = 'https://www.kimi.com/settings'
|
|
27
|
+
const CONSOLE = 'https://www.kimi.com/settings/subscription'
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Moonshot — the platform behind Kimi — publishes its live status on an
|
|
@@ -266,7 +266,7 @@ function readUsage({ route, body }) {
|
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
/** Kimi for Coding's route. */
|
|
269
|
-
export const
|
|
269
|
+
export const kimiCodingAdapters = [
|
|
270
270
|
defineAdapter({
|
|
271
271
|
id: 'kimi-coding',
|
|
272
272
|
routes: ['kimi-coding'],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* MiniMax adapter.
|
|
2
|
+
* MiniMax (CN) adapter.
|
|
3
3
|
*
|
|
4
4
|
* The coding plan answers a GET with bearer auth; a POST with a `key` body is
|
|
5
5
|
* the pay-as-you-go shape and returns 404 for a plan key, so the GET is the
|
|
@@ -218,10 +218,10 @@ function readTokenPlan({ route, body, model }) {
|
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
/** MiniMax's coding-plan route. */
|
|
222
|
-
export const
|
|
221
|
+
/** MiniMax (CN)'s coding-plan route. */
|
|
222
|
+
export const minimaxCnAdapters = [
|
|
223
223
|
defineAdapter({
|
|
224
|
-
id: 'minimax-
|
|
224
|
+
id: 'minimax-cn',
|
|
225
225
|
routes: ['minimax-cn'],
|
|
226
226
|
kind: KIND_QUOTA,
|
|
227
227
|
modelScoped: true,
|
|
@@ -232,7 +232,7 @@ export const minimaxAdapters = [
|
|
|
232
232
|
consoleUrl: CONSOLE,
|
|
233
233
|
status: STATUS,
|
|
234
234
|
display: {
|
|
235
|
-
name: { zh: 'MiniMax', en: 'MiniMax' },
|
|
235
|
+
name: { zh: 'MiniMax (国内)', en: 'MiniMax (CN)' },
|
|
236
236
|
mark: { icon: 'minimax', color: '#e21680' },
|
|
237
237
|
},
|
|
238
238
|
fixtures: [
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import { normalizeState, STATUS_OPERATIONAL, STATUS_UNKNOWN } from './status.js'
|
|
19
19
|
|
|
20
20
|
/** The Go plan page, where the plan itself is managed. Verified 2026-11-06. */
|
|
21
|
-
const CONSOLE = 'https://opencode.ai/
|
|
21
|
+
const CONSOLE = 'https://opencode.ai/console/workspace'
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* OpenCode published its own status API, and it names Go as a component —
|
|
@@ -117,7 +117,7 @@ function readUsage({ route, body }) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
/** OpenCode Go's route. */
|
|
120
|
-
export const
|
|
120
|
+
export const opencodeGoAdapters = [
|
|
121
121
|
defineAdapter({
|
|
122
122
|
id: 'opencode-go',
|
|
123
123
|
routes: ['opencode-go'],
|