dsh-draw 0.2.16 → 0.2.18
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 +24 -0
- package/README-es.md +13 -4
- package/README-hi.md +13 -4
- package/README-pt.md +13 -4
- package/README-zh.md +13 -4
- package/README.md +14 -4
- package/THIRD_PARTY_NOTICES.md +2 -2
- package/lib/client.js +75 -7
- package/lib/client.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/types/client/DrawResultCard.d.ts +44 -14
- package/lib/types/client/DrawResultCard.d.ts.map +1 -1
- package/lib/types/client/DrawResultCard.js +45 -9
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/client/locales.js +6 -0
- package/lib/types/client/present.d.ts +60 -0
- package/lib/types/client/present.d.ts.map +1 -1
- package/lib/types/client/present.js +74 -0
- package/lib/types/client/styles.d.ts.map +1 -1
- package/lib/types/client/styles.js +5 -0
- package/lib/types/version.d.ts +1 -1
- package/lib/types/version.js +1 -1
- package/package.json +22 -20
- package/src/client/DrawResultCard.tsx +76 -16
- package/src/client/locales.ts +9 -0
- package/src/client/present.ts +90 -0
- package/src/client/styles.ts +5 -0
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
## [Unreleased]
|
|
10
|
+
|
|
11
|
+
## [0.2.18] - 2026-09-25
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Host pins move to `0.1.7-rc.2`; re-verified against that host line. Every `@deepseek-ai/dsh-*` dev/test dependency now pins `0.1.7-rc.2`, the `dshWorkshop.compatibility.dshVersions` timeline appends `0.1.7-rc.2`, and the compatibility baseline in every README records the `dsh-v0.1.7-rc.2` host. The declared host ranges (`engines.dsh` and the `peerDependencies` union) are deliberately **unchanged** — they already admit `0.1.7-rc.2`, and a range is what the manifest accepts, not what has been tested.
|
|
16
|
+
|
|
17
|
+
## [0.2.17] - 2026-09-23
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- The result card is visible again while the call is still arriving. Harness `0.1.7-rc.1` split the client `tool.call.toolview` owner into three stages — `preparing`, `start`, `result` — and dispatches the **same keyed entry in all three**, so an `image_generate` card now receives a *preparing* owner whose block is an ordinary object with no `kind` and no `argsRaw`. The card's only guard was `'kind' in block`, so `presentDrawResult` returned `undefined` and the card rendered an empty `div`. Nothing threw, which is why it read as a cosmetic oddity rather than a crash: **the row was blank for the entire argument-streaming window.** The card now renders its own in-flight row for the stages before `result` — tool name plus a localized preparing/running label — because returning nothing cannot delegate to the host: a keyed cell that is *occupied* never reaches the owner fallback (the renderer falls back only for an empty cell), so an empty answer blanks the line instead of restoring the host's own generic row. The settled card, its accounting line, and regenerate are unchanged.
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- `scripts/verify-host-contract.mjs` (`pnpm run verify:host-contract`), a third ruler beside the two typechecks, wired into CI and the release gate. Both typechecks were green through this whole regression: this repository declares the tool-view contract **locally** (the harness ui-tool package index does not re-export it — re-verified against the installed `0.1.7-rc.1`) and `SlotMap` is an interface, so the two declarations merge and the local, narrower one becomes the program's authority; the host's real union was never the thing being checked. The new gate reads the host's own `ToolCallPhaseProps` declaration and the renderer's keyed dispatch and fails loudly when they no longer match what this plugin declares and relies on. It also pins the assumption the fix rests on ("the fallback is reachable only for an empty cell"), so a future host that changes that naming fails here instead of silently re-blanking the row. The checkout is a local development artifact, so when it is absent (CI, tarball installs) the gate verifies what it can without it; whenever it *is* present, every check runs.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- Move the `@deepseek-ai/dsh-*` dev/test pins to `0.1.7-rc.1`, record `0.1.7-rc.1` in `dshWorkshop.compatibility.dshVersions`, and point the CI step label and the weekly Compat workflow at the same line. The declared `engines.dsh` / `peerDependencies` bands are unchanged — the `|| >=0.1.7-0 <0.2.0` arm added in 0.2.16 already admits this prerelease, so no supported host line is dropped and no range is narrowed.
|
|
30
|
+
- The browser-half component specs are the first `.tsx` specs in this repo, so `vitest.config.ts` now includes `tests/**/*.spec.{ts,tsx}`. The previous pattern silently skipped them; a spec file that never runs is worse than no spec file. `@types/react-dom` joins `devDependencies` for the `react-dom/server` render face (no runtime dependency is added — `react-dom` was already a devDependency).
|
|
31
|
+
- The local `ToolCallOwnerProps` in `src/client/DrawResultCard.tsx` is the host's phase discriminant union again (`common & ToolCallPhaseProps`), split into an exported `ToolCallPhaseProps` and `ToolCallCommonProps` exactly as the harness declares them, and a spec assertion now rejects an owner with no `phase`.
|
|
32
|
+
|
|
9
33
|
## [0.2.16] - 2026-09-23
|
|
10
34
|
|
|
11
35
|
### Fixed
|
package/README-es.md
CHANGED
|
@@ -25,11 +25,18 @@
|
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
+
|
|
29
|
+
<!-- star-cta -->
|
|
30
|
+
## ⭐ 如果它帮到了你
|
|
31
|
+
|
|
32
|
+
Este plugin forma parte de la [familia de plugins DSH](https://github.com/PerryLink) (más de 40, todos Apache-2.0). Si te resulta útil, **dale una estrella**: no desbloquea nada, pero ayuda a que la siguiente persona lo encuentre antes.
|
|
33
|
+
|
|
34
|
+
*English:* part of a 40+ plugin family for DeepSeek Harness. If it is useful, **a star helps the next person find it** — nothing is gated behind it.
|
|
28
35
|
## Compatibilidad
|
|
29
36
|
|
|
30
37
|
| Superficie | Estado |
|
|
31
38
|
|---|---|
|
|
32
|
-
| Harness | DeepSeek Harness `dsh-v0.1.7-
|
|
39
|
+
| Harness | DeepSeek Harness `dsh-v0.1.7-rc.2` (compatibilidad declarada para `0.1.5-rc.2`) |
|
|
33
40
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
34
41
|
| Motores | Cualquier endpoint de imágenes compatible con OpenAI; presets para OpenAI Images (`gpt-image-1`) y Zhipu CogView (`cogview-3-flash`) |
|
|
35
42
|
| Superficies | Herramienta host `image_generate` + tarjeta de resultado web + pestaña de ajustes de Plugins |
|
|
@@ -37,6 +44,7 @@
|
|
|
37
44
|
La mitad de navegador se apoya en el `Context` de cordis y en los paquetes de cliente publicados (`dsh-client-ui-slots`, `dsh-client-ui-settings`, `dsh-client-ui-tool`, `dsh-client-locale`, `dsh-client-connection`); ya no depende del paquete eliminado `dsh-client-runtime` (el bloque de llamada de herramienta se lee mediante un contrato estructural local), por lo que la superficie de cliente también encaja con hosts `0.1.2-rc.1`.
|
|
38
45
|
0.1.2-rc.1 (adaptado el 2026-09-02): el sobre de sesión conserva su campo ignorable solo para compatibilidad de lectura de logs almacenados - Session.append aún no puede estamparlo, por lo que el comportamiento de la puerta no cambia. Verificado el 2026-09-06 contra el master checkout dsh-v0.1.7-alpha.1 (cadena completa de puertas + smoke de instalación de perfil).
|
|
39
46
|
0.1.6-alpha.2 (adaptado el 2026-09-18): el tercer parámetro de `Session.append` existe solo para tipos de superficie y es un `SurfaceIntent`, nunca un sobre `ignorable`, así que el tipo no-superficie `draw/generated` tampoco se escribe en esta línea — la cuota se cuenta en memoria por sesión y se reinicia al reiniciar la sesión (véase la nota de durabilidad de cuota). Verificado el 2026-09-18 (doble typecheck + suite completa + puertas self-contained/artifacts/readme).
|
|
47
|
+
0.1.7-rc.2 (adaptado el 2026-09-23): el contrato de cliente `tool.call.toolview` dividió su owner en tres etapas (`preparing` / `start` / `result`), y una tarjeta con clave ahora se despacha mientras los argumentos aún llegan en streaming. Por eso la tarjeta de resultado también dibuja su fila en curso para esas etapas previas: una celda keyed ocupada nunca alcanza la fila genérica del host, así que responder a una etapa preparada con nada dejaba la línea en blanco durante toda la ventana de streaming. Nada más cambia: la tarjeta liquidada, la línea de contabilidad y regenerar se comportan igual que antes. Verificado el 2026-09-23 (doble typecheck + suite completa + la nueva puerta host-contract).
|
|
40
48
|
|
|
41
49
|
## Qué obtienes
|
|
42
50
|
|
|
@@ -119,7 +127,7 @@ Ejemplo de sobrescritura en el parche de tu perfil:
|
|
|
119
127
|
| Superficie | Notas |
|
|
120
128
|
|---|---|
|
|
121
129
|
| `image_generate` | Parámetros estándar; devuelve JSON canónico (motor/modelo/tamaño, referencias de imagen, cuota, indicador de respaldo, intentos) más bloques de imagen |
|
|
122
|
-
| Tarjeta de resultado (`tool.call.toolview`, clave `image_generate`) |
|
|
130
|
+
| Tarjeta de resultado (`tool.call.toolview`, clave `image_generate`) | En cada etapa de la llamada: una fila en curso mientras llegan los argumentos, y tras asentarse las imágenes, la línea de motor/cuota y regenerar con un clic (ruta completa del drawer: cuota + enrutamiento + auditoría) |
|
|
123
131
|
| Pestaña de ajustes (Plugins → Image generation) | Cadena de motores, estado de credenciales, establecer/eliminar claves API (referencias de credencial), sondas de conectividad, límites de cuota |
|
|
124
132
|
|
|
125
133
|
## Permisos y datos
|
|
@@ -147,10 +155,11 @@ Ejemplo de sobrescritura en el parche de tu perfil:
|
|
|
147
155
|
```sh
|
|
148
156
|
pnpm install # node ^22.19 || >=24
|
|
149
157
|
pnpm run typecheck # tsc: src + tests contra el checkout local del harness
|
|
150
|
-
pnpm run typecheck:ci # tsc contra las caras publicadas 0.1.7-
|
|
151
|
-
pnpm test # vitest:
|
|
158
|
+
pnpm run typecheck:ci # tsc contra las caras publicadas 0.1.7-rc.2 (sin paths)
|
|
159
|
+
pnpm test # vitest: 19 archivos spec (transporte guionado, Context/Session/ToolRuntime reales)
|
|
152
160
|
pnpm run build # declaraciones tsc + bundles tsdown (lib/)
|
|
153
161
|
pnpm run verify:self-contained # las especificaciones de dependencias resuelven desde el registry
|
|
162
|
+
pnpm run verify:host-contract # el contrato tool-view del host sigue coincidiendo con lo que declara este plugin
|
|
154
163
|
pnpm run verify:artifacts # cara ESM host + manifiesto typert + bundle de navegador + archivos de configuración
|
|
155
164
|
pnpm pack # el tarball publicado
|
|
156
165
|
```
|
package/README-hi.md
CHANGED
|
@@ -25,11 +25,18 @@
|
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
+
|
|
29
|
+
<!-- star-cta -->
|
|
30
|
+
## ⭐ 如果它帮到了你
|
|
31
|
+
|
|
32
|
+
यह प्लगइन [DSH प्लगइन परिवार](https://github.com/PerryLink) का हिस्सा है (40+ प्लगइन, सभी Apache-2.0)। अगर यह उपयोगी लगे, तो **एक स्टार दें** — इससे कोई सुविधा अनलॉक नहीं होती, पर अगला व्यक्ति इसे खोज में आसानी से पा लेता है।
|
|
33
|
+
|
|
34
|
+
*English:* part of a 40+ plugin family for DeepSeek Harness. If it is useful, **a star helps the next person find it** — nothing is gated behind it.
|
|
28
35
|
## संगतता
|
|
29
36
|
|
|
30
37
|
| सतह | स्थिति |
|
|
31
38
|
|---|---|
|
|
32
|
-
| Harness | DeepSeek Harness `dsh-v0.1.7-
|
|
39
|
+
| Harness | DeepSeek Harness `dsh-v0.1.7-rc.2` (`0.1.5-rc.2` के लिए घोषित संगतता) |
|
|
33
40
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
34
41
|
| इंजन | कोई भी OpenAI-संगत images एंडपॉइंट; OpenAI Images (`gpt-image-1`) और Zhipu CogView (`cogview-3-flash`) प्रीसेट |
|
|
35
42
|
| सतहें | Host `image_generate` टूल + वेब परिणाम कार्ड + Plugins सेटिंग टैब |
|
|
@@ -37,6 +44,7 @@
|
|
|
37
44
|
ब्राउज़र हिस्सा cordis `Context` और प्रकाशित क्लाइंट पैकेजों (`dsh-client-ui-slots`, `dsh-client-ui-settings`, `dsh-client-ui-tool`, `dsh-client-locale`, `dsh-client-connection`) पर चलता है; यह अब हटाए गए `dsh-client-runtime` पैकेज पर निर्भर नहीं करता (टूल-कॉल ब्लॉक स्थानीय संरचनात्मक अनुबंध से पढ़ा जाता है), इसलिए क्लाइंट सतह `0.1.2-rc.1` होस्ट के साथ भी मेल खाती है।
|
|
38
45
|
0.1.2-rc.1 (2026-09-02 को अनुकूलित): सत्र लिफ़ाफ़ा अपना ignorable फ़ील्ड केवल संग्रहीत-लॉग पठन संगतता के लिए रखता है - Session.append अभी भी इसे स्टैम्प नहीं कर सकता, इसलिए गेट व्यवहार अपरिवर्तित है। 2026-09-06 को dsh-v0.1.7-alpha.1 master checkout के विरुद्ध सत्यापित (पूर्ण गेट श्रृंखला + प्रोफ़ाइल इंस्टॉल स्मोक)।
|
|
39
46
|
0.1.6-alpha.2 (2026-09-18 को अनुकूलित): `Session.append` का तीसरा पैरामीटर केवल सरफ़ेस-योग्य प्रकारों के लिए होता है और वह `SurfaceIntent` है, कभी `ignorable` एनवेलप नहीं, इसलिए गैर-सरफ़ेस `draw/generated` इस लाइन पर अब भी नहीं लिखा जाता — कोटा प्रति-सत्र स्मृति में गिना जाता है और सत्र पुनः आरंभ पर रीसेट होता है। 2026-09-18 को सत्यापित (दोहरा typecheck + पूरी सूट + self-contained/artifacts/readme गेट)।
|
|
47
|
+
0.1.7-rc.2 (2026-09-23 को अनुकूलित): क्लाइंट `tool.call.toolview` अनुबंध ने अपने owner को तीन चरणों (`preparing` / `start` / `result`) में बाँट दिया, और अब keyed कार्ड तब भी भेजा जाता है जब आर्ग्युमेंट अभी स्ट्रीम हो रहे हों। इसलिए परिणाम कार्ड उन पूर्व चरणों के लिए अपनी इन-फ़्लाइट पंक्ति भी दिखाता है: भरा हुआ keyed सेल कभी होस्ट की सामान्य पंक्ति तक नहीं पहुँचता, इसलिए तैयारी के चरण को खाली उत्तर देने से पूरी स्ट्रीमिंग अवधि में वह पंक्ति खाली रह जाती थी। और कुछ नहीं बदला: तय हो चुका कार्ड, लेखा पंक्ति और पुनः-उत्पादन पहले जैसे ही व्यवहार करते हैं। 2026-09-23 को सत्यापित (दोहरा typecheck + पूरी सूट + नया host-contract गेट)।
|
|
40
48
|
|
|
41
49
|
## आपको क्या मिलता है
|
|
42
50
|
|
|
@@ -119,7 +127,7 @@ dsh --profile web --dump-config | grep -A2 'id: dsh-draw'
|
|
|
119
127
|
| सतह | टिप्पणियाँ |
|
|
120
128
|
|---|---|
|
|
121
129
|
| `image_generate` | मानक पैरामीटर; कैननिकल JSON (इंजन/मॉडल/आकार, छवि संदर्भ, कोटा, फ़ॉलबैक झंडा, प्रयास) + छवि ब्लॉक लौटाता है |
|
|
122
|
-
| परिणाम कार्ड (`tool.call.toolview`, key `image_generate`) | छवियाँ, इंजन/कोटा
|
|
130
|
+
| परिणाम कार्ड (`tool.call.toolview`, key `image_generate`) | कॉल के हर चरण में: आर्ग्युमेंट स्ट्रीम होते समय इन-फ़्लाइट पंक्ति, और तय होने पर छवियाँ, इंजन/कोटा पंक्ति तथा एक-क्लिक regenerate (पूरा drawer पथ: कोटा + रूटिंग + ऑडिट) |
|
|
123
131
|
| सेटिंग टैब (Plugins → Image generation) | इंजन श्रृंखला, क्रेडेंशियल स्थिति, API कुंजी सेट/हटाएँ (क्रेडेंशियल संदर्भ), कनेक्टिविटी जाँच, कोटा सीमाएँ |
|
|
124
132
|
|
|
125
133
|
## अनुमतियाँ और डेटा
|
|
@@ -147,10 +155,11 @@ dsh --profile web --dump-config | grep -A2 'id: dsh-draw'
|
|
|
147
155
|
```sh
|
|
148
156
|
pnpm install # node ^22.19 || >=24
|
|
149
157
|
pnpm run typecheck # tsc: src + tests स्थानीय हार्नेस चेकआउट के विरुद्ध
|
|
150
|
-
pnpm run typecheck:ci # tsc प्रकाशित 0.1.7-
|
|
151
|
-
pnpm test # vitest:
|
|
158
|
+
pnpm run typecheck:ci # tsc प्रकाशित 0.1.7-rc.2 फ़ेस के विरुद्ध (बिना paths)
|
|
159
|
+
pnpm test # vitest: 19 spec फ़ाइलें (स्क्रिप्टेड ट्रांसपोर्ट, वास्तविक Context/Session/ToolRuntime)
|
|
152
160
|
pnpm run build # tsc घोषणाएँ + tsdown बंडल (lib/)
|
|
153
161
|
pnpm run verify:self-contained # निर्भरता स्पेक registry से हल होती हैं
|
|
162
|
+
pnpm run verify:host-contract # host का tool-view अनुबंध अब भी इस प्लगइन की घोषणा से मेल खाता है
|
|
154
163
|
pnpm run verify:artifacts # host ESM फ़ेस + typert मैनिफ़ेस्ट + ब्राउज़र बंडल + कॉन्फ़िग फ़ाइलें
|
|
155
164
|
pnpm pack # प्रकाशित tarball
|
|
156
165
|
```
|
package/README-pt.md
CHANGED
|
@@ -25,11 +25,18 @@
|
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
+
|
|
29
|
+
<!-- star-cta -->
|
|
30
|
+
## ⭐ 如果它帮到了你
|
|
31
|
+
|
|
32
|
+
Este plugin faz parte da [família de plugins DSH](https://github.com/PerryLink) (mais de 40, todos Apache-2.0). Se for útil, **deixe uma estrela**: não desbloqueia nada, mas ajuda a próxima pessoa a encontrá-lo.
|
|
33
|
+
|
|
34
|
+
*English:* part of a 40+ plugin family for DeepSeek Harness. If it is useful, **a star helps the next person find it** — nothing is gated behind it.
|
|
28
35
|
## Compatibilidade
|
|
29
36
|
|
|
30
37
|
| Superfície | Status |
|
|
31
38
|
|---|---|
|
|
32
|
-
| Harness | DeepSeek Harness `dsh-v0.1.7-
|
|
39
|
+
| Harness | DeepSeek Harness `dsh-v0.1.7-rc.2` (compatibilidade declarada para `0.1.5-rc.2`) |
|
|
33
40
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
34
41
|
| Motores | Qualquer endpoint de imagens compatível com OpenAI; presets para OpenAI Images (`gpt-image-1`) e Zhipu CogView (`cogview-3-flash`) |
|
|
35
42
|
| Superfícies | Ferramenta host `image_generate` + cartão de resultado web + aba de ajustes de Plugins |
|
|
@@ -37,6 +44,7 @@
|
|
|
37
44
|
A metade de navegador usa o `Context` do cordis e os pacotes de cliente publicados (`dsh-client-ui-slots`, `dsh-client-ui-settings`, `dsh-client-ui-tool`, `dsh-client-locale`, `dsh-client-connection`); ela não depende mais do pacote removido `dsh-client-runtime` (o bloco de chamada de ferramenta é lido por um contrato estrutural local), então a superfície de cliente também se alinha com hosts `0.1.2-rc.1`.
|
|
38
45
|
0.1.2-rc.1 (adaptado em 2026-09-02): o envelope de sessão mantém seu campo ignorable apenas para compatibilidade de leitura de logs armazenados - o Session.append ainda não consegue estampá-lo, então o comportamento da porta não muda. Verificado em 2026-09-06 contra o checkout master dsh-v0.1.7-alpha.1 (cadeia completa de portas + smoke de instalação de perfil).
|
|
39
46
|
0.1.6-alpha.2 (adaptado em 2026-09-18): o terceiro parâmetro de `Session.append` existe apenas para tipos de superfície e é um `SurfaceIntent`, nunca um envelope `ignorable`, então o tipo não-superfície `draw/generated` também não é gravado nesta linha — a cota é contada em memória por sessão e zera ao reiniciar a sessão (ver a nota de durabilidade de cota). Verificado em 2026-09-18 (typecheck duplo + suíte completa + portas self-contained/artifacts/readme).
|
|
47
|
+
0.1.7-rc.2 (adaptado em 2026-09-23): o contrato de cliente `tool.call.toolview` dividiu seu owner em três estágios (`preparing` / `start` / `result`), e um cartão com chave agora é despachado enquanto os argumentos ainda chegam em streaming. Por isso o cartão de resultado também desenha sua linha em andamento para esses estágios anteriores: uma célula keyed ocupada nunca alcança a linha genérica do host, então responder a um estágio de preparação com nada deixava a linha em branco durante toda a janela de streaming. Nada mais muda: o cartão liquidado, a linha de contabilidade e o regenerar se comportam como antes. Verificado em 2026-09-23 (typecheck duplo + suíte completa + a nova porta host-contract).
|
|
40
48
|
|
|
41
49
|
## O que você ganha
|
|
42
50
|
|
|
@@ -119,7 +127,7 @@ Exemplo de sobrescrita no patch do seu perfil:
|
|
|
119
127
|
| Superfície | Notas |
|
|
120
128
|
|---|---|
|
|
121
129
|
| `image_generate` | Parâmetros padrão; retorna JSON canônico (motor/modelo/tamanho, referências de imagem, cota, indicador de fallback, tentativas) mais blocos de imagem |
|
|
122
|
-
| Cartão de resultado (`tool.call.toolview`, chave `image_generate`) |
|
|
130
|
+
| Cartão de resultado (`tool.call.toolview`, chave `image_generate`) | Em cada estágio da chamada: uma linha em andamento enquanto os argumentos chegam, e depois de liquidada as imagens, a linha de motor/cota e regenerar com um clique (caminho completo do drawer: cota + roteamento + auditoria) |
|
|
123
131
|
| Aba de ajustes (Plugins → Image generation) | Cadeia de motores, estado de credenciais, definir/remover chaves de API (referências de credencial), sondas de conectividade, limites de cota |
|
|
124
132
|
|
|
125
133
|
## Permissões e dados
|
|
@@ -147,10 +155,11 @@ Exemplo de sobrescrita no patch do seu perfil:
|
|
|
147
155
|
```sh
|
|
148
156
|
pnpm install # node ^22.19 || >=24
|
|
149
157
|
pnpm run typecheck # tsc: src + tests contra o checkout local do harness
|
|
150
|
-
pnpm run typecheck:ci # tsc contra as faces publicadas 0.1.7-
|
|
151
|
-
pnpm test # vitest:
|
|
158
|
+
pnpm run typecheck:ci # tsc contra as faces publicadas 0.1.7-rc.2 (sem paths)
|
|
159
|
+
pnpm test # vitest: 19 arquivos spec (transporte roteirizado, Context/Session/ToolRuntime reais)
|
|
152
160
|
pnpm run build # declarações tsc + bundles tsdown (lib/)
|
|
153
161
|
pnpm run verify:self-contained # as especificações de dependências resolvem pelo registry
|
|
162
|
+
pnpm run verify:host-contract # o contrato tool-view do host ainda coincide com o que este plugin declara
|
|
154
163
|
pnpm run verify:artifacts # face ESM host + manifesto typert + bundle de navegador + arquivos de configuração
|
|
155
164
|
pnpm pack # o tarball publicado
|
|
156
165
|
```
|
package/README-zh.md
CHANGED
|
@@ -25,11 +25,18 @@
|
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
+
|
|
29
|
+
<!-- star-cta -->
|
|
30
|
+
## ⭐ 如果它帮到了你
|
|
31
|
+
|
|
32
|
+
这个插件是 [DSH 插件家族](https://github.com/PerryLink)的一员(40+ 个,全部 Apache-2.0)。如果你在用,**给个 star** —— 它不会解锁任何功能,但会让下一个人在搜索里更容易找到它。
|
|
33
|
+
|
|
34
|
+
*English:* part of a 40+ plugin family for DeepSeek Harness. If it is useful, **a star helps the next person find it** — nothing is gated behind it.
|
|
28
35
|
## 兼容性
|
|
29
36
|
|
|
30
37
|
| 方面 | 状态 |
|
|
31
38
|
|---|---|
|
|
32
|
-
| Harness | DeepSeek Harness `dsh-v0.1.7-
|
|
39
|
+
| Harness | DeepSeek Harness `dsh-v0.1.7-rc.2`(声明兼容 `0.1.5-rc.2`) |
|
|
33
40
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
34
41
|
| 引擎 | 任意 OpenAI 兼容图像端点;内置 OpenAI Images(`gpt-image-1`)与智谱 CogView(`cogview-3-flash`)预设 |
|
|
35
42
|
| 界面 | Host `image_generate` 工具 + Web 结果卡片 + Plugins 设置页签 |
|
|
@@ -37,6 +44,7 @@
|
|
|
37
44
|
浏览器半边基于 cordis `Context` 与已发布的客户端包(`dsh-client-ui-slots`、`dsh-client-ui-settings`、`dsh-client-ui-tool`、`dsh-client-locale`、`dsh-client-connection`);它不再依赖已移除的 `dsh-client-runtime` 包(工具调用块经本地结构契约读取),因此客户端接口面同样对齐 `0.1.2-rc.1` 宿主。
|
|
38
45
|
0.1.2-rc.1(2026-09-02 已适配):会话信封保留 ignorable 字段但仅用于存量日志读取兼容——Session.append 仍无法盖章,门控行为不变。已于 2026-09-06 对照 dsh-v0.1.7-alpha.1 master 检出核验(完整门禁链 + profile 安装冒烟)。
|
|
39
46
|
0.1.6-alpha.2(2026-09-18 已适配):`Session.append` 的第三参仅对表面事件类型存在且为 `SurfaceIntent`,绝非 `ignorable` 信封,因此非表面的 `draw/generated` 在该线上仍不落盘——配额按会话内存计数、会话重启归零(与下方「配额持久性」一致)。已于 2026-09-18 核验(双 typecheck 尺子 + 全量测试 + self-contained/artifacts/readme 门)。
|
|
47
|
+
0.1.7-rc.2(2026-09-23 已适配):客户端 `tool.call.toolview` 契约把 owner 拆成三个阶段(`preparing` / `start` / `result`),且参数仍在流式到达时就会派发带 key 的卡片。因此结果卡片现在也为这些更早的阶段渲染「进行中」行——已占用的 keyed 槽位永远不会落到宿主自带的通用行,所以对准备阶段不作回应会让整行在整个流式窗口内空白。其余行为不变:结算后的卡片、账目行与重新生成与之前完全一致。已于 2026-09-23 核验(双 typecheck 尺子 + 全量测试 + 新增 host-contract 门)。
|
|
40
48
|
|
|
41
49
|
## 你能得到什么
|
|
42
50
|
|
|
@@ -119,7 +127,7 @@ profile patch 中的覆盖示例:
|
|
|
119
127
|
| 界面 | 说明 |
|
|
120
128
|
|---|---|
|
|
121
129
|
| `image_generate` | 标准参数;返回规范 JSON(引擎/模型/尺寸、图片引用、配额、回退标志、尝试记录)加图片内容块 |
|
|
122
|
-
| 结果卡片(`tool.call.toolview`,key `image_generate`) |
|
|
130
|
+
| 结果卡片(`tool.call.toolview`,key `image_generate`) | 覆盖调用的每个阶段:参数流式到达时先显示进行中行,结算后显示图片、引擎/配额行与一键重新生成(完整 drawer 路径:配额 + 路由 + 审计) |
|
|
123
131
|
| 设置页签(Plugins → 图像生成) | 引擎链、凭据状态、设置/移除 API 密钥(凭据引用)、连通性探测、配额上限 |
|
|
124
132
|
|
|
125
133
|
## 权限与数据
|
|
@@ -147,10 +155,11 @@ profile patch 中的覆盖示例:
|
|
|
147
155
|
```sh
|
|
148
156
|
pnpm install # node ^22.19 || >=24
|
|
149
157
|
pnpm run typecheck # tsc:src + tests,对照本地 harness checkout
|
|
150
|
-
pnpm run typecheck:ci # tsc:对照已发布的 0.1.7-
|
|
151
|
-
pnpm test # vitest:
|
|
158
|
+
pnpm run typecheck:ci # tsc:对照已发布的 0.1.7-rc.2 类型(无 paths)
|
|
159
|
+
pnpm test # vitest:19 个 spec 文件(scripted 传输、真实 Context/Session/ToolRuntime)
|
|
152
160
|
pnpm run build # tsc 声明 + tsdown 打包(lib/)
|
|
153
161
|
pnpm run verify:self-contained # 依赖声明全部来自 registry
|
|
162
|
+
pnpm run verify:host-contract # 宿主 tool-view 契约仍与本插件声明一致
|
|
154
163
|
pnpm run verify:artifacts # host ESM 面 + typert manifest + 浏览器包 + 配置文件
|
|
155
164
|
pnpm pack # 发布用 tarball
|
|
156
165
|
```
|
package/README.md
CHANGED
|
@@ -26,11 +26,19 @@
|
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
+
<!-- star-cta -->
|
|
30
|
+
## ⭐ 如果它帮到了你
|
|
31
|
+
|
|
32
|
+
这个插件是 [DSH 插件家族](https://github.com/PerryLink)的一员(40+ 个,全部 Apache-2.0)。如果你在用,**给个 star** —— 它不会解锁任何功能,但会让下一个人在搜索里更容易找到它。
|
|
33
|
+
|
|
34
|
+
*English:* part of a 40+ plugin family for DeepSeek Harness. If it is useful, **a star helps the next person find it** — nothing is gated behind it.
|
|
35
|
+
|
|
36
|
+
|
|
29
37
|
## Compatibility
|
|
30
38
|
|
|
31
39
|
| Surface | Status |
|
|
32
40
|
|---|---|
|
|
33
|
-
| Harness | DeepSeek Harness `dsh-v0.1.7-
|
|
41
|
+
| Harness | DeepSeek Harness `dsh-v0.1.7-rc.2` (compat declared for `0.1.5-rc.2`) |
|
|
34
42
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
35
43
|
| Engines | Any OpenAI-compatible images endpoint; presets for OpenAI Images (`gpt-image-1`) and Zhipu CogView (`cogview-3-flash`) |
|
|
36
44
|
| Surfaces | Host `image_generate` tool + web result card + Plugins settings tab |
|
|
@@ -38,6 +46,7 @@
|
|
|
38
46
|
The browser half rides the cordis `Context` and the published client packages (`dsh-client-ui-slots`, `dsh-client-ui-settings`, `dsh-client-ui-tool`, `dsh-client-locale`, `dsh-client-connection`); it no longer depends on the removed `dsh-client-runtime` package (the tool-call block is read through a local structural contract), so the client surface also lines up with `0.1.2-rc.1` hosts.
|
|
39
47
|
0.1.2-rc.1 (adapted 2026-09-02): the session envelope keeps its ignorable field for stored-log read compatibility only - Session.append still cannot stamp it, so audit-gate behavior is unchanged. Verified 2026-09-06 against the dsh-v0.1.7-alpha.1 master checkout (full gate chain + profile install smoke).
|
|
40
48
|
0.1.6-alpha.2 (adapted 2026-09-18): `Session.append`'s third parameter exists only for surface-eligible event types and is a `SurfaceIntent`, never an `ignorable` envelope, so `draw/generated` (a non-surface type) is still not written on this line — quota is counted in memory per session and resets when the session restarts, exactly as the "Quota durability" note below describes. Verified 2026-09-18 (dual typecheck rulers + the full suite + self-contained/artifacts/readme gates).
|
|
49
|
+
0.1.7-rc.2 (adapted 2026-09-23): the client `tool.call.toolview` contract split its owner into three stages (`preparing` / `start` / `result`), and a keyed card is now dispatched while the arguments are still streaming. The result card therefore also renders the in-flight row for those earlier stages — an occupied keyed slot never reaches the host's own generic row, so answering a prepared stage with nothing blanked the line for the whole streaming window. Nothing else changed: the settled card, the accounting line, and regenerate behave exactly as before. Verified 2026-09-23 (dual typecheck rulers + the full suite + the new host-contract gate).
|
|
41
50
|
|
|
42
51
|
## What you get
|
|
43
52
|
|
|
@@ -120,7 +129,7 @@ Example override in your profile patch:
|
|
|
120
129
|
| Surface | Notes |
|
|
121
130
|
|---|---|
|
|
122
131
|
| `image_generate` | Standard parameters; returns canonical JSON (engine/model/size, image references, quota, fallback flag, attempts) plus image content blocks |
|
|
123
|
-
| Result card (`tool.call.toolview`, key `image_generate`) |
|
|
132
|
+
| Result card (`tool.call.toolview`, key `image_generate`) | In every stage of the call: an in-flight row while the arguments stream, then images, engine/quota line, and one-click regenerate once it settles (full drawer path: quota + routing + audit) |
|
|
124
133
|
| Settings tab (Plugins → Image generation) | Engine chain, credential status, set/remove API keys (credential references), connectivity probes, quota limits |
|
|
125
134
|
|
|
126
135
|
## Permissions & data
|
|
@@ -148,10 +157,11 @@ Example override in your profile patch:
|
|
|
148
157
|
```sh
|
|
149
158
|
pnpm install # node ^22.19 || >=24
|
|
150
159
|
pnpm run typecheck # tsc: src + tests against the local harness checkout
|
|
151
|
-
pnpm run typecheck:ci # tsc against the published 0.1.7-
|
|
152
|
-
pnpm test # vitest:
|
|
160
|
+
pnpm run typecheck:ci # tsc against the published 0.1.7-rc.2 faces (no paths)
|
|
161
|
+
pnpm test # vitest: 19 spec files (scripted transport, real Context/Session/ToolRuntime)
|
|
153
162
|
pnpm run build # tsc declarations + tsdown bundles (lib/)
|
|
154
163
|
pnpm run verify:self-contained # dependency specs resolve from the registry
|
|
164
|
+
pnpm run verify:host-contract # the host tool-view contract still matches what this plugin declares
|
|
155
165
|
pnpm run verify:artifacts # host ESM face + typert manifest + browser bundle + config files
|
|
156
166
|
pnpm pack # the published tarball
|
|
157
167
|
```
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -13,8 +13,8 @@ everything else is install-time:
|
|
|
13
13
|
| [zod](https://github.com/colinhacks/zod) | `^4.4.3` | MIT | Wire codecs shared by the host and client Typert faces (bundled into `lib/`) |
|
|
14
14
|
| [tsdown](https://github.com/rolldown/tsdown) | `^0.22.14` | MIT | Build-time bundling of `lib/` (a regular dependency so the git-install channel's `prepare` script can build) |
|
|
15
15
|
| [typescript](https://github.com/microsoft/TypeScript) | `^7.0.2` | Apache-2.0 | Build-time declaration emission (`lib/types/`) |
|
|
16
|
-
| [@deepseek-ai/cordis](https://www.npmjs.com/package/@deepseek-ai/cordis) | `^4.0.
|
|
17
|
-
| [@deepseek-ai/schemastery](https://www.npmjs.com/package/@deepseek-ai/schemastery) | `^3.18.
|
|
16
|
+
| [@deepseek-ai/cordis](https://www.npmjs.com/package/@deepseek-ai/cordis) | `^4.0.4` (peer) | See package | The plugin runtime |
|
|
17
|
+
| [@deepseek-ai/schemastery](https://www.npmjs.com/package/@deepseek-ai/schemastery) | `^3.18.2` (peer) | See package | Configuration schema |
|
|
18
18
|
| `@deepseek-ai/dsh-*` peers | `>=0.1.2-rc.1 <0.2.0 \|\| >=0.1.5-alpha.1 <0.2.0 \|\| >=0.1.6-0 <0.2.0 \|\| >=0.1.7-0 <0.2.0` (peer) | See packages | Official harness seams (`dsh-tools`, `dsh-session`, `dsh-attachment`, `dsh-credentials`, `dsh-llm`, `dsh-brand`, `dsh-typert-protocol`) |
|
|
19
19
|
|
|
20
20
|
At runtime the plugin only talks to the image-generation endpoints the user
|
package/lib/client.js
CHANGED
|
@@ -7,13 +7,35 @@ window.__ModuleLoader__.load({
|
|
|
7
7
|
let react = require("react");
|
|
8
8
|
//#region src/client/present.ts
|
|
9
9
|
/**
|
|
10
|
+
* Classify a frozen tool block into its Host stage, mirroring the Host's own
|
|
11
|
+
* `toolCallPhase`: a settled node wins on `kind`, and the running family splits
|
|
12
|
+
* on `phase`. `ToolCallBlock` is structurally narrower than the Host union
|
|
13
|
+
* (`RunningToolCallBlock` declares no `phase` field), so the running arm is
|
|
14
|
+
* read through a structural probe rather than a declared member.
|
|
15
|
+
*
|
|
16
|
+
* @param block - the frozen tool block the owner delivered.
|
|
17
|
+
* @returns the stage this block belongs to.
|
|
18
|
+
*/
|
|
19
|
+
function toolCallPhase(block) {
|
|
20
|
+
if ("kind" in block) return "result";
|
|
21
|
+
return block.phase === "preparing" ? "preparing" : "start";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
10
24
|
* Project one settled `image_generate` tool block onto the card model.
|
|
11
25
|
*
|
|
26
|
+
* The stage guard is explicit, not incidental: only the Host's `result` stage
|
|
27
|
+
* carries `kind`, and the preparing stage's block is an ordinary object, so
|
|
28
|
+
* an `undefined` return is the presenter's answer for every non-result stage
|
|
29
|
+
* as well as for a foreign tool, an error result, or a window-truncated call
|
|
30
|
+
* head. The card pairs that answer with {@link toolCallPhase} to render its
|
|
31
|
+
* in-flight row instead of an empty node.
|
|
32
|
+
*
|
|
12
33
|
* @param block - the frozen tool-call block (running or settled).
|
|
13
34
|
* @returns the presented model, or `undefined` when the block is not a settled
|
|
14
35
|
* image_generate result.
|
|
15
36
|
*/
|
|
16
37
|
function presentDrawResult(block) {
|
|
38
|
+
if (toolCallPhase(block) !== "result") return void 0;
|
|
17
39
|
if (!("kind" in block) || block.kind !== "tool-result" || block.isError) return void 0;
|
|
18
40
|
if (block.call?.name !== "image_generate") return void 0;
|
|
19
41
|
const value = block.meta ?? {};
|
|
@@ -86,10 +108,16 @@ window.__ModuleLoader__.load({
|
|
|
86
108
|
//#endregion
|
|
87
109
|
//#region src/client/DrawResultCard.tsx
|
|
88
110
|
/**
|
|
89
|
-
* The keyed `image_generate` tool
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
111
|
+
* The keyed `image_generate` tool view: engine/quota facts and the regenerate
|
|
112
|
+
* action once the call settles, and an in-flight row of its own while the
|
|
113
|
+
* arguments are still arriving. The images themselves are the attachment
|
|
114
|
+
* content blocks the shell already renders from the tool result, so the card
|
|
115
|
+
* only adds the accounting line and the action — it never duplicates image
|
|
116
|
+
* transport.
|
|
117
|
+
*
|
|
118
|
+
* The Host dispatches this keyed entry in EVERY stage of the call, and a keyed
|
|
119
|
+
* cell that is occupied never reaches the owner fallback — so the earlier
|
|
120
|
+
* stages cannot be answered with nothing without blanking the row.
|
|
93
121
|
*
|
|
94
122
|
* The `tool.call.toolview` SlotMap member is declared locally (mirroring the
|
|
95
123
|
* harness's own ui-tool contract declaration, which its package index does not
|
|
@@ -98,11 +126,40 @@ window.__ModuleLoader__.load({
|
|
|
98
126
|
* @module dsh-draw/client/DrawResultCard
|
|
99
127
|
*/
|
|
100
128
|
/**
|
|
101
|
-
* The keyed tool
|
|
102
|
-
*
|
|
103
|
-
*
|
|
129
|
+
* The keyed tool view. Dispatched by the wire tool name in EVERY stage of the
|
|
130
|
+
* call, so the card owes a presentation to the in-flight stages too: returning
|
|
131
|
+
* an empty node would leave the row blank, because an occupied keyed cell
|
|
132
|
+
* never reaches the Host's own generic row.
|
|
133
|
+
*
|
|
134
|
+
* @param props - owner currency (common + stage shares), locale, and injected bindings.
|
|
135
|
+
* @returns the in-flight row, or the settled result card.
|
|
104
136
|
*/
|
|
105
137
|
function DrawResultCard(props) {
|
|
138
|
+
const phase = toolCallPhase(props.block);
|
|
139
|
+
if (phase !== "result") {
|
|
140
|
+
const stage = props.phase === "result" ? phase : props.phase;
|
|
141
|
+
return (0, react.createElement)("div", {
|
|
142
|
+
className: "dshdraw-inflight",
|
|
143
|
+
"aria-busy": "true",
|
|
144
|
+
"data-phase": stage
|
|
145
|
+
}, (0, react.createElement)("span", { className: "dshdraw-inflight-title" }, props.t("row.title")), (0, react.createElement)("span", {
|
|
146
|
+
className: "dshdraw-sep",
|
|
147
|
+
"aria-hidden": "true"
|
|
148
|
+
}, "·"), (0, react.createElement)("span", { className: "dshdraw-inflight-summary" }, props.toolName), (0, react.createElement)("span", { className: "dshdraw-inflight-state" }, props.t(inFlightKey(stage))));
|
|
149
|
+
}
|
|
150
|
+
return (0, react.createElement)(DrawResultCardBody, props);
|
|
151
|
+
}
|
|
152
|
+
/** Locale key naming the stage of a call that has not settled yet. */
|
|
153
|
+
function inFlightKey(phase) {
|
|
154
|
+
return phase === "preparing" ? "row.preparing" : "row.running";
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The settled result card: engine/quota facts and the regenerate action.
|
|
158
|
+
*
|
|
159
|
+
* @param props - the owner at its `result` stage, locale, and injected bindings.
|
|
160
|
+
* @returns the card element.
|
|
161
|
+
*/
|
|
162
|
+
function DrawResultCardBody(props) {
|
|
106
163
|
const { block, regenerate, t } = props;
|
|
107
164
|
const presented = presentDrawResult(block);
|
|
108
165
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
@@ -275,6 +332,9 @@ window.__ModuleLoader__.load({
|
|
|
275
332
|
"result.regenerate": "Regenerate",
|
|
276
333
|
"result.regenerating": "Regenerating…",
|
|
277
334
|
"result.failed": "Regenerate failed",
|
|
335
|
+
"row.title": "Tool call",
|
|
336
|
+
"row.preparing": "Preparing tool call",
|
|
337
|
+
"row.running": "Running",
|
|
278
338
|
"tab": "Image generation",
|
|
279
339
|
"tab.engines": "Engines",
|
|
280
340
|
"tab.preferred": "preferred",
|
|
@@ -300,6 +360,9 @@ window.__ModuleLoader__.load({
|
|
|
300
360
|
"result.regenerate": "重新生成",
|
|
301
361
|
"result.regenerating": "正在重新生成…",
|
|
302
362
|
"result.failed": "重新生成失败",
|
|
363
|
+
"row.title": "工具调用",
|
|
364
|
+
"row.preparing": "正在准备调用",
|
|
365
|
+
"row.running": "运行中",
|
|
303
366
|
"tab": "图像生成",
|
|
304
367
|
"tab.engines": "引擎",
|
|
305
368
|
"tab.preferred": "首选",
|
|
@@ -5622,6 +5685,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5622
5685
|
.dshdraw-figure img { max-width: 100%; border-radius: 6px; border: 1px solid var(--dsh-border, #d0d7de); }
|
|
5623
5686
|
.dshdraw-figure figcaption { font-size: 11px; opacity: 0.75; overflow-wrap: anywhere; }
|
|
5624
5687
|
.dshdraw-meta { font-size: 12px; opacity: 0.85; display: flex; flex-wrap: wrap; gap: 12px; }
|
|
5688
|
+
.dshdraw-inflight { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 13px; min-height: 20px; }
|
|
5689
|
+
.dshdraw-inflight .dshdraw-sep { opacity: 0.45; }
|
|
5690
|
+
.dshdraw-inflight-title { font-weight: 500; }
|
|
5691
|
+
.dshdraw-inflight-summary { opacity: 0.85; overflow-wrap: anywhere; }
|
|
5692
|
+
.dshdraw-inflight-state { font-size: 12px; opacity: 0.7; }
|
|
5625
5693
|
.dshdraw-actions { display: flex; gap: 8px; }
|
|
5626
5694
|
.dshdraw-button {
|
|
5627
5695
|
border: 1px solid var(--dsh-border, #d0d7de); border-radius: 6px; background: transparent;
|