dsh-draw 0.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.
Files changed (104) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/LICENSE +201 -0
  3. package/README.es.md +194 -0
  4. package/README.hi.md +194 -0
  5. package/README.md +194 -0
  6. package/README.pt.md +194 -0
  7. package/README.zh.md +194 -0
  8. package/SECURITY.md +39 -0
  9. package/THIRD_PARTY_NOTICES.md +21 -0
  10. package/cordis.patch.yml +48 -0
  11. package/lib/client.js +4787 -0
  12. package/lib/client.js.map +1 -0
  13. package/lib/index.js +1429 -0
  14. package/lib/typert.host.js +26 -0
  15. package/lib/types/client/DrawResultCard.d.ts +58 -0
  16. package/lib/types/client/DrawResultCard.d.ts.map +1 -0
  17. package/lib/types/client/DrawResultCard.js +48 -0
  18. package/lib/types/client/DrawSettingsTab.d.ts +31 -0
  19. package/lib/types/client/DrawSettingsTab.d.ts.map +1 -0
  20. package/lib/types/client/DrawSettingsTab.js +129 -0
  21. package/lib/types/client/index.d.ts +35 -0
  22. package/lib/types/client/index.d.ts.map +1 -0
  23. package/lib/types/client/index.js +98 -0
  24. package/lib/types/client/locales.d.ts +14 -0
  25. package/lib/types/client/locales.d.ts.map +1 -0
  26. package/lib/types/client/locales.js +57 -0
  27. package/lib/types/client/present.d.ts +80 -0
  28. package/lib/types/client/present.d.ts.map +1 -0
  29. package/lib/types/client/present.js +86 -0
  30. package/lib/types/client/remote.d.ts +268 -0
  31. package/lib/types/client/remote.d.ts.map +1 -0
  32. package/lib/types/client/remote.js +15 -0
  33. package/lib/types/client/styles.d.ts +11 -0
  34. package/lib/types/client/styles.d.ts.map +1 -0
  35. package/lib/types/client/styles.js +43 -0
  36. package/lib/types/config.d.ts +160 -0
  37. package/lib/types/config.d.ts.map +1 -0
  38. package/lib/types/config.js +230 -0
  39. package/lib/types/drawer.d.ts +114 -0
  40. package/lib/types/drawer.d.ts.map +1 -0
  41. package/lib/types/drawer.js +138 -0
  42. package/lib/types/engine.d.ts +58 -0
  43. package/lib/types/engine.d.ts.map +1 -0
  44. package/lib/types/engine.js +135 -0
  45. package/lib/types/http.d.ts +89 -0
  46. package/lib/types/http.d.ts.map +1 -0
  47. package/lib/types/http.js +127 -0
  48. package/lib/types/index.d.ts +43 -0
  49. package/lib/types/index.d.ts.map +1 -0
  50. package/lib/types/index.js +78 -0
  51. package/lib/types/quota.d.ts +69 -0
  52. package/lib/types/quota.d.ts.map +1 -0
  53. package/lib/types/quota.js +56 -0
  54. package/lib/types/router.d.ts +141 -0
  55. package/lib/types/router.d.ts.map +1 -0
  56. package/lib/types/router.js +207 -0
  57. package/lib/types/sanitize.d.ts +40 -0
  58. package/lib/types/sanitize.d.ts.map +1 -0
  59. package/lib/types/sanitize.js +103 -0
  60. package/lib/types/service.d.ts +59 -0
  61. package/lib/types/service.d.ts.map +1 -0
  62. package/lib/types/service.js +131 -0
  63. package/lib/types/session-events.d.ts +66 -0
  64. package/lib/types/session-events.d.ts.map +1 -0
  65. package/lib/types/session-events.js +32 -0
  66. package/lib/types/tool.d.ts +30 -0
  67. package/lib/types/tool.d.ts.map +1 -0
  68. package/lib/types/tool.js +131 -0
  69. package/lib/types/translate.d.ts +64 -0
  70. package/lib/types/translate.d.ts.map +1 -0
  71. package/lib/types/translate.js +56 -0
  72. package/lib/types/typert.host.d.ts +250 -0
  73. package/lib/types/typert.host.d.ts.map +1 -0
  74. package/lib/types/typert.host.js +23 -0
  75. package/lib/types/version.d.ts +10 -0
  76. package/lib/types/version.d.ts.map +1 -0
  77. package/lib/types/version.js +9 -0
  78. package/lib/types/wire.d.ts +699 -0
  79. package/lib/types/wire.d.ts.map +1 -0
  80. package/lib/types/wire.js +273 -0
  81. package/lib/wire-Cc4JZ3jR.js +4370 -0
  82. package/package.json +179 -0
  83. package/src/client/DrawResultCard.tsx +100 -0
  84. package/src/client/DrawSettingsTab.tsx +159 -0
  85. package/src/client/index.ts +123 -0
  86. package/src/client/locales.ts +84 -0
  87. package/src/client/present.ts +137 -0
  88. package/src/client/remote.ts +44 -0
  89. package/src/client/styles.ts +44 -0
  90. package/src/config.ts +358 -0
  91. package/src/drawer.ts +234 -0
  92. package/src/engine.ts +182 -0
  93. package/src/http.ts +161 -0
  94. package/src/index.ts +93 -0
  95. package/src/quota.ts +98 -0
  96. package/src/router.ts +309 -0
  97. package/src/sanitize.ts +113 -0
  98. package/src/service.ts +169 -0
  99. package/src/session-events.ts +70 -0
  100. package/src/tool.ts +145 -0
  101. package/src/translate.ts +101 -0
  102. package/src/typert.host.ts +25 -0
  103. package/src/version.ts +10 -0
  104. package/src/wire.ts +417 -0
@@ -0,0 +1,21 @@
1
+ # Third-party notices
2
+
3
+ `dsh-draw` bundles no third-party source code; all TypeScript/JavaScript
4
+ sources in this repository are original works by the dsh-draw contributors,
5
+ licensed under Apache-2.0 (see `LICENSE`).
6
+
7
+ The package depends on the following software. The published tarball bundles
8
+ only `zod` (the wire codec library inlined into the host and client bundles);
9
+ everything else is install-time:
10
+
11
+ | Package | Version range | License | Purpose |
12
+ |---|---|---|---|
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
+ | [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
+ | [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.1` (peer) | See package | The plugin runtime |
17
+ | [@deepseek-ai/schemastery](https://www.npmjs.com/package/@deepseek-ai/schemastery) | `^3.18.0` (peer) | See package | Configuration schema |
18
+ | `@deepseek-ai/dsh-*` peers | `0.1.0-rc.6` (peer) | See packages | Official harness seams (`dsh-tools`, `dsh-session`, `dsh-attachment`, `dsh-credentials`, `dsh-llm`, `dsh-brand`, `dsh-typert-protocol`) |
19
+
20
+ At runtime the plugin only talks to the image-generation endpoints the user
21
+ configures and to the harness services listed as peerDependencies.
@@ -0,0 +1,48 @@
1
+ # dsh-draw bundle patch: mount the unified image-generation router.
2
+ #
3
+ # Every key below is a Config field (Schemastery schema); invalid values fail
4
+ # the profile load loudly. See README.md "Configuration" for the full table.
5
+ - insert:
6
+ - id: dsh-draw
7
+ name: dsh-draw
8
+ config:
9
+ # Ordered engine chain; the router walks it top-down and falls back on
10
+ # failure. apiKeyRef names an environment variable (credential
11
+ # reference) — never put a literal key here.
12
+ engines:
13
+ - id: openai
14
+ baseUrl: https://api.openai.com/v1
15
+ model: gpt-image-1
16
+ apiKeyRef: OPENAI_API_KEY
17
+ enabled: true
18
+ sizeMap: { square: 1024x1024, landscape: 1536x1024, portrait: 1024x1536, auto: auto }
19
+ qualitySupported: true
20
+ styleSupported: true
21
+ responseFormat: b64_json
22
+ imageMediaType: image/png
23
+ - id: cogview
24
+ baseUrl: https://open.bigmodel.cn/api/paas/v4
25
+ model: cogview-3-flash
26
+ apiKeyRef: ZHIPU_API_KEY
27
+ enabled: true
28
+ sizeMap: { square: 1024x1024, landscape: 1344x768, portrait: 768x1344, auto: 1024x1024 }
29
+ qualitySupported: false
30
+ styleSupported: false
31
+ responseFormat: url
32
+ imageMediaType: image/png
33
+ # Engine id the router prefers; must name a configured engine.
34
+ defaultEngine: openai
35
+ # Per-generation HTTP timeout in milliseconds (1000..600000).
36
+ requestTimeoutMs: 120000
37
+ # Cap on images one call may produce (1..10).
38
+ maxImagesPerCall: 4
39
+ # Prompt length cap in characters (1..32000).
40
+ maxPromptLength: 4000
41
+ # Per-session generation-call cap (1..100000).
42
+ maxGenerationsPerSession: 200
43
+ # Per-session generated-image byte cap (1048576..4294967296).
44
+ maxBytesPerSession: 209715200
45
+ # Consecutive failures before an engine enters cooldown (1..10).
46
+ failureThreshold: 2
47
+ # Engine cooldown in milliseconds after the threshold trips (1000..3600000).
48
+ cooldownMs: 60000