dsh-zcode-startplan 0.2.0 → 0.5.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.
@@ -0,0 +1,353 @@
1
+ /**
2
+ * 端到端冒烟:用 CPU 内的真实组件(账号池 / plan-client / SSE 解码 / 流翻译)跑通
3
+ *
4
+ * ```
5
+ * adapter.stream() → plan-client(选号 / captcha 探测 / 切号)→ 上游 SSE → DSH chunks
6
+ * ```
7
+ *
8
+ * 只把「上游 HTTP」与「captcha 载体」换成假实现;`apply()` 的接线也真跑一遍。
9
+ */
10
+
11
+ import test from 'node:test'
12
+ import assert from 'node:assert/strict'
13
+ import { mkdtempSync, rmSync } from 'node:fs'
14
+ import { tmpdir } from 'node:os'
15
+ import { join } from 'node:path'
16
+
17
+ import { AccountPool, SqliteStore } from '../lib/pool.js'
18
+ import { ZcodePlanClient } from '../lib/plan-client.js'
19
+ import { NativeZcodeStartPlanAdapter } from '../lib/adapter.js'
20
+ import { resolveConfig, Config, apply } from '../index.js'
21
+
22
+ const CREDENTIAL = { zcode_jwt: 'jwt-1', device_mid: 'dev-1', user_id: 'u-1' }
23
+
24
+ const sseStream = (events) =>
25
+ new ReadableStream({
26
+ start(controller) {
27
+ const encoder = new TextEncoder()
28
+ for (const event of events) controller.enqueue(encoder.encode(`event: ${event.type}\ndata: ${JSON.stringify(event)}\n\n`))
29
+ controller.close()
30
+ },
31
+ })
32
+
33
+ const textStream = () =>
34
+ sseStream([
35
+ { type: 'message_start', message: { model: 'GLM-5.3-Flash', usage: { input_tokens: 5 } } },
36
+ { type: 'content_block_start', index: 0, content_block: { type: 'text', text: '' } },
37
+ { type: 'content_block_delta', index: 0, delta: { type: 'text_delta', text: '## 交付物' } },
38
+ { type: 'content_block_delta', index: 0, delta: { type: 'text_delta', text: '\n好的' } },
39
+ { type: 'content_block_stop', index: 0 },
40
+ { type: 'message_delta', delta: { stop_reason: 'end_turn' }, usage: { output_tokens: 2 } },
41
+ { type: 'message_stop' },
42
+ ])
43
+
44
+ const okResponse = (body) => ({
45
+ ok: true,
46
+ status: 200,
47
+ headers: new Headers({ 'content-type': 'text/event-stream' }),
48
+ body,
49
+ })
50
+
51
+ async function makeAdapter(t, options = {}) {
52
+ const dir = mkdtempSync(join(tmpdir(), 'zsp-e2e-'))
53
+ const store = await new SqliteStore(join(dir, 'accounts.db'))
54
+ t.after(() => {
55
+ store.close()
56
+ rmSync(dir, { recursive: true, force: true })
57
+ })
58
+ const pool = new AccountPool({ store })
59
+ pool.add(CREDENTIAL, '测试账号')
60
+
61
+ const minter = {
62
+ async mint() {
63
+ return { param: 'p-1', interactive: false }
64
+ },
65
+ async fetchConfig() {
66
+ return undefined
67
+ },
68
+ }
69
+ const client = new ZcodePlanClient({ pool, minter, fetchImpl: options.fetchImpl })
70
+ const adapter = new NativeZcodeStartPlanAdapter({
71
+ client,
72
+ models: async () => [
73
+ { id: 'GLM-5.3-Flash', name: 'GLM-5.3-Flash', contextWindow: 1_000_000, maxTokens: 65_536, supportsImage: true },
74
+ ],
75
+ })
76
+ return { adapter, pool, store, client }
77
+ }
78
+
79
+ const streamOptions = {
80
+ provider: 'zcode-start-plan',
81
+ model: 'GLM-5.3-Flash',
82
+ maxTokens: 512,
83
+ messages: [{ role: 'user', content: [{ type: 'text', text: '你好' }] }],
84
+ }
85
+
86
+ test('adapter.stream:产出合法的 DSH chunk 序列(以 usage + finish 收尾)', async (t) => {
87
+ const { adapter } = await makeAdapter(t, { fetchImpl: async () => okResponse(textStream()) })
88
+
89
+ const chunks = []
90
+ for await (const chunk of adapter.stream(streamOptions)) chunks.push(chunk)
91
+
92
+ const nonDelta = chunks.map((chunk) => chunk.type).filter((type) => type !== 'text-delta')
93
+ assert.deepEqual(nonDelta, ['block-start', 'block-end', 'usage', 'finish'])
94
+ assert.equal(
95
+ chunks.filter((chunk) => chunk.type === 'text-delta').map((chunk) => chunk.text).join(''),
96
+ '## 交付物\n好的',
97
+ )
98
+ /** finish.reason 是对象(FinishReasonMap),宿主 BlockAssembler 读 chunk.reason。 */
99
+ assert.deepEqual(chunks[chunks.length - 1].reason, { kind: 'stop' })
100
+ assert.equal(chunks[chunks.length - 2].usage.outputTokens, 2)
101
+ })
102
+
103
+ test('adapter.stream:上游失败时以 terminal finish 错误 chunk 收尾(不抛异常)', async (t) => {
104
+ const { adapter } = await makeAdapter(t, {
105
+ fetchImpl: async () => ({
106
+ ok: false,
107
+ status: 403,
108
+ headers: new Headers({ 'content-type': 'application/json' }),
109
+ text: async () => '{"code":3012,"msg":"request has been blocked due to unusual activity."}',
110
+ }),
111
+ })
112
+
113
+ const chunks = []
114
+ for await (const chunk of adapter.stream(streamOptions)) chunks.push(chunk)
115
+ const finish = chunks[chunks.length - 1]
116
+ assert.equal(finish.type, 'finish')
117
+ /** 宿主读 chunk.reason(BlockAssembler);kind 在顶层会被吞成正常结束。 */
118
+ assert.equal(finish.reason.kind, 'error')
119
+ assert.equal(finish.reason.failure.code, 'RATE_LIMIT')
120
+ assert.match(finish.reason.failure.message, /3012/)
121
+ })
122
+
123
+ test('adapter.listModels / resolveModel:模型元数据带上下文窗口与输入模态', async (t) => {
124
+ const { adapter } = await makeAdapter(t)
125
+ const models = await adapter.listModels('zcode-start-plan')
126
+ assert.equal(models.length, 1)
127
+ assert.equal(models[0].context.contextWindow, 1_000_000)
128
+ assert.deepEqual(models[0].inputModalities, ['text', 'image'])
129
+
130
+ const resolved = await adapter.resolveModel('zcode-start-plan', 'GLM-5.3-Flash')
131
+ assert.equal(resolved.id, 'GLM-5.3-Flash')
132
+ assert.equal(resolved.provider, 'zcode-start-plan')
133
+ })
134
+
135
+ test('adapter 契约:providerRetryPolicy 必须可实现(宿主直接调用它)', async (t) => {
136
+ /**
137
+ * `ctx.llm.registerAdapter()` 的 `prepareRoutes` 会**不带可选调用保护**地执行
138
+ * `adapter.providerRetryPolicy(provider)`;漏掉它在宿主里抛
139
+ * `adapter.providerRetryPolicy is not a function`,整条路由注册失败。
140
+ * 这条断言把该契约钉住。
141
+ */
142
+ const { adapter } = await makeAdapter(t)
143
+ assert.equal(typeof adapter.providerRetryPolicy, 'function')
144
+ assert.equal(adapter.providerRetryPolicy('zcode-start-plan'), undefined)
145
+ assert.equal(typeof adapter.providerInfo, 'function')
146
+ const info = adapter.providerInfo('zcode-start-plan')
147
+ assert.equal(info.id, 'zcode-start-plan')
148
+ assert.ok(info.name.length > 0)
149
+ })
150
+
151
+ test('adapter 契约:prepareCall 必须可实现(宿主选模型后直接调用它)', async (t) => {
152
+ /**
153
+ * 宿主在真正发起请求前调用 `adapter.prepareCall(provider, model, signal)`。
154
+ * 基类 `LlmAdapter` 有默认实现,但本适配器没有 extends 基类(避免与宿主版本耦合),
155
+ * 必须自己补 —— 漏掉它表现为
156
+ * `registration.adapter.prepareCall is not a function`:**选模型即报错**。
157
+ */
158
+ const { adapter } = await makeAdapter(t)
159
+ assert.equal(typeof adapter.prepareCall, 'function')
160
+
161
+ const prepared = await adapter.prepareCall('zcode-start-plan', 'GLM-5.3-Flash')
162
+ assert.equal(prepared.model.provider, 'zcode-start-plan')
163
+ assert.equal(prepared.model.id, 'GLM-5.3-Flash')
164
+ assert.equal(typeof prepared.stream, 'function', 'stream 必须是同一次准备代际的入口')
165
+
166
+ /** 流入口要真的能产出 chunk(宿主随后会消费它)。 */
167
+ const chunks = []
168
+ for await (const chunk of prepared.stream({
169
+ provider: 'zcode-start-plan',
170
+ model: 'GLM-5.3-Flash',
171
+ messages: [{ role: 'user', content: [{ type: 'text', text: 'ping' }] }],
172
+ })) {
173
+ chunks.push(chunk)
174
+ }
175
+ assert.ok(chunks.length > 0, 'stream 应产出至少一个 chunk')
176
+ assert.equal(chunks[chunks.length - 1].type, 'finish')
177
+ })
178
+
179
+ test('reasoning efforts:每个 effort 必须有非空 id 与 name,且 id 不重复', async (t) => {
180
+ /**
181
+ * `dsh-llm` 的 `normalizeModelInfo` 逐项校验:
182
+ * typeof effort.id === 'string' && effort.id.length > 0
183
+ * typeof effort.name === 'string' && effort.name.length > 0
184
+ * !seen.has(effort.id)
185
+ * 任一条不中即抛 `INVALID_MODEL_REASONING`
186
+ * ("invalid or duplicate reasoning effort metadata"),模型在宿主里不可用。
187
+ */
188
+ const { toModelInfo } = await import('../lib/adapter.js')
189
+
190
+ const info = toModelInfo('zcode-start-plan', {
191
+ id: 'GLM-5.3',
192
+ name: 'GLM-5.3',
193
+ contextWindow: 1_000_000,
194
+ maxTokens: 128_000,
195
+ supportsImage: false,
196
+ reasoningLevels: ['low', 'high', 'max'],
197
+ defaultReasoningLevel: 'max',
198
+ })
199
+
200
+ assert.equal(info.reasoning.efforts.length, 3)
201
+ for (const effort of info.reasoning.efforts) {
202
+ assert.equal(typeof effort.id, 'string')
203
+ assert.ok(effort.id.length > 0, 'effort.id 不能为空')
204
+ assert.equal(typeof effort.name, 'string')
205
+ assert.ok(effort.name.length > 0, 'effort.name 不能为空')
206
+ }
207
+ assert.deepEqual(info.reasoning.efforts.map((e) => e.id), ['low', 'high', 'max'])
208
+ assert.equal(info.reasoning.defaultEffort, 'max')
209
+
210
+ /** 重复 / 空值档位被过滤,不会让整个模型失效。 */
211
+ const dirty = toModelInfo('p', { id: 'm', reasoningLevels: ['low', 'low', '', 'high'] })
212
+ assert.deepEqual(dirty.reasoning.efforts.map((e) => e.id), ['low', 'high'])
213
+
214
+ /** 没有档位信息时完全不带 reasoning 字段。 */
215
+ const plain = toModelInfo('p', { id: 'm' })
216
+ assert.equal(plain.reasoning, undefined)
217
+ })
218
+
219
+ test('Config 校验:非法 captcha.mode / debugPort 被拒,合法值补齐默认', () => {
220
+ assert.throws(() => Config({ captcha: { mode: 'browser' } }))
221
+ assert.throws(() => Config({ captcha: { debugPort: 0 } }))
222
+ assert.throws(() => Config({ models: 'GLM' }))
223
+
224
+ const good = Config({ captcha: { debugPort: 9333 } })
225
+ assert.deepEqual(good.captcha, { mode: 'cdp', debugPort: 9333, origin: 'https://zcode.z.ai/' })
226
+ assert.deepEqual(good.models, ['GLM-5.3-Flash', 'GLM-5.3'])
227
+ assert.equal(resolveConfig(undefined).provider, 'zcode-start-plan')
228
+ })
229
+
230
+ test('apply:等 llm 出现后注册 adapter + 状态工具,dispose 时收尾', async (t) => {
231
+ const dir = mkdtempSync(join(tmpdir(), 'zsp-apply-'))
232
+ t.after(() => rmSync(dir, { recursive: true, force: true }))
233
+
234
+ const registered = []
235
+ const tools = []
236
+ const disposers = []
237
+ const intervals = []
238
+ const routes = []
239
+ /**
240
+ * 宿主的 `ctx` 是**沙箱 facade**:只暴露 `inject` 声明过的服务。
241
+ * 实测(一次性诊断插件):`Object.keys(ctx)` 仅 `['fiber']`;
242
+ * 碰未声明的服务直接抛 `cannot get property "tools" without inject`。
243
+ * 因此这里按插件的 `inject` 列表(llm/tools/timer)提供服务,
244
+ * 并**不提供** `emit` / `on` / `setInterval`。
245
+ *
246
+ * ⚠ `webServer` **不在 facade 上**(它走可选注入 `ctx.inject(['webServer'], …)`):
247
+ * 这里提供 `inject` 实现来模拟宿主:服务已就绪则立即回调,并把 webServer
248
+ * 交进去。0.4.4 的「面板永远 404」正是因为从 facade 上探测 `ctx.webServer`
249
+ * —— 永远拿不到 —— 而静默跳过注册。
250
+ */
251
+ const ctx = {
252
+ logger: { info() {}, warn() {} },
253
+ llm: {
254
+ registerAdapter: (providers, adapter) => {
255
+ registered.push({ providers, adapter })
256
+ return () => {}
257
+ },
258
+ /** 沙箱里没有 ctx.emit,改用 llm 自己的发布入口。 */
259
+ emitAdaptersUpdated() {},
260
+ },
261
+ tools: { register: (tool) => { tools.push(tool); return () => {} } },
262
+ timer: {
263
+ interval: (callback, delay) => {
264
+ intervals.push(delay)
265
+ return () => {}
266
+ },
267
+ },
268
+ /**
269
+ * 可选注入:宿主只把 `{ webServer }` 这一小份 service 交给回调。
270
+ * 回调里用的 `webCtx.effect` 由宿主托管,这里同样交给 disposers 收集。
271
+ */
272
+ inject(services, callback) {
273
+ assert.deepEqual(services, ['webServer'])
274
+ callback({
275
+ webServer: {
276
+ register: (route) => {
277
+ routes.push(route)
278
+ return () => {}
279
+ },
280
+ },
281
+ effect(fn) {
282
+ const disposer = fn()
283
+ if (typeof disposer === 'function') disposers.push(disposer)
284
+ return disposer
285
+ },
286
+ })
287
+ return () => {}
288
+ },
289
+ effect(fn) {
290
+ /**
291
+ * 宿主语义:`fn` 同步执行,**返回的 disposer 由 effect 持有**;
292
+ * 测试里收集它,模拟 fiber 释放。
293
+ */
294
+ const disposer = fn()
295
+ if (typeof disposer === 'function') disposers.push(disposer)
296
+ return disposer
297
+ },
298
+ }
299
+
300
+ const pluginCleanup = apply(ctx, { dataDir: dir })
301
+
302
+ for (let i = 0; i < 200 && registered.length === 0; i += 1) {
303
+ await new Promise((resolve) => setTimeout(resolve, 20))
304
+ }
305
+
306
+ assert.equal(registered.length, 1)
307
+ assert.deepEqual(registered[0].providers, ['zcode-start-plan'])
308
+ assert.equal(typeof registered[0].adapter.stream, 'function')
309
+ assert.equal(tools.length, 1)
310
+ assert.equal(tools[0].name, 'zcode_start_plan_status')
311
+ assert.deepEqual(intervals, [60 * 60_000], '应通过 ctx.timer.interval 注册每小时清理')
312
+
313
+ /**
314
+ * ⚠ 面板 404 的回归闸:管理路由必须经**可选注入**挂到 `webServer` 上。
315
+ * 0.4.4 从 facade 探测 `ctx.webServer` → 拿不到 → 静默跳过 → 面板永远 404。
316
+ * 这里断言 15 条 `/api/zcode-start-plan/*` 路由真的注册进了路由表。
317
+ */
318
+ assert.equal(routes.length, 15, `应注册 15 条账号面板路由,实际 ${routes.length}`)
319
+ const paths = routes.map((route) => route.path).sort()
320
+ assert.ok(paths.includes('/api/zcode-start-plan/summary'), '缺少 /summary(面板首次加载就靠它)')
321
+ assert.ok(paths.includes('/api/zcode-start-plan/login/start'), '缺少 /login/start')
322
+ assert.ok(paths.includes('/api/zcode-start-plan/login/poll'), '缺少 /login/poll')
323
+ assert.ok(paths.includes('/api/zcode-start-plan/claimable'), '缺少 /claimable(赠送额度查询)')
324
+ assert.ok(paths.includes('/api/zcode-start-plan/claim'), '缺少 /claim(赠送额度领取)')
325
+ assert.ok(paths.includes('/api/zcode-start-plan/restart-cdp'), '缺少 /restart-cdp(以调试端口重启)')
326
+ assert.ok(routes.every((route) => route.kind === 'exact'), '路由必须都是 exact kind')
327
+
328
+ const status = await tools[0].execute()
329
+ assert.equal(status.provider, 'zcode-start-plan')
330
+ assert.equal(status.accountCount, 0)
331
+ assert.equal(typeof status.captcha.reachable, 'boolean')
332
+ /** 官方标准要求 apply 交出 cleanup,且状态工具能报告适配器是否真的注册上。 */
333
+ assert.equal(status.adapterRegistered, true, '状态工具应报告适配器已注册')
334
+
335
+ /**
336
+ * ⚠ 输出必须**无损 JSON**:宿主把 `JSON.parse(text)` 与原值深比较,
337
+ * 带缩进的序列化、以及含 `undefined` 的对象都会被判 `value is not lossless JSON`,
338
+ * 整个工具结果被拒。
339
+ */
340
+ const rendered = tools[0].output.render({}, status)
341
+ assert.equal(rendered[0].type, 'text')
342
+ const parsed = JSON.parse(rendered[0].text)
343
+ assert.deepEqual(parsed, JSON.parse(JSON.stringify(status)))
344
+ /** 结果里不得有 undefined 值(会被 stringify 静默丢弃)。 */
345
+ assert.equal(JSON.stringify(parsed), JSON.stringify(status))
346
+ /** 缺省值一律 null(不是 undefined)—— 否则 round-trip 后键会消失。 */
347
+ assert.equal(status.error, null)
348
+ assert.equal(status.captcha.reason === null || typeof status.captcha.reason === 'string', true)
349
+ assert.equal(typeof pluginCleanup, 'function', 'apply 必须返回 cleanup')
350
+
351
+ /** 收尾只走 apply 的返回值(它内部会释放 SQLite / 端点 / captcha)。 */
352
+ await pluginCleanup()
353
+ })
@@ -0,0 +1 @@
1
+ {"code":1005,"msg":"exceed quota limit","logid":"20261023133203dcba5140cd75aef970d1"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * 登录渠道(国内 智谱 / 国际 Z.AI)的归一化与配置校验。
3
+ *
4
+ * 依据(实测 2026-10-23):两条渠道共用同一个 `oauth/cli/init` 协议,
5
+ * 只在 `provider` 与授权站点上不同;非法 provider 返回 500 code=1000。
6
+ */
7
+
8
+ import test from 'node:test'
9
+ import assert from 'node:assert/strict'
10
+
11
+ import {
12
+ DEFAULT_LOGIN_CHANNEL,
13
+ LOGIN_CHANNELS,
14
+ normalizeLoginChannel,
15
+ resolveLoginChannel,
16
+ } from '../lib/upstream-api.js'
17
+ import { Config } from '../index.js'
18
+
19
+ test('默认渠道是国内站', () => {
20
+ assert.equal(DEFAULT_LOGIN_CHANNEL, 'bigmodel')
21
+ assert.equal(normalizeLoginChannel(undefined), 'bigmodel')
22
+ assert.equal(normalizeLoginChannel(''), 'bigmodel')
23
+ assert.equal(normalizeLoginChannel(' '), 'bigmodel')
24
+ })
25
+
26
+ test('国内渠道的别名(含中文与我自己的简写 cn)', () => {
27
+ for (const input of ['bigmodel', 'cn', 'china', 'domestic', '国内', '智谱', 'CN', 'BigModel']) {
28
+ assert.equal(normalizeLoginChannel(input), 'bigmodel', input)
29
+ }
30
+ })
31
+
32
+ test('国际渠道的别名(含中文与我自己的简写 intl)', () => {
33
+ for (const input of ['zai', 'z-ai', 'intl', 'international', 'global', '国际', '海外', 'ZAI', 'INTL']) {
34
+ assert.equal(normalizeLoginChannel(input), 'zai', input)
35
+ }
36
+ })
37
+
38
+ test('非法渠道回退默认,不抛错(避免把用户挡住)', () => {
39
+ assert.equal(normalizeLoginChannel('bigmodel-intl'), 'bigmodel')
40
+ assert.equal(normalizeLoginChannel('openai'), 'bigmodel')
41
+ })
42
+
43
+ test('渠道描述:provider 是上游真实取值,站点与 API Key 地址不同', () => {
44
+ const cn = resolveLoginChannel('cn')
45
+ const intl = resolveLoginChannel('intl')
46
+ assert.equal(cn.provider, 'bigmodel')
47
+ assert.equal(intl.provider, 'zai')
48
+ assert.equal(cn.site, 'bigmodel.cn')
49
+ assert.equal(intl.site, 'z.ai')
50
+ assert.notEqual(cn.apiKeyUrl, intl.apiKeyUrl)
51
+ assert.match(cn.label, /国内/)
52
+ assert.match(intl.label, /国际/)
53
+ /** 上游只认这两个 provider 值。 */
54
+ assert.deepEqual(Object.keys(LOGIN_CHANNELS).sort(), ['bigmodel', 'zai'])
55
+ })
56
+
57
+ test('Config 是 schemastery 原生 schema(DSH 用 isNativeConfigSchema 判定)', () => {
58
+ /** 与宿主 `isNativeConfigSchema` 完全同构的判据。 */
59
+ const meta = Reflect.get(Config, 'meta')
60
+ assert.equal(Reflect.get(Config, Symbol.for('schemastery')), true)
61
+ assert.equal(typeof Reflect.get(Config, 'type'), 'string')
62
+ assert.equal(typeof meta, 'object')
63
+ assert.notEqual(meta, null)
64
+ })
65
+
66
+ test('Config 校验:channel 只接受 cn/intl 及其别名', () => {
67
+ const accept = (value) => {
68
+ try {
69
+ Config({ channel: value })
70
+ return true
71
+ } catch {
72
+ return false
73
+ }
74
+ }
75
+ for (const good of ['cn', 'intl', 'bigmodel', 'zai', '国内', '国际']) {
76
+ assert.equal(accept(good), true, `应接受 ${good}`)
77
+ }
78
+ for (const bad of ['bigmodel-intl', 'openai', ' ', 'z-ai-x']) {
79
+ assert.equal(accept(bad), false, `应拒绝 ${bad}`)
80
+ }
81
+ })
82
+
83
+ test('Config 校验:默认 channel 是 cn,且未写时也补齐', () => {
84
+ assert.equal(Config({}).channel, 'cn')
85
+ /** 覆盖值原样生效。 */
86
+ assert.equal(Config({ channel: 'intl' }).channel, 'intl')
87
+ })
88
+
89
+ test('Config 其余字段:默认值补齐 + 非法值报错', () => {
90
+ const defaults = Config({})
91
+ assert.deepEqual(defaults.models, ['GLM-5.3-Flash', 'GLM-5.3'])
92
+ assert.deepEqual(defaults.captcha, { mode: 'cdp', debugPort: 9229, origin: 'https://zcode.z.ai/' })
93
+ assert.deepEqual(defaults.endpoint, { enabled: false, port: 17899 })
94
+ assert.equal(defaults.statusTool, true)
95
+ assert.equal(defaults.provider, 'zcode-start-plan')
96
+
97
+ assert.throws(() => Config({ captcha: { mode: 'browser' } }))
98
+ assert.throws(() => Config({ captcha: { debugPort: 0 } }))
99
+ assert.throws(() => Config({ models: 'GLM' }))
100
+ assert.equal(Config({ captcha: { debugPort: 9333 } }).captcha.debugPort, 9333)
101
+ })
102
+