@dickpy/dsh-imagegen 1.5.7 → 1.5.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/lib/index.js CHANGED
@@ -41,7 +41,7 @@ function installSettingsSectionCompat(ctx, ns, schema, entry, hooks) {
41
41
  /** Settings namespace this plugin owns (host settings seam + bridge). */
42
42
  const IMAGEGEN_SETTINGS_NAMESPACE = "dsh-imagegen";
43
43
  /** Published package version shared by the host updater and the client UI. */
44
- const PLUGIN_VERSION = "1.5.7";
44
+ const PLUGIN_VERSION = "1.5.9";
45
45
  /** Same-origin route family (loopback-only, mirroring the dsh-ssh fence). */
46
46
  const SETTINGS_API = {
47
47
  describe: "/api/dsh-imagegen/settings/describe",
@@ -2030,7 +2030,7 @@ function defaultDocument(id, title) {
2030
2030
  y: 0,
2031
2031
  k: 1
2032
2032
  },
2033
- background: "dots",
2033
+ background: "liquid",
2034
2034
  nodes: [],
2035
2035
  connections: [],
2036
2036
  createdAt: now,
@@ -2060,7 +2060,7 @@ function isNode(value) {
2060
2060
  function isDocument(value) {
2061
2061
  if (value === null || typeof value !== "object") return false;
2062
2062
  const document = value;
2063
- return document.version === 2 && typeof document.id === "string" && typeof document.title === "string" && typeof document.revision === "number" && document.viewport !== null && typeof document.viewport === "object" && typeof document.viewport.x === "number" && typeof document.viewport.y === "number" && typeof document.viewport.k === "number" && (document.background === "dots" || document.background === "lines" || document.background === "diagonal" || document.background === "checker" || document.background === "blank" || document.background === "image") && (document.backgroundImage === void 0 || typeof document.backgroundImage === "string") && Array.isArray(document.nodes) && document.nodes.every(isNode) && Array.isArray(document.connections);
2063
+ return document.version === 2 && typeof document.id === "string" && typeof document.title === "string" && typeof document.revision === "number" && document.viewport !== null && typeof document.viewport === "object" && typeof document.viewport.x === "number" && typeof document.viewport.y === "number" && typeof document.viewport.k === "number" && (document.background === "dots" || document.background === "lines" || document.background === "blank" || document.background === "image" || document.background === "flow" || document.background === "liquid" || document.background === "floatingLines" || document.background === "galaxy" || document.background === "silk" || document.background === "waves" || document.background === "faultyTerminal" || document.background === "dotField" || document.background === "dotGrid" || document.background === "shapeGrid") && (document.backgroundImage === void 0 || typeof document.backgroundImage === "string") && Array.isArray(document.nodes) && document.nodes.every(isNode) && Array.isArray(document.connections);
2064
2064
  }
2065
2065
  /** Upgrade a v1 (image/text/annotation + edges) document to the v2 node-graph model.
2066
2066
  * Images and text notes keep their geometry; annotation prompt cards become plain
@@ -2162,6 +2162,13 @@ function migrateLegacyDocument(input) {
2162
2162
  updatedAt: typeof input.updatedAt === "number" ? input.updatedAt : now
2163
2163
  };
2164
2164
  }
2165
+ /** Background modes removed from the picker still show up in older saved
2166
+ * documents; map them to their nearest surviving replacement. */
2167
+ const REMOVED_BACKGROUND_FALLBACK = {
2168
+ diagonal: "lines",
2169
+ checker: "dots",
2170
+ aurora: "liquid"
2171
+ };
2165
2172
  /** Accept either the v2 document or a legacy v1 payload and return v2. */
2166
2173
  function coerceDocument(value) {
2167
2174
  if (value === null || typeof value !== "object") return void 0;
@@ -2170,6 +2177,14 @@ function coerceDocument(value) {
2170
2177
  const migrated = migrateLegacyDocument(document);
2171
2178
  return isDocument(migrated) ? migrated : void 0;
2172
2179
  }
2180
+ const fallback = REMOVED_BACKGROUND_FALLBACK[String(document.background)];
2181
+ if (fallback !== void 0) return isDocument({
2182
+ ...document,
2183
+ background: fallback
2184
+ }) ? {
2185
+ ...document,
2186
+ background: fallback
2187
+ } : void 0;
2173
2188
  return isDocument(value) ? value : void 0;
2174
2189
  }
2175
2190
  let mutation = Promise.resolve();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dickpy/dsh-imagegen",
3
3
  "description": "AI image generation plugin for the dsh web GUI: text-to-image and image-to-image through configurable provider channels (gpt-image-2 / grok-imagine-image / nanobanana series / seedream-5.0-pro / dall-e-3, with native xAI Grok Imagine, Google Nano Banana and ByteDance Seedream request shaping), with per-channel model catalogs and a New Session / Image Generation tab entry opening a three-column studio beside the native conversation.",
4
- "version": "1.5.7",
4
+ "version": "1.5.9",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -28,6 +28,7 @@
28
28
  }
29
29
  },
30
30
  "dependencies": {
31
+ "lucide-react": "^1.41.0",
31
32
  "schemastery": "^3.18.0"
32
33
  },
33
34
  "devDependencies": {
@@ -93,7 +93,7 @@ function defaultDocument(id: string, title: string): CanvasDocument {
93
93
  title,
94
94
  revision: 1,
95
95
  viewport: { x: 0, y: 0, k: 1 },
96
- background: 'dots',
96
+ background: 'liquid',
97
97
  nodes: [],
98
98
  connections: [],
99
99
  createdAt: now,
@@ -135,8 +135,12 @@ function isDocument(value: unknown): value is CanvasDocument {
135
135
  && typeof (document.viewport as { x?: unknown }).x === 'number'
136
136
  && typeof (document.viewport as { y?: unknown }).y === 'number'
137
137
  && typeof (document.viewport as { k?: unknown }).k === 'number'
138
- && (document.background === 'dots' || document.background === 'lines' || document.background === 'diagonal'
139
- || document.background === 'checker' || document.background === 'blank' || document.background === 'image')
138
+ && (document.background === 'dots' || document.background === 'lines' || document.background === 'blank'
139
+ || document.background === 'image' || document.background === 'flow' || document.background === 'liquid'
140
+ || document.background === 'floatingLines' || document.background === 'galaxy'
141
+ || document.background === 'silk' || document.background === 'waves'
142
+ || document.background === 'faultyTerminal' || document.background === 'dotField'
143
+ || document.background === 'dotGrid' || document.background === 'shapeGrid')
140
144
  && (document.backgroundImage === undefined || typeof document.backgroundImage === 'string')
141
145
  && Array.isArray(document.nodes) && document.nodes.every(isNode)
142
146
  && Array.isArray(document.connections)
@@ -225,6 +229,14 @@ function migrateLegacyDocument(input: Record<string, unknown>): CanvasDocument {
225
229
  }
226
230
  }
227
231
 
232
+ /** Background modes removed from the picker still show up in older saved
233
+ * documents; map them to their nearest surviving replacement. */
234
+ const REMOVED_BACKGROUND_FALLBACK: Record<string, CanvasDocument['background']> = {
235
+ diagonal: 'lines',
236
+ checker: 'dots',
237
+ aurora: 'liquid',
238
+ }
239
+
228
240
  /** Accept either the v2 document or a legacy v1 payload and return v2. */
229
241
  function coerceDocument(value: unknown): CanvasDocument | undefined {
230
242
  if (value === null || typeof value !== 'object') return undefined
@@ -233,6 +245,8 @@ function coerceDocument(value: unknown): CanvasDocument | undefined {
233
245
  const migrated = migrateLegacyDocument(document)
234
246
  return isDocument(migrated) ? migrated : undefined
235
247
  }
248
+ const fallback = REMOVED_BACKGROUND_FALLBACK[String(document.background)]
249
+ if (fallback !== undefined) return isDocument({ ...document, background: fallback }) ? { ...document, background: fallback } as CanvasDocument : undefined
236
250
  return isDocument(value) ? value : undefined
237
251
  }
238
252