@eum-agent/llm-provider-zhipu 0.0.0-stage → 1.1.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/assets/NOTICE ADDED
@@ -0,0 +1,28 @@
1
+ Vendor marks from lobehub/lobe-icons (@lobehub/icons-static-svg 1.95.1, MIT), except where noted. Each file is named for the catalogue row contributed by its owning provider extension.
2
+
3
+ - zhipu*.svg: the Z glyph from Z.ai's own logo (https://z-cdn.chatglm.cn/z-ai/static/logo.svg), without its dark tile.
4
+ - kimi-coding*.svg: the K filled black, as kimi.com's light-scheme favicon draws it; the lobe-icons original fills it white.
5
+
6
+ The lobe-icons marks are distributed under the MIT License:
7
+
8
+ MIT License
9
+
10
+ Copyright (c) 2023 LobeHub
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ <svg height="24" viewBox="3 3 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><title>Zhipu</title><g fill="#2D2D2D"><path d="M15.47 7.1l-1.3 1.85c-.2.29-.54.47-.9.47h-7.1V7.09c-.01.01 9.3.01 9.3.01z"/><path d="M24.3 7.1L13.14 22.91H5.7L16.86 7.1z"/><path d="M14.53 22.91l1.31-1.86c.2-.29.54-.47.9-.47h7.09v2.33h-9.3z"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg height="24" viewBox="3 3 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><title>Zhipu</title><g fill="#2D2D2D"><path d="M15.47 7.1l-1.3 1.85c-.2.29-.54.47-.9.47h-7.1V7.09c-.01.01 9.3.01 9.3.01z"/><path d="M24.3 7.1L13.14 22.91H5.7L16.86 7.1z"/><path d="M14.53 22.91l1.31-1.86c.2-.29.54-.47.9-.47h7.09v2.33h-9.3z"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg height="24" viewBox="3 3 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><title>Zhipu</title><g fill="#2D2D2D"><path d="M15.47 7.1l-1.3 1.85c-.2.29-.54.47-.9.47h-7.1V7.09c-.01.01 9.3.01 9.3.01z"/><path d="M24.3 7.1L13.14 22.91H5.7L16.86 7.1z"/><path d="M14.53 22.91l1.31-1.86c.2-.29.54-.47.9-.47h7.09v2.33h-9.3z"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg height="24" viewBox="3 3 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><title>Zhipu</title><g fill="#2D2D2D"><path d="M15.47 7.1l-1.3 1.85c-.2.29-.54.47-.9.47h-7.1V7.09c-.01.01 9.3.01 9.3.01z"/><path d="M24.3 7.1L13.14 22.91H5.7L16.86 7.1z"/><path d="M14.53 22.91l1.31-1.86c.2-.29.54-.47.9-.47h7.09v2.33h-9.3z"/></g></svg>
package/dist/index.js ADDED
@@ -0,0 +1,1203 @@
1
+ //#endregion
2
+ //#region src/catalog.ts
3
+ /** Supplier-owned catalogue rows; protocol request facts belong to protocol registrations. */
4
+ const catalog = {
5
+ vendors: [
6
+ {
7
+ kind: "vendor",
8
+ id: "zhipu-cn",
9
+ logo: "data:image/svg+xml,%3Csvg%20height%3D%2224%22%20viewBox%3D%223%203%2024%2024%22%20width%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ctitle%3EZhipu%3C%2Ftitle%3E%3Cg%20fill%3D%22%232D2D2D%22%3E%3Cpath%20d%3D%22M15.47%207.1l-1.3%201.85c-.2.29-.54.47-.9.47h-7.1V7.09c-.01.01%209.3.01%209.3.01z%22%2F%3E%3Cpath%20d%3D%22M24.3%207.1L13.14%2022.91H5.7L16.86%207.1z%22%2F%3E%3Cpath%20d%3D%22M14.53%2022.91l1.31-1.86c.2-.29.54-.47.9-.47h7.09v2.33h-9.3z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A",
10
+ name: "智谱 GLM",
11
+ region: "国内",
12
+ market: "domestic",
13
+ catalogKey: "zhipuai",
14
+ canListModels: true,
15
+ endpoints: [{
16
+ baseUrl: "https://open.bigmodel.cn/api/v1",
17
+ modelThinkingSwitch: true,
18
+ type: "glm",
19
+ endpointId: "zhipu-cn",
20
+ protocolIds: [
21
+ "openai",
22
+ "openai-responses",
23
+ "anthropic"
24
+ ]
25
+ }]
26
+ },
27
+ {
28
+ kind: "vendor",
29
+ id: "zhipu",
30
+ logo: "data:image/svg+xml,%3Csvg%20height%3D%2224%22%20viewBox%3D%223%203%2024%2024%22%20width%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ctitle%3EZhipu%3C%2Ftitle%3E%3Cg%20fill%3D%22%232D2D2D%22%3E%3Cpath%20d%3D%22M15.47%207.1l-1.3%201.85c-.2.29-.54.47-.9.47h-7.1V7.09c-.01.01%209.3.01%209.3.01z%22%2F%3E%3Cpath%20d%3D%22M24.3%207.1L13.14%2022.91H5.7L16.86%207.1z%22%2F%3E%3Cpath%20d%3D%22M14.53%2022.91l1.31-1.86c.2-.29.54-.47.9-.47h7.09v2.33h-9.3z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A",
31
+ name: "智谱 GLM",
32
+ region: "国际 · Z.AI",
33
+ market: "international",
34
+ catalogKey: "zai",
35
+ canListModels: true,
36
+ endpoints: [{
37
+ baseUrl: "https://api.z.ai/api/paas/v4",
38
+ modelThinkingSwitch: true,
39
+ type: "glm",
40
+ endpointId: "zhipu",
41
+ protocolIds: [
42
+ "openai",
43
+ "openai-responses",
44
+ "anthropic"
45
+ ]
46
+ }]
47
+ },
48
+ {
49
+ kind: "vendor",
50
+ id: "zhipu-coding-cn",
51
+ logo: "data:image/svg+xml,%3Csvg%20height%3D%2224%22%20viewBox%3D%223%203%2024%2024%22%20width%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ctitle%3EZhipu%3C%2Ftitle%3E%3Cg%20fill%3D%22%232D2D2D%22%3E%3Cpath%20d%3D%22M15.47%207.1l-1.3%201.85c-.2.29-.54.47-.9.47h-7.1V7.09c-.01.01%209.3.01%209.3.01z%22%2F%3E%3Cpath%20d%3D%22M24.3%207.1L13.14%2022.91H5.7L16.86%207.1z%22%2F%3E%3Cpath%20d%3D%22M14.53%2022.91l1.31-1.86c.2-.29.54-.47.9-.47h7.09v2.33h-9.3z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A",
52
+ name: "智谱 GLM Coding Plan",
53
+ region: "国内",
54
+ market: "domestic",
55
+ catalogKey: "zhipuai-coding-plan",
56
+ canListModels: true,
57
+ endpoints: [{
58
+ baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4",
59
+ modelThinkingSwitch: true,
60
+ type: "glm",
61
+ endpointId: "zhipu-coding-cn",
62
+ protocolIds: [
63
+ "openai",
64
+ "openai-responses",
65
+ "anthropic"
66
+ ]
67
+ }]
68
+ },
69
+ {
70
+ kind: "vendor",
71
+ id: "zhipu-coding",
72
+ logo: "data:image/svg+xml,%3Csvg%20height%3D%2224%22%20viewBox%3D%223%203%2024%2024%22%20width%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ctitle%3EZhipu%3C%2Ftitle%3E%3Cg%20fill%3D%22%232D2D2D%22%3E%3Cpath%20d%3D%22M15.47%207.1l-1.3%201.85c-.2.29-.54.47-.9.47h-7.1V7.09c-.01.01%209.3.01%209.3.01z%22%2F%3E%3Cpath%20d%3D%22M24.3%207.1L13.14%2022.91H5.7L16.86%207.1z%22%2F%3E%3Cpath%20d%3D%22M14.53%2022.91l1.31-1.86c.2-.29.54-.47.9-.47h7.09v2.33h-9.3z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A",
73
+ name: "智谱 GLM Coding Plan",
74
+ region: "国际 · Z.AI",
75
+ market: "international",
76
+ catalogKey: "zai-coding-plan",
77
+ canListModels: true,
78
+ endpoints: [{
79
+ baseUrl: "https://api.z.ai/api/coding/paas/v4",
80
+ modelThinkingSwitch: true,
81
+ type: "glm",
82
+ endpointId: "zhipu-coding",
83
+ protocolIds: [
84
+ "openai",
85
+ "openai-responses",
86
+ "anthropic"
87
+ ]
88
+ }]
89
+ }
90
+ ],
91
+ snapshot: {
92
+ "zhipu-cn": {
93
+ "glm-5.2": {
94
+ "id": "glm-5.2",
95
+ "name": "GLM-5.2",
96
+ "family": "glm",
97
+ "reasoning": true,
98
+ "reasoning_options": [{
99
+ "type": "effort",
100
+ "values": ["high", "max"]
101
+ }],
102
+ "temperature": true,
103
+ "tool_call": true,
104
+ "attachment": false,
105
+ "modalities": {
106
+ "input": ["text"],
107
+ "output": ["text"]
108
+ },
109
+ "limit": {
110
+ "context": 1e6,
111
+ "output": 131072
112
+ },
113
+ "release_date": "2026-06-13"
114
+ },
115
+ "glm-5.3-flash": {
116
+ "id": "glm-5.3-flash",
117
+ "name": "GLM-5.3-Flash",
118
+ "family": "glm-flash",
119
+ "reasoning": true,
120
+ "reasoning_options": [{
121
+ "type": "effort",
122
+ "values": [
123
+ "low",
124
+ "high",
125
+ "max"
126
+ ]
127
+ }],
128
+ "temperature": true,
129
+ "tool_call": true,
130
+ "attachment": true,
131
+ "modalities": {
132
+ "input": [
133
+ "text",
134
+ "image",
135
+ "video",
136
+ "pdf"
137
+ ],
138
+ "output": ["text"]
139
+ },
140
+ "limit": {
141
+ "context": 1e6,
142
+ "output": 131072
143
+ },
144
+ "release_date": "2026-08-26"
145
+ },
146
+ "glm-5": {
147
+ "id": "glm-5",
148
+ "name": "GLM-5",
149
+ "family": "glm",
150
+ "reasoning": true,
151
+ "reasoning_options": [{ "type": "toggle" }],
152
+ "temperature": true,
153
+ "tool_call": true,
154
+ "attachment": false,
155
+ "modalities": {
156
+ "input": ["text"],
157
+ "output": ["text"]
158
+ },
159
+ "limit": {
160
+ "context": 204800,
161
+ "output": 131072
162
+ },
163
+ "release_date": "2026-02-11"
164
+ },
165
+ "glm-5.1": {
166
+ "id": "glm-5.1",
167
+ "name": "GLM-5.1",
168
+ "family": "glm",
169
+ "reasoning": true,
170
+ "reasoning_options": [{ "type": "toggle" }],
171
+ "temperature": true,
172
+ "tool_call": true,
173
+ "attachment": false,
174
+ "modalities": {
175
+ "input": ["text"],
176
+ "output": ["text"]
177
+ },
178
+ "limit": {
179
+ "context": 2e5,
180
+ "output": 131072
181
+ },
182
+ "release_date": "2026-03-27"
183
+ },
184
+ "glm-5.3": {
185
+ "id": "glm-5.3",
186
+ "name": "GLM-5.3",
187
+ "family": "glm",
188
+ "reasoning": true,
189
+ "reasoning_options": [{
190
+ "type": "effort",
191
+ "values": [
192
+ "low",
193
+ "high",
194
+ "max"
195
+ ]
196
+ }],
197
+ "temperature": true,
198
+ "tool_call": true,
199
+ "attachment": false,
200
+ "modalities": {
201
+ "input": ["text"],
202
+ "output": ["text"]
203
+ },
204
+ "limit": {
205
+ "context": 1e6,
206
+ "output": 131072
207
+ },
208
+ "release_date": "2026-08-14"
209
+ },
210
+ "glm-5v-turbo": {
211
+ "id": "glm-5v-turbo",
212
+ "name": "GLM-5V-Turbo",
213
+ "family": "glm",
214
+ "reasoning": true,
215
+ "reasoning_options": [{ "type": "toggle" }],
216
+ "temperature": true,
217
+ "tool_call": true,
218
+ "attachment": true,
219
+ "modalities": {
220
+ "input": [
221
+ "text",
222
+ "image",
223
+ "video",
224
+ "pdf"
225
+ ],
226
+ "output": ["text"]
227
+ },
228
+ "limit": {
229
+ "context": 2e5,
230
+ "output": 131072
231
+ },
232
+ "release_date": "2026-04-01"
233
+ },
234
+ "glm-4.7-flash": {
235
+ "id": "glm-4.7-flash",
236
+ "name": "GLM-4.7-Flash",
237
+ "family": "glm-flash",
238
+ "reasoning": true,
239
+ "reasoning_options": [{ "type": "toggle" }],
240
+ "temperature": true,
241
+ "tool_call": true,
242
+ "attachment": false,
243
+ "modalities": {
244
+ "input": ["text"],
245
+ "output": ["text"]
246
+ },
247
+ "limit": {
248
+ "context": 2e5,
249
+ "output": 131072
250
+ },
251
+ "release_date": "2026-01-19"
252
+ },
253
+ "glm-4.7-flashx": {
254
+ "id": "glm-4.7-flashx",
255
+ "name": "GLM-4.7-FlashX",
256
+ "family": "glm-flash",
257
+ "reasoning": true,
258
+ "reasoning_options": [{ "type": "toggle" }],
259
+ "temperature": true,
260
+ "tool_call": true,
261
+ "attachment": false,
262
+ "modalities": {
263
+ "input": ["text"],
264
+ "output": ["text"]
265
+ },
266
+ "limit": {
267
+ "context": 2e5,
268
+ "output": 131072
269
+ },
270
+ "release_date": "2026-01-19"
271
+ },
272
+ "glm-4.5v": {
273
+ "id": "glm-4.5v",
274
+ "name": "GLM-4.5V",
275
+ "family": "glm",
276
+ "reasoning": true,
277
+ "reasoning_options": [{ "type": "toggle" }],
278
+ "temperature": true,
279
+ "tool_call": true,
280
+ "attachment": true,
281
+ "modalities": {
282
+ "input": [
283
+ "text",
284
+ "image",
285
+ "video"
286
+ ],
287
+ "output": ["text"]
288
+ },
289
+ "limit": {
290
+ "context": 64e3,
291
+ "output": 16384
292
+ },
293
+ "release_date": "2025-08-11"
294
+ },
295
+ "glm-4.5": {
296
+ "id": "glm-4.5",
297
+ "name": "GLM-4.5",
298
+ "family": "glm",
299
+ "reasoning": true,
300
+ "reasoning_options": [{ "type": "toggle" }],
301
+ "temperature": true,
302
+ "tool_call": true,
303
+ "attachment": false,
304
+ "modalities": {
305
+ "input": ["text"],
306
+ "output": ["text"]
307
+ },
308
+ "limit": {
309
+ "context": 131072,
310
+ "output": 98304
311
+ },
312
+ "release_date": "2025-07-28"
313
+ },
314
+ "glm-4.5-flash": {
315
+ "id": "glm-4.5-flash",
316
+ "name": "GLM-4.5-Flash",
317
+ "family": "glm-flash",
318
+ "reasoning": true,
319
+ "reasoning_options": [{ "type": "toggle" }],
320
+ "temperature": true,
321
+ "tool_call": true,
322
+ "attachment": false,
323
+ "modalities": {
324
+ "input": ["text"],
325
+ "output": ["text"]
326
+ },
327
+ "limit": {
328
+ "context": 131072,
329
+ "output": 98304
330
+ },
331
+ "release_date": "2025-07-28"
332
+ },
333
+ "glm-4.6v": {
334
+ "id": "glm-4.6v",
335
+ "name": "GLM-4.6V",
336
+ "family": "glm",
337
+ "reasoning": true,
338
+ "reasoning_options": [{ "type": "toggle" }],
339
+ "temperature": true,
340
+ "tool_call": true,
341
+ "attachment": true,
342
+ "modalities": {
343
+ "input": [
344
+ "text",
345
+ "image",
346
+ "video"
347
+ ],
348
+ "output": ["text"]
349
+ },
350
+ "limit": {
351
+ "context": 128e3,
352
+ "output": 32768
353
+ },
354
+ "release_date": "2025-12-08"
355
+ },
356
+ "glm-4.6": {
357
+ "id": "glm-4.6",
358
+ "name": "GLM-4.6",
359
+ "family": "glm",
360
+ "reasoning": true,
361
+ "reasoning_options": [{ "type": "toggle" }],
362
+ "temperature": true,
363
+ "tool_call": true,
364
+ "attachment": false,
365
+ "modalities": {
366
+ "input": ["text"],
367
+ "output": ["text"]
368
+ },
369
+ "limit": {
370
+ "context": 204800,
371
+ "output": 131072
372
+ },
373
+ "release_date": "2025-09-30"
374
+ },
375
+ "glm-4.5-air": {
376
+ "id": "glm-4.5-air",
377
+ "name": "GLM-4.5-Air",
378
+ "family": "glm-air",
379
+ "reasoning": true,
380
+ "reasoning_options": [{ "type": "toggle" }],
381
+ "temperature": true,
382
+ "tool_call": true,
383
+ "attachment": false,
384
+ "modalities": {
385
+ "input": ["text"],
386
+ "output": ["text"]
387
+ },
388
+ "limit": {
389
+ "context": 131072,
390
+ "output": 98304
391
+ },
392
+ "release_date": "2025-07-28"
393
+ },
394
+ "glm-4.7": {
395
+ "id": "glm-4.7",
396
+ "name": "GLM-4.7",
397
+ "family": "glm",
398
+ "reasoning": true,
399
+ "reasoning_options": [{ "type": "toggle" }],
400
+ "temperature": true,
401
+ "tool_call": true,
402
+ "attachment": false,
403
+ "modalities": {
404
+ "input": ["text"],
405
+ "output": ["text"]
406
+ },
407
+ "limit": {
408
+ "context": 204800,
409
+ "output": 131072
410
+ },
411
+ "release_date": "2025-12-22"
412
+ }
413
+ },
414
+ "zhipu": {
415
+ "glm-4.7": {
416
+ "id": "glm-4.7",
417
+ "name": "GLM-4.7",
418
+ "family": "glm",
419
+ "reasoning": true,
420
+ "reasoning_options": [{ "type": "toggle" }],
421
+ "temperature": true,
422
+ "tool_call": true,
423
+ "attachment": false,
424
+ "modalities": {
425
+ "input": ["text"],
426
+ "output": ["text"]
427
+ },
428
+ "limit": {
429
+ "context": 204800,
430
+ "output": 131072
431
+ },
432
+ "release_date": "2025-12-22"
433
+ },
434
+ "glm-4.5-air": {
435
+ "id": "glm-4.5-air",
436
+ "name": "GLM-4.5-Air",
437
+ "family": "glm-air",
438
+ "reasoning": true,
439
+ "reasoning_options": [{ "type": "toggle" }],
440
+ "temperature": true,
441
+ "tool_call": true,
442
+ "attachment": false,
443
+ "modalities": {
444
+ "input": ["text"],
445
+ "output": ["text"]
446
+ },
447
+ "limit": {
448
+ "context": 131072,
449
+ "output": 98304
450
+ },
451
+ "release_date": "2025-07-28"
452
+ },
453
+ "glm-4.6": {
454
+ "id": "glm-4.6",
455
+ "name": "GLM-4.6",
456
+ "family": "glm",
457
+ "reasoning": true,
458
+ "reasoning_options": [{ "type": "toggle" }],
459
+ "temperature": true,
460
+ "tool_call": true,
461
+ "attachment": false,
462
+ "modalities": {
463
+ "input": ["text"],
464
+ "output": ["text"]
465
+ },
466
+ "limit": {
467
+ "context": 204800,
468
+ "output": 131072
469
+ },
470
+ "release_date": "2025-09-30"
471
+ },
472
+ "glm-4.6v": {
473
+ "id": "glm-4.6v",
474
+ "name": "GLM-4.6V",
475
+ "family": "glm",
476
+ "reasoning": true,
477
+ "reasoning_options": [{ "type": "toggle" }],
478
+ "temperature": true,
479
+ "tool_call": true,
480
+ "attachment": true,
481
+ "modalities": {
482
+ "input": [
483
+ "text",
484
+ "image",
485
+ "video"
486
+ ],
487
+ "output": ["text"]
488
+ },
489
+ "limit": {
490
+ "context": 128e3,
491
+ "output": 32768
492
+ },
493
+ "release_date": "2025-12-08"
494
+ },
495
+ "glm-5.2": {
496
+ "id": "glm-5.2",
497
+ "name": "GLM-5.2",
498
+ "family": "glm",
499
+ "reasoning": true,
500
+ "reasoning_options": [{
501
+ "type": "effort",
502
+ "values": ["high", "max"]
503
+ }],
504
+ "temperature": true,
505
+ "tool_call": true,
506
+ "attachment": false,
507
+ "modalities": {
508
+ "input": ["text"],
509
+ "output": ["text"]
510
+ },
511
+ "limit": {
512
+ "context": 1e6,
513
+ "output": 131072
514
+ },
515
+ "release_date": "2026-06-13"
516
+ },
517
+ "glm-4.5-flash": {
518
+ "id": "glm-4.5-flash",
519
+ "name": "GLM-4.5-Flash",
520
+ "family": "glm-flash",
521
+ "reasoning": true,
522
+ "reasoning_options": [{ "type": "toggle" }],
523
+ "temperature": true,
524
+ "tool_call": true,
525
+ "attachment": false,
526
+ "modalities": {
527
+ "input": ["text"],
528
+ "output": ["text"]
529
+ },
530
+ "limit": {
531
+ "context": 131072,
532
+ "output": 98304
533
+ },
534
+ "release_date": "2025-07-28"
535
+ },
536
+ "glm-5.3-flash": {
537
+ "id": "glm-5.3-flash",
538
+ "name": "GLM-5.3-Flash",
539
+ "family": "glm-flash",
540
+ "reasoning": true,
541
+ "reasoning_options": [{
542
+ "type": "effort",
543
+ "values": [
544
+ "low",
545
+ "high",
546
+ "max"
547
+ ]
548
+ }],
549
+ "temperature": true,
550
+ "tool_call": true,
551
+ "attachment": true,
552
+ "modalities": {
553
+ "input": [
554
+ "text",
555
+ "image",
556
+ "video",
557
+ "pdf"
558
+ ],
559
+ "output": ["text"]
560
+ },
561
+ "limit": {
562
+ "context": 1e6,
563
+ "output": 131072
564
+ },
565
+ "release_date": "2026-08-26"
566
+ },
567
+ "glm-4.5": {
568
+ "id": "glm-4.5",
569
+ "name": "GLM-4.5",
570
+ "family": "glm",
571
+ "reasoning": true,
572
+ "reasoning_options": [{ "type": "toggle" }],
573
+ "temperature": true,
574
+ "tool_call": true,
575
+ "attachment": false,
576
+ "modalities": {
577
+ "input": ["text"],
578
+ "output": ["text"]
579
+ },
580
+ "limit": {
581
+ "context": 131072,
582
+ "output": 98304
583
+ },
584
+ "release_date": "2025-07-28"
585
+ },
586
+ "glm-4.5v": {
587
+ "id": "glm-4.5v",
588
+ "name": "GLM-4.5V",
589
+ "family": "glm",
590
+ "reasoning": true,
591
+ "reasoning_options": [{ "type": "toggle" }],
592
+ "temperature": true,
593
+ "tool_call": true,
594
+ "attachment": true,
595
+ "modalities": {
596
+ "input": [
597
+ "text",
598
+ "image",
599
+ "video"
600
+ ],
601
+ "output": ["text"]
602
+ },
603
+ "limit": {
604
+ "context": 64e3,
605
+ "output": 16384
606
+ },
607
+ "release_date": "2025-08-11"
608
+ },
609
+ "glm-4.7-flashx": {
610
+ "id": "glm-4.7-flashx",
611
+ "name": "GLM-4.7-FlashX",
612
+ "family": "glm-flash",
613
+ "reasoning": true,
614
+ "reasoning_options": [{ "type": "toggle" }],
615
+ "temperature": true,
616
+ "tool_call": true,
617
+ "attachment": false,
618
+ "modalities": {
619
+ "input": ["text"],
620
+ "output": ["text"]
621
+ },
622
+ "limit": {
623
+ "context": 2e5,
624
+ "output": 131072
625
+ },
626
+ "release_date": "2026-01-19"
627
+ },
628
+ "glm-5": {
629
+ "id": "glm-5",
630
+ "name": "GLM-5",
631
+ "family": "glm",
632
+ "reasoning": true,
633
+ "reasoning_options": [{ "type": "toggle" }],
634
+ "temperature": true,
635
+ "tool_call": true,
636
+ "attachment": false,
637
+ "modalities": {
638
+ "input": ["text"],
639
+ "output": ["text"]
640
+ },
641
+ "limit": {
642
+ "context": 204800,
643
+ "output": 131072
644
+ },
645
+ "release_date": "2026-02-12"
646
+ },
647
+ "glm-5.1": {
648
+ "id": "glm-5.1",
649
+ "name": "GLM-5.1",
650
+ "family": "glm",
651
+ "reasoning": true,
652
+ "reasoning_options": [{ "type": "toggle" }],
653
+ "temperature": true,
654
+ "tool_call": true,
655
+ "attachment": false,
656
+ "modalities": {
657
+ "input": ["text"],
658
+ "output": ["text"]
659
+ },
660
+ "limit": {
661
+ "context": 2e5,
662
+ "output": 131072
663
+ },
664
+ "release_date": "2026-04-07"
665
+ },
666
+ "glm-5-turbo": {
667
+ "id": "glm-5-turbo",
668
+ "name": "GLM-5-Turbo",
669
+ "family": "glm",
670
+ "reasoning": true,
671
+ "reasoning_options": [{ "type": "toggle" }],
672
+ "temperature": true,
673
+ "tool_call": true,
674
+ "attachment": false,
675
+ "modalities": {
676
+ "input": ["text"],
677
+ "output": ["text"]
678
+ },
679
+ "limit": {
680
+ "context": 2e5,
681
+ "output": 131072
682
+ },
683
+ "release_date": "2026-03-16"
684
+ },
685
+ "glm-5.3": {
686
+ "id": "glm-5.3",
687
+ "name": "GLM-5.3",
688
+ "family": "glm",
689
+ "reasoning": true,
690
+ "reasoning_options": [{
691
+ "type": "effort",
692
+ "values": [
693
+ "low",
694
+ "high",
695
+ "max"
696
+ ]
697
+ }],
698
+ "temperature": true,
699
+ "tool_call": true,
700
+ "attachment": false,
701
+ "modalities": {
702
+ "input": ["text"],
703
+ "output": ["text"]
704
+ },
705
+ "limit": {
706
+ "context": 1e6,
707
+ "output": 131072
708
+ },
709
+ "release_date": "2026-08-14"
710
+ },
711
+ "glm-5v-turbo": {
712
+ "id": "glm-5v-turbo",
713
+ "name": "GLM-5V-Turbo",
714
+ "family": "glm",
715
+ "reasoning": true,
716
+ "reasoning_options": [{ "type": "toggle" }],
717
+ "temperature": true,
718
+ "tool_call": true,
719
+ "attachment": true,
720
+ "modalities": {
721
+ "input": [
722
+ "text",
723
+ "image",
724
+ "video",
725
+ "pdf"
726
+ ],
727
+ "output": ["text"]
728
+ },
729
+ "limit": {
730
+ "context": 2e5,
731
+ "output": 131072
732
+ },
733
+ "release_date": "2026-04-01"
734
+ },
735
+ "glm-4.7-flash": {
736
+ "id": "glm-4.7-flash",
737
+ "name": "GLM-4.7-Flash",
738
+ "family": "glm-flash",
739
+ "reasoning": true,
740
+ "reasoning_options": [{ "type": "toggle" }],
741
+ "temperature": true,
742
+ "tool_call": true,
743
+ "attachment": false,
744
+ "modalities": {
745
+ "input": ["text"],
746
+ "output": ["text"]
747
+ },
748
+ "limit": {
749
+ "context": 2e5,
750
+ "output": 131072
751
+ },
752
+ "release_date": "2026-01-19"
753
+ }
754
+ },
755
+ "zhipu-coding-cn": {
756
+ "glm-5.3-flash": {
757
+ "id": "glm-5.3-flash",
758
+ "name": "GLM-5.3-Flash",
759
+ "family": "glm-flash",
760
+ "reasoning": true,
761
+ "reasoning_options": [{
762
+ "type": "effort",
763
+ "values": [
764
+ "low",
765
+ "high",
766
+ "max"
767
+ ]
768
+ }],
769
+ "temperature": true,
770
+ "tool_call": true,
771
+ "attachment": true,
772
+ "modalities": {
773
+ "input": [
774
+ "text",
775
+ "image",
776
+ "video",
777
+ "pdf"
778
+ ],
779
+ "output": ["text"]
780
+ },
781
+ "limit": {
782
+ "context": 1e6,
783
+ "output": 131072
784
+ },
785
+ "release_date": "2026-08-26"
786
+ },
787
+ "glm-5.3-highspeed": {
788
+ "id": "glm-5.3-highspeed",
789
+ "name": "GLM-5.3 Highspeed",
790
+ "family": "glm",
791
+ "reasoning": true,
792
+ "reasoning_options": [{
793
+ "type": "effort",
794
+ "values": [
795
+ "low",
796
+ "high",
797
+ "max"
798
+ ]
799
+ }],
800
+ "temperature": true,
801
+ "tool_call": true,
802
+ "attachment": false,
803
+ "modalities": {
804
+ "input": ["text"],
805
+ "output": ["text"]
806
+ },
807
+ "limit": {
808
+ "context": 1e6,
809
+ "output": 131072
810
+ },
811
+ "release_date": "2026-08-14"
812
+ },
813
+ "glm-5.3": {
814
+ "id": "glm-5.3",
815
+ "name": "GLM-5.3",
816
+ "family": "glm",
817
+ "reasoning": true,
818
+ "reasoning_options": [{
819
+ "type": "effort",
820
+ "values": [
821
+ "low",
822
+ "high",
823
+ "max"
824
+ ]
825
+ }],
826
+ "temperature": true,
827
+ "tool_call": true,
828
+ "attachment": false,
829
+ "modalities": {
830
+ "input": ["text"],
831
+ "output": ["text"]
832
+ },
833
+ "limit": {
834
+ "context": 1e6,
835
+ "output": 131072
836
+ },
837
+ "release_date": "2026-08-14"
838
+ },
839
+ "glm-4.6v": {
840
+ "id": "glm-4.6v",
841
+ "name": "GLM-4.6V",
842
+ "family": "glm",
843
+ "reasoning": true,
844
+ "reasoning_options": [{ "type": "toggle" }],
845
+ "temperature": true,
846
+ "tool_call": true,
847
+ "attachment": true,
848
+ "modalities": {
849
+ "input": [
850
+ "text",
851
+ "image",
852
+ "video"
853
+ ],
854
+ "output": ["text"]
855
+ },
856
+ "limit": {
857
+ "context": 128e3,
858
+ "output": 32768
859
+ },
860
+ "release_date": "2025-12-08"
861
+ }
862
+ },
863
+ "zhipu-coding": {
864
+ "glm-5.3-flash": {
865
+ "id": "glm-5.3-flash",
866
+ "name": "GLM-5.3-Flash",
867
+ "family": "glm-flash",
868
+ "reasoning": true,
869
+ "reasoning_options": [{
870
+ "type": "effort",
871
+ "values": [
872
+ "low",
873
+ "high",
874
+ "max"
875
+ ]
876
+ }],
877
+ "temperature": true,
878
+ "tool_call": true,
879
+ "attachment": true,
880
+ "modalities": {
881
+ "input": [
882
+ "text",
883
+ "image",
884
+ "video",
885
+ "pdf"
886
+ ],
887
+ "output": ["text"]
888
+ },
889
+ "limit": {
890
+ "context": 1e6,
891
+ "output": 131072
892
+ },
893
+ "release_date": "2026-08-26"
894
+ },
895
+ "glm-5.3-highspeed": {
896
+ "id": "glm-5.3-highspeed",
897
+ "name": "GLM-5.3 Highspeed",
898
+ "family": "glm",
899
+ "reasoning": true,
900
+ "reasoning_options": [{
901
+ "type": "effort",
902
+ "values": [
903
+ "low",
904
+ "high",
905
+ "max"
906
+ ]
907
+ }],
908
+ "temperature": true,
909
+ "tool_call": true,
910
+ "attachment": false,
911
+ "modalities": {
912
+ "input": ["text"],
913
+ "output": ["text"]
914
+ },
915
+ "limit": {
916
+ "context": 1e6,
917
+ "output": 131072
918
+ },
919
+ "release_date": "2026-08-14"
920
+ },
921
+ "glm-5.2-highspeed": {
922
+ "id": "glm-5.2-highspeed",
923
+ "name": "GLM-5.2 Highspeed",
924
+ "family": "glm",
925
+ "reasoning": true,
926
+ "reasoning_options": [{
927
+ "type": "effort",
928
+ "values": ["high", "max"]
929
+ }],
930
+ "temperature": true,
931
+ "tool_call": true,
932
+ "attachment": false,
933
+ "modalities": {
934
+ "input": ["text"],
935
+ "output": ["text"]
936
+ },
937
+ "limit": {
938
+ "context": 1e6,
939
+ "output": 131072
940
+ },
941
+ "release_date": "2026-06-13"
942
+ },
943
+ "glm-4.7": {
944
+ "id": "glm-4.7",
945
+ "name": "GLM-4.7",
946
+ "family": "glm",
947
+ "reasoning": true,
948
+ "reasoning_options": [{ "type": "toggle" }],
949
+ "temperature": true,
950
+ "tool_call": true,
951
+ "attachment": false,
952
+ "modalities": {
953
+ "input": ["text"],
954
+ "output": ["text"]
955
+ },
956
+ "limit": {
957
+ "context": 204800,
958
+ "output": 131072
959
+ },
960
+ "release_date": "2025-12-22"
961
+ },
962
+ "glm-5.2": {
963
+ "id": "glm-5.2",
964
+ "name": "GLM-5.2",
965
+ "family": "glm",
966
+ "reasoning": true,
967
+ "reasoning_options": [{
968
+ "type": "effort",
969
+ "values": ["high", "max"]
970
+ }],
971
+ "temperature": true,
972
+ "tool_call": true,
973
+ "attachment": false,
974
+ "modalities": {
975
+ "input": ["text"],
976
+ "output": ["text"]
977
+ },
978
+ "limit": {
979
+ "context": 1e6,
980
+ "output": 131072
981
+ },
982
+ "release_date": "2026-06-13"
983
+ },
984
+ "glm-5-turbo": {
985
+ "id": "glm-5-turbo",
986
+ "name": "GLM-5-Turbo",
987
+ "family": "glm",
988
+ "reasoning": true,
989
+ "reasoning_options": [{ "type": "toggle" }],
990
+ "temperature": true,
991
+ "tool_call": true,
992
+ "attachment": false,
993
+ "modalities": {
994
+ "input": ["text"],
995
+ "output": ["text"]
996
+ },
997
+ "limit": {
998
+ "context": 2e5,
999
+ "output": 131072
1000
+ },
1001
+ "release_date": "2026-03-16"
1002
+ },
1003
+ "glm-5.3": {
1004
+ "id": "glm-5.3",
1005
+ "name": "GLM-5.3",
1006
+ "family": "glm",
1007
+ "reasoning": true,
1008
+ "reasoning_options": [{
1009
+ "type": "effort",
1010
+ "values": [
1011
+ "low",
1012
+ "high",
1013
+ "max"
1014
+ ]
1015
+ }],
1016
+ "temperature": true,
1017
+ "tool_call": true,
1018
+ "attachment": false,
1019
+ "modalities": {
1020
+ "input": ["text"],
1021
+ "output": ["text"]
1022
+ },
1023
+ "limit": {
1024
+ "context": 1e6,
1025
+ "output": 131072
1026
+ },
1027
+ "release_date": "2026-08-14"
1028
+ }
1029
+ }
1030
+ },
1031
+ snapshotAt: Date.parse("2026-09-17")
1032
+ };
1033
+ //#endregion
1034
+ //#region src/routing.ts
1035
+ /** Maps only declared official roots; protocol implementations own the remaining resource URI. */
1036
+ function connectionConfig(endpoint, protocolId, config, aliases = []) {
1037
+ const defaults = Object.values(endpoint.capabilities).find((one) => one.protocolIds.includes(protocolId))?.protocolDefaults?.[protocolId] ?? {};
1038
+ const configured = config.baseUrl;
1039
+ const canonical = [
1040
+ endpoint.defaults?.baseUrl,
1041
+ ...Object.values(endpoint.capabilities).flatMap((one) => Object.values(one.protocolDefaults ?? {}).map((value) => value.baseUrl)),
1042
+ ...aliases
1043
+ ].filter((value) => typeof value === "string");
1044
+ const isOfficial = configured === void 0 || typeof configured === "string" && canonical.some((value) => value.replace(/\/+$/, "") === configured.replace(/\/+$/, ""));
1045
+ const selected = defaults.baseUrl ?? endpoint.defaults?.baseUrl;
1046
+ return {
1047
+ ...endpoint.defaults,
1048
+ ...defaults,
1049
+ ...config,
1050
+ ...isOfficial && selected !== void 0 ? { baseUrl: selected } : {}
1051
+ };
1052
+ }
1053
+ const endpoints = [
1054
+ {
1055
+ id: "zhipu-cn",
1056
+ label: "智谱 GLM · 国内",
1057
+ capabilities: { chat: {
1058
+ protocolIds: [
1059
+ "openai",
1060
+ "openai-responses",
1061
+ "anthropic"
1062
+ ],
1063
+ defaultProtocolId: "openai-responses",
1064
+ protocolDefaults: {
1065
+ openai: { baseUrl: "https://open.bigmodel.cn/api/paas/v4" },
1066
+ anthropic: { baseUrl: "https://open.bigmodel.cn/api/anthropic/v1" },
1067
+ "openai-responses": { baseUrl: "https://open.bigmodel.cn/api/v1" }
1068
+ },
1069
+ listingVia: {
1070
+ endpointId: "zhipu-cn",
1071
+ protocolId: "openai"
1072
+ }
1073
+ } },
1074
+ defaults: { baseUrl: "https://open.bigmodel.cn/api/v1" },
1075
+ credentialGroup: "glm"
1076
+ },
1077
+ {
1078
+ id: "zhipu",
1079
+ label: "智谱 GLM · 国际 · Z.AI",
1080
+ capabilities: { chat: {
1081
+ protocolIds: [
1082
+ "openai",
1083
+ "openai-responses",
1084
+ "anthropic"
1085
+ ],
1086
+ defaultProtocolId: "openai",
1087
+ protocolDefaults: {
1088
+ anthropic: { baseUrl: "https://api.z.ai/api/anthropic/v1" },
1089
+ "openai-responses": { baseUrl: "https://api.z.ai/api/v1" }
1090
+ },
1091
+ listingVia: {
1092
+ endpointId: "zhipu",
1093
+ protocolId: "openai"
1094
+ }
1095
+ } },
1096
+ defaults: { baseUrl: "https://api.z.ai/api/paas/v4" },
1097
+ credentialGroup: "glm"
1098
+ },
1099
+ {
1100
+ id: "zhipu-coding-cn",
1101
+ label: "智谱 GLM Coding Plan · 国内",
1102
+ capabilities: { chat: {
1103
+ protocolIds: [
1104
+ "openai",
1105
+ "openai-responses",
1106
+ "anthropic"
1107
+ ],
1108
+ defaultProtocolId: "openai",
1109
+ protocolDefaults: {
1110
+ anthropic: { baseUrl: "https://open.bigmodel.cn/api/anthropic/v1" },
1111
+ "openai-responses": { baseUrl: "https://open.bigmodel.cn/api/v1" }
1112
+ },
1113
+ listingVia: {
1114
+ endpointId: "zhipu-coding-cn",
1115
+ protocolId: "openai"
1116
+ }
1117
+ } },
1118
+ defaults: { baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4" },
1119
+ credentialGroup: "glm"
1120
+ },
1121
+ {
1122
+ id: "zhipu-coding",
1123
+ label: "智谱 GLM Coding Plan · 国际 · Z.AI",
1124
+ capabilities: { chat: {
1125
+ protocolIds: [
1126
+ "openai",
1127
+ "openai-responses",
1128
+ "anthropic"
1129
+ ],
1130
+ defaultProtocolId: "openai",
1131
+ protocolDefaults: {
1132
+ anthropic: { baseUrl: "https://api.z.ai/api/anthropic/v1" },
1133
+ "openai-responses": { baseUrl: "https://api.z.ai/api/v1" }
1134
+ },
1135
+ listingVia: {
1136
+ endpointId: "zhipu-coding",
1137
+ protocolId: "openai"
1138
+ }
1139
+ } },
1140
+ defaults: { baseUrl: "https://api.z.ai/api/coding/paas/v4" },
1141
+ credentialGroup: "glm"
1142
+ }
1143
+ ];
1144
+ const protocolOptions = {
1145
+ openai: {
1146
+ thinkingField: true,
1147
+ reasoningReplay: "reasoning-content"
1148
+ },
1149
+ "openai-responses": {
1150
+ reasoningReplay: "reasoning-content",
1151
+ reasoningSummary: false,
1152
+ effortCache: false,
1153
+ promptCacheKey: true
1154
+ },
1155
+ anthropic: {
1156
+ reasoningReplay: "unsigned-thinking",
1157
+ effortCache: false,
1158
+ cacheBreakpoints: false,
1159
+ thinkingEffort: true,
1160
+ thinkingBeta: false,
1161
+ thinkingMode: "enabled"
1162
+ }
1163
+ };
1164
+ /** Builds this supplier's declaration without network activity or protocol imports. */
1165
+ function glmProviderType(support) {
1166
+ return {
1167
+ type: "glm",
1168
+ label: "GLM",
1169
+ fields: [{
1170
+ key: "apiKey",
1171
+ kind: "secret",
1172
+ label: "API Key",
1173
+ required: true
1174
+ }],
1175
+ endpoints,
1176
+ catalog: support ? {
1177
+ ...catalog,
1178
+ source: support.catalogueSource("https://models.dev/api.json", "models")
1179
+ } : catalog,
1180
+ prepareConnection(input) {
1181
+ const endpoint = endpoints.find((one) => one.id === input.endpointId);
1182
+ if (!endpoint || !Object.values(endpoint.capabilities).some((one) => one.protocolIds.includes(input.protocolId))) throw new Error("unsupported supplier endpoint or protocol");
1183
+ return {
1184
+ config: connectionConfig(endpoint, input.protocolId, input.config),
1185
+ options: protocolOptions[input.protocolId] ?? {}
1186
+ };
1187
+ }
1188
+ };
1189
+ }
1190
+ //#endregion
1191
+ //#region src/index.ts
1192
+ /** Suppliers contribute no tools. */
1193
+ const TOOL_NAMES = [];
1194
+ const plugin = {
1195
+ name: "@eum-agent/llm-provider-zhipu",
1196
+ requires: ["model-catalogue-sources"],
1197
+ apply(ctx) {
1198
+ const support = ctx.services.get("model-catalogue-sources");
1199
+ ctx.modelProviders.register(glmProviderType(support));
1200
+ }
1201
+ };
1202
+ //#endregion
1203
+ export { TOOL_NAMES, plugin as default };
package/package.json CHANGED
@@ -1,6 +1,41 @@
1
1
  {
2
2
  "name": "@eum-agent/llm-provider-zhipu",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "displayName": {
4
+ "en-US": "Zhipu GLM Model Connection",
5
+ "zh-CN": "模型接入 · 智谱 GLM"
6
+ },
7
+ "version": "1.1.0",
8
+ "type": "module",
9
+ "description": "Zhipu GLM model provider with domestic and international endpoints",
10
+ "license": "MIT",
11
+ "exports": {
12
+ ".": {
13
+ "default": "./dist/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "assets"
19
+ ],
20
+ "devDependencies": {
21
+ "@eum-agent/plugin": "1.1.0"
22
+ },
23
+ "dependencies": {
24
+ "zod": "^4.4.3"
25
+ },
26
+ "yaoguang": {
27
+ "description": {
28
+ "en-US": "Zhipu GLM model provider with domestic and international endpoints",
29
+ "zh-CN": "智谱 GLM 模型服务与国内、国际端点"
30
+ },
31
+ "dependencies": {
32
+ "@eum-agent/llm-management": "1.1.0"
33
+ },
34
+ "kind": "extension"
35
+ },
36
+ "scripts": {
37
+ "build": "tsdown",
38
+ "test": "vitest run",
39
+ "typecheck": "tsc --noEmit"
40
+ }
6
41
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.