dsh-comfyui-canvas 0.1.6 → 0.1.7

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
@@ -3,7 +3,7 @@
3
3
  > [中文](README.zh.md) · English
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
- [![Version](https://img.shields.io/badge/version-0.1.6-brightgreen.svg)](https://github.com/wbin0001/dsh-comfyui-canvas/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.1.7-brightgreen.svg)](https://github.com/wbin0001/dsh-comfyui-canvas/releases)
7
7
  [![GitHub Stars](https://img.shields.io/github/stars/wbin0001/dsh-comfyui-canvas.svg?style=social)](https://github.com/wbin0001/dsh-comfyui-canvas)
8
8
  [![DSH](https://img.shields.io/badge/DSH-v0.1.x-blueviolet.svg)](https://github.com/DeepSeek-Harness/DSH)
9
9
  [![ComfyUI](https://img.shields.io/badge/ComfyUI-0.34+-orange.svg)](https://github.com/comfyanonymous/ComfyUI)
package/README.zh.md CHANGED
@@ -3,7 +3,7 @@
3
3
  > 中文 · [English](README.md)
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
- [![Version](https://img.shields.io/badge/version-0.1.6-brightgreen.svg)](https://github.com/wbin0001/dsh-comfyui-canvas/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.1.7-brightgreen.svg)](https://github.com/wbin0001/dsh-comfyui-canvas/releases)
7
7
  [![GitHub Stars](https://img.shields.io/github/stars/wbin0001/dsh-comfyui-canvas.svg?style=social)](https://github.com/wbin0001/dsh-comfyui-canvas)
8
8
  [![DSH](https://img.shields.io/badge/DSH-v0.1.x-blueviolet.svg)](https://github.com/DeepSeek-Harness/DSH)
9
9
  [![ComfyUI](https://img.shields.io/badge/ComfyUI-0.34+-orange.svg)](https://github.com/comfyanonymous/ComfyUI)
@@ -9,7 +9,7 @@
9
9
 
10
10
  # Bridge release version. The DSH plugin compares this against its embedded
11
11
  # copy (see version.json) to decide whether an update is needed.
12
- __version__ = "0.1.6"
12
+ __version__ = "0.1.7"
13
13
 
14
14
  import os
15
15
  import time
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "ComfyUI-DSH-Canvas",
3
- "version": "0.1.6"
3
+ "version": "0.1.7"
4
4
  }
package/lib/index.js CHANGED
@@ -303,6 +303,8 @@ export function apply(ctx) {
303
303
  // Function-level handle to the settings scope (used by comfyui_config's
304
304
  // activeView read); undefined when the settings service is unavailable.
305
305
  let settingsScope = undefined
306
+ // Assigned after a successful settings.register; no-op until then.
307
+ let safeUpdate = () => undefined
306
308
  // The background process handle of the ComfyUI launched by this plugin, so
307
309
  // the canvas header's stop/restart buttons can kill it directly.
308
310
  let comfyProc = null
@@ -344,6 +346,12 @@ export function apply(ctx) {
344
346
  try {
345
347
  const scope = settings.register(NAMESPACE, ConfigSchema, { applies: 'live' })
346
348
  settingsScope = scope
349
+ // Every queued settings write is a promise. try/catch CANNOT see its
350
+ // rejection, and an unhandled rejection is fatal to boot (installFailLoud
351
+ // reports it as "fatal load failure"). Funnel all writes through here.
352
+ safeUpdate = (patch) => {
353
+ try { void Promise.resolve(scope.update(patch)).catch(() => undefined) } catch { /* best effort */ }
354
+ }
347
355
  resolveBase = () => {
348
356
  const value = scope.get()
349
357
  const base = (value?.baseUrl || DEFAULT_BASE).replace(/\/+$/, '')
@@ -362,7 +370,7 @@ export function apply(ctx) {
362
370
  void (async () => {
363
371
  const fail = (message) => {
364
372
  console.error(`[dsh-comfyui-canvas] ${message}`)
365
- try { scope.update({ launchError: message }) } catch { /* best effort */ }
373
+ safeUpdate({ launchError: message })
366
374
  }
367
375
  try {
368
376
  const cmd = (value?.launchCommand || '').trim()
@@ -371,7 +379,7 @@ export function apply(ctx) {
371
379
  return
372
380
  }
373
381
  // Clear any stale error from a previous attempt before launching.
374
- try { scope.update({ launchError: '' }) } catch { /* best effort */ }
382
+ safeUpdate({ launchError: '' })
375
383
  const workdir = (value?.comfyuiDir || '').trim() || undefined
376
384
  const shell = ctx.get?.('shell')
377
385
  if (shell && typeof shell.start === 'function') {
@@ -405,7 +413,7 @@ export function apply(ctx) {
405
413
  }
406
414
  } finally {
407
415
  launching = false
408
- try { scope.update({ launchRequested: false }) } catch { /* best effort */ }
416
+ safeUpdate({ launchRequested: false })
409
417
  }
410
418
  })()
411
419
  })
@@ -426,7 +434,7 @@ export function apply(ctx) {
426
434
  const base = resolveBase()
427
435
  const result = await probeBridgeAuth(base, token)
428
436
  try {
429
- scope.update({ bridgeProbe: result, probeRequested: false })
437
+ safeUpdate({ bridgeProbe: result, probeRequested: false })
430
438
  } catch { /* best effort */ }
431
439
  } finally {
432
440
  probing = false
@@ -439,7 +447,7 @@ export function apply(ctx) {
439
447
  try {
440
448
  const pkgPath = fileURLToPath(new URL('../package.json', import.meta.url))
441
449
  const version = String(JSON.parse(readFileSync(pkgPath, 'utf8')).version || '')
442
- if (version) scope.update({ pluginVersion: version })
450
+ if (version) safeUpdate({ pluginVersion: version })
443
451
  } catch { /* best effort */ }
444
452
 
445
453
  // Plugin-update watcher: the settings page sets updateRequest with
@@ -455,7 +463,7 @@ export function apply(ctx) {
455
463
  updatingPlugin = true
456
464
  void (async () => {
457
465
  const setState = (patch) => {
458
- try { scope.update(patch) } catch { /* best effort */ }
466
+ safeUpdate(patch)
459
467
  }
460
468
  try {
461
469
  const action = req.action === 'update' ? 'update' : 'check'
@@ -545,7 +553,7 @@ export function apply(ctx) {
545
553
  controlling = true
546
554
  void (async () => {
547
555
  const setState = (patch) => {
548
- try { scope.update(patch) } catch { /* best effort */ }
556
+ safeUpdate(patch)
549
557
  }
550
558
  try {
551
559
  const action = ctrl.action === 'restart' ? 'restart' : 'stop'
@@ -810,6 +818,9 @@ export function apply(ctx) {
810
818
  },
811
819
  matrix: {
812
820
  type: 'object',
821
+ // Required by the tool-schema compiler: object params must declare
822
+ // additionalProperties explicitly (see packages/core/tools/src/schema.ts).
823
+ additionalProperties: true,
813
824
  description: 'Declarative parameter sweep: {fields: [{nodeId, key, values}], mode: "zip"|"product"}. Expanded into runs. Use this OR runs, not both.',
814
825
  },
815
826
  },