dsh-image-lite 0.2.0 → 0.2.2

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/README.md CHANGED
@@ -12,8 +12,8 @@ DSH 生图插件支持**双模式生图**:
12
12
  两种模式共用同一份模型库与快速配置(插件入口 `image-gen-lite`,volatile 热生效),
13
13
  自包含、无外部依赖,密钥经 DSH 核心凭据服务解析。
14
14
 
15
- > **环境要求**:DSH `>= 0.2.1-rc.2`,Node.js `^22.19.0 || >= 24.0.0`(随宿主)。
16
- > 低于该版本的 DSH 不保证可用:本插件依赖的 `configForms`、右栏标签注册等接口在 0.2.1 系列才稳定。
15
+ > **环境要求**:DSH `>= 0.2.2-rc.5`,Node.js `^22.19.0 || >= 24.0.0`(随宿主)。
16
+ > 低于该版本的 DSH 不保证可用:本插件依赖的 `configForms`、右栏标签注册等接口在 0.2.1 系列才稳定;当前已验证版本为 DSH `0.2.2-rc.5`(含 0.2.2-rc.3 → rc.5 的升级兼容性核对)。
17
17
 
18
18
  ## 两种生图模式
19
19
 
@@ -91,7 +91,7 @@ DSH 生图插件支持**双模式生图**:
91
91
 
92
92
  ## 安装
93
93
 
94
- 需要 DSH `>= 0.2.1-rc.2`(Node.js `^22.19.0 || >= 24.0.0`,随宿主提供)。
94
+ 需要 DSH `>= 0.2.2-rc.5`(Node.js `^22.19.0 || >= 24.0.0`,随宿主提供)。
95
95
 
96
96
  ### 方式一:从 npm 安装(推荐)
97
97
 
@@ -148,9 +148,10 @@ Both modes share one model library and one set of defaults (plugin entry
148
148
  `image-gen-lite`, volatile / hot-reloaded). The plugin is self-contained with no
149
149
  runtime dependencies, and API keys are resolved through DSH's credential service.
150
150
 
151
- > **Requirements**: DSH `>= 0.2.1-rc.2`, Node.js `^22.19.0 || >= 24.0.0` (provided by the host).
151
+ > **Requirements**: DSH `>= 0.2.2-rc.5`, Node.js `^22.19.0 || >= 24.0.0` (provided by the host).
152
152
  > Older DSH builds are not supported: the `configForms` and right-sidebar tab APIs this plugin
153
- > relies on only settled in the 0.2.1 series.
153
+ > relies on only settled in the 0.2.1 series; the verified version is DSH `0.2.2-rc.5`
154
+ > (including a compatibility check of the 0.2.2-rc.3 → rc.5 upgrade).
154
155
 
155
156
  ### The two modes
156
157
 
@@ -241,7 +242,7 @@ and talks only to the domain you configured.**
241
242
 
242
243
  ### Install
243
244
 
244
- Requires DSH `>= 0.2.1-rc.2` (Node.js `^22.19.0 || >= 24.0.0`, supplied by the host).
245
+ Requires DSH `>= 0.2.2-rc.5` (Node.js `^22.19.0 || >= 24.0.0`, supplied by the host).
245
246
 
246
247
  **Option 1 — from npm (recommended):**
247
248
 
@@ -0,0 +1,19 @@
1
+ <svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <!-- Subject: one framed picture with a landscape inside — the studio's own
3
+ output at its simplest. Drafted to references/artwork.md: 36x36 canvas,
4
+ no tile or background (Plugin Manager draws the tile), ink box 22x17
5
+ centred on (18,18), flat two-stop gradient borrowed from the installed
6
+ icons it sits beside (#69B9FF -> #324DE2), no text, no effects. -->
7
+ <rect x="7" y="9.5" width="22" height="17" rx="3.2" stroke="url(#igl-frame)" stroke-width="2.2"/>
8
+ <path d="M9.6 23.4l4.5-4.4a2.1 2.1 0 0 1 2.9 0l2.1 2.1" stroke="url(#igl-frame)" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/>
9
+ <circle cx="13.4" cy="15.3" r="1.85" fill="url(#igl-frame)"/>
10
+ <defs>
11
+ <linearGradient id="igl-frame" x1="18" y1="9.5" x2="18" y2="26.5" gradientUnits="userSpaceOnUse">
12
+ <stop stop-color="#69B9FF"/>
13
+ <stop offset="1" stop-color="#324DE2"/>
14
+ </linearGradient>
15
+ </defs>
16
+ </svg>
17
+
18
+
19
+
package/client.js CHANGED
@@ -28,14 +28,71 @@ window.__ModuleLoader__.load({
28
28
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' })
29
29
 
30
30
  const React = require('react')
31
- // Icons are a cosmetic concern: if this runtime's module registry does
32
- // not resolve the primitives package for third-party clients, the module
33
- // must still activate (every icon use site degrades to text labels).
34
- let primitives = {}
35
- try {
36
- primitives = require('@deepseek-ai/dsh-client-ui-primitives') ?? {}
37
- } catch {
38
- primitives = {}
31
+ // Glyphs are drawn here instead of imported. `@deepseek-ai/dsh-client-ui-primitives`
32
+ // exports no generic icon set (only its own `GuideArtwork*` illustrations), and a
33
+ // third-party client's module table need not resolve it at all — so every glyph
34
+ // used to fall through to a text label. Local SVGs render on any release, keep the
35
+ // product's stroke weight, and inherit `currentColor` from the button around them.
36
+ const glyph = (props, ...children) => React.createElement('svg', {
37
+ width: props.size ?? 16,
38
+ height: props.size ?? 16,
39
+ viewBox: '0 0 16 16',
40
+ fill: 'none',
41
+ stroke: 'currentColor',
42
+ strokeWidth: 1.4,
43
+ strokeLinecap: 'round',
44
+ strokeLinejoin: 'round',
45
+ className: props.className,
46
+ 'aria-hidden': 'true',
47
+ focusable: 'false',
48
+ }, ...children)
49
+ const glyphPath = (d, extra) => React.createElement('path', { d, ...extra })
50
+
51
+ function IconClose(props) {
52
+ return glyph(props, glyphPath('M4.6 4.6l6.8 6.8'), glyphPath('M11.4 4.6l-6.8 6.8'))
53
+ }
54
+
55
+ function IconTrash(props) {
56
+ return glyph(props,
57
+ glyphPath('M3 4.4h10'),
58
+ glyphPath('M6.4 4.4V3.1h3.2v1.3'),
59
+ glyphPath('M4.7 4.4l.6 8.1a.9.9 0 0 0 .9.8h3.6a.9.9 0 0 0 .9-.8l.6-8.1'),
60
+ glyphPath('M6.8 6.8v4.2'),
61
+ glyphPath('M9.2 6.8v4.2'))
62
+ }
63
+
64
+ function IconPlus(props) {
65
+ return glyph(props, glyphPath('M8 3.6v8.8'), glyphPath('M3.6 8h8.8'))
66
+ }
67
+
68
+ function IconSparkle(props) {
69
+ return glyph(props, glyphPath('M8 2.6c.55 2.5 1.9 3.85 4.4 4.4-2.5.55-3.85 1.9-4.4 4.4-.55-2.5-1.9-3.85-4.4-4.4 2.5-.55 3.85-1.9 4.4-4.4Z'))
70
+ }
71
+
72
+ // The 开始 guide capsule draws a fixed-palette 36px illustration (the same
73
+ // contract the shipped `GuideArtwork*` components follow): one framed
74
+ // picture, the studio's own output at its simplest, so the card stops
75
+ // showing the guide's cube placeholder. Flat #539CFA keeps it legible on the
76
+ // guide's dark card; the plugin row's icon in `assets/icon.svg` carries the
77
+ // same drawing as a gradient, where it sits beside other gradient icons.
78
+ function StudioArtwork({ size = 36, className } = {}) {
79
+ return React.createElement('svg', {
80
+ width: size,
81
+ height: size,
82
+ className,
83
+ viewBox: '0 0 36 36',
84
+ fill: 'none',
85
+ xmlns: 'http://www.w3.org/2000/svg',
86
+ 'aria-hidden': 'true',
87
+ focusable: 'false',
88
+ },
89
+ React.createElement('rect', { x: 7, y: 9.5, width: 22, height: 17, rx: 3.2, stroke: '#539CFA', strokeWidth: 2.2 }),
90
+ React.createElement('path', {
91
+ d: 'M9.6 23.4l4.5-4.4a2.1 2.1 0 0 1 2.9 0l2.1 2.1',
92
+ stroke: '#539CFA', strokeWidth: 2.2, strokeLinecap: 'round', strokeLinejoin: 'round',
93
+ }),
94
+ React.createElement('circle', { cx: 13.4, cy: 15.3, r: 1.85, fill: '#539CFA' }),
95
+ )
39
96
  }
40
97
  // A `position: fixed` overlay is still clipped when an ancestor creates a
41
98
  // containing block (`transform` / `filter` / `contain`) — the right sidebar
@@ -48,12 +105,6 @@ window.__ModuleLoader__.load({
48
105
  } catch {
49
106
  portalFactory = null
50
107
  }
51
- const pickIcon = (...names) => names.map((n) => primitives[n]).find((v) => typeof v === 'function')
52
- const IconClose = pickIcon('IconCloseOutline16', 'IconCloseOutlineRegular', 'IconCloseOutlineMedium')
53
- const IconTrash = pickIcon('IconTrashOutline16', 'IconTrashOutlineRegular', 'IconTrashOutlineMedium')
54
- const IconPlus = pickIcon('IconPlusOutline16', 'IconPlusOutlineRegular', 'IconPlusOutlineMedium')
55
- const IconSparkle = pickIcon('IconSparkle16', 'IconSparkleRegular', 'IconSparkleMedium')
56
-
57
108
  const ENTRY_NS = 'image-gen-lite'
58
109
  const LOCALE_NS = 'image-gen-lite'
59
110
  const RPC_CHANNEL = '/image-gen-lite'
@@ -722,7 +773,7 @@ window.__ModuleLoader__.load({
722
773
  display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
723
774
  },
724
775
  onClick: onClose,
725
- }, IconClose ? React.createElement(IconClose, { size: 16 }) : t('tvClose')),
776
+ }, React.createElement(IconClose, { size: 16 })),
726
777
  )
727
778
 
728
779
  // No portal runtime (older bundle): still better than a clipped overlay.
@@ -786,7 +837,7 @@ window.__ModuleLoader__.load({
786
837
  const text = textParts.join('\n')
787
838
  return React.createElement('div', { style: { display: 'flex', flexDirection: 'column', gap: 6, padding: '4px 0' } },
788
839
  React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 6 } },
789
- IconSparkle ? React.createElement(IconSparkle, { size: 14 }) : null,
840
+ React.createElement(IconSparkle, { size: 14 }),
790
841
  React.createElement('span', {
791
842
  style: { fontSize: 13, lineHeight: '20px', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' },
792
843
  }, `${TOOL_NAME}: ${derivePrompt(argsRaw)}`)),
@@ -976,7 +1027,7 @@ window.__ModuleLoader__.load({
976
1027
  ? React.createElement('button', {
977
1028
  type: 'button', className: 'dsh-igl-btn',
978
1029
  onClick: () => setEditing(draftFromProvider(null, providers)),
979
- }, IconPlus ? React.createElement(IconPlus, { size: 12 }) : '+', t('addProvider'))
1030
+ }, React.createElement(IconPlus, { size: 12 }), t('addProvider'))
980
1031
  : null,
981
1032
  ),
982
1033
  editing !== null
@@ -1284,7 +1335,7 @@ window.__ModuleLoader__.load({
1284
1335
  React.createElement('div', { style: { display: 'flex', gap: 6, flex: 'none' } },
1285
1336
  React.createElement('button', { type: 'button', className: 'dsh-igl-btn', onClick: onEdit }, t('editProvider')),
1286
1337
  React.createElement('button', { type: 'button', className: 'dsh-igl-btn', onClick: onDelete, 'aria-label': t('deleteProvider') },
1287
- IconTrash ? React.createElement(IconTrash, { size: 12 }) : t('deleteProvider')),
1338
+ React.createElement(IconTrash, { size: 12 })),
1288
1339
  ),
1289
1340
  )
1290
1341
  }
@@ -1653,7 +1704,7 @@ window.__ModuleLoader__.load({
1653
1704
  },
1654
1705
  'aria-label': t('removeRef'),
1655
1706
  onClick: () => removeRef(ref),
1656
- }, IconTrash ? React.createElement(IconTrash, { size: 12 }) : '×'),
1707
+ }, React.createElement(IconTrash, { size: 12 })),
1657
1708
  ))),
1658
1709
  ),
1659
1710
  React.createElement('div', { style: css.row },
@@ -1713,7 +1764,7 @@ window.__ModuleLoader__.load({
1713
1764
  function StudioTitle(props) {
1714
1765
  const t = props.t ?? translateFactory(en)
1715
1766
  return React.createElement(React.Fragment, null,
1716
- IconSparkle ? React.createElement(IconSparkle, { size: 16 }) : null,
1767
+ React.createElement(IconSparkle, { size: 16 }),
1717
1768
  React.createElement('span', { style: { fontSize: 13, lineHeight: '20px' } }, t('title')),
1718
1769
  )
1719
1770
  }
@@ -1726,7 +1777,7 @@ window.__ModuleLoader__.load({
1726
1777
  title: t('cornerTooltip'),
1727
1778
  'aria-label': t('cornerTooltip'),
1728
1779
  onClick: props.openStudio,
1729
- }, IconSparkle ? React.createElement(IconSparkle, { size: 16 }) : t('title'))
1780
+ }, React.createElement(IconSparkle, { size: 16 }))
1730
1781
  }
1731
1782
 
1732
1783
  // ---------------------------------------------------------------- configForms
@@ -1815,6 +1866,7 @@ window.__ModuleLoader__.load({
1815
1866
  order: 30,
1816
1867
  title: () => t('guideTitle'),
1817
1868
  description: () => t('guideDescription'),
1869
+ icon: StudioArtwork,
1818
1870
  }],
1819
1871
  keepMounted: true,
1820
1872
  }))
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Image studio lite",
4
+ "description": "Generate images from the conversation with the image_generate_lite tool, or work in the 生图工作台 sidebar tab. The model library, default model and default image spec live in this plugin's own settings card."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "生图工作台 lite",
4
+ "description": "直接在对话里用 image_generate_lite 工具生图,或在侧边栏「生图工作台」处理生图任务。模型库、默认模型与默认出图规格都存于本插件自己的设置卡。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-image-lite",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "DSH 生图插件支持双模式生图:直接对话大模型,通过 image_generate_lite 工具生图;或在侧边栏「生图工作台」处理生图任务。",
5
5
  "keywords": [
6
6
  "deepseek",
@@ -13,6 +13,7 @@
13
13
  ],
14
14
  "type": "module",
15
15
  "main": "index.js",
16
+ "icon": "./assets/icon.svg",
16
17
  "scripts": {
17
18
  "test": "node --test test/*.test.js"
18
19
  },
@@ -20,6 +21,8 @@
20
21
  ".": "./index.js",
21
22
  "./client": "./client.js",
22
23
  "./wire": "./wire.js",
24
+ "./icon": "./assets/icon.svg",
25
+ "./locale/*.json": "./locale/*.json",
23
26
  "./package.json": "./package.json"
24
27
  },
25
28
  "files": [
@@ -30,6 +33,8 @@
30
33
  "README.md",
31
34
  "docs/how-it-works.svg",
32
35
  "docs/how-it-works.en.svg",
36
+ "assets/icon.svg",
37
+ "locale/*.json",
33
38
  "LICENSE"
34
39
  ],
35
40
  "repository": {
@@ -53,14 +58,13 @@
53
58
  "platform": "web",
54
59
  "inject": [
55
60
  "@deepseek-ai/dsh-client-ui-renderer",
56
- "@deepseek-ai/dsh-client-ui-primitives",
57
61
  "@deepseek-ai/dsh-client-locale"
58
62
  ]
59
63
  }
60
64
  },
61
65
  "engines": {
62
66
  "node": "^22.19.0 || >=24.0.0",
63
- "dsh": ">=0.2.1-rc.2"
67
+ "dsh": ">=0.2.2-rc.5"
64
68
  },
65
69
  "license": "MIT",
66
70
  "peerDependencies": {