diff --git a/package.json b/package.json index d85194a556c..f56abed406e 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "dependencies": { "@alloc/quick-lru": "catalog:", "@atlaskit/pragmatic-drag-and-drop": "^1.3.1", - "@comfyorg/comfy-multi-player": "0.3.3", + "@comfyorg/comfy-multi-player": "0.3.4", "@comfyorg/comfyui-desktop-bridge-types": "catalog:", "@comfyorg/comfyui-electron-types": "catalog:", "@comfyorg/design-system": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d51157d5409..a33a5ff40ee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -476,8 +476,8 @@ importers: specifier: ^1.3.1 version: 1.8.1 '@comfyorg/comfy-multi-player': - specifier: 0.3.3 - version: 0.3.3 + specifier: 0.3.4 + version: 0.3.4 '@comfyorg/comfyui-desktop-bridge-types': specifier: 'catalog:' version: 0.2.0 @@ -1605,8 +1605,8 @@ packages: resolution: {integrity: sha512-y7/yvZ2TPAnR9+jnc00klvNNLkJiXFFrQA/hlLCcxA9a2A4zQIOimyFQ9XfwYKiGD1fb5GY8vbKIIgO8d5Tb2A==} engines: {node: '>= 20.12.0'} - '@comfyorg/comfy-multi-player@0.3.3': - resolution: {integrity: sha512-Km9XY+D6SHO2+swsdzpUdiNayXTItXkeJxKtxvtrMVRpSlf/76PyIWumDLRhunuQNPvPLeqFTFBCtl3S55VF6w==} + '@comfyorg/comfy-multi-player@0.3.4': + resolution: {integrity: sha512-B4WQAvzHnlbVFk14jvuQTZ6bFu3E2BTNi/aj+dVKXAIvnwT/buZ9hlsV4CMW357eJNvIiYv4xYda3/1byk9wgQ==} '@comfyorg/comfyui-desktop-bridge-types@0.2.0': resolution: {integrity: sha512-V5Wj5KXDzTDm5GJAa0xBISjmndNIY5P79pRHQbLkkqJxgp/GPb/QGvcI+xG4ogol0ODJ4j/UBnUmkzpSafw8Aw==} @@ -10109,7 +10109,7 @@ snapshots: fast-wrap-ansi: 0.2.2 sisteransi: 1.0.5 - '@comfyorg/comfy-multi-player@0.3.3': + '@comfyorg/comfy-multi-player@0.3.4': dependencies: yjs: 13.6.31 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 23e4d4baa7f..938fa40614a 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -163,7 +163,6 @@ catalog: cleanupUnusedCatalogs: true allowBuilds: - '@comfyorg/comfy-multi-player@https://codeload.github.com/Comfy-Org/comfy-multi-player/tar.gz/58e2333ce3bb6375fd2efbc1e9d7df17327f37e0': true '@firebase/util': false '@sentry/cli': true '@tailwindcss/oxide': true @@ -199,4 +198,4 @@ overrides: # Transitional - drop once 0.2.0 is older than the release-age gate. minimumReleaseAgeExclude: - '@comfyorg/comfyui-desktop-bridge-types@0.2.0' - - '@comfyorg/comfy-multi-player@0.2.0 || 0.2.1 || 0.3.0 || 0.3.2 || 0.3.3' + - '@comfyorg/comfy-multi-player@0.2.0 || 0.2.1 || 0.3.0 || 0.3.2 || 0.3.3 || 0.3.4' diff --git a/src/workbench/extensions/agent/crdt/ecsFollowerAdapter.integration.test.ts b/src/workbench/extensions/agent/crdt/ecsFollowerAdapter.integration.test.ts index 422801caef9..c681f9e407e 100644 --- a/src/workbench/extensions/agent/crdt/ecsFollowerAdapter.integration.test.ts +++ b/src/workbench/extensions/agent/crdt/ecsFollowerAdapter.integration.test.ts @@ -1150,6 +1150,103 @@ describe('EcsFollowerAdapter integration', () => { followerB.destroy() }) + it('projects links inserted with a workflow batch', () => { + const host = mint({ nodes: [], links: [] }, catalog) + const follower = new FollowerDoc() + const adapter = new EcsFollowerAdapter( + createGraphMutations({ + placement: inertPlacementPort, + getScope: () => scope, + layout: { createNode: vi.fn(), deleteNodes: vi.fn() } + }) + ) + adapter.bind('wf', follower) + + try { + const insertWorkflow = op('insert-workflow', 1, { + op: 'insert_workflow', + workflow: { + nodes: [ + { + id: 101, + type: 'Source', + outputs: [{ name: 'image', type: 'IMAGE', links: [201] }] + }, + { + id: 102, + type: 'Source', + inputs: [{ name: 'image', type: 'IMAGE', link: 201 }], + outputs: [{ name: 'image', type: 'IMAGE', links: [202] }] + }, + { + id: 103, + type: 'Sink', + inputs: [{ name: 'image', type: 'IMAGE', link: 202 }] + } + ], + links: [ + [201, 101, 0, 102, 0, 'IMAGE'], + [202, 102, 0, 103, 0, 'IMAGE'] + ] + } + }) + const result = applyOps( + host, + [insertWorkflow] as Parameters[1], + catalog + ) + expect(result.outcomes).toEqual([ + { op_id: 'insert-workflow', outcome: 'applied' } + ]) + + const insertedLinks = [...linksMap(host).entries()].map( + ([key, value]) => { + const id = + value instanceof Y.Array + ? value.get(0) + : Array.isArray(value) + ? value[0] + : null + return [key, id] as const + } + ) + expect(insertedLinks).toHaveLength(2) + expect( + insertedLinks.every( + ([key, id]) => + typeof id === 'number' && + Number.isSafeInteger(id) && + id >= 0 && + String(id) === key + ) + ).toBe(true) + + const update = Y.encodeStateAsUpdate(host) + follower.applyRemoteUpdate(update) + expect( + adapter.applyFrame({ + workflowId: 'wf', + seq: 1, + update, + actor: 'agent:test', + opIds: [insertWorkflow.op_id] + }) + ).toBe(true) + + for (const [, id] of insertedLinks) { + expect(typeof id).toBe('number') + if (typeof id !== 'number') continue + expect( + useLinkStore().getTopology(scope.rootGraphId, toLinkId(id)) + ).toBeDefined() + } + } finally { + adapter.destroy() + follower.destroy() + host.destroy() + } + }) + it('populates node slot arrays identically whether add+connect ops arrive in one combined frame or separate singleton frames (R-96)', () => { const buildOps = (prefix: string) => [ op(`${prefix}-1`, 1, {