dsh-draw 0.1.2 → 0.2.1
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 +31 -0
- package/README.es.md +2 -1
- package/README.hi.md +2 -1
- package/README.md +4 -3
- package/README.pt.md +2 -1
- package/README.zh.md +2 -1
- package/cordis.patch.yml +5 -1
- package/lib/client.js +4 -2
- package/lib/client.js.map +1 -1
- package/lib/index.js +173 -9
- package/lib/types/client/present.d.ts +3 -1
- package/lib/types/client/present.d.ts.map +1 -1
- package/lib/types/client/present.js +4 -2
- package/lib/types/config.d.ts +6 -0
- package/lib/types/config.d.ts.map +1 -1
- package/lib/types/config.js +8 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +1 -0
- package/lib/types/provider.d.ts +39 -0
- package/lib/types/provider.d.ts.map +1 -0
- package/lib/types/provider.js +192 -0
- package/lib/types/router.d.ts +1 -3
- package/lib/types/router.d.ts.map +1 -1
- package/lib/types/router.js +3 -7
- package/lib/types/version.d.ts +4 -3
- package/lib/types/version.d.ts.map +1 -1
- package/lib/types/version.js +4 -3
- package/package.json +28 -2
- package/src/client/present.ts +4 -2
- package/src/config.ts +15 -0
- package/src/index.ts +1 -0
- package/src/provider.ts +237 -0
- package/src/router.ts +4 -8
- package/src/version.ts +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,37 @@ All notable changes to this project are documented in this file.
|
|
|
5
5
|
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
|
+
## [0.2.1] - 2026-08-27
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Declare the web-client inject packages (`@deepseek-ai/dsh-client-connection`,
|
|
13
|
+
`@deepseek-ai/dsh-client-locale`, `@deepseek-ai/dsh-client-runtime`,
|
|
14
|
+
`@deepseek-ai/dsh-client-ui-settings`, `@deepseek-ai/dsh-client-ui-slots`,
|
|
15
|
+
`@deepseek-ai/dsh-client-ui-tool`) as optional peerDependencies so the
|
|
16
|
+
bundle composition is explicit and standalone installs stay clean.
|
|
17
|
+
|
|
18
|
+
## [0.2.0] - 2026-08-26
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- Pluggable engine provider seam (Replicate / fal.ai).
|
|
23
|
+
|
|
24
|
+
## [0.1.3] - 2026-08-23
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- Presenter pure-function suite (`tests/present.spec.ts`, 11 tests): `presentDrawResult` and `presentDrawPanel` are pinned directly on their arguments — settled/error/foreign/null-call-head blocks, meta fallbacks, regenerate-args parsing, engine-row projection, and the cooldown flag.
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- `presentDrawPanel` now takes an optional `now` clock (default `Date.now`) so the cooldown flag is a pure function of its inputs and testable without fake timers; the `image_generate` tool surface and the settings tab are unchanged.
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- The five-language README "Development" section reported a stale `77 tests, 11 suites`; it now matches the actual `107 tests, 16 test files`.
|
|
37
|
+
- `src/version.ts` referenced a non-existent `tests/version.spec.ts`; the comment now names the real tripwire (`tests/session-events.spec.ts`).
|
|
38
|
+
|
|
8
39
|
## [0.1.2] - 2026-08-22
|
|
9
40
|
|
|
10
41
|
### Changed
|
package/README.es.md
CHANGED
|
@@ -139,7 +139,7 @@ Ejemplo de sobrescritura en el parche de tu perfil:
|
|
|
139
139
|
pnpm install # node ^22.19 || >=24
|
|
140
140
|
pnpm run typecheck # tsc: src + tests contra el checkout local del harness
|
|
141
141
|
pnpm run typecheck:ci # tsc contra las caras publicadas 0.1.1-rc.2 (sin paths)
|
|
142
|
-
pnpm test # vitest:
|
|
142
|
+
pnpm test # vitest: 107 tests, 16 archivos de prueba (transporte guionado, Context/Session/ToolRuntime reales)
|
|
143
143
|
pnpm run build # declaraciones tsc + bundles tsdown (lib/)
|
|
144
144
|
pnpm run verify:self-contained # las especificaciones de dependencias resuelven desde el registry
|
|
145
145
|
pnpm run verify:artifacts # cara ESM host + manifiesto typert + bundle de navegador + archivos de configuración
|
|
@@ -153,6 +153,7 @@ pnpm pack # el tarball publicado
|
|
|
153
153
|
## Contributors
|
|
154
154
|
|
|
155
155
|
- [@PerryLink](https://github.com/PerryLink) — creador y mantenedor: enrutador de motores, drawer, contabilidad de cuota, vocabulario wire de Typert, mitad de navegador y la documentación en cinco idiomas.
|
|
156
|
+
- [@Mohei-Muun](https://github.com/Mohei-Muun) — informó del fallo de carga del registro de sesión `draw/generated` en hosts rc.7 ([#2](https://github.com/PerryLink/dsh-draw/issues/2)), que condujo a la puerta de eventos adaptativa.
|
|
156
157
|
|
|
157
158
|
## PerryLink DSH Plugin Family
|
|
158
159
|
|
package/README.hi.md
CHANGED
|
@@ -139,7 +139,7 @@ dsh --profile web --dump-config | grep -A2 'id: dsh-draw'
|
|
|
139
139
|
pnpm install # node ^22.19 || >=24
|
|
140
140
|
pnpm run typecheck # tsc: src + tests स्थानीय हार्नेस चेकआउट के विरुद्ध
|
|
141
141
|
pnpm run typecheck:ci # tsc प्रकाशित 0.1.1-rc.2 फ़ेस के विरुद्ध (बिना paths)
|
|
142
|
-
pnpm test # vitest:
|
|
142
|
+
pnpm test # vitest: 107 टेस्ट, 16 टेस्ट फ़ाइलें (स्क्रिप्टेड ट्रांसपोर्ट, वास्तविक Context/Session/ToolRuntime)
|
|
143
143
|
pnpm run build # tsc घोषणाएँ + tsdown बंडल (lib/)
|
|
144
144
|
pnpm run verify:self-contained # निर्भरता स्पेक registry से हल होती हैं
|
|
145
145
|
pnpm run verify:artifacts # host ESM फ़ेस + typert मैनिफ़ेस्ट + ब्राउज़र बंडल + कॉन्फ़िग फ़ाइलें
|
|
@@ -153,6 +153,7 @@ pnpm pack # प्रकाशित tarball
|
|
|
153
153
|
## Contributors
|
|
154
154
|
|
|
155
155
|
- [@PerryLink](https://github.com/PerryLink) — निर्माता और मेंटेनर: इंजन रूटर, drawer, कोटा लेखा, Typert wire शब्दावली, ब्राउज़र आधा और पाँच-भाषा दस्तावेज़।
|
|
156
|
+
- [@Mohei-Muun](https://github.com/Mohei-Muun) — rc.7 होस्ट पर `draw/generated` सत्र-लॉग लोड विफलता की सूचना दी ([#2](https://github.com/PerryLink/dsh-draw/issues/2)), जिससे अनुकूली इवेंट गेट बना।
|
|
156
157
|
|
|
157
158
|
## PerryLink DSH Plugin Family
|
|
158
159
|
|
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ All tunables are Schemastery `Config` fields (changeable from cordis.yml). An id
|
|
|
85
85
|
|
|
86
86
|
| Key | Default | Meaning |
|
|
87
87
|
|---|---|---|
|
|
88
|
-
| `engines` | OpenAI + CogView presets | Ordered engine chain, walked top-down with fallback; each entry: `id`, `baseUrl` (no credentials), `model`, `apiKeyRef` (env-var name), `enabled`, `sizeMap`, `qualitySupported`, `styleSupported`, `responseFormat` (`b64_json`/`url`), `imageMediaType` |
|
|
88
|
+
| `engines` | OpenAI + CogView presets | Ordered engine chain, walked top-down with fallback; each entry: `id`, `baseUrl` (no credentials), `model`, `apiKeyRef` (env-var name), `provider` (`openai`/`replicate`/`fal`, default `openai`), `enabled`, `sizeMap`, `qualitySupported`, `styleSupported`, `responseFormat` (`b64_json`/`url`), `imageMediaType` |
|
|
89
89
|
| `defaultEngine` | `openai` | Engine id the router prefers; must name a configured engine |
|
|
90
90
|
| `requestTimeoutMs` | `120000` | Per-generation HTTP timeout (1000..600000) |
|
|
91
91
|
| `maxImagesPerCall` | `4` | Cap on images one call may produce (1..10) |
|
|
@@ -130,7 +130,7 @@ Example override in your profile patch:
|
|
|
130
130
|
## Known limitations
|
|
131
131
|
|
|
132
132
|
- **Image models only.** No video, audio, or edit endpoints; no vision understanding.
|
|
133
|
-
- **Engine compatibility.**
|
|
133
|
+
- **Engine compatibility.** Three vocabularies are supported through the provider seam: `openai` (the `POST /images/generations` shape), `replicate` (prediction create + poll), and `fal` (the `fal.run` queue). Provider-specific extras beyond `prompt`/size/count (e.g. seed, scheduler) are out of scope.
|
|
134
134
|
- **Cost awareness is structural.** The plugin counts calls and bytes but does not know engine pricing — pair with `dsh-budget` for cost governance.
|
|
135
135
|
- **Quota durability on rc.6/rc.7.** On hosts whose session log cannot carry `draw/generated` (static event whitelist, no `ignorable` envelope), quota stays exact for the live session from the in-memory fallback ledger but resets on restart; durable accounting resumes on hosts with a plugin event surface.
|
|
136
136
|
|
|
@@ -140,7 +140,7 @@ Example override in your profile patch:
|
|
|
140
140
|
pnpm install # node ^22.19 || >=24
|
|
141
141
|
pnpm run typecheck # tsc: src + tests against the local harness checkout
|
|
142
142
|
pnpm run typecheck:ci # tsc against the published 0.1.1-rc.2 faces (no paths)
|
|
143
|
-
pnpm test # vitest:
|
|
143
|
+
pnpm test # vitest: 107 tests, 16 test files (scripted transport, real Context/Session/ToolRuntime)
|
|
144
144
|
pnpm run build # tsc declarations + tsdown bundles (lib/)
|
|
145
145
|
pnpm run verify:self-contained # dependency specs resolve from the registry
|
|
146
146
|
pnpm run verify:artifacts # host ESM face + typert manifest + browser bundle + config files
|
|
@@ -154,6 +154,7 @@ pnpm pack # the published tarball
|
|
|
154
154
|
## Contributors
|
|
155
155
|
|
|
156
156
|
- [@PerryLink](https://github.com/PerryLink) — creator and maintainer: engine router, drawer, quota accounting, Typert wire vocabulary, browser half, and the five-language docs.
|
|
157
|
+
- [@Mohei-Muun](https://github.com/Mohei-Muun) — reported the `draw/generated` session-log unload bug on rc.7 hosts ([#2](https://github.com/PerryLink/dsh-draw/issues/2)), which led to the adaptive event gate.
|
|
157
158
|
|
|
158
159
|
## PerryLink DSH Plugin Family
|
|
159
160
|
|
package/README.pt.md
CHANGED
|
@@ -139,7 +139,7 @@ Exemplo de sobrescrita no patch do seu perfil:
|
|
|
139
139
|
pnpm install # node ^22.19 || >=24
|
|
140
140
|
pnpm run typecheck # tsc: src + tests contra o checkout local do harness
|
|
141
141
|
pnpm run typecheck:ci # tsc contra as faces publicadas 0.1.1-rc.2 (sem paths)
|
|
142
|
-
pnpm test # vitest:
|
|
142
|
+
pnpm test # vitest: 107 testes, 16 arquivos de teste (transporte roteirizado, Context/Session/ToolRuntime reais)
|
|
143
143
|
pnpm run build # declarações tsc + bundles tsdown (lib/)
|
|
144
144
|
pnpm run verify:self-contained # as especificações de dependências resolvem pelo registry
|
|
145
145
|
pnpm run verify:artifacts # face ESM host + manifesto typert + bundle de navegador + arquivos de configuração
|
|
@@ -153,6 +153,7 @@ pnpm pack # o tarball publicado
|
|
|
153
153
|
## Contributors
|
|
154
154
|
|
|
155
155
|
- [@PerryLink](https://github.com/PerryLink) — criador e mantenedor: roteador de motores, drawer, contabilidade de cota, vocabulário wire do Typert, metade de navegador e a documentação em cinco idiomas.
|
|
156
|
+
- [@Mohei-Muun](https://github.com/Mohei-Muun) — relatou a falha de carregamento do log de sessão `draw/generated` em hosts rc.7 ([#2](https://github.com/PerryLink/dsh-draw/issues/2)), que levou ao gate de eventos adaptativo.
|
|
156
157
|
|
|
157
158
|
## PerryLink DSH Plugin Family
|
|
158
159
|
|
package/README.zh.md
CHANGED
|
@@ -139,7 +139,7 @@ profile patch 中的覆盖示例:
|
|
|
139
139
|
pnpm install # node ^22.19 || >=24
|
|
140
140
|
pnpm run typecheck # tsc:src + tests,对照本地 harness checkout
|
|
141
141
|
pnpm run typecheck:ci # tsc:对照已发布的 0.1.1-rc.2 类型(无 paths)
|
|
142
|
-
pnpm test # vitest:
|
|
142
|
+
pnpm test # vitest:107 个测试、16 个测试文件(scripted 传输、真实 Context/Session/ToolRuntime)
|
|
143
143
|
pnpm run build # tsc 声明 + tsdown 打包(lib/)
|
|
144
144
|
pnpm run verify:self-contained # 依赖声明全部来自 registry
|
|
145
145
|
pnpm run verify:artifacts # host ESM 面 + typert manifest + 浏览器包 + 配置文件
|
|
@@ -153,6 +153,7 @@ pnpm pack # 发布用 tarball
|
|
|
153
153
|
## Contributors
|
|
154
154
|
|
|
155
155
|
- [@PerryLink](https://github.com/PerryLink) —— 创建者与维护者:引擎路由、drawer、配额记账、Typert wire 词汇、浏览器半与五语文档。
|
|
156
|
+
- [@Mohei-Muun](https://github.com/Mohei-Muun) —— 报告了 rc.7 主机上 `draw/generated` 会话日志导致会话无法重载的缺陷([#2](https://github.com/PerryLink/dsh-draw/issues/2)),推动了自适应事件门控的实现。
|
|
156
157
|
|
|
157
158
|
## PerryLink DSH Plugin Family
|
|
158
159
|
|
package/cordis.patch.yml
CHANGED
|
@@ -8,12 +8,15 @@
|
|
|
8
8
|
config:
|
|
9
9
|
# Ordered engine chain; the router walks it top-down and falls back on
|
|
10
10
|
# failure. apiKeyRef names an environment variable (credential
|
|
11
|
-
# reference) — never put a literal key here.
|
|
11
|
+
# reference) — never put a literal key here. `provider` selects the
|
|
12
|
+
# request/response vocabulary: openai (OpenAI-compatible images API),
|
|
13
|
+
# replicate (prediction polling), or fal (fal.run queue).
|
|
12
14
|
engines:
|
|
13
15
|
- id: openai
|
|
14
16
|
baseUrl: https://api.openai.com/v1
|
|
15
17
|
model: gpt-image-1
|
|
16
18
|
apiKeyRef: OPENAI_API_KEY
|
|
19
|
+
provider: openai
|
|
17
20
|
enabled: true
|
|
18
21
|
sizeMap: { square: 1024x1024, landscape: 1536x1024, portrait: 1024x1536, auto: auto }
|
|
19
22
|
qualitySupported: true
|
|
@@ -24,6 +27,7 @@
|
|
|
24
27
|
baseUrl: https://open.bigmodel.cn/api/paas/v4
|
|
25
28
|
model: cogview-3-flash
|
|
26
29
|
apiKeyRef: ZHIPU_API_KEY
|
|
30
|
+
provider: openai
|
|
27
31
|
enabled: true
|
|
28
32
|
sizeMap: { square: 1024x1024, landscape: 1344x768, portrait: 768x1344, auto: 1024x1024 }
|
|
29
33
|
qualitySupported: false
|
package/lib/client.js
CHANGED
|
@@ -54,9 +54,11 @@ window.__ModuleLoader__.load({
|
|
|
54
54
|
* Project the panel snapshot onto the settings row model.
|
|
55
55
|
*
|
|
56
56
|
* @param snapshot - the `draw/status` wire snapshot.
|
|
57
|
+
* @param now - clock override for the cooldown flag (default {@link Date.now});
|
|
58
|
+
* injected so the presenter stays a pure function of its inputs.
|
|
57
59
|
* @returns the presented panel model.
|
|
58
60
|
*/
|
|
59
|
-
function presentDrawPanel(snapshot) {
|
|
61
|
+
function presentDrawPanel(snapshot, now = Date.now) {
|
|
60
62
|
return {
|
|
61
63
|
pluginVersion: snapshot.pluginVersion,
|
|
62
64
|
engines: snapshot.engines.map((engine) => ({
|
|
@@ -70,7 +72,7 @@ window.__ModuleLoader__.load({
|
|
|
70
72
|
...engine.credential.source !== void 0 ? { credentialSource: engine.credential.source } : {},
|
|
71
73
|
credentialWritable: engine.credential.writable,
|
|
72
74
|
consecutiveFailures: engine.health.consecutiveFailures,
|
|
73
|
-
coolingDown: engine.health.cooldownUntil !== null && engine.health.cooldownUntil >
|
|
75
|
+
coolingDown: engine.health.cooldownUntil !== null && engine.health.cooldownUntil > now(),
|
|
74
76
|
lastError: engine.health.lastError
|
|
75
77
|
})),
|
|
76
78
|
quota: {
|