@ponydev/dsh-model-usage 1.0.7 → 1.0.9
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 +13 -0
- package/assets/logos/opencode.svg +7 -0
- package/lib/client.js +25 -18
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.9 — 2026-10-20
|
|
4
|
+
|
|
5
|
+
### 修复
|
|
6
|
+
- 供应商卡头部在 `displayName` 与路由 id 相同时不再重复显示(如 `opencode-go opencode-go`)
|
|
7
|
+
|
|
8
|
+
## 1.0.8 — 2026-10-20
|
|
9
|
+
|
|
10
|
+
### 新增
|
|
11
|
+
- OpenCode / OpenCode Go 官方 Logo(`opencode.ai/favicon.svg`)
|
|
12
|
+
|
|
13
|
+
### 修复
|
|
14
|
+
- 方形品牌标(Z.ai、Kimi、OpenRouter、MiniMax、OpenCode、xAI)改用**圆角方形**渲染,避免圆形裁切掉四角
|
|
15
|
+
|
|
3
16
|
## 1.0.7 — 2026-10-20
|
|
4
17
|
|
|
5
18
|
### 修复
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512"><svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="512" height="512" fill="#131010"></rect>
|
|
3
|
+
<path d="M320 224V352H192V224H320Z" fill="#5A5858"></path>
|
|
4
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M384 416H128V96H384V416ZM320 160H192V352H320V160Z" fill="white"></path>
|
|
5
|
+
</svg><style>@media (prefers-color-scheme: light) { :root { filter: none; } }
|
|
6
|
+
@media (prefers-color-scheme: dark) { :root { filter: none; } }
|
|
7
|
+
</style></svg>
|
package/lib/client.js
CHANGED
|
@@ -445,35 +445,42 @@ window.__ModuleLoader__.load({
|
|
|
445
445
|
}
|
|
446
446
|
|
|
447
447
|
// ---------------------------------------------------------------- atoms
|
|
448
|
+
// [路由正则, slug, 形状]:方形品牌标用 rounded 避免圆形裁切
|
|
448
449
|
const LOGO_SLUGS = [
|
|
449
|
-
[/^deepseek/, 'deepseek'],
|
|
450
|
-
[/^(zai|glm|bigmodel|zhipu|chatglm)/, 'zai'],
|
|
451
|
-
[/^openai$/, 'openai'],
|
|
452
|
-
[/^anthropic/, 'anthropic'],
|
|
453
|
-
[/^(google-)?gemini/, 'googlegemini'],
|
|
454
|
-
[/^(moonshot|kimi|moonshotai)/, 'kimi'],
|
|
455
|
-
[/^openrouter/, 'openrouter'],
|
|
456
|
-
[/^minimax/, 'minimax'],
|
|
457
|
-
[/^
|
|
450
|
+
[/^deepseek/, 'deepseek', 'circle'],
|
|
451
|
+
[/^(zai|glm|bigmodel|zhipu|chatglm)/, 'zai', 'square'],
|
|
452
|
+
[/^openai$/, 'openai', 'circle'],
|
|
453
|
+
[/^anthropic/, 'anthropic', 'circle'],
|
|
454
|
+
[/^(google-)?gemini/, 'googlegemini', 'circle'],
|
|
455
|
+
[/^(moonshot|kimi|moonshotai)/, 'kimi', 'square'],
|
|
456
|
+
[/^openrouter/, 'openrouter', 'square'],
|
|
457
|
+
[/^minimax/, 'minimax', 'square'],
|
|
458
|
+
[/^opencode/, 'opencode', 'square'],
|
|
459
|
+
[/^xai/, 'xai', 'square'],
|
|
458
460
|
]
|
|
459
|
-
function
|
|
460
|
-
for (const [re, slug] of LOGO_SLUGS) if (re.test(route || '')) return slug
|
|
461
|
+
function logoSpec(route) {
|
|
462
|
+
for (const [re, slug, shape] of LOGO_SLUGS) if (re.test(route || '')) return { slug, shape }
|
|
461
463
|
return null
|
|
462
464
|
}
|
|
463
465
|
|
|
464
466
|
function Logo({ route, size = 24 }) {
|
|
465
467
|
const [failed, setFailed] = useState(false)
|
|
466
|
-
const
|
|
467
|
-
if (
|
|
468
|
+
const spec = logoSpec(route)
|
|
469
|
+
if (spec && !failed) {
|
|
470
|
+
const square = spec.shape === 'square'
|
|
468
471
|
return h('span', {
|
|
469
472
|
className: 'dmu-logo',
|
|
470
|
-
style:
|
|
473
|
+
style: square
|
|
474
|
+
? { width: size, height: size, borderRadius: Math.max(4, Math.round(size * 0.26)), background: 'transparent' }
|
|
475
|
+
: { width: size, height: size, background: 'var(--dsw-alias-bg-layer-1,#fff)', border: '1px solid var(--dsw-alias-border-l1,#e3e7ed)' },
|
|
471
476
|
title: route || '',
|
|
472
477
|
},
|
|
473
478
|
h('img', {
|
|
474
|
-
src: 'model-usage/logo/' + slug + '.svg',
|
|
475
|
-
alt: route || '',
|
|
476
|
-
|
|
479
|
+
src: 'model-usage/logo/' + spec.slug + '.svg',
|
|
480
|
+
alt: route || '',
|
|
481
|
+
width: square ? size : size - 6,
|
|
482
|
+
height: square ? size : size - 6,
|
|
483
|
+
style: { display: 'block', margin: 'auto', objectFit: 'contain', borderRadius: square ? Math.max(4, Math.round(size * 0.26)) : 0 },
|
|
477
484
|
onError: () => setFailed(true),
|
|
478
485
|
}))
|
|
479
486
|
}
|
|
@@ -531,7 +538,7 @@ window.__ModuleLoader__.load({
|
|
|
531
538
|
const kids = []
|
|
532
539
|
|
|
533
540
|
const headerKids = [h(Logo, { route: p.route, size: 22 }), h('span', null, p.displayName || p.route)]
|
|
534
|
-
if (p.route) headerKids.push(h('span', { className: 'route' }, p.route))
|
|
541
|
+
if (p.route && p.displayName !== p.route) headerKids.push(h('span', { className: 'route' }, p.route))
|
|
535
542
|
if (kind === 'sub' && p.plan) headerKids.push(h(PlanPill, null, p.plan))
|
|
536
543
|
if (kind === 'api' && p.balance) {
|
|
537
544
|
headerKids.push(h(StatusPill, { ok: p.balance.available !== false, okText: tr('available'), badText: tr('unavailable') }))
|