From 00472aa35ef4210da4ce14e55e8af359a76568de Mon Sep 17 00:00:00 2001 From: bymyself Date: Fri, 28 Aug 2026 12:46:09 +0000 Subject: [PATCH 01/16] test: add deterministic agent fixture harness --- .../agent/crdt/__fixtures__/add-node.json | 37 ++++++++++++ .../agent/crdt/agentFixtureHarness.test.ts | 56 ++++++++++++++++++ .../agent/crdt/agentFixtureHarness.ts | 57 +++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 src/workbench/extensions/agent/crdt/__fixtures__/add-node.json create mode 100644 src/workbench/extensions/agent/crdt/agentFixtureHarness.test.ts create mode 100644 src/workbench/extensions/agent/crdt/agentFixtureHarness.ts diff --git a/src/workbench/extensions/agent/crdt/__fixtures__/add-node.json b/src/workbench/extensions/agent/crdt/__fixtures__/add-node.json new file mode 100644 index 00000000000..a646838b1d7 --- /dev/null +++ b/src/workbench/extensions/agent/crdt/__fixtures__/add-node.json @@ -0,0 +1,37 @@ +{ + "scenario": "add-node", + "frames": [ + { + "type": "draft_patch", + "data": { + "base_version": 10, + "version": 11, + "workflow_id": "fixture-workflow-native-folders", + "message_id": "fixture-message-add-node", + "thread_id": "fixture-thread", + "content": { + "last_node_id": 1, + "links": [], + "nodes": [ + { + "id": 1, + "type": "LoadImage", + "pos": [100, 100], + "size": [315, 314], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [ + { "name": "IMAGE", "type": "IMAGE", "links": [] }, + { "name": "MASK", "type": "MASK", "links": [] } + ], + "properties": {}, + "widgets_values": ["reference.png", "image"] + } + ] + } + } + } + ] +} diff --git a/src/workbench/extensions/agent/crdt/agentFixtureHarness.test.ts b/src/workbench/extensions/agent/crdt/agentFixtureHarness.test.ts new file mode 100644 index 00000000000..893a5fce5aa --- /dev/null +++ b/src/workbench/extensions/agent/crdt/agentFixtureHarness.test.ts @@ -0,0 +1,56 @@ +import { describe, expect, it, vi } from 'vitest' + +import addNodeFixture from './__fixtures__/add-node.json' +import type { + AgentFixtureAdapter, + AgentResponseFixture, + FixtureNode, + RemoteMutationContext +} from './agentFixtureHarness' +import { replayAgentFixture } from './agentFixtureHarness' + +class TestGraphAdapter implements AgentFixtureAdapter { + readonly nodes = new Map() + readonly emitLocalOp = vi.fn() + private activeContext: RemoteMutationContext | undefined + + readonly graphMutations = { + batch: (context: RemoteMutationContext, apply: () => void): void => { + this.activeContext = context + try { + apply() + } finally { + this.activeContext = undefined + } + } + } + + applyDraftPatch( + workflow: { readonly nodes: readonly FixtureNode[] }, + context: RemoteMutationContext + ): void { + expect(context).toBe(this.activeContext) + for (const node of workflow.nodes) { + this.nodes.set(node.id, node) + if (context.source !== 'agent-remote') this.emitLocalOp(node) + } + } +} + +describe('replayAgentFixture', () => { + it('applies an add-node response with call-carried echo suppression', () => { + const adapter = new TestGraphAdapter() + + replayAgentFixture( + addNodeFixture as AgentResponseFixture, + adapter, + 'fixture-actor' + ) + + expect(adapter.nodes.get(1)).toMatchObject({ + type: 'LoadImage', + widgets_values: ['reference.png', 'image'] + }) + expect(adapter.emitLocalOp).not.toHaveBeenCalled() + }) +}) diff --git a/src/workbench/extensions/agent/crdt/agentFixtureHarness.ts b/src/workbench/extensions/agent/crdt/agentFixtureHarness.ts new file mode 100644 index 00000000000..acc7c129acb --- /dev/null +++ b/src/workbench/extensions/agent/crdt/agentFixtureHarness.ts @@ -0,0 +1,57 @@ +export interface FixtureNode { + readonly id: number | string + readonly type: string + readonly widgets_values: readonly unknown[] +} + +interface FixtureWorkflow { + readonly nodes: readonly FixtureNode[] +} + +interface DraftPatchFrame { + readonly type: 'draft_patch' + readonly data: { + readonly message_id: string + readonly thread_id: string + readonly content: FixtureWorkflow + } +} + +export interface AgentResponseFixture { + readonly scenario: string + readonly frames: readonly DraftPatchFrame[] +} + +export interface RemoteMutationContext { + readonly source: 'agent-remote' + readonly actor: string + readonly op_id: string +} + +export interface AgentFixtureAdapter { + readonly graphMutations: { + batch(context: RemoteMutationContext, apply: () => void): void + } + applyDraftPatch( + workflow: FixtureWorkflow, + context: RemoteMutationContext + ): void +} + +export function replayAgentFixture( + fixture: AgentResponseFixture, + adapter: AgentFixtureAdapter, + actor = 'fixture-agent' +): void { + for (const frame of fixture.frames) { + const context: RemoteMutationContext = { + source: 'agent-remote', + actor, + op_id: frame.data.message_id + } + + adapter.graphMutations.batch(context, () => { + adapter.applyDraftPatch(frame.data.content, context) + }) + } +} From d5ecf9d611eff341d577baa7429fa4e67223a9d6 Mon Sep 17 00:00:00 2001 From: bymyself Date: Fri, 28 Aug 2026 14:40:06 +0000 Subject: [PATCH 02/16] feat: generate docframe protocol types --- package.json | 2 + pnpm-lock.yaml | 177 +++++-- pnpm-workspace.yaml | 1 + scripts/check-docframe-typegen.sh | 8 + src/schemas/docframe/generated/docframe.d.ts | 300 ++++++++++++ src/schemas/docframe/openapi.yaml | 469 +++++++++++++++++++ 6 files changed, 930 insertions(+), 27 deletions(-) create mode 100755 scripts/check-docframe-typegen.sh create mode 100644 src/schemas/docframe/generated/docframe.d.ts create mode 100644 src/schemas/docframe/openapi.yaml diff --git a/package.json b/package.json index a3889b05654..b5f2157aac4 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "format:check": "oxfmt --check", "format": "oxfmt --write", "json-schema": "tsx scripts/generate-json-schema.ts", + "typegen:docframe": "openapi-typescript src/schemas/docframe/openapi.yaml --output src/schemas/docframe/generated/docframe.d.ts", "knip:no-cache": "knip", "knip": "knip --cache", "lint:fix:no-cache": "pnpm oxlint:main --fix && pnpm oxlint:audit && eslint src --fix", @@ -205,6 +206,7 @@ "mixpanel-browser": "catalog:", "monocart-coverage-reports": "catalog:", "openai": "catalog:", + "openapi-typescript": "catalog:", "oxfmt": "catalog:", "oxlint": "catalog:", "oxlint-tsgolint": "catalog:", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5a4aeab56f0..9da73860ec9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -306,6 +306,9 @@ catalogs: openai: specifier: ^7.4.0 version: 7.4.0 + openapi-typescript: + specifier: ^7.13.0 + version: 7.13.0 oxfmt: specifier: ^0.59.0 version: 0.59.0 @@ -570,7 +573,7 @@ importers: version: 14.4.0(vue@3.5.41(typescript@6.0.3)) '@vueuse/integrations': specifier: 'catalog:' - version: 14.4.0(axios@1.18.1(debug@4.4.3))(fuse.js@7.0.0)(vue@3.5.41(typescript@6.0.3)) + version: 14.4.0(axios@1.18.1(debug@4.4.3))(change-case@5.4.4)(fuse.js@7.0.0)(vue@3.5.41(typescript@6.0.3)) '@vueuse/router': specifier: ^14.4.0 version: 14.4.0(vue-router@5.2.0(@vue/compiler-sfc@3.5.41)(esbuild@0.28.1)(pinia@4.0.2(@vue/devtools-api@8.1.5)(typescript@6.0.3)(vue@3.5.41(typescript@6.0.3)))(rolldown@1.2.3)(vite@8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0))(vue@3.5.41(typescript@6.0.3)))(vue@3.5.41(typescript@6.0.3)) @@ -842,6 +845,9 @@ importers: openai: specifier: 'catalog:' version: 7.4.0(ws@8.21.1)(zod@3.25.76) + openapi-typescript: + specifier: 'catalog:' + version: 7.13.0(typescript@6.0.3) oxfmt: specifier: 'catalog:' version: 0.59.0 @@ -3483,6 +3489,16 @@ packages: '@protobufjs/utf8@1.1.2': resolution: {integrity: sha512-b1UQwcEZ4yCnMCD8DAL1VlbvBJE9/IX4FTIp7BG1xYpf29SLazLSrqUkj4w7Y5y7cCVP6E5tcqqcI0xemPkHug==} + '@redocly/ajv@8.11.2': + resolution: {integrity: sha512-io1JpnwtIcvojV7QKDUSIuMN/ikdOUd1ReEnUnMKGfDVridQZ31J0MmIuqwuRjWDZfmvr+Q0MqCcfHM2gTivOg==} + + '@redocly/config@0.22.0': + resolution: {integrity: sha512-gAy93Ddo01Z3bHuVdPWfCwzgfaYgMdaZPcfL7JZ7hWJoK9V0lXDbigTWkhiPFAaLWzbOJ+kbUQG1+XwIm0KRGQ==} + + '@redocly/openapi-core@1.34.19': + resolution: {integrity: sha512-o/0VgsBXgwcY1lyeqcVtSGdTQAPnVggo0fbFVPlxl5XVDKUcVH0OLRqt3CbkwByT5FU305E0iE0O7MzThjDblw==} + engines: {node: '>=18.17.0', npm: '>=9.5.0'} + '@remirror/core-constants@3.0.0': resolution: {integrity: sha512-42aWfPrimMfDKDi4YegyS7x+/0tlzaqwPQCULLanv3DMIlu96KTJR0fM5isWX2UViOqlGnX6YFgqWepcX+XMNg==} @@ -4915,6 +4931,10 @@ packages: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} + agent-base@7.1.4: + resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} + engines: {node: '>= 14'} + ajv-draft-04@1.0.0: resolution: {integrity: sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==} peerDependencies: @@ -5209,6 +5229,9 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + change-case@5.4.4: + resolution: {integrity: sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==} + character-entities-html4@2.1.0: resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} @@ -5296,6 +5319,9 @@ packages: colord@2.9.3: resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} + colorette@1.4.0: + resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==} + colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} @@ -6321,6 +6347,10 @@ packages: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} engines: {node: '>= 6'} + https-proxy-agent@7.0.6: + resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} + engines: {node: '>= 14'} + human-signals@2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} @@ -6367,6 +6397,10 @@ packages: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} + index-to-position@1.2.0: + resolution: {integrity: sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw==} + engines: {node: '>=18'} + inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -6600,6 +6634,10 @@ packages: js-cookie@3.0.8: resolution: {integrity: sha512-yeJd4aNAdYZQjaon2bpD/Gb0B/omw7HQOsynXXcOiWVCacbBcPlgn8S/d1X6blFSaHao7ozqtW7NZW19xpCtIw==} + js-levenshtein@1.1.6: + resolution: {integrity: sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==} + engines: {node: '>=0.10.0'} + js-stringify@1.0.2: resolution: {integrity: sha512-rtS5ATOo2Q5k1G+DADISilDA6lv79zIiwFd6CcjuIxGKLFm5C+RLImRscVap9k55i+MOZwgliw+NejvkLuGD5g==} @@ -7429,6 +7467,12 @@ packages: zod: optional: true + openapi-typescript@7.13.0: + resolution: {integrity: sha512-EFP392gcqXS7ntPvbhBzbF8TyBA+baIYEm791Hy5YkjDYKTnk/Tn5OQeKm5BIZvJihpp8Zzr4hzx0Irde1LNGQ==} + hasBin: true + peerDependencies: + typescript: ^5.x + optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -7526,6 +7570,10 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} + parse-json@8.3.0: + resolution: {integrity: sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==} + engines: {node: '>=18'} + parse-latin@7.0.0: resolution: {integrity: sha512-mhHgobPPua5kZ98EF4HWiH167JWBfl4pvAIXXdbaVohtK7a6YBOy56kvhCqduqyo/f3yrHFWmqmiMg/BkBkYYQ==} @@ -7619,6 +7667,10 @@ packages: engines: {node: '>=18'} hasBin: true + pluralize@8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + possible-typed-array-names@1.1.0: resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} @@ -8807,6 +8859,9 @@ packages: peerDependencies: browserslist: '>= 4.21.0' + uri-js-replace@1.0.1: + resolution: {integrity: sha512-W+C9NWNLFOoBI2QWDp4UT9pv65r2w5Cx+3sTYFvtMdDBxkKt1syCqsUdSFAChbEe1uK5TfS04wt/nGwmaeIQ0g==} + uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} @@ -9372,6 +9427,9 @@ packages: yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + yaml-ast-parser@0.0.43: + resolution: {integrity: sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==} + yaml-eslint-parser@2.1.0: resolution: {integrity: sha512-1zo9KRfp6vIAXBEhWAz09ex3hUwh3T+/6dGbGteHvNseA0Uk4FgQnPES55klZ6cDzSy9FpgKS0D/CoLUvCCj4w==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} @@ -9779,7 +9837,7 @@ snapshots: '@babel/types': 7.29.8 '@jridgewell/remapping': 2.3.5 convert-source-map: 2.0.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -9961,7 +10019,7 @@ snapshots: '@babel/parser': 7.29.8 '@babel/template': 7.29.7 '@babel/types': 7.29.8 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -10311,7 +10369,7 @@ snapshots: '@eslint/config-array@0.23.5': dependencies: '@eslint/object-schema': 3.0.5 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) minimatch: 10.2.5 transitivePeerDependencies: - supports-color @@ -10332,7 +10390,7 @@ snapshots: '@eslint/eslintrc@3.3.6': dependencies: ajv: 6.15.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) espree: 10.4.0 globals: 14.0.0 ignore: 5.3.2 @@ -10979,7 +11037,7 @@ snapshots: '@eslint/eslintrc': 3.3.6 '@intlify/core-base': 11.4.8 '@intlify/message-compiler': 11.4.8 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) eslint: 10.8.1(jiti@2.7.0) eslint-compat-utils: 0.6.5(eslint@10.8.1(jiti@2.7.0)) glob: 10.5.0 @@ -11695,6 +11753,29 @@ snapshots: '@protobufjs/utf8@1.1.2': {} + '@redocly/ajv@8.11.2': + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js-replace: 1.0.1 + + '@redocly/config@0.22.0': {} + + '@redocly/openapi-core@1.34.19(supports-color@10.2.2)': + dependencies: + '@redocly/ajv': 8.11.2 + '@redocly/config': 0.22.0 + colorette: 1.4.0 + https-proxy-agent: 7.0.6(supports-color@10.2.2) + js-levenshtein: 1.1.6 + js-yaml: 4.3.1 + minimatch: 5.1.9 + pluralize: 8.0.0 + yaml-ast-parser: 0.0.43 + transitivePeerDependencies: + - supports-color + '@remirror/core-constants@3.0.0': {} '@rolldown/binding-android-arm64@1.2.3': @@ -12536,7 +12617,7 @@ snapshots: '@typescript-eslint/types': 8.67.0 '@typescript-eslint/typescript-estree': 8.67.0(typescript@6.0.3) '@typescript-eslint/visitor-keys': 8.67.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) eslint: 10.8.1(jiti@2.7.0) typescript: 6.0.3 transitivePeerDependencies: @@ -12546,7 +12627,7 @@ snapshots: dependencies: '@typescript-eslint/tsconfig-utils': 8.66.0(typescript@6.0.3) '@typescript-eslint/types': 8.66.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) typescript: 6.0.3 transitivePeerDependencies: - supports-color @@ -12555,7 +12636,7 @@ snapshots: dependencies: '@typescript-eslint/tsconfig-utils': 8.66.0(typescript@6.0.3) '@typescript-eslint/types': 8.66.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) typescript: 6.0.3 transitivePeerDependencies: - supports-color @@ -12564,7 +12645,7 @@ snapshots: dependencies: '@typescript-eslint/tsconfig-utils': 8.67.0(typescript@6.0.3) '@typescript-eslint/types': 8.67.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) typescript: 6.0.3 transitivePeerDependencies: - supports-color @@ -12601,7 +12682,7 @@ snapshots: '@typescript-eslint/types': 8.67.0 '@typescript-eslint/typescript-estree': 8.67.0(typescript@6.0.3) '@typescript-eslint/utils': 8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3) - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) eslint: 10.8.1(jiti@2.7.0) ts-api-utils: 2.5.0(typescript@6.0.3) typescript: 6.0.3 @@ -12620,7 +12701,7 @@ snapshots: '@typescript-eslint/tsconfig-utils': 8.64.0(typescript@6.0.3) '@typescript-eslint/types': 8.64.0 '@typescript-eslint/visitor-keys': 8.64.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) minimatch: 10.2.5 semver: 7.8.5 tinyglobby: 0.2.17 @@ -12635,7 +12716,7 @@ snapshots: '@typescript-eslint/tsconfig-utils': 8.66.0(typescript@6.0.3) '@typescript-eslint/types': 8.66.0 '@typescript-eslint/visitor-keys': 8.66.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) minimatch: 10.2.5 semver: 7.8.5 tinyglobby: 0.2.17 @@ -12650,7 +12731,7 @@ snapshots: '@typescript-eslint/tsconfig-utils': 8.67.0(typescript@6.0.3) '@typescript-eslint/types': 8.67.0 '@typescript-eslint/visitor-keys': 8.67.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) minimatch: 10.2.5 semver: 7.8.5 tinyglobby: 0.2.17 @@ -13163,13 +13244,14 @@ snapshots: '@vueuse/shared': 14.4.0(vue@3.5.41(typescript@6.0.3)) vue: 3.5.41(typescript@6.0.3) - '@vueuse/integrations@14.4.0(axios@1.18.1(debug@4.4.3))(fuse.js@7.0.0)(vue@3.5.41(typescript@6.0.3))': + '@vueuse/integrations@14.4.0(axios@1.18.1(debug@4.4.3))(change-case@5.4.4)(fuse.js@7.0.0)(vue@3.5.41(typescript@6.0.3))': dependencies: '@vueuse/core': 14.4.0(vue@3.5.41(typescript@6.0.3)) '@vueuse/shared': 14.4.0(vue@3.5.41(typescript@6.0.3)) vue: 3.5.41(typescript@6.0.3) optionalDependencies: axios: 1.18.1(debug@4.4.3) + change-case: 5.4.4 fuse.js: 7.0.0 '@vueuse/metadata@12.8.2': {} @@ -13229,10 +13311,12 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color + agent-base@7.1.4: {} + ajv-draft-04@1.0.0(ajv@8.20.0): optionalDependencies: ajv: 8.20.0 @@ -13626,6 +13710,8 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 + change-case@5.4.4: {} + character-entities-html4@2.1.0: {} character-entities-legacy@3.0.0: {} @@ -13711,6 +13797,8 @@ snapshots: colord@2.9.3: {} + colorette@1.4.0: {} + colorette@2.0.20: {} combined-stream@1.0.8: @@ -13858,9 +13946,11 @@ snapshots: transitivePeerDependencies: - '@noble/hashes' - debug@4.4.3: + debug@4.4.3(supports-color@10.2.2): dependencies: ms: 2.1.3 + optionalDependencies: + supports-color: 10.2.2 decimal.js@10.6.0: {} @@ -14153,7 +14243,7 @@ snapshots: eslint-import-resolver-typescript@4.4.5(eslint-plugin-import-x@4.17.1(@typescript-eslint/utils@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)))(eslint@10.8.1(jiti@2.7.0)): dependencies: - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) eslint: 10.8.1(jiti@2.7.0) eslint-import-context: 0.1.9(unrs-resolver@1.12.2) get-tsconfig: 4.14.0 @@ -14188,7 +14278,7 @@ snapshots: dependencies: '@typescript-eslint/types': 8.64.0 comment-parser: 1.4.7 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) eslint: 10.8.1(jiti@2.7.0) eslint-import-context: 0.1.9(unrs-resolver@1.12.2) is-glob: 4.0.3 @@ -14276,7 +14366,7 @@ snapshots: '@types/estree': 1.0.9 ajv: 6.15.0 cross-spawn: 7.0.6 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) escape-string-regexp: 4.0.0 eslint-scope: 9.1.2 eslint-visitor-keys: 5.0.1 @@ -14555,7 +14645,7 @@ snapshots: follow-redirects@1.16.0(debug@4.4.3): optionalDependencies: - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) fontace@0.4.1: dependencies: @@ -14944,7 +15034,14 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) + transitivePeerDependencies: + - supports-color + + https-proxy-agent@7.0.6(supports-color@10.2.2): + dependencies: + agent-base: 7.1.4 + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -14976,6 +15073,8 @@ snapshots: indent-string@4.0.0: {} + index-to-position@1.2.0: {} + inherits@2.0.4: {} ini@1.3.8: {} @@ -15193,6 +15292,8 @@ snapshots: js-cookie@3.0.8: {} + js-levenshtein@1.1.6: {} + js-stringify@1.0.2: {} js-tokens@10.0.0: {} @@ -16009,7 +16110,7 @@ snapshots: micromark@4.0.2: dependencies: '@types/debug': 4.1.13 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) decode-named-character-reference: 1.3.0 devlop: 1.1.0 micromark-core-commonmark: 2.0.3 @@ -16241,6 +16342,16 @@ snapshots: ws: 8.21.1 zod: 3.25.76 + openapi-typescript@7.13.0(typescript@6.0.3): + dependencies: + '@redocly/openapi-core': 1.34.19(supports-color@10.2.2) + ansi-colors: 4.1.3 + change-case: 5.4.4 + parse-json: 8.3.0 + supports-color: 10.2.2 + typescript: 6.0.3 + yargs-parser: 21.1.1 + optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -16455,6 +16566,12 @@ snapshots: json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 + parse-json@8.3.0: + dependencies: + '@babel/code-frame': 7.29.7 + index-to-position: 1.2.0 + type-fest: 4.41.0 + parse-latin@7.0.0: dependencies: '@types/nlcst': 2.0.3 @@ -16543,6 +16660,8 @@ snapshots: optionalDependencies: fsevents: 2.3.2 + pluralize@8.0.0: {} + possible-typed-array-names@1.1.0: {} postcss-html@1.8.1: @@ -17346,7 +17465,7 @@ snapshots: dependencies: arg: 5.0.2 check-more-types: 2.24.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) execa: 5.1.1 lazy-ass: 2.0.3 tree-kill: 1.2.2 @@ -17465,7 +17584,7 @@ snapshots: cosmiconfig: 9.0.2(typescript@6.0.3) css-functions-list: 3.3.3 css-tree: 3.2.1 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) fast-glob: 3.3.3 fastest-levenshtein: 1.0.16 file-entry-cache: 11.1.5 @@ -17807,7 +17926,7 @@ snapshots: '@rollup/pluginutils': 5.4.0 '@volar/typescript': 2.4.28 compare-versions: 6.1.1 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) kolorist: 1.8.0 local-pkg: 1.2.1 magic-string: 0.30.21 @@ -17941,6 +18060,8 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 + uri-js-replace@1.0.1: {} + uri-js@4.4.1: dependencies: punycode: 2.3.1 @@ -18291,7 +18412,7 @@ snapshots: vue-eslint-parser@10.4.1(eslint@10.8.1(jiti@2.7.0)): dependencies: - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) eslint: 10.8.1(jiti@2.7.0) eslint-scope: 9.1.2 eslint-visitor-keys: 5.0.1 @@ -18547,6 +18668,8 @@ snapshots: yallist@3.1.1: {} + yaml-ast-parser@0.0.43: {} + yaml-eslint-parser@2.1.0: dependencies: eslint-visitor-keys: 5.0.1 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index e88a4b8f5d5..58b4fbb1478 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -112,6 +112,7 @@ catalog: mixpanel-browser: ^2.71.0 monocart-coverage-reports: ^2.12.9 openai: ^7.4.0 + openapi-typescript: ^7.13.0 oxfmt: ^0.59.0 oxlint: ^1.77.0 oxlint-tsgolint: ^7.0.2001 diff --git a/scripts/check-docframe-typegen.sh b/scripts/check-docframe-typegen.sh new file mode 100755 index 00000000000..e57d7685f00 --- /dev/null +++ b/scripts/check-docframe-typegen.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail + +repo_root="$(git rev-parse --show-toplevel)" +cd "$repo_root" + +pnpm typegen:docframe +git diff --exit-code -- src/schemas/docframe/generated/ diff --git a/src/schemas/docframe/generated/docframe.d.ts b/src/schemas/docframe/generated/docframe.d.ts new file mode 100644 index 00000000000..b040543bb27 --- /dev/null +++ b/src/schemas/docframe/generated/docframe.d.ts @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + +export type paths = Record +export type webhooks = Record +export interface components { + schemas: { + /** @description Any doc-frame envelope. Provenance: inventory "Message inventory" and "OpenAPI handoff notes" §1. */ + DocFrame: + | components['schemas']['DocSubscribeFrame'] + | components['schemas']['DocSubscribedFrame'] + | components['schemas']['DocUnsubscribeFrame'] + | components['schemas']['DocUpdateFrame'] + | components['schemas']['DocOpsFrame'] + | components['schemas']['DocOpsResultFrame'] + | components['schemas']['DocResetFrame'] + | components['schemas']['AwarenessFrame'] + /** @description Client-originated doc frames accepted by cloud ingress. */ + DocFrameClientToServer: + | components['schemas']['DocSubscribeFrame'] + | components['schemas']['DocUnsubscribeFrame'] + | components['schemas']['DocOpsFrame'] + | components['schemas']['AwarenessFrame'] + /** @description Server-originated doc frames parsed by the browser follower. */ + DocFrameServerToClient: + | components['schemas']['DocSubscribedFrame'] + | components['schemas']['DocUpdateFrame'] + | components['schemas']['DocOpsResultFrame'] + | components['schemas']['DocResetFrame'] + | components['schemas']['AwarenessFrame'] + /** + * @description Exactly 1 on the current /ws protocol. + * @constant + */ + ProtocolVersion: 1 + /** @description Workflow identifier. The implementation additionally rejects control and channel-special characters. Provenance: inventory "Validation and size limits". */ + WorkflowId: string + /** @description Authoritative document sequence number. */ + Sequence: number + /** @description Standard-base64 data, capped at 8 MiB encoded. */ + Base64Payload: string + DocSubscribeFrame: { + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: 'doc_subscribe' + data: components['schemas']['DocSubscribeData'] + } + DocSubscribeData: { + v: components['schemas']['ProtocolVersion'] + workflow_id: components['schemas']['WorkflowId'] + /** @description Optional Yjs state vector. Empty or absent requests full catch-up; the current FE always emits this field. Provenance: inventory "Message inventory" row doc_subscribe. */ + state_vector_b64?: components['schemas']['Base64Payload'] + } + DocSubscribedFrame: { + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: 'doc_subscribed' + data: components['schemas']['DocSubscribedData'] + } + /** @description Provenance inventory "Message inventory" row doc_subscribed. */ + DocSubscribedData: { + v: components['schemas']['ProtocolVersion'] + workflow_id: components['schemas']['WorkflowId'] + ok: boolean + seq?: components['schemas']['Sequence'] + code?: string + message?: string + } + DocUnsubscribeFrame: { + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: 'doc_unsubscribe' + data: components['schemas']['DocUnsubscribeData'] + } + /** @description Provenance inventory "Message inventory" row doc_unsubscribe. */ + DocUnsubscribeData: { + v: components['schemas']['ProtocolVersion'] + workflow_id: components['schemas']['WorkflowId'] + } + DocUpdateFrame: { + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: 'doc_update' + data: components['schemas']['DocUpdateData'] + } + /** @description Provenance inventory "Message inventory" row doc_update. */ + DocUpdateData: { + v: components['schemas']['ProtocolVersion'] + workflow_id: components['schemas']['WorkflowId'] + seq: components['schemas']['Sequence'] + /** @description Non-empty Yjs binary update encoded as standard base64. */ + update_b64: components['schemas']['Base64Payload'] + actor?: string + } + DocOpsFrame: { + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: 'doc_ops' + data: components['schemas']['DocOpsData'] + } + /** @description Provenance inventory "Nested doc_ops.ops[*] inventory". */ + DocOpsData: { + v: components['schemas']['ProtocolVersion'] + workflow_id: components['schemas']['WorkflowId'] + /** @description Tab identity; whitespace, colon, and controls are rejected. */ + tab: string + /** @description Semantic operations, with a 4 MiB aggregate encoded-size cap. The WS relay validates the common envelope but treats operation interiors as opaque; the five variants are the executable 02b producer vocabulary. */ + ops: components['schemas']['DocOp'][] + } + DocOpsResultFrame: { + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: 'doc_ops_result' + data: components['schemas']['DocOpsResultData'] + } + /** @description Optional arrays follow Go omitempty behavior; the FE normalizes absent arrays to empty arrays. Only the canonical cloud failure shape is modeled. Provenance: inventory "Message inventory" row doc_ops_result. */ + DocOpsResultData: { + v: components['schemas']['ProtocolVersion'] + workflow_id: components['schemas']['WorkflowId'] + ok: boolean + seq?: components['schemas']['Sequence'] + applied?: string[] + skipped?: string[] + failed?: components['schemas']['DocOpFailure'] + code?: string + message?: string + } + DocOpFailure: { + index: number + op_id?: string + code: string + message: string + } + DocResetFrame: { + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: 'doc_reset' + data: components['schemas']['DocResetData'] + } + /** @description Explicit lineage break; carries no update or snapshot. Provenance: inventory "Message inventory" row doc_reset. */ + DocResetData: { + v: components['schemas']['ProtocolVersion'] + workflow_id: components['schemas']['WorkflowId'] + seq: components['schemas']['Sequence'] + actor?: string + } + AwarenessFrame: { + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: 'awareness' + data: components['schemas']['AwarenessData'] + } + /** @description Bidirectional protocol capability; neither inspected FE revision emits it. Provenance: inventory "Message inventory" row awareness. */ + AwarenessData: { + v: components['schemas']['ProtocolVersion'] + workflow_id: components['schemas']['WorkflowId'] + actor: string + /** @description Ephemeral presence state, capped at 8 KiB encoded JSON. */ + state?: Record + /** @description Unix seconds; server overwrites/stamps expiry before fanout. */ + expires_at?: number + } + /** @description Five operation payloads emitted by the inspected 02b executable lineage. Current checked-in PoC producers mint only add_node and delete_node. */ + DocOp: + | components['schemas']['AddNodeOp'] + | components['schemas']['DeleteNodeOp'] + | components['schemas']['ClearOp'] + | components['schemas']['ConnectOp'] + | components['schemas']['SetWidgetOp'] + /** @description Provenance inventory "Common emitted envelope". */ + DocOpCommon: { + op: string + /** @description Unique within a batch; minted once before dispatch. */ + op_id: string + actor: string + base_version: number + /** @description Ordering stamp [base_version, actor]. */ + stamp: [number, string] + } + /** @description NodeId is imported from the shared package in 02b; observed link seams explicitly accept string or number, so the wire contract preserves both. */ + NodeId: string | number + AddNodeOp: components['schemas']['DocOpCommon'] & { + /** @constant */ + op: 'add_node' + op_id?: string + actor?: string + base_version?: number + stamp?: [number, string] + node_id: components['schemas']['NodeId'] + class_type: string + pos: [number, number] + node: { + [key: string]: unknown + } + } & { + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + op: 'add_node' + } + DeleteNodeOp: components['schemas']['DocOpCommon'] & { + /** @constant */ + op: 'delete_node' + op_id?: string + actor?: string + base_version?: number + stamp?: unknown[] + node_id: components['schemas']['NodeId'] + removed_links: components['schemas']['NodeId'][] + } & { + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + op: 'delete_node' + } + ClearOp: components['schemas']['DocOpCommon'] & { + /** @constant */ + op: 'clear' + op_id?: string + actor?: string + base_version?: number + stamp?: unknown[] + removed_nodes: components['schemas']['NodeId'][] + } & { + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + op: 'clear' + } + ConnectOp: components['schemas']['DocOpCommon'] & { + /** @constant */ + op: 'connect' + op_id?: string + actor?: string + base_version?: number + stamp?: unknown[] + link_id: components['schemas']['NodeId'] + from_node: components['schemas']['NodeId'] + from_slot: number + to_node: components['schemas']['NodeId'] + to_slot: number + link_type: string + } & { + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + op: 'connect' + } + /** @description Root form omits path and inner_widget; interior form includes both. value and old accept any JSON value. Provenance inventory "Additional operation payloads emitted on 02b". */ + SetWidgetOp: components['schemas']['DocOpCommon'] & { + /** @constant */ + op: 'set_widget' + op_id?: string + actor?: string + base_version?: number + stamp?: unknown[] + node_id: components['schemas']['NodeId'] + widget: string + value: unknown + old: unknown + path?: string[] + inner_widget?: string + } & { + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + op: 'set_widget' + } + } + responses: never + parameters: never + requestBodies: never + headers: never + pathItems: never +} +export type $defs = Record +export type operations = Record diff --git a/src/schemas/docframe/openapi.yaml b/src/schemas/docframe/openapi.yaml new file mode 100644 index 00000000000..f088cde48ce --- /dev/null +++ b/src/schemas/docframe/openapi.yaml @@ -0,0 +1,469 @@ +# Copied from /home/c_byrne/workspaces/in-app-agent/openapi/docframe.yaml +# Program source commit: ff40d62e097c164c1b061a701724b27cde669fc7 +openapi: 3.1.0 +info: + title: ComfyUI Doc-frame WebSocket Protocol + version: 0.1.0 + description: >- + Code-derived contract for the eight document-frame messages carried by the + existing ComfyUI JSON WebSocket. This specification describes wire shapes, + not client delivery guarantees. Provenance: reports/protocol/docframe-wire-inventory.md. +servers: + - url: '{scheme}://{host}' + description: Deployment-specific ComfyUI WebSocket origin. + variables: + scheme: + default: wss + enum: [ws, wss] + host: + default: agent.comfy.org +paths: {} + +# OpenAPI has no native WebSocket operation object. This extension documents the +# existing endpoint and points both directions at JSON Schema discriminator unions. +# Provenance: inventory sections "Topology", "Envelope and notation", and +# "Direction enforcement". +x-websocket: + path: /ws + subprotocol: json + description: >- + Existing authenticated ComfyUI WebSocket shared with other protocol families. + This contract covers doc frames only. Client-originated server-only doc-frame + discriminators are ignored by the current cloud ingress implementation. + clientToServer: + $ref: '#/components/schemas/DocFrameClientToServer' + serverToClient: + $ref: '#/components/schemas/DocFrameServerToClient' + +components: + schemas: + DocFrame: + description: >- + Any doc-frame envelope. Provenance: inventory "Message inventory" and + "OpenAPI handoff notes" §1. + oneOf: + - $ref: '#/components/schemas/DocSubscribeFrame' + - $ref: '#/components/schemas/DocSubscribedFrame' + - $ref: '#/components/schemas/DocUnsubscribeFrame' + - $ref: '#/components/schemas/DocUpdateFrame' + - $ref: '#/components/schemas/DocOpsFrame' + - $ref: '#/components/schemas/DocOpsResultFrame' + - $ref: '#/components/schemas/DocResetFrame' + - $ref: '#/components/schemas/AwarenessFrame' + discriminator: + propertyName: type + mapping: + doc_subscribe: '#/components/schemas/DocSubscribeFrame' + doc_subscribed: '#/components/schemas/DocSubscribedFrame' + doc_unsubscribe: '#/components/schemas/DocUnsubscribeFrame' + doc_update: '#/components/schemas/DocUpdateFrame' + doc_ops: '#/components/schemas/DocOpsFrame' + doc_ops_result: '#/components/schemas/DocOpsResultFrame' + doc_reset: '#/components/schemas/DocResetFrame' + awareness: '#/components/schemas/AwarenessFrame' + + DocFrameClientToServer: + description: Client-originated doc frames accepted by cloud ingress. + oneOf: + - $ref: '#/components/schemas/DocSubscribeFrame' + - $ref: '#/components/schemas/DocUnsubscribeFrame' + - $ref: '#/components/schemas/DocOpsFrame' + - $ref: '#/components/schemas/AwarenessFrame' + discriminator: + propertyName: type + mapping: + doc_subscribe: '#/components/schemas/DocSubscribeFrame' + doc_unsubscribe: '#/components/schemas/DocUnsubscribeFrame' + doc_ops: '#/components/schemas/DocOpsFrame' + awareness: '#/components/schemas/AwarenessFrame' + + DocFrameServerToClient: + description: Server-originated doc frames parsed by the browser follower. + oneOf: + - $ref: '#/components/schemas/DocSubscribedFrame' + - $ref: '#/components/schemas/DocUpdateFrame' + - $ref: '#/components/schemas/DocOpsResultFrame' + - $ref: '#/components/schemas/DocResetFrame' + - $ref: '#/components/schemas/AwarenessFrame' + discriminator: + propertyName: type + mapping: + doc_subscribed: '#/components/schemas/DocSubscribedFrame' + doc_update: '#/components/schemas/DocUpdateFrame' + doc_ops_result: '#/components/schemas/DocOpsResultFrame' + doc_reset: '#/components/schemas/DocResetFrame' + awareness: '#/components/schemas/AwarenessFrame' + + ProtocolVersion: + type: integer + const: 1 + description: Exactly 1 on the current /ws protocol. + + WorkflowId: + type: string + minLength: 1 + maxLength: 128 + description: >- + Workflow identifier. The implementation additionally rejects control and + channel-special characters. Provenance: inventory "Validation and size limits". + + Sequence: + type: integer + minimum: 0 + description: Authoritative document sequence number. + + Base64Payload: + type: string + contentEncoding: base64 + maxLength: 8388608 + description: Standard-base64 data, capped at 8 MiB encoded. + + DocSubscribeFrame: + type: object + additionalProperties: false + required: [type, data] + properties: + type: { type: string, const: doc_subscribe } + data: { $ref: '#/components/schemas/DocSubscribeData' } + DocSubscribeData: + type: object + additionalProperties: false + required: [v, workflow_id] + properties: + v: { $ref: '#/components/schemas/ProtocolVersion' } + workflow_id: { $ref: '#/components/schemas/WorkflowId' } + state_vector_b64: + allOf: [{ $ref: '#/components/schemas/Base64Payload' }] + description: >- + Optional Yjs state vector. Empty or absent requests full catch-up; + the current FE always emits this field. Provenance: inventory + "Message inventory" row doc_subscribe. + + DocSubscribedFrame: + type: object + additionalProperties: false + required: [type, data] + properties: + type: { type: string, const: doc_subscribed } + data: { $ref: '#/components/schemas/DocSubscribedData' } + DocSubscribedData: + type: object + additionalProperties: false + required: [v, workflow_id, ok] + properties: + v: { $ref: '#/components/schemas/ProtocolVersion' } + workflow_id: { $ref: '#/components/schemas/WorkflowId' } + ok: { type: boolean } + seq: { $ref: '#/components/schemas/Sequence' } + code: { type: string } + message: { type: string } + description: Provenance inventory "Message inventory" row doc_subscribed. + + DocUnsubscribeFrame: + type: object + additionalProperties: false + required: [type, data] + properties: + type: { type: string, const: doc_unsubscribe } + data: { $ref: '#/components/schemas/DocUnsubscribeData' } + DocUnsubscribeData: + type: object + additionalProperties: false + required: [v, workflow_id] + properties: + v: { $ref: '#/components/schemas/ProtocolVersion' } + workflow_id: { $ref: '#/components/schemas/WorkflowId' } + description: Provenance inventory "Message inventory" row doc_unsubscribe. + + DocUpdateFrame: + type: object + additionalProperties: false + required: [type, data] + properties: + type: { type: string, const: doc_update } + data: { $ref: '#/components/schemas/DocUpdateData' } + DocUpdateData: + type: object + additionalProperties: false + required: [v, workflow_id, seq, update_b64] + properties: + v: { $ref: '#/components/schemas/ProtocolVersion' } + workflow_id: { $ref: '#/components/schemas/WorkflowId' } + seq: { $ref: '#/components/schemas/Sequence' } + update_b64: + allOf: [{ $ref: '#/components/schemas/Base64Payload' }] + minLength: 1 + description: Non-empty Yjs binary update encoded as standard base64. + actor: { type: string } + description: Provenance inventory "Message inventory" row doc_update. + + DocOpsFrame: + type: object + additionalProperties: false + required: [type, data] + properties: + type: { type: string, const: doc_ops } + data: { $ref: '#/components/schemas/DocOpsData' } + DocOpsData: + type: object + additionalProperties: false + required: [v, workflow_id, tab, ops] + properties: + v: { $ref: '#/components/schemas/ProtocolVersion' } + workflow_id: { $ref: '#/components/schemas/WorkflowId' } + tab: + type: string + minLength: 1 + maxLength: 256 + description: Tab identity; whitespace, colon, and controls are rejected. + ops: + type: array + minItems: 1 + maxItems: 256 + items: { $ref: '#/components/schemas/DocOp' } + description: >- + Semantic operations, with a 4 MiB aggregate encoded-size cap. The WS + relay validates the common envelope but treats operation interiors as + opaque; the five variants are the executable 02b producer vocabulary. + description: Provenance inventory "Nested doc_ops.ops[*] inventory". + + DocOpsResultFrame: + type: object + additionalProperties: false + required: [type, data] + properties: + type: { type: string, const: doc_ops_result } + data: { $ref: '#/components/schemas/DocOpsResultData' } + DocOpsResultData: + type: object + additionalProperties: false + required: [v, workflow_id, ok] + properties: + v: { $ref: '#/components/schemas/ProtocolVersion' } + workflow_id: { $ref: '#/components/schemas/WorkflowId' } + ok: { type: boolean } + seq: { $ref: '#/components/schemas/Sequence' } + applied: + type: array + items: { type: string } + skipped: + type: array + items: { type: string } + failed: { $ref: '#/components/schemas/DocOpFailure' } + code: { type: string } + message: { type: string } + description: >- + Optional arrays follow Go omitempty behavior; the FE normalizes absent + arrays to empty arrays. Only the canonical cloud failure shape is modeled. + Provenance: inventory "Message inventory" row doc_ops_result. + DocOpFailure: + type: object + additionalProperties: false + required: [index, code, message] + properties: + index: { type: integer, minimum: 0 } + op_id: { type: string, maxLength: 128 } + code: { type: string } + message: { type: string } + + DocResetFrame: + type: object + additionalProperties: false + required: [type, data] + properties: + type: { type: string, const: doc_reset } + data: { $ref: '#/components/schemas/DocResetData' } + DocResetData: + type: object + additionalProperties: false + required: [v, workflow_id, seq] + properties: + v: { $ref: '#/components/schemas/ProtocolVersion' } + workflow_id: { $ref: '#/components/schemas/WorkflowId' } + seq: { $ref: '#/components/schemas/Sequence' } + actor: { type: string } + description: >- + Explicit lineage break; carries no update or snapshot. Provenance: + inventory "Message inventory" row doc_reset. + + AwarenessFrame: + type: object + additionalProperties: false + required: [type, data] + properties: + type: { type: string, const: awareness } + data: { $ref: '#/components/schemas/AwarenessData' } + AwarenessData: + type: object + additionalProperties: false + required: [v, workflow_id, actor] + properties: + v: { $ref: '#/components/schemas/ProtocolVersion' } + workflow_id: { $ref: '#/components/schemas/WorkflowId' } + actor: { type: string, maxLength: 256 } + state: + type: object + description: Ephemeral presence state, capped at 8 KiB encoded JSON. + expires_at: + type: integer + minimum: 0 + description: Unix seconds; server overwrites/stamps expiry before fanout. + description: >- + Bidirectional protocol capability; neither inspected FE revision emits it. + Provenance: inventory "Message inventory" row awareness. + + DocOp: + description: >- + Five operation payloads emitted by the inspected 02b executable lineage. + Current checked-in PoC producers mint only add_node and delete_node. + oneOf: + - $ref: '#/components/schemas/AddNodeOp' + - $ref: '#/components/schemas/DeleteNodeOp' + - $ref: '#/components/schemas/ClearOp' + - $ref: '#/components/schemas/ConnectOp' + - $ref: '#/components/schemas/SetWidgetOp' + discriminator: + propertyName: op + mapping: + add_node: '#/components/schemas/AddNodeOp' + delete_node: '#/components/schemas/DeleteNodeOp' + clear: '#/components/schemas/ClearOp' + connect: '#/components/schemas/ConnectOp' + set_widget: '#/components/schemas/SetWidgetOp' + + DocOpCommon: + type: object + required: [op, op_id, actor, base_version, stamp] + properties: + op: { type: string } + op_id: + type: string + minLength: 1 + maxLength: 128 + description: Unique within a batch; minted once before dispatch. + actor: + type: string + minLength: 1 + maxLength: 256 + pattern: '^(agent:[^:]+:[^:]+|human:[^:]+:[^:]+|system:mint)$' + base_version: { type: integer } + stamp: + type: array + prefixItems: + - { type: integer } + - { type: string, minLength: 1 } + minItems: 2 + maxItems: 2 + description: Ordering stamp [base_version, actor]. + description: Provenance inventory "Common emitted envelope". + + NodeId: + description: >- + NodeId is imported from the shared package in 02b; observed link seams + explicitly accept string or number, so the wire contract preserves both. + oneOf: + - { type: string } + - { type: number } + + AddNodeOp: + allOf: + - $ref: '#/components/schemas/DocOpCommon' + - type: object + additionalProperties: false + required: [op, node_id, class_type, pos, node] + properties: + op: { type: string, const: add_node } + op_id: { type: string, minLength: 1, maxLength: 128 } + actor: { type: string, minLength: 1, maxLength: 256 } + base_version: { type: integer } + stamp: + type: array + prefixItems: [{ type: integer }, { type: string, minLength: 1 }] + minItems: 2 + maxItems: 2 + node_id: { $ref: '#/components/schemas/NodeId' } + class_type: { type: string } + pos: + type: array + prefixItems: [{ type: number }, { type: number }] + minItems: 2 + maxItems: 2 + node: { type: object, additionalProperties: true } + + DeleteNodeOp: + allOf: + - $ref: '#/components/schemas/DocOpCommon' + - type: object + additionalProperties: false + required: [op, node_id, removed_links] + properties: + op: { type: string, const: delete_node } + op_id: { type: string, minLength: 1, maxLength: 128 } + actor: { type: string, minLength: 1, maxLength: 256 } + base_version: { type: integer } + stamp: { type: array, minItems: 2, maxItems: 2 } + node_id: { $ref: '#/components/schemas/NodeId' } + removed_links: + type: array + items: { $ref: '#/components/schemas/NodeId' } + + ClearOp: + allOf: + - $ref: '#/components/schemas/DocOpCommon' + - type: object + additionalProperties: false + required: [op, removed_nodes] + properties: + op: { type: string, const: clear } + op_id: { type: string, minLength: 1, maxLength: 128 } + actor: { type: string, minLength: 1, maxLength: 256 } + base_version: { type: integer } + stamp: { type: array, minItems: 2, maxItems: 2 } + removed_nodes: + type: array + items: { $ref: '#/components/schemas/NodeId' } + + ConnectOp: + allOf: + - $ref: '#/components/schemas/DocOpCommon' + - type: object + additionalProperties: false + required: + [op, link_id, from_node, from_slot, to_node, to_slot, link_type] + properties: + op: { type: string, const: connect } + op_id: { type: string, minLength: 1, maxLength: 128 } + actor: { type: string, minLength: 1, maxLength: 256 } + base_version: { type: integer } + stamp: { type: array, minItems: 2, maxItems: 2 } + link_id: { $ref: '#/components/schemas/NodeId' } + from_node: { $ref: '#/components/schemas/NodeId' } + from_slot: { type: integer } + to_node: { $ref: '#/components/schemas/NodeId' } + to_slot: { type: integer } + link_type: { type: string } + + SetWidgetOp: + allOf: + - $ref: '#/components/schemas/DocOpCommon' + - type: object + additionalProperties: false + required: [op, node_id, widget, value, old] + properties: + op: { type: string, const: set_widget } + op_id: { type: string, minLength: 1, maxLength: 128 } + actor: { type: string, minLength: 1, maxLength: 256 } + base_version: { type: integer } + stamp: { type: array, minItems: 2, maxItems: 2 } + node_id: { $ref: '#/components/schemas/NodeId' } + widget: { type: string } + value: {} + old: {} + path: + type: array + items: { type: string } + inner_widget: { type: string } + description: >- + Root form omits path and inner_widget; interior form includes both. + value and old accept any JSON value. Provenance inventory "Additional + operation payloads emitted on 02b". From aa858591f67b6b567cbcfa9307105f59a4293bc1 Mon Sep 17 00:00:00 2001 From: bymyself Date: Fri, 28 Aug 2026 14:41:41 +0000 Subject: [PATCH 03/16] fix: format generated docframe types --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b5f2157aac4..43010167bf1 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "format:check": "oxfmt --check", "format": "oxfmt --write", "json-schema": "tsx scripts/generate-json-schema.ts", - "typegen:docframe": "openapi-typescript src/schemas/docframe/openapi.yaml --output src/schemas/docframe/generated/docframe.d.ts", + "typegen:docframe": "openapi-typescript src/schemas/docframe/openapi.yaml --output src/schemas/docframe/generated/docframe.d.ts && oxfmt --write src/schemas/docframe/generated/docframe.d.ts", "knip:no-cache": "knip", "knip": "knip --cache", "lint:fix:no-cache": "pnpm oxlint:main --fix && pnpm oxlint:audit && eslint src --fix", From 1681e7299e2ee238c7765add679a72b8fa4a01e5 Mon Sep 17 00:00:00 2001 From: bymyself Date: Fri, 28 Aug 2026 19:11:10 +0000 Subject: [PATCH 04/16] docs: link docframe typegen contract --- .../in-app-agent-docframe-typegen.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 docs/architecture/in-app-agent-docframe-typegen.md diff --git a/docs/architecture/in-app-agent-docframe-typegen.md b/docs/architecture/in-app-agent-docframe-typegen.md new file mode 100644 index 00000000000..78a0df02269 --- /dev/null +++ b/docs/architecture/in-app-agent-docframe-typegen.md @@ -0,0 +1,37 @@ +# In-App Agent doc-frame type-generation contract + +This document cross-references the type-generation work in frontend PR #16191. The wire contract +is governed by workspace ADR-017 and cloud PR #7730; this frontend branch owns the generated +consumer surface and its freshness guard, not a second protocol definition. + +## Contract + +```text +cloud services/ingest/openapi.yaml + ├──▶ generated cloud doc-frame models + ├──▶ FE projection / generated ingest types + └──▶ generated smoke client + all outputs must pass freshness checks +``` + +- `doc_update`, `doc_reset`, and `doc_ops_result` are derived from the cloud OpenAPI source. +- `doc_ops_result.data.failed` is the wire spelling. A frontend adapter may expose `failure`, but + that mapping must remain at the adapter boundary. +- Generated types describe the `{type,data}` bytes; they do not implement CRDT application, + authority, or mutation semantics. +- Any schema change regenerates every committed output and must leave the dual-directory freshness + gate green before the contract is considered landed. + +## References + +- Workspace ADR-017: [OpenAPI doc-frame authority](https://github.com/christian-byrne/in-app-agent-program/blob/main/decisions/ADR-017-docframe-openapi-authority-and-typegen.md). +- Cloud PR [#7730](https://github.com/Comfy-Org/cloud/pull/7730). +- Workspace verification: `reports/audit/verify-dir-12-openapi-landing-current.md`. +- Related frontend follower boundary: `docs/adr/0019-in-app-agent-crdt-follower-and-distribution.md`. + +## Glossary + +- **Doc frame:** a CRDT message carried by the WebSocket `{type,data}` envelope. +- **Wire spelling:** the serialized field name shared by all producers and consumers. +- **Freshness gate:** CI that regenerates outputs and rejects stale committed files. +- **Adapter boundary:** the one place a consumer may map a wire name to an internal name. From 86d4a5a9aa84eb573d1c3e1bd4db37b0dd8b08e0 Mon Sep 17 00:00:00 2001 From: bymyself Date: Mon, 31 Aug 2026 12:17:23 +0000 Subject: [PATCH 05/16] test: preserve doc_update op id typegen --- src/schemas/docframe/generated/docframe.d.ts | 2 + src/schemas/docframe/openapi.test.ts | 72 ++++++++++++++++++++ src/schemas/docframe/openapi.yaml | 4 ++ 3 files changed, 78 insertions(+) create mode 100644 src/schemas/docframe/openapi.test.ts diff --git a/src/schemas/docframe/generated/docframe.d.ts b/src/schemas/docframe/generated/docframe.d.ts index b040543bb27..9ad6886105c 100644 --- a/src/schemas/docframe/generated/docframe.d.ts +++ b/src/schemas/docframe/generated/docframe.d.ts @@ -101,6 +101,8 @@ export interface components { /** @description Non-empty Yjs binary update encoded as standard base64. */ update_b64: components['schemas']['Base64Payload'] actor?: string + /** @description Creator-minted operation ids whose effects are included in this update. */ + op_ids?: string[] } DocOpsFrame: { /** diff --git a/src/schemas/docframe/openapi.test.ts b/src/schemas/docframe/openapi.test.ts new file mode 100644 index 00000000000..1167060304a --- /dev/null +++ b/src/schemas/docframe/openapi.test.ts @@ -0,0 +1,72 @@ +import { readFileSync } from 'node:fs' +import { join } from 'node:path' +import { parse } from 'yaml' +import { describe, expect, it } from 'vitest' + +type ObjectSchema = { + properties?: Record + required?: string[] + type?: string + items?: ObjectSchema + minLength?: number +} + +const openApi = parse( + readFileSync( + join(process.cwd(), 'src/schemas/docframe/openapi.yaml'), + 'utf-8' + ) +) as { + components: { schemas: Record } +} + +const docUpdateSchema = openApi.components.schemas.DocUpdateData +const opIdsSchema = docUpdateSchema.properties?.op_ids + +const validDocUpdateFixtures = [ + { v: 1, workflow_id: 'wf-1', seq: 1, update_b64: 'AQ==' }, + { + v: 1, + workflow_id: 'wf-1', + seq: 2, + update_b64: 'AQ==', + op_ids: ['op-1', 'op-2'] + } +] + +const invalidDocUpdateFixtures = [ + { v: 1, workflow_id: 'wf-1', seq: 3, update_b64: 'AQ==', op_ids: [''] }, + { v: 1, workflow_id: 'wf-1', seq: 4, update_b64: 'AQ==', op_ids: [42] } +] + +function opIdsMatchesSchema(value: unknown): boolean { + if (value === undefined) return true + if (opIdsSchema?.type !== 'array') return false + if (!Array.isArray(value)) return false + + return value.every( + (item) => + typeof item === opIdsSchema.items?.type && + item.length >= (opIdsSchema.items.minLength ?? 0) + ) +} + +describe('docframe OpenAPI schema', () => { + it('keeps doc_update operation ids as optional non-empty strings', () => { + expect(docUpdateSchema.required).not.toContain('op_ids') + expect(opIdsSchema).toMatchObject({ + type: 'array', + items: { type: 'string', minLength: 1 } + }) + expect( + validDocUpdateFixtures.every((fixture) => + opIdsMatchesSchema(fixture.op_ids) + ) + ).toBe(true) + expect( + invalidDocUpdateFixtures.every( + (fixture) => !opIdsMatchesSchema(fixture.op_ids) + ) + ).toBe(true) + }) +}) diff --git a/src/schemas/docframe/openapi.yaml b/src/schemas/docframe/openapi.yaml index f088cde48ce..f84668e27aa 100644 --- a/src/schemas/docframe/openapi.yaml +++ b/src/schemas/docframe/openapi.yaml @@ -195,6 +195,10 @@ components: minLength: 1 description: Non-empty Yjs binary update encoded as standard base64. actor: { type: string } + op_ids: + type: array + items: { type: string, minLength: 1 } + description: Creator-minted operation ids whose effects are included in this update. description: Provenance inventory "Message inventory" row doc_update. DocOpsFrame: From 9e003a7fab4a8d3085816ca52bb77be68c3d26b2 Mon Sep 17 00:00:00 2001 From: bymyself Date: Mon, 31 Aug 2026 12:23:18 +0000 Subject: [PATCH 06/16] fix: satisfy docframe OpenAPI yaml lint --- src/schemas/docframe/openapi.yaml | 596 ++++++++++++++++++++---------- 1 file changed, 395 insertions(+), 201 deletions(-) diff --git a/src/schemas/docframe/openapi.yaml b/src/schemas/docframe/openapi.yaml index f84668e27aa..9ccd201d96f 100644 --- a/src/schemas/docframe/openapi.yaml +++ b/src/schemas/docframe/openapi.yaml @@ -1,46 +1,40 @@ -# Copied from /home/c_byrne/workspaces/in-app-agent/openapi/docframe.yaml -# Program source commit: ff40d62e097c164c1b061a701724b27cde669fc7 openapi: 3.1.0 info: title: ComfyUI Doc-frame WebSocket Protocol version: 0.1.0 - description: >- - Code-derived contract for the eight document-frame messages carried by the - existing ComfyUI JSON WebSocket. This specification describes wire shapes, - not client delivery guarantees. Provenance: reports/protocol/docframe-wire-inventory.md. + description: + 'Code-derived contract for the eight document-frame messages carried + by the existing ComfyUI JSON WebSocket. This specification describes wire shapes, + not client delivery guarantees. Provenance: reports/protocol/docframe-wire-inventory.md.' servers: - url: '{scheme}://{host}' description: Deployment-specific ComfyUI WebSocket origin. variables: scheme: default: wss - enum: [ws, wss] + enum: + - ws + - wss host: default: agent.comfy.org paths: {} - -# OpenAPI has no native WebSocket operation object. This extension documents the -# existing endpoint and points both directions at JSON Schema discriminator unions. -# Provenance: inventory sections "Topology", "Envelope and notation", and -# "Direction enforcement". x-websocket: path: /ws subprotocol: json - description: >- - Existing authenticated ComfyUI WebSocket shared with other protocol families. - This contract covers doc frames only. Client-originated server-only doc-frame - discriminators are ignored by the current cloud ingress implementation. + description: + Existing authenticated ComfyUI WebSocket shared with other protocol + families. This contract covers doc frames only. Client-originated server-only + doc-frame discriminators are ignored by the current cloud ingress implementation. clientToServer: $ref: '#/components/schemas/DocFrameClientToServer' serverToClient: $ref: '#/components/schemas/DocFrameServerToClient' - components: schemas: DocFrame: - description: >- - Any doc-frame envelope. Provenance: inventory "Message inventory" and - "OpenAPI handoff notes" §1. + description: + 'Any doc-frame envelope. Provenance: inventory "Message inventory" + and "OpenAPI handoff notes" §1.' oneOf: - $ref: '#/components/schemas/DocSubscribeFrame' - $ref: '#/components/schemas/DocSubscribedFrame' @@ -61,7 +55,6 @@ components: doc_ops_result: '#/components/schemas/DocOpsResultFrame' doc_reset: '#/components/schemas/DocResetFrame' awareness: '#/components/schemas/AwarenessFrame' - DocFrameClientToServer: description: Client-originated doc frames accepted by cloud ingress. oneOf: @@ -76,7 +69,6 @@ components: doc_unsubscribe: '#/components/schemas/DocUnsubscribeFrame' doc_ops: '#/components/schemas/DocOpsFrame' awareness: '#/components/schemas/AwarenessFrame' - DocFrameServerToClient: description: Server-originated doc frames parsed by the browser follower. oneOf: @@ -93,128 +85,182 @@ components: doc_ops_result: '#/components/schemas/DocOpsResultFrame' doc_reset: '#/components/schemas/DocResetFrame' awareness: '#/components/schemas/AwarenessFrame' - ProtocolVersion: type: integer const: 1 description: Exactly 1 on the current /ws protocol. - WorkflowId: type: string minLength: 1 maxLength: 128 - description: >- - Workflow identifier. The implementation additionally rejects control and - channel-special characters. Provenance: inventory "Validation and size limits". - + description: + 'Workflow identifier. The implementation additionally rejects control + and channel-special characters. Provenance: inventory "Validation and size + limits".' Sequence: type: integer minimum: 0 description: Authoritative document sequence number. - Base64Payload: type: string contentEncoding: base64 maxLength: 8388608 description: Standard-base64 data, capped at 8 MiB encoded. - DocSubscribeFrame: type: object additionalProperties: false - required: [type, data] + required: + - type + - data properties: - type: { type: string, const: doc_subscribe } - data: { $ref: '#/components/schemas/DocSubscribeData' } + type: + type: string + const: doc_subscribe + data: + $ref: '#/components/schemas/DocSubscribeData' DocSubscribeData: type: object additionalProperties: false - required: [v, workflow_id] + required: + - v + - workflow_id properties: - v: { $ref: '#/components/schemas/ProtocolVersion' } - workflow_id: { $ref: '#/components/schemas/WorkflowId' } + v: + $ref: '#/components/schemas/ProtocolVersion' + workflow_id: + $ref: '#/components/schemas/WorkflowId' state_vector_b64: - allOf: [{ $ref: '#/components/schemas/Base64Payload' }] - description: >- - Optional Yjs state vector. Empty or absent requests full catch-up; - the current FE always emits this field. Provenance: inventory - "Message inventory" row doc_subscribe. - + allOf: + - $ref: '#/components/schemas/Base64Payload' + description: + 'Optional Yjs state vector. Empty or absent requests full catch-up; + the current FE always emits this field. Provenance: inventory "Message + inventory" row doc_subscribe.' DocSubscribedFrame: type: object additionalProperties: false - required: [type, data] + required: + - type + - data properties: - type: { type: string, const: doc_subscribed } - data: { $ref: '#/components/schemas/DocSubscribedData' } + type: + type: string + const: doc_subscribed + data: + $ref: '#/components/schemas/DocSubscribedData' DocSubscribedData: type: object additionalProperties: false - required: [v, workflow_id, ok] + required: + - v + - workflow_id + - ok properties: - v: { $ref: '#/components/schemas/ProtocolVersion' } - workflow_id: { $ref: '#/components/schemas/WorkflowId' } - ok: { type: boolean } - seq: { $ref: '#/components/schemas/Sequence' } - code: { type: string } - message: { type: string } + v: + $ref: '#/components/schemas/ProtocolVersion' + workflow_id: + $ref: '#/components/schemas/WorkflowId' + ok: + type: boolean + seq: + $ref: '#/components/schemas/Sequence' + code: + type: string + message: + type: string description: Provenance inventory "Message inventory" row doc_subscribed. - DocUnsubscribeFrame: type: object additionalProperties: false - required: [type, data] + required: + - type + - data properties: - type: { type: string, const: doc_unsubscribe } - data: { $ref: '#/components/schemas/DocUnsubscribeData' } + type: + type: string + const: doc_unsubscribe + data: + $ref: '#/components/schemas/DocUnsubscribeData' DocUnsubscribeData: type: object additionalProperties: false - required: [v, workflow_id] + required: + - v + - workflow_id properties: - v: { $ref: '#/components/schemas/ProtocolVersion' } - workflow_id: { $ref: '#/components/schemas/WorkflowId' } + v: + $ref: '#/components/schemas/ProtocolVersion' + workflow_id: + $ref: '#/components/schemas/WorkflowId' description: Provenance inventory "Message inventory" row doc_unsubscribe. - DocUpdateFrame: type: object additionalProperties: false - required: [type, data] + required: + - type + - data properties: - type: { type: string, const: doc_update } - data: { $ref: '#/components/schemas/DocUpdateData' } + type: + type: string + const: doc_update + data: + $ref: '#/components/schemas/DocUpdateData' DocUpdateData: type: object additionalProperties: false - required: [v, workflow_id, seq, update_b64] + required: + - v + - workflow_id + - seq + - update_b64 properties: - v: { $ref: '#/components/schemas/ProtocolVersion' } - workflow_id: { $ref: '#/components/schemas/WorkflowId' } - seq: { $ref: '#/components/schemas/Sequence' } + v: + $ref: '#/components/schemas/ProtocolVersion' + workflow_id: + $ref: '#/components/schemas/WorkflowId' + seq: + $ref: '#/components/schemas/Sequence' update_b64: - allOf: [{ $ref: '#/components/schemas/Base64Payload' }] + allOf: + - $ref: '#/components/schemas/Base64Payload' minLength: 1 description: Non-empty Yjs binary update encoded as standard base64. - actor: { type: string } + actor: + type: string op_ids: type: array - items: { type: string, minLength: 1 } - description: Creator-minted operation ids whose effects are included in this update. + items: + type: string + minLength: 1 + description: + Creator-minted operation ids whose effects are included in + this update. description: Provenance inventory "Message inventory" row doc_update. - DocOpsFrame: type: object additionalProperties: false - required: [type, data] + required: + - type + - data properties: - type: { type: string, const: doc_ops } - data: { $ref: '#/components/schemas/DocOpsData' } + type: + type: string + const: doc_ops + data: + $ref: '#/components/schemas/DocOpsData' DocOpsData: type: object additionalProperties: false - required: [v, workflow_id, tab, ops] + required: + - v + - workflow_id + - tab + - ops properties: - v: { $ref: '#/components/schemas/ProtocolVersion' } - workflow_id: { $ref: '#/components/schemas/WorkflowId' } + v: + $ref: '#/components/schemas/ProtocolVersion' + workflow_id: + $ref: '#/components/schemas/WorkflowId' tab: type: string minLength: 1 @@ -224,87 +270,135 @@ components: type: array minItems: 1 maxItems: 256 - items: { $ref: '#/components/schemas/DocOp' } - description: >- - Semantic operations, with a 4 MiB aggregate encoded-size cap. The WS - relay validates the common envelope but treats operation interiors as - opaque; the five variants are the executable 02b producer vocabulary. + items: + $ref: '#/components/schemas/DocOp' + description: + Semantic operations, with a 4 MiB aggregate encoded-size cap. + The WS relay validates the common envelope but treats operation interiors + as opaque; the five variants are the executable 02b producer vocabulary. description: Provenance inventory "Nested doc_ops.ops[*] inventory". - DocOpsResultFrame: type: object additionalProperties: false - required: [type, data] + required: + - type + - data properties: - type: { type: string, const: doc_ops_result } - data: { $ref: '#/components/schemas/DocOpsResultData' } + type: + type: string + const: doc_ops_result + data: + $ref: '#/components/schemas/DocOpsResultData' DocOpsResultData: type: object additionalProperties: false - required: [v, workflow_id, ok] + required: + - v + - workflow_id + - ok properties: - v: { $ref: '#/components/schemas/ProtocolVersion' } - workflow_id: { $ref: '#/components/schemas/WorkflowId' } - ok: { type: boolean } - seq: { $ref: '#/components/schemas/Sequence' } + v: + $ref: '#/components/schemas/ProtocolVersion' + workflow_id: + $ref: '#/components/schemas/WorkflowId' + ok: + type: boolean + seq: + $ref: '#/components/schemas/Sequence' applied: type: array - items: { type: string } + items: + type: string skipped: type: array - items: { type: string } - failed: { $ref: '#/components/schemas/DocOpFailure' } - code: { type: string } - message: { type: string } - description: >- - Optional arrays follow Go omitempty behavior; the FE normalizes absent - arrays to empty arrays. Only the canonical cloud failure shape is modeled. - Provenance: inventory "Message inventory" row doc_ops_result. + items: + type: string + failed: + $ref: '#/components/schemas/DocOpFailure' + code: + type: string + message: + type: string + description: + 'Optional arrays follow Go omitempty behavior; the FE normalizes + absent arrays to empty arrays. Only the canonical cloud failure shape is modeled. + Provenance: inventory "Message inventory" row doc_ops_result.' DocOpFailure: type: object additionalProperties: false - required: [index, code, message] + required: + - index + - code + - message properties: - index: { type: integer, minimum: 0 } - op_id: { type: string, maxLength: 128 } - code: { type: string } - message: { type: string } - + index: + type: integer + minimum: 0 + op_id: + type: string + maxLength: 128 + code: + type: string + message: + type: string DocResetFrame: type: object additionalProperties: false - required: [type, data] + required: + - type + - data properties: - type: { type: string, const: doc_reset } - data: { $ref: '#/components/schemas/DocResetData' } + type: + type: string + const: doc_reset + data: + $ref: '#/components/schemas/DocResetData' DocResetData: type: object additionalProperties: false - required: [v, workflow_id, seq] + required: + - v + - workflow_id + - seq properties: - v: { $ref: '#/components/schemas/ProtocolVersion' } - workflow_id: { $ref: '#/components/schemas/WorkflowId' } - seq: { $ref: '#/components/schemas/Sequence' } - actor: { type: string } - description: >- - Explicit lineage break; carries no update or snapshot. Provenance: - inventory "Message inventory" row doc_reset. - + v: + $ref: '#/components/schemas/ProtocolVersion' + workflow_id: + $ref: '#/components/schemas/WorkflowId' + seq: + $ref: '#/components/schemas/Sequence' + actor: + type: string + description: + 'Explicit lineage break; carries no update or snapshot. Provenance: + inventory "Message inventory" row doc_reset.' AwarenessFrame: type: object additionalProperties: false - required: [type, data] + required: + - type + - data properties: - type: { type: string, const: awareness } - data: { $ref: '#/components/schemas/AwarenessData' } + type: + type: string + const: awareness + data: + $ref: '#/components/schemas/AwarenessData' AwarenessData: type: object additionalProperties: false - required: [v, workflow_id, actor] + required: + - v + - workflow_id + - actor properties: - v: { $ref: '#/components/schemas/ProtocolVersion' } - workflow_id: { $ref: '#/components/schemas/WorkflowId' } - actor: { type: string, maxLength: 256 } + v: + $ref: '#/components/schemas/ProtocolVersion' + workflow_id: + $ref: '#/components/schemas/WorkflowId' + actor: + type: string + maxLength: 256 state: type: object description: Ephemeral presence state, capped at 8 KiB encoded JSON. @@ -312,14 +406,13 @@ components: type: integer minimum: 0 description: Unix seconds; server overwrites/stamps expiry before fanout. - description: >- - Bidirectional protocol capability; neither inspected FE revision emits it. - Provenance: inventory "Message inventory" row awareness. - + description: + 'Bidirectional protocol capability; neither inspected FE revision + emits it. Provenance: inventory "Message inventory" row awareness.' DocOp: - description: >- - Five operation payloads emitted by the inspected 02b executable lineage. - Current checked-in PoC producers mint only add_node and delete_node. + description: + Five operation payloads emitted by the inspected 02b executable + lineage. Current checked-in PoC producers mint only add_node and delete_node. oneOf: - $ref: '#/components/schemas/AddNodeOp' - $ref: '#/components/schemas/DeleteNodeOp' @@ -334,12 +427,17 @@ components: clear: '#/components/schemas/ClearOp' connect: '#/components/schemas/ConnectOp' set_widget: '#/components/schemas/SetWidgetOp' - DocOpCommon: type: object - required: [op, op_id, actor, base_version, stamp] + required: + - op + - op_id + - actor + - base_version + - stamp properties: - op: { type: string } + op: + type: string op_id: type: string minLength: 1 @@ -349,125 +447,221 @@ components: type: string minLength: 1 maxLength: 256 - pattern: '^(agent:[^:]+:[^:]+|human:[^:]+:[^:]+|system:mint)$' - base_version: { type: integer } + pattern: ^(agent:[^:]+:[^:]+|human:[^:]+:[^:]+|system:mint)$ + base_version: + type: integer stamp: type: array prefixItems: - - { type: integer } - - { type: string, minLength: 1 } + - type: integer + - type: string + minLength: 1 minItems: 2 maxItems: 2 description: Ordering stamp [base_version, actor]. description: Provenance inventory "Common emitted envelope". - NodeId: - description: >- - NodeId is imported from the shared package in 02b; observed link seams - explicitly accept string or number, so the wire contract preserves both. + description: + NodeId is imported from the shared package in 02b; observed link + seams explicitly accept string or number, so the wire contract preserves both. oneOf: - - { type: string } - - { type: number } - + - type: string + - type: number AddNodeOp: allOf: - $ref: '#/components/schemas/DocOpCommon' - type: object additionalProperties: false - required: [op, node_id, class_type, pos, node] + required: + - op + - node_id + - class_type + - pos + - node properties: - op: { type: string, const: add_node } - op_id: { type: string, minLength: 1, maxLength: 128 } - actor: { type: string, minLength: 1, maxLength: 256 } - base_version: { type: integer } + op: + type: string + const: add_node + op_id: + type: string + minLength: 1 + maxLength: 128 + actor: + type: string + minLength: 1 + maxLength: 256 + base_version: + type: integer stamp: type: array - prefixItems: [{ type: integer }, { type: string, minLength: 1 }] + prefixItems: + - type: integer + - type: string + minLength: 1 minItems: 2 maxItems: 2 - node_id: { $ref: '#/components/schemas/NodeId' } - class_type: { type: string } + node_id: + $ref: '#/components/schemas/NodeId' + class_type: + type: string pos: type: array - prefixItems: [{ type: number }, { type: number }] + prefixItems: + - type: number + - type: number minItems: 2 maxItems: 2 - node: { type: object, additionalProperties: true } - + node: + type: object + additionalProperties: true DeleteNodeOp: allOf: - $ref: '#/components/schemas/DocOpCommon' - type: object additionalProperties: false - required: [op, node_id, removed_links] + required: + - op + - node_id + - removed_links properties: - op: { type: string, const: delete_node } - op_id: { type: string, minLength: 1, maxLength: 128 } - actor: { type: string, minLength: 1, maxLength: 256 } - base_version: { type: integer } - stamp: { type: array, minItems: 2, maxItems: 2 } - node_id: { $ref: '#/components/schemas/NodeId' } + op: + type: string + const: delete_node + op_id: + type: string + minLength: 1 + maxLength: 128 + actor: + type: string + minLength: 1 + maxLength: 256 + base_version: + type: integer + stamp: + type: array + minItems: 2 + maxItems: 2 + node_id: + $ref: '#/components/schemas/NodeId' removed_links: type: array - items: { $ref: '#/components/schemas/NodeId' } - + items: + $ref: '#/components/schemas/NodeId' ClearOp: allOf: - $ref: '#/components/schemas/DocOpCommon' - type: object additionalProperties: false - required: [op, removed_nodes] + required: + - op + - removed_nodes properties: - op: { type: string, const: clear } - op_id: { type: string, minLength: 1, maxLength: 128 } - actor: { type: string, minLength: 1, maxLength: 256 } - base_version: { type: integer } - stamp: { type: array, minItems: 2, maxItems: 2 } + op: + type: string + const: clear + op_id: + type: string + minLength: 1 + maxLength: 128 + actor: + type: string + minLength: 1 + maxLength: 256 + base_version: + type: integer + stamp: + type: array + minItems: 2 + maxItems: 2 removed_nodes: type: array - items: { $ref: '#/components/schemas/NodeId' } - + items: + $ref: '#/components/schemas/NodeId' ConnectOp: allOf: - $ref: '#/components/schemas/DocOpCommon' - type: object additionalProperties: false required: - [op, link_id, from_node, from_slot, to_node, to_slot, link_type] + - op + - link_id + - from_node + - from_slot + - to_node + - to_slot + - link_type properties: - op: { type: string, const: connect } - op_id: { type: string, minLength: 1, maxLength: 128 } - actor: { type: string, minLength: 1, maxLength: 256 } - base_version: { type: integer } - stamp: { type: array, minItems: 2, maxItems: 2 } - link_id: { $ref: '#/components/schemas/NodeId' } - from_node: { $ref: '#/components/schemas/NodeId' } - from_slot: { type: integer } - to_node: { $ref: '#/components/schemas/NodeId' } - to_slot: { type: integer } - link_type: { type: string } - + op: + type: string + const: connect + op_id: + type: string + minLength: 1 + maxLength: 128 + actor: + type: string + minLength: 1 + maxLength: 256 + base_version: + type: integer + stamp: + type: array + minItems: 2 + maxItems: 2 + link_id: + $ref: '#/components/schemas/NodeId' + from_node: + $ref: '#/components/schemas/NodeId' + from_slot: + type: integer + to_node: + $ref: '#/components/schemas/NodeId' + to_slot: + type: integer + link_type: + type: string SetWidgetOp: allOf: - $ref: '#/components/schemas/DocOpCommon' - type: object additionalProperties: false - required: [op, node_id, widget, value, old] + required: + - op + - node_id + - widget + - value + - old properties: - op: { type: string, const: set_widget } - op_id: { type: string, minLength: 1, maxLength: 128 } - actor: { type: string, minLength: 1, maxLength: 256 } - base_version: { type: integer } - stamp: { type: array, minItems: 2, maxItems: 2 } - node_id: { $ref: '#/components/schemas/NodeId' } - widget: { type: string } + op: + type: string + const: set_widget + op_id: + type: string + minLength: 1 + maxLength: 128 + actor: + type: string + minLength: 1 + maxLength: 256 + base_version: + type: integer + stamp: + type: array + minItems: 2 + maxItems: 2 + node_id: + $ref: '#/components/schemas/NodeId' + widget: + type: string value: {} old: {} path: type: array - items: { type: string } - inner_widget: { type: string } - description: >- + items: + type: string + inner_widget: + type: string + description: Root form omits path and inner_widget; interior form includes both. - value and old accept any JSON value. Provenance inventory "Additional - operation payloads emitted on 02b". + value and old accept any JSON value. Provenance inventory "Additional operation + payloads emitted on 02b". From 40259f518251f2b2cf6ad080718e23103917e64a Mon Sep 17 00:00:00 2001 From: bymyself Date: Tue, 1 Sep 2026 03:09:49 +0000 Subject: [PATCH 07/16] ci: verify generated DocFrame types Addresses review feedback: https://github.com/Comfy-Org/ComfyUI_frontend/pull/16191#discussion_r3894413419 --- .github/workflows/ci-lint-format.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-lint-format.yaml b/.github/workflows/ci-lint-format.yaml index 6c8b0bbaccc..6038f2c48ef 100644 --- a/.github/workflows/ci-lint-format.yaml +++ b/.github/workflows/ci-lint-format.yaml @@ -34,6 +34,9 @@ jobs: - name: Setup frontend uses: ./.github/actions/setup-frontend + - name: Verify generated DocFrame types + run: scripts/check-docframe-typegen.sh + - name: Run ESLint with auto-fix run: pnpm lint:fix From 60875a1ee6c1934c7a88068cf2c35c51eb15adde Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Tue, 1 Sep 2026 09:58:07 +0000 Subject: [PATCH 08/16] test: validate DocUpdateData with Ajv Addresses review feedback: https://github.com/Comfy-Org/ComfyUI_frontend/pull/16191#discussion_r3894413439 --- package.json | 1 + pnpm-lock.yaml | 308 ++++++++++++++------------- pnpm-workspace.yaml | 1 + src/schemas/docframe/openapi.test.ts | 66 +++--- 4 files changed, 189 insertions(+), 187 deletions(-) diff --git a/package.json b/package.json index 43010167bf1..b3e98bca7ba 100644 --- a/package.json +++ b/package.json @@ -180,6 +180,7 @@ "@vitest/coverage-v8": "catalog:", "@vitest/ui": "catalog:", "@webgpu/types": "catalog:", + "ajv": "catalog:", "cross-env": "catalog:", "eslint": "catalog:", "eslint-config-prettier": "catalog:", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9da73860ec9..198b833e9f8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -186,6 +186,9 @@ catalogs: ag-psd: specifier: ^31.0.2 version: 31.0.2 + ajv: + specifier: ^8.18.0 + version: 8.20.0 algoliasearch: specifier: ^5.21.0 version: 5.56.0 @@ -573,7 +576,7 @@ importers: version: 14.4.0(vue@3.5.41(typescript@6.0.3)) '@vueuse/integrations': specifier: 'catalog:' - version: 14.4.0(axios@1.18.1(debug@4.4.3))(change-case@5.4.4)(fuse.js@7.0.0)(vue@3.5.41(typescript@6.0.3)) + version: 14.4.0(axios@1.18.1(supports-color@10.2.2))(change-case@5.4.4)(fuse.js@7.0.0)(vue@3.5.41(typescript@6.0.3)) '@vueuse/router': specifier: ^14.4.0 version: 14.4.0(vue-router@5.2.0(@vue/compiler-sfc@3.5.41)(esbuild@0.28.1)(pinia@4.0.2(@vue/devtools-api@8.1.5)(typescript@6.0.3)(vue@3.5.41(typescript@6.0.3)))(rolldown@1.2.3)(vite@8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0))(vue@3.5.41(typescript@6.0.3)))(vue@3.5.41(typescript@6.0.3)) @@ -591,7 +594,7 @@ importers: version: 5.56.0 axios: specifier: 'catalog:' - version: 1.18.1(debug@4.4.3) + version: 1.18.1(supports-color@10.2.2) chart.js: specifier: ^4.5.0 version: 4.5.1 @@ -700,10 +703,10 @@ importers: version: link:packages/ingest-types '@eslint/js': specifier: 'catalog:' - version: 10.0.1(eslint@10.8.1(jiti@2.7.0)) + version: 10.0.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2)) '@intlify/eslint-plugin-vue-i18n': specifier: 'catalog:' - version: 4.5.1(eslint@10.8.1(jiti@2.7.0))(jsonc-eslint-parser@3.1.0)(vue-eslint-parser@10.4.1(eslint@10.8.1(jiti@2.7.0)))(yaml-eslint-parser@2.1.0) + version: 4.5.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(jsonc-eslint-parser@3.1.0)(supports-color@10.2.2)(vue-eslint-parser@10.4.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(yaml-eslint-parser@2.1.0) '@pinia/testing': specifier: 'catalog:' version: 2.0.1(pinia@4.0.2(@vue/devtools-api@8.1.5)(typescript@6.0.3)(vue@3.5.41(typescript@6.0.3))) @@ -712,7 +715,7 @@ importers: version: 1.61.1 '@sentry/vite-plugin': specifier: 'catalog:' - version: 4.9.1 + version: 4.9.1(supports-color@10.2.2) '@storybook/addon-docs': specifier: 'catalog:' version: 10.5.6(@types/react@19.2.17)(esbuild@0.28.1)(storybook@10.5.6(@types/react@19.2.17)(prettier@3.9.5)(react@19.2.8))(vite@8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0)) @@ -767,42 +770,45 @@ importers: '@webgpu/types': specifier: 'catalog:' version: 0.1.71 + ajv: + specifier: 'catalog:' + version: 8.20.0 cross-env: specifier: 'catalog:' version: 10.1.0 eslint: specifier: 'catalog:' - version: 10.8.1(jiti@2.7.0) + version: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) eslint-config-prettier: specifier: 'catalog:' - version: 10.1.8(eslint@10.8.1(jiti@2.7.0)) + version: 10.1.8(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2)) eslint-import-resolver-typescript: specifier: 'catalog:' - version: 4.4.5(eslint-plugin-import-x@4.17.1(@typescript-eslint/utils@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)))(eslint@10.8.1(jiti@2.7.0)) + version: 4.4.5(eslint-plugin-import-x@4.17.1(@typescript-eslint/utils@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) eslint-plugin-better-tailwindcss: specifier: 'catalog:' - version: 4.7.0(eslint@10.8.1(jiti@2.7.0))(oxlint@1.77.0(oxlint-tsgolint@7.0.2001))(tailwindcss@4.3.2)(typescript@6.0.3) + version: 4.7.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(oxlint@1.77.0(oxlint-tsgolint@7.0.2001))(tailwindcss@4.3.2)(typescript@6.0.3) eslint-plugin-import-x: specifier: 'catalog:' - version: 4.17.1(@typescript-eslint/utils@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)) + version: 4.17.1(@typescript-eslint/utils@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) eslint-plugin-oxlint: specifier: 'catalog:' version: 1.78.0(oxlint@1.77.0(oxlint-tsgolint@7.0.2001)) eslint-plugin-playwright: specifier: 'catalog:' - version: 2.11.0(eslint@10.8.1(jiti@2.7.0)) + version: 2.11.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2)) eslint-plugin-storybook: specifier: 'catalog:' - version: 10.5.8(eslint@10.8.1(jiti@2.7.0))(storybook@10.5.6(@types/react@19.2.17)(prettier@3.9.5)(react@19.2.8))(typescript@6.0.3) + version: 10.5.8(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(storybook@10.5.6(@types/react@19.2.17)(prettier@3.9.5)(react@19.2.8))(supports-color@10.2.2)(typescript@6.0.3) eslint-plugin-testing-library: specifier: 'catalog:' - version: 7.16.2(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3) + version: 7.16.2(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@6.0.3) eslint-plugin-unused-imports: specifier: 'catalog:' - version: 4.4.1(@typescript-eslint/eslint-plugin@8.67.0(@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)) + version: 4.4.1(@typescript-eslint/eslint-plugin@8.67.0(@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2)) eslint-plugin-vue: specifier: 'catalog:' - version: 10.10.0(@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0))(vue-eslint-parser@10.4.1(eslint@10.8.1(jiti@2.7.0))) + version: 10.10.0(@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(vue-eslint-parser@10.4.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)) fallow: specifier: 'catalog:' version: 2.104.0 @@ -871,13 +877,13 @@ importers: version: 6.0.11(rolldown@1.2.3) start-server-and-test: specifier: 'catalog:' - version: 3.0.12 + version: 3.0.12(supports-color@10.2.2) storybook: specifier: 'catalog:' version: 10.5.6(@types/react@19.2.17)(prettier@3.9.5)(react@19.2.8) stylelint: specifier: 'catalog:' - version: 17.14.0(typescript@6.0.3) + version: 17.14.0(supports-color@10.2.2)(typescript@6.0.3) tailwindcss: specifier: 'catalog:' version: 4.3.2 @@ -889,7 +895,7 @@ importers: version: 6.0.3 typescript-eslint: specifier: 'catalog:' - version: 8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3) + version: 8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3) unplugin-icons: specifier: 'catalog:' version: 23.0.1(@vue/compiler-sfc@3.5.41) @@ -907,7 +913,7 @@ importers: version: 8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0) vite-plugin-dts: specifier: 'catalog:' - version: 5.0.3(@microsoft/api-extractor@7.58.9(@types/node@25.9.5))(@vue/language-core@3.3.9)(esbuild@0.28.1)(rolldown@1.2.3)(typescript@6.0.3)(vite@8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0)) + version: 5.0.3(@microsoft/api-extractor@7.58.9(@types/node@25.9.5))(@vue/language-core@3.3.9)(esbuild@0.28.1)(rolldown@1.2.3)(supports-color@10.2.2)(typescript@6.0.3)(vite@8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0)) vite-plugin-html: specifier: 'catalog:' version: 3.2.2(vite@8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0)) @@ -922,7 +928,7 @@ importers: version: 3.3.9 vue-eslint-parser: specifier: 'catalog:' - version: 10.4.1(eslint@10.8.1(jiti@2.7.0)) + version: 10.4.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vue-tsc: specifier: 'catalog:' version: 3.3.9(typescript@6.0.3) @@ -1114,7 +1120,7 @@ importers: dependencies: axios: specifier: 'catalog:' - version: 1.18.1(debug@4.4.3) + version: 1.18.1(debug@4.4.3(supports-color@10.2.2)) devDependencies: typescript: specifier: 'catalog:' @@ -9824,7 +9830,7 @@ snapshots: '@babel/compat-data@7.29.7': {} - '@babel/core@7.29.7': + '@babel/core@7.29.7(supports-color@10.2.2)': dependencies: '@babel/code-frame': 7.29.7 '@babel/generator': 7.29.8 @@ -9833,7 +9839,7 @@ snapshots: '@babel/helpers': 7.29.7 '@babel/parser': 7.29.8 '@babel/template': 7.29.7 - '@babel/traverse': 7.29.8 + '@babel/traverse': 7.29.8(supports-color@10.2.2) '@babel/types': 7.29.8 '@jridgewell/remapping': 2.3.5 convert-source-map: 2.0.0 @@ -9875,13 +9881,13 @@ snapshots: '@babel/helper-create-class-features-plugin@7.29.7(@babel/core@7.29.7)': dependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-annotate-as-pure': 7.29.7 '@babel/helper-member-expression-to-functions': 7.29.7 '@babel/helper-optimise-call-expression': 7.29.7 '@babel/helper-replace-supers': 7.29.7(@babel/core@7.29.7) '@babel/helper-skip-transparent-expression-wrappers': 7.29.7 - '@babel/traverse': 7.29.8 + '@babel/traverse': 7.29.8(supports-color@10.2.2) semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -9890,24 +9896,24 @@ snapshots: '@babel/helper-member-expression-to-functions@7.29.7': dependencies: - '@babel/traverse': 7.29.8 + '@babel/traverse': 7.29.8(supports-color@10.2.2) '@babel/types': 7.29.8 transitivePeerDependencies: - supports-color '@babel/helper-module-imports@7.29.7': dependencies: - '@babel/traverse': 7.29.8 + '@babel/traverse': 7.29.8(supports-color@10.2.2) '@babel/types': 7.29.8 transitivePeerDependencies: - supports-color '@babel/helper-module-transforms@7.29.7(@babel/core@7.29.7)': dependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-module-imports': 7.29.7 '@babel/helper-validator-identifier': 7.29.7 - '@babel/traverse': 7.29.8 + '@babel/traverse': 7.29.8(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -9919,16 +9925,16 @@ snapshots: '@babel/helper-replace-supers@7.29.7(@babel/core@7.29.7)': dependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-member-expression-to-functions': 7.29.7 '@babel/helper-optimise-call-expression': 7.29.7 - '@babel/traverse': 7.29.8 + '@babel/traverse': 7.29.8(supports-color@10.2.2) transitivePeerDependencies: - supports-color '@babel/helper-skip-transparent-expression-wrappers@7.29.7': dependencies: - '@babel/traverse': 7.29.8 + '@babel/traverse': 7.29.8(supports-color@10.2.2) '@babel/types': 7.29.8 transitivePeerDependencies: - supports-color @@ -9958,7 +9964,7 @@ snapshots: '@babel/plugin-proposal-decorators@7.29.7(@babel/core@7.29.7)': dependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-create-class-features-plugin': 7.29.7(@babel/core@7.29.7) '@babel/helper-plugin-utils': 7.29.7 '@babel/plugin-syntax-decorators': 7.29.7(@babel/core@7.29.7) @@ -9967,32 +9973,32 @@ snapshots: '@babel/plugin-syntax-decorators@7.29.7(@babel/core@7.29.7)': dependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.29.7 '@babel/plugin-syntax-import-attributes@7.29.7(@babel/core@7.29.7)': dependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.29.7 '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.29.7)': dependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.29.7 '@babel/plugin-syntax-jsx@7.29.7(@babel/core@7.29.7)': dependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.29.7 '@babel/plugin-syntax-typescript@7.29.7(@babel/core@7.29.7)': dependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.29.7 '@babel/plugin-transform-typescript@7.29.7(@babel/core@7.29.7)': dependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-annotate-as-pure': 7.29.7 '@babel/helper-create-class-features-plugin': 7.29.7(@babel/core@7.29.7) '@babel/helper-plugin-utils': 7.29.7 @@ -10011,7 +10017,7 @@ snapshots: '@babel/parser': 7.29.8 '@babel/types': 7.29.8 - '@babel/traverse@7.29.8': + '@babel/traverse@7.29.8(supports-color@10.2.2)': dependencies: '@babel/code-frame': 7.29.7 '@babel/generator': 7.29.8 @@ -10359,14 +10365,14 @@ snapshots: '@esbuild/win32-x64@0.28.1': optional: true - '@eslint-community/eslint-utils@4.9.1(eslint@10.8.1(jiti@2.7.0))': + '@eslint-community/eslint-utils@4.9.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))': dependencies: - eslint: 10.8.1(jiti@2.7.0) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.2': {} - '@eslint/config-array@0.23.5': + '@eslint/config-array@0.23.5(supports-color@10.2.2)': dependencies: '@eslint/object-schema': 3.0.5 debug: 4.4.3(supports-color@10.2.2) @@ -10387,7 +10393,7 @@ snapshots: mdn-data: 2.29.0 source-map-js: 1.2.1 - '@eslint/eslintrc@3.3.6': + '@eslint/eslintrc@3.3.6(supports-color@10.2.2)': dependencies: ajv: 6.15.0 debug: 4.4.3(supports-color@10.2.2) @@ -10401,9 +10407,9 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@10.0.1(eslint@10.8.1(jiti@2.7.0))': + '@eslint/js@10.0.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))': optionalDependencies: - eslint: 10.8.1(jiti@2.7.0) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) '@eslint/object-schema@3.0.5': {} @@ -11032,14 +11038,14 @@ snapshots: '@intlify/core-base': 11.4.8 '@intlify/shared': 11.4.8 - '@intlify/eslint-plugin-vue-i18n@4.5.1(eslint@10.8.1(jiti@2.7.0))(jsonc-eslint-parser@3.1.0)(vue-eslint-parser@10.4.1(eslint@10.8.1(jiti@2.7.0)))(yaml-eslint-parser@2.1.0)': + '@intlify/eslint-plugin-vue-i18n@4.5.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(jsonc-eslint-parser@3.1.0)(supports-color@10.2.2)(vue-eslint-parser@10.4.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(yaml-eslint-parser@2.1.0)': dependencies: - '@eslint/eslintrc': 3.3.6 + '@eslint/eslintrc': 3.3.6(supports-color@10.2.2) '@intlify/core-base': 11.4.8 '@intlify/message-compiler': 11.4.8 debug: 4.4.3(supports-color@10.2.2) - eslint: 10.8.1(jiti@2.7.0) - eslint-compat-utils: 0.6.5(eslint@10.8.1(jiti@2.7.0)) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) + eslint-compat-utils: 0.6.5(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2)) glob: 10.5.0 globals: 17.7.0 ignore: 7.0.6 @@ -11051,7 +11057,7 @@ snapshots: parse5: 7.3.0 semver: 7.8.5 synckit: 0.11.13 - vue-eslint-parser: 10.4.1(eslint@10.8.1(jiti@2.7.0)) + vue-eslint-parser: 10.4.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) yaml-eslint-parser: 2.1.0 transitivePeerDependencies: - supports-color @@ -11910,9 +11916,9 @@ snapshots: '@sentry/replay': 10.65.0 '@sentry/replay-canvas': 10.65.0 - '@sentry/bundler-plugin-core@4.9.1': + '@sentry/bundler-plugin-core@4.9.1(supports-color@10.2.2)': dependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) '@sentry/babel-plugin-component-annotate': 4.9.1 '@sentry/cli': 2.58.6 dotenv: 16.6.1 @@ -11950,7 +11956,7 @@ snapshots: '@sentry/cli@2.58.6': dependencies: - https-proxy-agent: 5.0.1 + https-proxy-agent: 5.0.1(supports-color@10.2.2) node-fetch: 2.7.0 progress: 2.0.3 proxy-from-env: 1.1.0 @@ -11988,9 +11994,9 @@ snapshots: '@sentry/browser-utils': 10.65.0 '@sentry/core': 10.65.0 - '@sentry/vite-plugin@4.9.1': + '@sentry/vite-plugin@4.9.1(supports-color@10.2.2)': dependencies: - '@sentry/bundler-plugin-core': 4.9.1 + '@sentry/bundler-plugin-core': 4.9.1(supports-color@10.2.2) unplugin: 1.0.1 transitivePeerDependencies: - encoding @@ -12595,15 +12601,15 @@ snapshots: dependencies: '@types/node': 25.9.5 - '@typescript-eslint/eslint-plugin@8.67.0(@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3)': + '@typescript-eslint/eslint-plugin@8.67.0(@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3)': dependencies: '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/parser': 8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3) '@typescript-eslint/scope-manager': 8.67.0 - '@typescript-eslint/type-utils': 8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3) - '@typescript-eslint/utils': 8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/type-utils': 8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3) + '@typescript-eslint/utils': 8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3) '@typescript-eslint/visitor-keys': 8.67.0 - eslint: 10.8.1(jiti@2.7.0) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) ignore: 7.0.6 natural-compare: 1.4.0 ts-api-utils: 2.5.0(typescript@6.0.3) @@ -12611,19 +12617,19 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3)': + '@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3)': dependencies: '@typescript-eslint/scope-manager': 8.67.0 '@typescript-eslint/types': 8.67.0 '@typescript-eslint/typescript-estree': 8.67.0(typescript@6.0.3) '@typescript-eslint/visitor-keys': 8.67.0 debug: 4.4.3(supports-color@10.2.2) - eslint: 10.8.1(jiti@2.7.0) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.64.0(typescript@6.0.3)': + '@typescript-eslint/project-service@8.64.0(supports-color@10.2.2)(typescript@6.0.3)': dependencies: '@typescript-eslint/tsconfig-utils': 8.66.0(typescript@6.0.3) '@typescript-eslint/types': 8.66.0 @@ -12632,7 +12638,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.66.0(typescript@6.0.3)': + '@typescript-eslint/project-service@8.66.0(supports-color@10.2.2)(typescript@6.0.3)': dependencies: '@typescript-eslint/tsconfig-utils': 8.66.0(typescript@6.0.3) '@typescript-eslint/types': 8.66.0 @@ -12677,13 +12683,13 @@ snapshots: dependencies: typescript: 6.0.3 - '@typescript-eslint/type-utils@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3)': + '@typescript-eslint/type-utils@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3)': dependencies: '@typescript-eslint/types': 8.67.0 '@typescript-eslint/typescript-estree': 8.67.0(typescript@6.0.3) - '@typescript-eslint/utils': 8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/utils': 8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3) debug: 4.4.3(supports-color@10.2.2) - eslint: 10.8.1(jiti@2.7.0) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) ts-api-utils: 2.5.0(typescript@6.0.3) typescript: 6.0.3 transitivePeerDependencies: @@ -12695,9 +12701,9 @@ snapshots: '@typescript-eslint/types@8.67.0': {} - '@typescript-eslint/typescript-estree@8.64.0(typescript@6.0.3)': + '@typescript-eslint/typescript-estree@8.64.0(supports-color@10.2.2)(typescript@6.0.3)': dependencies: - '@typescript-eslint/project-service': 8.64.0(typescript@6.0.3) + '@typescript-eslint/project-service': 8.64.0(supports-color@10.2.2)(typescript@6.0.3) '@typescript-eslint/tsconfig-utils': 8.64.0(typescript@6.0.3) '@typescript-eslint/types': 8.64.0 '@typescript-eslint/visitor-keys': 8.64.0 @@ -12710,9 +12716,9 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.66.0(typescript@6.0.3)': + '@typescript-eslint/typescript-estree@8.66.0(supports-color@10.2.2)(typescript@6.0.3)': dependencies: - '@typescript-eslint/project-service': 8.66.0(typescript@6.0.3) + '@typescript-eslint/project-service': 8.66.0(supports-color@10.2.2)(typescript@6.0.3) '@typescript-eslint/tsconfig-utils': 8.66.0(typescript@6.0.3) '@typescript-eslint/types': 8.66.0 '@typescript-eslint/visitor-keys': 8.66.0 @@ -12740,35 +12746,35 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.64.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3)': + '@typescript-eslint/utils@8.64.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@6.0.3)': dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@10.8.1(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.9.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2)) '@typescript-eslint/scope-manager': 8.64.0 '@typescript-eslint/types': 8.64.0 - '@typescript-eslint/typescript-estree': 8.64.0(typescript@6.0.3) - eslint: 10.8.1(jiti@2.7.0) + '@typescript-eslint/typescript-estree': 8.64.0(supports-color@10.2.2)(typescript@6.0.3) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.66.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3)': + '@typescript-eslint/utils@8.66.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@6.0.3)': dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@10.8.1(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.9.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2)) '@typescript-eslint/scope-manager': 8.66.0 '@typescript-eslint/types': 8.66.0 - '@typescript-eslint/typescript-estree': 8.66.0(typescript@6.0.3) - eslint: 10.8.1(jiti@2.7.0) + '@typescript-eslint/typescript-estree': 8.66.0(supports-color@10.2.2)(typescript@6.0.3) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3)': + '@typescript-eslint/utils@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3)': dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@10.8.1(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.9.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2)) '@typescript-eslint/scope-manager': 8.67.0 '@typescript-eslint/types': 8.67.0 '@typescript-eslint/typescript-estree': 8.67.0(typescript@6.0.3) - eslint: 10.8.1(jiti@2.7.0) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) typescript: 6.0.3 transitivePeerDependencies: - supports-color @@ -12884,7 +12890,7 @@ snapshots: '@vitejs/plugin-vue-jsx@5.1.6(vite@8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0))(vue@3.5.41(typescript@6.0.3))': dependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/plugin-syntax-typescript': 7.29.7(@babel/core@7.29.7) '@babel/plugin-transform-typescript': 7.29.7(@babel/core@7.29.7) '@rolldown/pluginutils': 1.0.1 @@ -13058,13 +13064,13 @@ snapshots: '@babel/helper-plugin-utils': 7.29.7 '@babel/plugin-syntax-jsx': 7.29.7(@babel/core@7.29.7) '@babel/template': 7.29.7 - '@babel/traverse': 7.29.8 + '@babel/traverse': 7.29.8(supports-color@10.2.2) '@babel/types': 7.29.8 '@vue/babel-helper-vue-transform-on': 1.5.0 '@vue/babel-plugin-resolve-type': 1.5.0(@babel/core@7.29.7) '@vue/shared': 3.5.41 optionalDependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -13074,20 +13080,20 @@ snapshots: '@babel/helper-plugin-utils': 7.29.7 '@babel/plugin-syntax-jsx': 7.29.7(@babel/core@7.29.7) '@babel/template': 7.29.7 - '@babel/traverse': 7.29.8 + '@babel/traverse': 7.29.8(supports-color@10.2.2) '@babel/types': 7.29.8 '@vue/babel-helper-vue-transform-on': 2.0.1 '@vue/babel-plugin-resolve-type': 2.0.1(@babel/core@7.29.7) '@vue/shared': 3.5.41 optionalDependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) transitivePeerDependencies: - supports-color '@vue/babel-plugin-resolve-type@1.5.0(@babel/core@7.29.7)': dependencies: '@babel/code-frame': 7.29.7 - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-module-imports': 7.29.7 '@babel/helper-plugin-utils': 7.29.7 '@babel/parser': 7.29.8 @@ -13098,7 +13104,7 @@ snapshots: '@vue/babel-plugin-resolve-type@2.0.1(@babel/core@7.29.7)': dependencies: '@babel/code-frame': 7.29.7 - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/helper-module-imports': 7.29.7 '@babel/helper-plugin-utils': 7.29.7 '@babel/parser': 7.29.8 @@ -13244,13 +13250,13 @@ snapshots: '@vueuse/shared': 14.4.0(vue@3.5.41(typescript@6.0.3)) vue: 3.5.41(typescript@6.0.3) - '@vueuse/integrations@14.4.0(axios@1.18.1(debug@4.4.3))(change-case@5.4.4)(fuse.js@7.0.0)(vue@3.5.41(typescript@6.0.3))': + '@vueuse/integrations@14.4.0(axios@1.18.1(supports-color@10.2.2))(change-case@5.4.4)(fuse.js@7.0.0)(vue@3.5.41(typescript@6.0.3))': dependencies: '@vueuse/core': 14.4.0(vue@3.5.41(typescript@6.0.3)) '@vueuse/shared': 14.4.0(vue@3.5.41(typescript@6.0.3)) vue: 3.5.41(typescript@6.0.3) optionalDependencies: - axios: 1.18.1(debug@4.4.3) + axios: 1.18.1(supports-color@10.2.2) change-case: 5.4.4 fuse.js: 7.0.0 @@ -13309,7 +13315,7 @@ snapshots: base64-js: 1.5.1 pako: 2.1.0 - agent-base@6.0.2: + agent-base@6.0.2(supports-color@10.2.2): dependencies: debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: @@ -13557,11 +13563,21 @@ snapshots: dependencies: possible-typed-array-names: 1.1.0 - axios@1.18.1(debug@4.4.3): + axios@1.18.1(debug@4.4.3(supports-color@10.2.2)): dependencies: - follow-redirects: 1.16.0(debug@4.4.3) + follow-redirects: 1.16.0(debug@4.4.3(supports-color@10.2.2)) form-data: 4.0.6 - https-proxy-agent: 5.0.1 + https-proxy-agent: 5.0.1(supports-color@10.2.2) + proxy-from-env: 2.1.0 + transitivePeerDependencies: + - debug + - supports-color + + axios@1.18.1(supports-color@10.2.2): + dependencies: + follow-redirects: 1.16.0(debug@4.4.3(supports-color@10.2.2)) + form-data: 4.0.6 + https-proxy-agent: 5.0.1(supports-color@10.2.2) proxy-from-env: 2.1.0 transitivePeerDependencies: - debug @@ -14225,14 +14241,14 @@ snapshots: escape-string-regexp@5.0.0: {} - eslint-compat-utils@0.6.5(eslint@10.8.1(jiti@2.7.0)): + eslint-compat-utils@0.6.5(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2)): dependencies: - eslint: 10.8.1(jiti@2.7.0) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) semver: 7.8.5 - eslint-config-prettier@10.1.8(eslint@10.8.1(jiti@2.7.0)): + eslint-config-prettier@10.1.8(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2)): dependencies: - eslint: 10.8.1(jiti@2.7.0) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) eslint-import-context@0.1.9(unrs-resolver@1.12.2): dependencies: @@ -14241,10 +14257,10 @@ snapshots: optionalDependencies: unrs-resolver: 1.12.2 - eslint-import-resolver-typescript@4.4.5(eslint-plugin-import-x@4.17.1(@typescript-eslint/utils@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)))(eslint@10.8.1(jiti@2.7.0)): + eslint-import-resolver-typescript@4.4.5(eslint-plugin-import-x@4.17.1(@typescript-eslint/utils@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: debug: 4.4.3(supports-color@10.2.2) - eslint: 10.8.1(jiti@2.7.0) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) eslint-import-context: 0.1.9(unrs-resolver@1.12.2) get-tsconfig: 4.14.0 is-bun-module: 2.0.0 @@ -14252,11 +14268,11 @@ snapshots: tinyglobby: 0.2.17 unrs-resolver: 1.12.2 optionalDependencies: - eslint-plugin-import-x: 4.17.1(@typescript-eslint/utils@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)) + eslint-plugin-import-x: 4.17.1(@typescript-eslint/utils@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) transitivePeerDependencies: - supports-color - eslint-plugin-better-tailwindcss@4.7.0(eslint@10.8.1(jiti@2.7.0))(oxlint@1.77.0(oxlint-tsgolint@7.0.2001))(tailwindcss@4.3.2)(typescript@6.0.3): + eslint-plugin-better-tailwindcss@4.7.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(oxlint@1.77.0(oxlint-tsgolint@7.0.2001))(tailwindcss@4.3.2)(typescript@6.0.3): dependencies: '@eslint/css-tree': 4.0.5 '@valibot/to-json-schema': 1.7.1(valibot@1.4.2(typescript@6.0.3)) @@ -14268,18 +14284,18 @@ snapshots: tsconfig-paths-webpack-plugin: 4.2.0 valibot: 1.4.2(typescript@6.0.3) optionalDependencies: - eslint: 10.8.1(jiti@2.7.0) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) oxlint: 1.77.0(oxlint-tsgolint@7.0.2001) transitivePeerDependencies: - '@eslint/css' - typescript - eslint-plugin-import-x@4.17.1(@typescript-eslint/utils@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)): + eslint-plugin-import-x@4.17.1(@typescript-eslint/utils@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: '@typescript-eslint/types': 8.64.0 comment-parser: 1.4.7 debug: 4.4.3(supports-color@10.2.2) - eslint: 10.8.1(jiti@2.7.0) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) eslint-import-context: 0.1.9(unrs-resolver@1.12.2) is-glob: 4.0.3 minimatch: 9.0.9 @@ -14287,7 +14303,7 @@ snapshots: stable-hash-x: 0.2.0 unrs-resolver: 1.12.2 optionalDependencies: - '@typescript-eslint/utils': 8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/utils': 8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3) transitivePeerDependencies: - supports-color @@ -14296,48 +14312,48 @@ snapshots: jsonc-parser: 3.3.1 oxlint: 1.77.0(oxlint-tsgolint@7.0.2001) - eslint-plugin-playwright@2.11.0(eslint@10.8.1(jiti@2.7.0)): + eslint-plugin-playwright@2.11.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2)): dependencies: - eslint: 10.8.1(jiti@2.7.0) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) globals: 17.7.0 - eslint-plugin-storybook@10.5.8(eslint@10.8.1(jiti@2.7.0))(storybook@10.5.6(@types/react@19.2.17)(prettier@3.9.5)(react@19.2.8))(typescript@6.0.3): + eslint-plugin-storybook@10.5.8(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(storybook@10.5.6(@types/react@19.2.17)(prettier@3.9.5)(react@19.2.8))(supports-color@10.2.2)(typescript@6.0.3): dependencies: '@typescript-eslint/types': 8.66.0 - '@typescript-eslint/utils': 8.66.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3) - eslint: 10.8.1(jiti@2.7.0) + '@typescript-eslint/utils': 8.66.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@6.0.3) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) storybook: 10.5.6(@types/react@19.2.17)(prettier@3.9.5)(react@19.2.8) transitivePeerDependencies: - supports-color - typescript - eslint-plugin-testing-library@7.16.2(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3): + eslint-plugin-testing-library@7.16.2(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@6.0.3): dependencies: '@typescript-eslint/scope-manager': 8.64.0 - '@typescript-eslint/utils': 8.64.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3) - eslint: 10.8.1(jiti@2.7.0) + '@typescript-eslint/utils': 8.64.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@6.0.3) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) transitivePeerDependencies: - supports-color - typescript - eslint-plugin-unused-imports@4.4.1(@typescript-eslint/eslint-plugin@8.67.0(@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)): + eslint-plugin-unused-imports@4.4.1(@typescript-eslint/eslint-plugin@8.67.0(@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2)): dependencies: - eslint: 10.8.1(jiti@2.7.0) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) optionalDependencies: - '@typescript-eslint/eslint-plugin': 8.67.0(@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/eslint-plugin': 8.67.0(@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3) - eslint-plugin-vue@10.10.0(@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0))(vue-eslint-parser@10.4.1(eslint@10.8.1(jiti@2.7.0))): + eslint-plugin-vue@10.10.0(@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(vue-eslint-parser@10.4.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)): dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@10.8.1(jiti@2.7.0)) - eslint: 10.8.1(jiti@2.7.0) + '@eslint-community/eslint-utils': 4.9.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2)) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) natural-compare: 1.4.0 nth-check: 2.1.1 postcss-selector-parser: 7.1.4 semver: 7.8.5 - vue-eslint-parser: 10.4.1(eslint@10.8.1(jiti@2.7.0)) + vue-eslint-parser: 10.4.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) xml-name-validator: 5.0.0 optionalDependencies: - '@typescript-eslint/parser': 8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/parser': 8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3) eslint-scope@9.1.2: dependencies: @@ -14352,11 +14368,11 @@ snapshots: eslint-visitor-keys@5.0.1: {} - eslint@10.8.1(jiti@2.7.0): + eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2): dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@10.8.1(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.9.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2)) '@eslint-community/regexpp': 4.12.2 - '@eslint/config-array': 0.23.5 + '@eslint/config-array': 0.23.5(supports-color@10.2.2) '@eslint/config-helpers': 0.7.0 '@eslint/core': 1.2.1 '@eslint/plugin-kit': 0.7.2 @@ -14643,7 +14659,7 @@ snapshots: flattie@1.1.1: {} - follow-redirects@1.16.0(debug@4.4.3): + follow-redirects@1.16.0(debug@4.4.3(supports-color@10.2.2)): optionalDependencies: debug: 4.4.3(supports-color@10.2.2) @@ -15031,9 +15047,9 @@ snapshots: http-parser-js@0.5.10: {} - https-proxy-agent@5.0.1: + https-proxy-agent@5.0.1(supports-color@10.2.2): dependencies: - agent-base: 6.0.2 + agent-base: 6.0.2(supports-color@10.2.2) debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -17461,7 +17477,7 @@ snapshots: automation-events: 7.1.19 tslib: 2.8.1 - start-server-and-test@3.0.12: + start-server-and-test@3.0.12(supports-color@10.2.2): dependencies: arg: 5.0.2 check-more-types: 2.24.0 @@ -17469,7 +17485,7 @@ snapshots: execa: 5.1.1 lazy-ass: 2.0.3 tree-kill: 1.2.2 - wait-on: 9.1.0(debug@4.4.3) + wait-on: 9.1.0(debug@4.4.3(supports-color@10.2.2)) transitivePeerDependencies: - supports-color @@ -17571,7 +17587,7 @@ snapshots: dependencies: inline-style-parser: 0.2.7 - stylelint@17.14.0(typescript@6.0.3): + stylelint@17.14.0(supports-color@10.2.2)(typescript@6.0.3): dependencies: '@csstools/css-calc': 3.2.1(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0) '@csstools/css-parser-algorithms': 4.0.0(@csstools/css-tokenizer@4.0.0) @@ -17820,13 +17836,13 @@ snapshots: dependencies: semver: 7.8.5 - typescript-eslint@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3): + typescript-eslint@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.67.0(@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3) - '@typescript-eslint/parser': 8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/eslint-plugin': 8.67.0(@typescript-eslint/parser@8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3))(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3) + '@typescript-eslint/parser': 8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3) '@typescript-eslint/typescript-estree': 8.67.0(typescript@6.0.3) - '@typescript-eslint/utils': 8.67.0(eslint@10.8.1(jiti@2.7.0))(typescript@6.0.3) - eslint: 10.8.1(jiti@2.7.0) + '@typescript-eslint/utils': 8.67.0(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(typescript@6.0.3) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) typescript: 6.0.3 transitivePeerDependencies: - supports-color @@ -17921,7 +17937,7 @@ snapshots: universalify@2.0.1: {} - unplugin-dts@1.0.3(@microsoft/api-extractor@7.58.9(@types/node@25.9.5))(@vue/language-core@3.3.9)(esbuild@0.28.1)(rolldown@1.2.3)(typescript@6.0.3)(vite@8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0)): + unplugin-dts@1.0.3(@microsoft/api-extractor@7.58.9(@types/node@25.9.5))(@vue/language-core@3.3.9)(esbuild@0.28.1)(rolldown@1.2.3)(supports-color@10.2.2)(typescript@6.0.3)(vite@8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0)): dependencies: '@rollup/pluginutils': 5.4.0 '@volar/typescript': 2.4.28 @@ -18117,9 +18133,9 @@ snapshots: dependencies: vite: 8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0) - vite-plugin-dts@5.0.3(@microsoft/api-extractor@7.58.9(@types/node@25.9.5))(@vue/language-core@3.3.9)(esbuild@0.28.1)(rolldown@1.2.3)(typescript@6.0.3)(vite@8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0)): + vite-plugin-dts@5.0.3(@microsoft/api-extractor@7.58.9(@types/node@25.9.5))(@vue/language-core@3.3.9)(esbuild@0.28.1)(rolldown@1.2.3)(supports-color@10.2.2)(typescript@6.0.3)(vite@8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0)): dependencies: - unplugin-dts: 1.0.3(@microsoft/api-extractor@7.58.9(@types/node@25.9.5))(@vue/language-core@3.3.9)(esbuild@0.28.1)(rolldown@1.2.3)(typescript@6.0.3)(vite@8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0)) + unplugin-dts: 1.0.3(@microsoft/api-extractor@7.58.9(@types/node@25.9.5))(@vue/language-core@3.3.9)(esbuild@0.28.1)(rolldown@1.2.3)(supports-color@10.2.2)(typescript@6.0.3)(vite@8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0)) optionalDependencies: '@microsoft/api-extractor': 7.58.9(@types/node@25.9.5) vite: 8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0) @@ -18177,7 +18193,7 @@ snapshots: vite-plugin-vue-inspector@6.0.0(vite@8.2.1(@types/node@25.9.5)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0)(tsx@4.23.1)(yaml@2.9.0)): dependencies: - '@babel/core': 7.29.7 + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/plugin-proposal-decorators': 7.29.7(@babel/core@7.29.7) '@babel/plugin-syntax-import-attributes': 7.29.7(@babel/core@7.29.7) '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.29.7) @@ -18410,10 +18426,10 @@ snapshots: vue: 3.5.41(typescript@6.0.3) vue-inbrowser-compiler-independent-utils: 4.71.1(vue@3.5.41(typescript@6.0.3)) - vue-eslint-parser@10.4.1(eslint@10.8.1(jiti@2.7.0)): + vue-eslint-parser@10.4.1(eslint@10.8.1(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: debug: 4.4.3(supports-color@10.2.2) - eslint: 10.8.1(jiti@2.7.0) + eslint: 10.8.1(jiti@2.7.0)(supports-color@10.2.2) eslint-scope: 9.1.2 eslint-visitor-keys: 5.0.1 espree: 11.2.0 @@ -18505,9 +18521,9 @@ snapshots: dependencies: xml-name-validator: 5.0.0 - wait-on@9.1.0(debug@4.4.3): + wait-on@9.1.0(debug@4.4.3(supports-color@10.2.2)): dependencies: - axios: 1.18.1(debug@4.4.3) + axios: 1.18.1(debug@4.4.3(supports-color@10.2.2)) joi: 18.2.3 lodash: 4.18.1 minimist: 1.2.8 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 58b4fbb1478..8eda2be7b28 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -73,6 +73,7 @@ catalog: '@webgpu/types': ^0.1.66 ag-psd: ^31.0.2 algoliasearch: ^5.21.0 + ajv: ^8.18.0 astro: ^7.2.1 axios: ^1.15.2 class-variance-authority: ^0.7.1 diff --git a/src/schemas/docframe/openapi.test.ts b/src/schemas/docframe/openapi.test.ts index 1167060304a..1f93eea8499 100644 --- a/src/schemas/docframe/openapi.test.ts +++ b/src/schemas/docframe/openapi.test.ts @@ -1,27 +1,22 @@ import { readFileSync } from 'node:fs' import { join } from 'node:path' +import Ajv from 'ajv' import { parse } from 'yaml' import { describe, expect, it } from 'vitest' -type ObjectSchema = { - properties?: Record - required?: string[] - type?: string - items?: ObjectSchema - minLength?: number -} - const openApi = parse( readFileSync( join(process.cwd(), 'src/schemas/docframe/openapi.yaml'), 'utf-8' ) ) as { - components: { schemas: Record } + components: { schemas: Record } } -const docUpdateSchema = openApi.components.schemas.DocUpdateData -const opIdsSchema = docUpdateSchema.properties?.op_ids +const validateDocUpdate = new Ajv({ strict: false }).compile({ + $ref: '#/components/schemas/DocUpdateData', + components: openApi.components +}) const validDocUpdateFixtures = [ { v: 1, workflow_id: 'wf-1', seq: 1, update_b64: 'AQ==' }, @@ -35,38 +30,27 @@ const validDocUpdateFixtures = [ ] const invalidDocUpdateFixtures = [ - { v: 1, workflow_id: 'wf-1', seq: 3, update_b64: 'AQ==', op_ids: [''] }, - { v: 1, workflow_id: 'wf-1', seq: 4, update_b64: 'AQ==', op_ids: [42] } + { workflow_id: 'wf-1', seq: 3, update_b64: 'AQ==' }, + { + v: 1, + workflow_id: 'wf-1', + seq: 4, + update_b64: 'AQ==', + unexpected: true + }, + { v: 1, workflow_id: 'wf-1', seq: 5, update_b64: 'AQ==', op_ids: [''] }, + { v: 1, workflow_id: 'wf-1', seq: 6, update_b64: 'AQ==', op_ids: [42] } ] -function opIdsMatchesSchema(value: unknown): boolean { - if (value === undefined) return true - if (opIdsSchema?.type !== 'array') return false - if (!Array.isArray(value)) return false - - return value.every( - (item) => - typeof item === opIdsSchema.items?.type && - item.length >= (opIdsSchema.items.minLength ?? 0) - ) -} - describe('docframe OpenAPI schema', () => { - it('keeps doc_update operation ids as optional non-empty strings', () => { - expect(docUpdateSchema.required).not.toContain('op_ids') - expect(opIdsSchema).toMatchObject({ - type: 'array', - items: { type: 'string', minLength: 1 } - }) - expect( - validDocUpdateFixtures.every((fixture) => - opIdsMatchesSchema(fixture.op_ids) - ) - ).toBe(true) - expect( - invalidDocUpdateFixtures.every( - (fixture) => !opIdsMatchesSchema(fixture.op_ids) - ) - ).toBe(true) + it('validates complete doc_update payloads', () => { + for (const fixture of validDocUpdateFixtures) { + expect(validateDocUpdate(fixture)).toBe(true) + } + + for (const fixture of invalidDocUpdateFixtures) { + expect(validateDocUpdate(fixture)).toBe(false) + expect(validateDocUpdate.errors).not.toBeNull() + } }) }) From 0e6808fe0249cee9f66c446f3e5c542fc00e2250 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Tue, 1 Sep 2026 10:04:05 +0000 Subject: [PATCH 09/16] test: remove duplicate draft patch applier Addresses review feedback: https://github.com/Comfy-Org/ComfyUI_frontend/pull/16191#discussion_r3894413452 --- .../agent/crdt/__fixtures__/add-node.json | 37 ------------ .../agent/crdt/agentFixtureHarness.test.ts | 56 ------------------- 2 files changed, 93 deletions(-) delete mode 100644 src/workbench/extensions/agent/crdt/__fixtures__/add-node.json delete mode 100644 src/workbench/extensions/agent/crdt/agentFixtureHarness.test.ts diff --git a/src/workbench/extensions/agent/crdt/__fixtures__/add-node.json b/src/workbench/extensions/agent/crdt/__fixtures__/add-node.json deleted file mode 100644 index a646838b1d7..00000000000 --- a/src/workbench/extensions/agent/crdt/__fixtures__/add-node.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "scenario": "add-node", - "frames": [ - { - "type": "draft_patch", - "data": { - "base_version": 10, - "version": 11, - "workflow_id": "fixture-workflow-native-folders", - "message_id": "fixture-message-add-node", - "thread_id": "fixture-thread", - "content": { - "last_node_id": 1, - "links": [], - "nodes": [ - { - "id": 1, - "type": "LoadImage", - "pos": [100, 100], - "size": [315, 314], - "flags": {}, - "order": 0, - "mode": 0, - "inputs": [], - "outputs": [ - { "name": "IMAGE", "type": "IMAGE", "links": [] }, - { "name": "MASK", "type": "MASK", "links": [] } - ], - "properties": {}, - "widgets_values": ["reference.png", "image"] - } - ] - } - } - } - ] -} diff --git a/src/workbench/extensions/agent/crdt/agentFixtureHarness.test.ts b/src/workbench/extensions/agent/crdt/agentFixtureHarness.test.ts deleted file mode 100644 index 893a5fce5aa..00000000000 --- a/src/workbench/extensions/agent/crdt/agentFixtureHarness.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' - -import addNodeFixture from './__fixtures__/add-node.json' -import type { - AgentFixtureAdapter, - AgentResponseFixture, - FixtureNode, - RemoteMutationContext -} from './agentFixtureHarness' -import { replayAgentFixture } from './agentFixtureHarness' - -class TestGraphAdapter implements AgentFixtureAdapter { - readonly nodes = new Map() - readonly emitLocalOp = vi.fn() - private activeContext: RemoteMutationContext | undefined - - readonly graphMutations = { - batch: (context: RemoteMutationContext, apply: () => void): void => { - this.activeContext = context - try { - apply() - } finally { - this.activeContext = undefined - } - } - } - - applyDraftPatch( - workflow: { readonly nodes: readonly FixtureNode[] }, - context: RemoteMutationContext - ): void { - expect(context).toBe(this.activeContext) - for (const node of workflow.nodes) { - this.nodes.set(node.id, node) - if (context.source !== 'agent-remote') this.emitLocalOp(node) - } - } -} - -describe('replayAgentFixture', () => { - it('applies an add-node response with call-carried echo suppression', () => { - const adapter = new TestGraphAdapter() - - replayAgentFixture( - addNodeFixture as AgentResponseFixture, - adapter, - 'fixture-actor' - ) - - expect(adapter.nodes.get(1)).toMatchObject({ - type: 'LoadImage', - widgets_values: ['reference.png', 'image'] - }) - expect(adapter.emitLocalOp).not.toHaveBeenCalled() - }) -}) From 21c537d3b94891e533623577769689471bb6acc8 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Tue, 1 Sep 2026 10:04:33 +0000 Subject: [PATCH 10/16] test: remove handwritten DocFrame fixture types Addresses review feedback: https://github.com/Comfy-Org/ComfyUI_frontend/pull/16191#discussion_r3894413461 --- .../agent/crdt/agentFixtureHarness.ts | 57 ------------------- 1 file changed, 57 deletions(-) delete mode 100644 src/workbench/extensions/agent/crdt/agentFixtureHarness.ts diff --git a/src/workbench/extensions/agent/crdt/agentFixtureHarness.ts b/src/workbench/extensions/agent/crdt/agentFixtureHarness.ts deleted file mode 100644 index acc7c129acb..00000000000 --- a/src/workbench/extensions/agent/crdt/agentFixtureHarness.ts +++ /dev/null @@ -1,57 +0,0 @@ -export interface FixtureNode { - readonly id: number | string - readonly type: string - readonly widgets_values: readonly unknown[] -} - -interface FixtureWorkflow { - readonly nodes: readonly FixtureNode[] -} - -interface DraftPatchFrame { - readonly type: 'draft_patch' - readonly data: { - readonly message_id: string - readonly thread_id: string - readonly content: FixtureWorkflow - } -} - -export interface AgentResponseFixture { - readonly scenario: string - readonly frames: readonly DraftPatchFrame[] -} - -export interface RemoteMutationContext { - readonly source: 'agent-remote' - readonly actor: string - readonly op_id: string -} - -export interface AgentFixtureAdapter { - readonly graphMutations: { - batch(context: RemoteMutationContext, apply: () => void): void - } - applyDraftPatch( - workflow: FixtureWorkflow, - context: RemoteMutationContext - ): void -} - -export function replayAgentFixture( - fixture: AgentResponseFixture, - adapter: AgentFixtureAdapter, - actor = 'fixture-agent' -): void { - for (const frame of fixture.frames) { - const context: RemoteMutationContext = { - source: 'agent-remote', - actor, - op_id: frame.data.message_id - } - - adapter.graphMutations.batch(context, () => { - adapter.applyDraftPatch(frame.data.content, context) - }) - } -} From 80696063661a29aad2c89ce9306542c85fee881f Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Fri, 4 Sep 2026 08:41:57 +0000 Subject: [PATCH 11/16] fix(types): bound doc update operation ids --- src/schemas/docframe/openapi.test.ts | 29 ++++++++++++++++++++++++---- src/schemas/docframe/openapi.yaml | 2 ++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/schemas/docframe/openapi.test.ts b/src/schemas/docframe/openapi.test.ts index 1f93eea8499..812ed489f4b 100644 --- a/src/schemas/docframe/openapi.test.ts +++ b/src/schemas/docframe/openapi.test.ts @@ -26,20 +26,41 @@ const validDocUpdateFixtures = [ seq: 2, update_b64: 'AQ==', op_ids: ['op-1', 'op-2'] + }, + { + v: 1, + workflow_id: 'wf-1', + seq: 3, + update_b64: 'AQ==', + op_ids: Array.from({ length: 256 }, () => 'x'.repeat(128)) } ] const invalidDocUpdateFixtures = [ - { workflow_id: 'wf-1', seq: 3, update_b64: 'AQ==' }, + { workflow_id: 'wf-1', seq: 4, update_b64: 'AQ==' }, { v: 1, workflow_id: 'wf-1', - seq: 4, + seq: 5, update_b64: 'AQ==', unexpected: true }, - { v: 1, workflow_id: 'wf-1', seq: 5, update_b64: 'AQ==', op_ids: [''] }, - { v: 1, workflow_id: 'wf-1', seq: 6, update_b64: 'AQ==', op_ids: [42] } + { v: 1, workflow_id: 'wf-1', seq: 6, update_b64: 'AQ==', op_ids: [''] }, + { v: 1, workflow_id: 'wf-1', seq: 7, update_b64: 'AQ==', op_ids: [42] }, + { + v: 1, + workflow_id: 'wf-1', + seq: 8, + update_b64: 'AQ==', + op_ids: Array.from({ length: 257 }, () => 'op') + }, + { + v: 1, + workflow_id: 'wf-1', + seq: 9, + update_b64: 'AQ==', + op_ids: ['x'.repeat(129)] + } ] describe('docframe OpenAPI schema', () => { diff --git a/src/schemas/docframe/openapi.yaml b/src/schemas/docframe/openapi.yaml index 9ccd201d96f..d20c05f9ac9 100644 --- a/src/schemas/docframe/openapi.yaml +++ b/src/schemas/docframe/openapi.yaml @@ -229,9 +229,11 @@ components: type: string op_ids: type: array + maxItems: 256 items: type: string minLength: 1 + maxLength: 128 description: Creator-minted operation ids whose effects are included in this update. From 30dded3899e61fd084dfd28541a7c19350765a8e Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Thu, 10 Sep 2026 21:24:20 -0700 Subject: [PATCH 12/16] chore: drop frontend-local docframe schema and typegen The wire contract is owned by cloud services/ingest/openapi.yaml, and the generated TypeScript projection of it is already committed here as packages/ingest-types (ServerDocFrame, DocUpdateFrame/Data, DocResetFrame/Data, DocOpsResultFrame/Data, DocOpFailure) with matching Zod validators, kept fresh by the automated cloud sync. The local schema was a second definition that had already drifted: it declared a doc_update op_ids field the wire schema does not carry, and the freshness check could not detect that because it only compared the local schema against its own output. Addresses review feedback: https://github.com/Comfy-Org/ComfyUI_frontend/pull/16191#discussion_r3912720460 https://github.com/Comfy-Org/ComfyUI_frontend/pull/16191#discussion_r3936081202 --- .github/workflows/ci-lint-format.yaml | 3 - .../in-app-agent-docframe-typegen.md | 40 +- package.json | 3 - pnpm-workspace.yaml | 2 - scripts/check-docframe-typegen.sh | 8 - src/schemas/docframe/generated/docframe.d.ts | 302 -------- src/schemas/docframe/openapi.test.ts | 77 -- src/schemas/docframe/openapi.yaml | 669 ------------------ 8 files changed, 24 insertions(+), 1080 deletions(-) delete mode 100755 scripts/check-docframe-typegen.sh delete mode 100644 src/schemas/docframe/generated/docframe.d.ts delete mode 100644 src/schemas/docframe/openapi.test.ts delete mode 100644 src/schemas/docframe/openapi.yaml diff --git a/.github/workflows/ci-lint-format.yaml b/.github/workflows/ci-lint-format.yaml index 6038f2c48ef..6c8b0bbaccc 100644 --- a/.github/workflows/ci-lint-format.yaml +++ b/.github/workflows/ci-lint-format.yaml @@ -34,9 +34,6 @@ jobs: - name: Setup frontend uses: ./.github/actions/setup-frontend - - name: Verify generated DocFrame types - run: scripts/check-docframe-typegen.sh - - name: Run ESLint with auto-fix run: pnpm lint:fix diff --git a/docs/architecture/in-app-agent-docframe-typegen.md b/docs/architecture/in-app-agent-docframe-typegen.md index 78a0df02269..e24896d8279 100644 --- a/docs/architecture/in-app-agent-docframe-typegen.md +++ b/docs/architecture/in-app-agent-docframe-typegen.md @@ -1,37 +1,45 @@ # In-App Agent doc-frame type-generation contract -This document cross-references the type-generation work in frontend PR #16191. The wire contract -is governed by workspace ADR-017 and cloud PR #7730; this frontend branch owns the generated -consumer surface and its freshness guard, not a second protocol definition. +The CRDT doc-frame wire contract is owned by Comfy Cloud's ingest service. The frontend consumes it +as a generated artifact and does not maintain a second protocol definition. ## Contract ```text -cloud services/ingest/openapi.yaml - ├──▶ generated cloud doc-frame models - ├──▶ FE projection / generated ingest types - └──▶ generated smoke client - all outputs must pass freshness checks +cloud services/ingest/openapi.yaml (authority) + ├──▶ cloud common/websocket/docframes (generated Go models) + └──▶ packages/ingest-types (generated TS types + Zod schemas) + └──▶ src/workbench/extensions/agent/crdt ``` -- `doc_update`, `doc_reset`, and `doc_ops_result` are derived from the cloud OpenAPI source. +- `ServerDocFrame`, `DocUpdateFrame`/`DocUpdateData`, `DocResetFrame`/`DocResetData`, + `DocOpsResultFrame`/`DocOpsResultData`, and `DocOpFailure` come from `@comfyorg/ingest-types`. + `@comfyorg/ingest-types/zod` exposes the matching runtime validators. +- `packages/ingest-types` is regenerated from the cloud spec by an automated sync + (`[chore] Update Ingest API types from cloud@`). That sync is the freshness mechanism; the + frontend does not re-derive the schema locally. - `doc_ops_result.data.failed` is the wire spelling. A frontend adapter may expose `failure`, but that mapping must remain at the adapter boundary. - Generated types describe the `{type,data}` bytes; they do not implement CRDT application, authority, or mutation semantics. -- Any schema change regenerates every committed output and must leave the dual-directory freshness - gate green before the contract is considered landed. + +## Validation the generated schema cannot provide + +`update_b64` is declared `type: string` with a base64 `contentEncoding` annotation. Both OpenAPI +and the Zod schema generated from it treat that annotation as documentation, so neither rejects a +malformed payload. Cloud validates base64 in code (`validateB64` in `common/websocket/messages`), +and the frontend does the same in `parseServerDocFrame`. Schema conformance is therefore necessary +but not sufficient, and `docFrameWireContract.test.ts` pins both halves. ## References -- Workspace ADR-017: [OpenAPI doc-frame authority](https://github.com/christian-byrne/in-app-agent-program/blob/main/decisions/ADR-017-docframe-openapi-authority-and-typegen.md). -- Cloud PR [#7730](https://github.com/Comfy-Org/cloud/pull/7730). -- Workspace verification: `reports/audit/verify-dir-12-openapi-landing-current.md`. -- Related frontend follower boundary: `docs/adr/0019-in-app-agent-crdt-follower-and-distribution.md`. +- Cloud PR [#7730](https://github.com/Comfy-Org/cloud/pull/7730) — generated CRDT doc-frame wire types. +- `docs/guidance/typescript.md` — server/API response types come from the generated shared packages. +- `docs/adr/CRDT-FOLLOWER-0025-in-app-agent-crdt-follower-and-distribution-resolved-boundaries.md` — + frontend follower boundary. ## Glossary - **Doc frame:** a CRDT message carried by the WebSocket `{type,data}` envelope. - **Wire spelling:** the serialized field name shared by all producers and consumers. -- **Freshness gate:** CI that regenerates outputs and rejects stale committed files. - **Adapter boundary:** the one place a consumer may map a wire name to an internal name. diff --git a/package.json b/package.json index 49ec89fb1c0..5a0f5d6d677 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "format:check": "oxfmt --check", "format": "oxfmt --write", "json-schema": "tsx scripts/generate-json-schema.ts", - "typegen:docframe": "openapi-typescript src/schemas/docframe/openapi.yaml --output src/schemas/docframe/generated/docframe.d.ts && oxfmt --write src/schemas/docframe/generated/docframe.d.ts", "knip:no-cache": "knip", "knip": "knip --cache", "lint:fix:no-cache": "pnpm oxlint:main --fix && pnpm oxlint:audit && eslint src apps/website --fix", @@ -183,7 +182,6 @@ "@vitest/coverage-v8": "catalog:", "@vitest/ui": "catalog:", "@webgpu/types": "catalog:", - "ajv": "catalog:", "cross-env": "catalog:", "eslint": "catalog:", "eslint-config-prettier": "catalog:", @@ -210,7 +208,6 @@ "mixpanel-browser": "catalog:", "monocart-coverage-reports": "catalog:", "openai": "catalog:", - "openapi-typescript": "catalog:", "oxfmt": "catalog:", "oxlint": "catalog:", "oxlint-tsgolint": "catalog:", diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 500a7928fd7..00c4d467762 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -70,7 +70,6 @@ catalog: ajv: ^8.20.0 ag-psd: ^31.0.2 algoliasearch: ^5.21.0 - ajv: ^8.18.0 astro: ^7.2.1 axios: ^1.15.2 class-variance-authority: ^0.7.1 @@ -110,7 +109,6 @@ catalog: mixpanel-browser: ^2.71.0 monocart-coverage-reports: ^2.12.9 openai: ^7.4.0 - openapi-typescript: ^7.13.0 oxfmt: ^0.59.0 oxlint: ^1.77.0 oxlint-tsgolint: ^7.0.2001 diff --git a/scripts/check-docframe-typegen.sh b/scripts/check-docframe-typegen.sh deleted file mode 100755 index e57d7685f00..00000000000 --- a/scripts/check-docframe-typegen.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -repo_root="$(git rev-parse --show-toplevel)" -cd "$repo_root" - -pnpm typegen:docframe -git diff --exit-code -- src/schemas/docframe/generated/ diff --git a/src/schemas/docframe/generated/docframe.d.ts b/src/schemas/docframe/generated/docframe.d.ts deleted file mode 100644 index 9ad6886105c..00000000000 --- a/src/schemas/docframe/generated/docframe.d.ts +++ /dev/null @@ -1,302 +0,0 @@ -/** - * This file was auto-generated by openapi-typescript. - * Do not make direct changes to the file. - */ - -export type paths = Record -export type webhooks = Record -export interface components { - schemas: { - /** @description Any doc-frame envelope. Provenance: inventory "Message inventory" and "OpenAPI handoff notes" §1. */ - DocFrame: - | components['schemas']['DocSubscribeFrame'] - | components['schemas']['DocSubscribedFrame'] - | components['schemas']['DocUnsubscribeFrame'] - | components['schemas']['DocUpdateFrame'] - | components['schemas']['DocOpsFrame'] - | components['schemas']['DocOpsResultFrame'] - | components['schemas']['DocResetFrame'] - | components['schemas']['AwarenessFrame'] - /** @description Client-originated doc frames accepted by cloud ingress. */ - DocFrameClientToServer: - | components['schemas']['DocSubscribeFrame'] - | components['schemas']['DocUnsubscribeFrame'] - | components['schemas']['DocOpsFrame'] - | components['schemas']['AwarenessFrame'] - /** @description Server-originated doc frames parsed by the browser follower. */ - DocFrameServerToClient: - | components['schemas']['DocSubscribedFrame'] - | components['schemas']['DocUpdateFrame'] - | components['schemas']['DocOpsResultFrame'] - | components['schemas']['DocResetFrame'] - | components['schemas']['AwarenessFrame'] - /** - * @description Exactly 1 on the current /ws protocol. - * @constant - */ - ProtocolVersion: 1 - /** @description Workflow identifier. The implementation additionally rejects control and channel-special characters. Provenance: inventory "Validation and size limits". */ - WorkflowId: string - /** @description Authoritative document sequence number. */ - Sequence: number - /** @description Standard-base64 data, capped at 8 MiB encoded. */ - Base64Payload: string - DocSubscribeFrame: { - /** - * @description discriminator enum property added by openapi-typescript - * @enum {string} - */ - type: 'doc_subscribe' - data: components['schemas']['DocSubscribeData'] - } - DocSubscribeData: { - v: components['schemas']['ProtocolVersion'] - workflow_id: components['schemas']['WorkflowId'] - /** @description Optional Yjs state vector. Empty or absent requests full catch-up; the current FE always emits this field. Provenance: inventory "Message inventory" row doc_subscribe. */ - state_vector_b64?: components['schemas']['Base64Payload'] - } - DocSubscribedFrame: { - /** - * @description discriminator enum property added by openapi-typescript - * @enum {string} - */ - type: 'doc_subscribed' - data: components['schemas']['DocSubscribedData'] - } - /** @description Provenance inventory "Message inventory" row doc_subscribed. */ - DocSubscribedData: { - v: components['schemas']['ProtocolVersion'] - workflow_id: components['schemas']['WorkflowId'] - ok: boolean - seq?: components['schemas']['Sequence'] - code?: string - message?: string - } - DocUnsubscribeFrame: { - /** - * @description discriminator enum property added by openapi-typescript - * @enum {string} - */ - type: 'doc_unsubscribe' - data: components['schemas']['DocUnsubscribeData'] - } - /** @description Provenance inventory "Message inventory" row doc_unsubscribe. */ - DocUnsubscribeData: { - v: components['schemas']['ProtocolVersion'] - workflow_id: components['schemas']['WorkflowId'] - } - DocUpdateFrame: { - /** - * @description discriminator enum property added by openapi-typescript - * @enum {string} - */ - type: 'doc_update' - data: components['schemas']['DocUpdateData'] - } - /** @description Provenance inventory "Message inventory" row doc_update. */ - DocUpdateData: { - v: components['schemas']['ProtocolVersion'] - workflow_id: components['schemas']['WorkflowId'] - seq: components['schemas']['Sequence'] - /** @description Non-empty Yjs binary update encoded as standard base64. */ - update_b64: components['schemas']['Base64Payload'] - actor?: string - /** @description Creator-minted operation ids whose effects are included in this update. */ - op_ids?: string[] - } - DocOpsFrame: { - /** - * @description discriminator enum property added by openapi-typescript - * @enum {string} - */ - type: 'doc_ops' - data: components['schemas']['DocOpsData'] - } - /** @description Provenance inventory "Nested doc_ops.ops[*] inventory". */ - DocOpsData: { - v: components['schemas']['ProtocolVersion'] - workflow_id: components['schemas']['WorkflowId'] - /** @description Tab identity; whitespace, colon, and controls are rejected. */ - tab: string - /** @description Semantic operations, with a 4 MiB aggregate encoded-size cap. The WS relay validates the common envelope but treats operation interiors as opaque; the five variants are the executable 02b producer vocabulary. */ - ops: components['schemas']['DocOp'][] - } - DocOpsResultFrame: { - /** - * @description discriminator enum property added by openapi-typescript - * @enum {string} - */ - type: 'doc_ops_result' - data: components['schemas']['DocOpsResultData'] - } - /** @description Optional arrays follow Go omitempty behavior; the FE normalizes absent arrays to empty arrays. Only the canonical cloud failure shape is modeled. Provenance: inventory "Message inventory" row doc_ops_result. */ - DocOpsResultData: { - v: components['schemas']['ProtocolVersion'] - workflow_id: components['schemas']['WorkflowId'] - ok: boolean - seq?: components['schemas']['Sequence'] - applied?: string[] - skipped?: string[] - failed?: components['schemas']['DocOpFailure'] - code?: string - message?: string - } - DocOpFailure: { - index: number - op_id?: string - code: string - message: string - } - DocResetFrame: { - /** - * @description discriminator enum property added by openapi-typescript - * @enum {string} - */ - type: 'doc_reset' - data: components['schemas']['DocResetData'] - } - /** @description Explicit lineage break; carries no update or snapshot. Provenance: inventory "Message inventory" row doc_reset. */ - DocResetData: { - v: components['schemas']['ProtocolVersion'] - workflow_id: components['schemas']['WorkflowId'] - seq: components['schemas']['Sequence'] - actor?: string - } - AwarenessFrame: { - /** - * @description discriminator enum property added by openapi-typescript - * @enum {string} - */ - type: 'awareness' - data: components['schemas']['AwarenessData'] - } - /** @description Bidirectional protocol capability; neither inspected FE revision emits it. Provenance: inventory "Message inventory" row awareness. */ - AwarenessData: { - v: components['schemas']['ProtocolVersion'] - workflow_id: components['schemas']['WorkflowId'] - actor: string - /** @description Ephemeral presence state, capped at 8 KiB encoded JSON. */ - state?: Record - /** @description Unix seconds; server overwrites/stamps expiry before fanout. */ - expires_at?: number - } - /** @description Five operation payloads emitted by the inspected 02b executable lineage. Current checked-in PoC producers mint only add_node and delete_node. */ - DocOp: - | components['schemas']['AddNodeOp'] - | components['schemas']['DeleteNodeOp'] - | components['schemas']['ClearOp'] - | components['schemas']['ConnectOp'] - | components['schemas']['SetWidgetOp'] - /** @description Provenance inventory "Common emitted envelope". */ - DocOpCommon: { - op: string - /** @description Unique within a batch; minted once before dispatch. */ - op_id: string - actor: string - base_version: number - /** @description Ordering stamp [base_version, actor]. */ - stamp: [number, string] - } - /** @description NodeId is imported from the shared package in 02b; observed link seams explicitly accept string or number, so the wire contract preserves both. */ - NodeId: string | number - AddNodeOp: components['schemas']['DocOpCommon'] & { - /** @constant */ - op: 'add_node' - op_id?: string - actor?: string - base_version?: number - stamp?: [number, string] - node_id: components['schemas']['NodeId'] - class_type: string - pos: [number, number] - node: { - [key: string]: unknown - } - } & { - /** - * @description discriminator enum property added by openapi-typescript - * @enum {string} - */ - op: 'add_node' - } - DeleteNodeOp: components['schemas']['DocOpCommon'] & { - /** @constant */ - op: 'delete_node' - op_id?: string - actor?: string - base_version?: number - stamp?: unknown[] - node_id: components['schemas']['NodeId'] - removed_links: components['schemas']['NodeId'][] - } & { - /** - * @description discriminator enum property added by openapi-typescript - * @enum {string} - */ - op: 'delete_node' - } - ClearOp: components['schemas']['DocOpCommon'] & { - /** @constant */ - op: 'clear' - op_id?: string - actor?: string - base_version?: number - stamp?: unknown[] - removed_nodes: components['schemas']['NodeId'][] - } & { - /** - * @description discriminator enum property added by openapi-typescript - * @enum {string} - */ - op: 'clear' - } - ConnectOp: components['schemas']['DocOpCommon'] & { - /** @constant */ - op: 'connect' - op_id?: string - actor?: string - base_version?: number - stamp?: unknown[] - link_id: components['schemas']['NodeId'] - from_node: components['schemas']['NodeId'] - from_slot: number - to_node: components['schemas']['NodeId'] - to_slot: number - link_type: string - } & { - /** - * @description discriminator enum property added by openapi-typescript - * @enum {string} - */ - op: 'connect' - } - /** @description Root form omits path and inner_widget; interior form includes both. value and old accept any JSON value. Provenance inventory "Additional operation payloads emitted on 02b". */ - SetWidgetOp: components['schemas']['DocOpCommon'] & { - /** @constant */ - op: 'set_widget' - op_id?: string - actor?: string - base_version?: number - stamp?: unknown[] - node_id: components['schemas']['NodeId'] - widget: string - value: unknown - old: unknown - path?: string[] - inner_widget?: string - } & { - /** - * @description discriminator enum property added by openapi-typescript - * @enum {string} - */ - op: 'set_widget' - } - } - responses: never - parameters: never - requestBodies: never - headers: never - pathItems: never -} -export type $defs = Record -export type operations = Record diff --git a/src/schemas/docframe/openapi.test.ts b/src/schemas/docframe/openapi.test.ts deleted file mode 100644 index 812ed489f4b..00000000000 --- a/src/schemas/docframe/openapi.test.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import Ajv from 'ajv' -import { parse } from 'yaml' -import { describe, expect, it } from 'vitest' - -const openApi = parse( - readFileSync( - join(process.cwd(), 'src/schemas/docframe/openapi.yaml'), - 'utf-8' - ) -) as { - components: { schemas: Record } -} - -const validateDocUpdate = new Ajv({ strict: false }).compile({ - $ref: '#/components/schemas/DocUpdateData', - components: openApi.components -}) - -const validDocUpdateFixtures = [ - { v: 1, workflow_id: 'wf-1', seq: 1, update_b64: 'AQ==' }, - { - v: 1, - workflow_id: 'wf-1', - seq: 2, - update_b64: 'AQ==', - op_ids: ['op-1', 'op-2'] - }, - { - v: 1, - workflow_id: 'wf-1', - seq: 3, - update_b64: 'AQ==', - op_ids: Array.from({ length: 256 }, () => 'x'.repeat(128)) - } -] - -const invalidDocUpdateFixtures = [ - { workflow_id: 'wf-1', seq: 4, update_b64: 'AQ==' }, - { - v: 1, - workflow_id: 'wf-1', - seq: 5, - update_b64: 'AQ==', - unexpected: true - }, - { v: 1, workflow_id: 'wf-1', seq: 6, update_b64: 'AQ==', op_ids: [''] }, - { v: 1, workflow_id: 'wf-1', seq: 7, update_b64: 'AQ==', op_ids: [42] }, - { - v: 1, - workflow_id: 'wf-1', - seq: 8, - update_b64: 'AQ==', - op_ids: Array.from({ length: 257 }, () => 'op') - }, - { - v: 1, - workflow_id: 'wf-1', - seq: 9, - update_b64: 'AQ==', - op_ids: ['x'.repeat(129)] - } -] - -describe('docframe OpenAPI schema', () => { - it('validates complete doc_update payloads', () => { - for (const fixture of validDocUpdateFixtures) { - expect(validateDocUpdate(fixture)).toBe(true) - } - - for (const fixture of invalidDocUpdateFixtures) { - expect(validateDocUpdate(fixture)).toBe(false) - expect(validateDocUpdate.errors).not.toBeNull() - } - }) -}) diff --git a/src/schemas/docframe/openapi.yaml b/src/schemas/docframe/openapi.yaml deleted file mode 100644 index d20c05f9ac9..00000000000 --- a/src/schemas/docframe/openapi.yaml +++ /dev/null @@ -1,669 +0,0 @@ -openapi: 3.1.0 -info: - title: ComfyUI Doc-frame WebSocket Protocol - version: 0.1.0 - description: - 'Code-derived contract for the eight document-frame messages carried - by the existing ComfyUI JSON WebSocket. This specification describes wire shapes, - not client delivery guarantees. Provenance: reports/protocol/docframe-wire-inventory.md.' -servers: - - url: '{scheme}://{host}' - description: Deployment-specific ComfyUI WebSocket origin. - variables: - scheme: - default: wss - enum: - - ws - - wss - host: - default: agent.comfy.org -paths: {} -x-websocket: - path: /ws - subprotocol: json - description: - Existing authenticated ComfyUI WebSocket shared with other protocol - families. This contract covers doc frames only. Client-originated server-only - doc-frame discriminators are ignored by the current cloud ingress implementation. - clientToServer: - $ref: '#/components/schemas/DocFrameClientToServer' - serverToClient: - $ref: '#/components/schemas/DocFrameServerToClient' -components: - schemas: - DocFrame: - description: - 'Any doc-frame envelope. Provenance: inventory "Message inventory" - and "OpenAPI handoff notes" §1.' - oneOf: - - $ref: '#/components/schemas/DocSubscribeFrame' - - $ref: '#/components/schemas/DocSubscribedFrame' - - $ref: '#/components/schemas/DocUnsubscribeFrame' - - $ref: '#/components/schemas/DocUpdateFrame' - - $ref: '#/components/schemas/DocOpsFrame' - - $ref: '#/components/schemas/DocOpsResultFrame' - - $ref: '#/components/schemas/DocResetFrame' - - $ref: '#/components/schemas/AwarenessFrame' - discriminator: - propertyName: type - mapping: - doc_subscribe: '#/components/schemas/DocSubscribeFrame' - doc_subscribed: '#/components/schemas/DocSubscribedFrame' - doc_unsubscribe: '#/components/schemas/DocUnsubscribeFrame' - doc_update: '#/components/schemas/DocUpdateFrame' - doc_ops: '#/components/schemas/DocOpsFrame' - doc_ops_result: '#/components/schemas/DocOpsResultFrame' - doc_reset: '#/components/schemas/DocResetFrame' - awareness: '#/components/schemas/AwarenessFrame' - DocFrameClientToServer: - description: Client-originated doc frames accepted by cloud ingress. - oneOf: - - $ref: '#/components/schemas/DocSubscribeFrame' - - $ref: '#/components/schemas/DocUnsubscribeFrame' - - $ref: '#/components/schemas/DocOpsFrame' - - $ref: '#/components/schemas/AwarenessFrame' - discriminator: - propertyName: type - mapping: - doc_subscribe: '#/components/schemas/DocSubscribeFrame' - doc_unsubscribe: '#/components/schemas/DocUnsubscribeFrame' - doc_ops: '#/components/schemas/DocOpsFrame' - awareness: '#/components/schemas/AwarenessFrame' - DocFrameServerToClient: - description: Server-originated doc frames parsed by the browser follower. - oneOf: - - $ref: '#/components/schemas/DocSubscribedFrame' - - $ref: '#/components/schemas/DocUpdateFrame' - - $ref: '#/components/schemas/DocOpsResultFrame' - - $ref: '#/components/schemas/DocResetFrame' - - $ref: '#/components/schemas/AwarenessFrame' - discriminator: - propertyName: type - mapping: - doc_subscribed: '#/components/schemas/DocSubscribedFrame' - doc_update: '#/components/schemas/DocUpdateFrame' - doc_ops_result: '#/components/schemas/DocOpsResultFrame' - doc_reset: '#/components/schemas/DocResetFrame' - awareness: '#/components/schemas/AwarenessFrame' - ProtocolVersion: - type: integer - const: 1 - description: Exactly 1 on the current /ws protocol. - WorkflowId: - type: string - minLength: 1 - maxLength: 128 - description: - 'Workflow identifier. The implementation additionally rejects control - and channel-special characters. Provenance: inventory "Validation and size - limits".' - Sequence: - type: integer - minimum: 0 - description: Authoritative document sequence number. - Base64Payload: - type: string - contentEncoding: base64 - maxLength: 8388608 - description: Standard-base64 data, capped at 8 MiB encoded. - DocSubscribeFrame: - type: object - additionalProperties: false - required: - - type - - data - properties: - type: - type: string - const: doc_subscribe - data: - $ref: '#/components/schemas/DocSubscribeData' - DocSubscribeData: - type: object - additionalProperties: false - required: - - v - - workflow_id - properties: - v: - $ref: '#/components/schemas/ProtocolVersion' - workflow_id: - $ref: '#/components/schemas/WorkflowId' - state_vector_b64: - allOf: - - $ref: '#/components/schemas/Base64Payload' - description: - 'Optional Yjs state vector. Empty or absent requests full catch-up; - the current FE always emits this field. Provenance: inventory "Message - inventory" row doc_subscribe.' - DocSubscribedFrame: - type: object - additionalProperties: false - required: - - type - - data - properties: - type: - type: string - const: doc_subscribed - data: - $ref: '#/components/schemas/DocSubscribedData' - DocSubscribedData: - type: object - additionalProperties: false - required: - - v - - workflow_id - - ok - properties: - v: - $ref: '#/components/schemas/ProtocolVersion' - workflow_id: - $ref: '#/components/schemas/WorkflowId' - ok: - type: boolean - seq: - $ref: '#/components/schemas/Sequence' - code: - type: string - message: - type: string - description: Provenance inventory "Message inventory" row doc_subscribed. - DocUnsubscribeFrame: - type: object - additionalProperties: false - required: - - type - - data - properties: - type: - type: string - const: doc_unsubscribe - data: - $ref: '#/components/schemas/DocUnsubscribeData' - DocUnsubscribeData: - type: object - additionalProperties: false - required: - - v - - workflow_id - properties: - v: - $ref: '#/components/schemas/ProtocolVersion' - workflow_id: - $ref: '#/components/schemas/WorkflowId' - description: Provenance inventory "Message inventory" row doc_unsubscribe. - DocUpdateFrame: - type: object - additionalProperties: false - required: - - type - - data - properties: - type: - type: string - const: doc_update - data: - $ref: '#/components/schemas/DocUpdateData' - DocUpdateData: - type: object - additionalProperties: false - required: - - v - - workflow_id - - seq - - update_b64 - properties: - v: - $ref: '#/components/schemas/ProtocolVersion' - workflow_id: - $ref: '#/components/schemas/WorkflowId' - seq: - $ref: '#/components/schemas/Sequence' - update_b64: - allOf: - - $ref: '#/components/schemas/Base64Payload' - minLength: 1 - description: Non-empty Yjs binary update encoded as standard base64. - actor: - type: string - op_ids: - type: array - maxItems: 256 - items: - type: string - minLength: 1 - maxLength: 128 - description: - Creator-minted operation ids whose effects are included in - this update. - description: Provenance inventory "Message inventory" row doc_update. - DocOpsFrame: - type: object - additionalProperties: false - required: - - type - - data - properties: - type: - type: string - const: doc_ops - data: - $ref: '#/components/schemas/DocOpsData' - DocOpsData: - type: object - additionalProperties: false - required: - - v - - workflow_id - - tab - - ops - properties: - v: - $ref: '#/components/schemas/ProtocolVersion' - workflow_id: - $ref: '#/components/schemas/WorkflowId' - tab: - type: string - minLength: 1 - maxLength: 256 - description: Tab identity; whitespace, colon, and controls are rejected. - ops: - type: array - minItems: 1 - maxItems: 256 - items: - $ref: '#/components/schemas/DocOp' - description: - Semantic operations, with a 4 MiB aggregate encoded-size cap. - The WS relay validates the common envelope but treats operation interiors - as opaque; the five variants are the executable 02b producer vocabulary. - description: Provenance inventory "Nested doc_ops.ops[*] inventory". - DocOpsResultFrame: - type: object - additionalProperties: false - required: - - type - - data - properties: - type: - type: string - const: doc_ops_result - data: - $ref: '#/components/schemas/DocOpsResultData' - DocOpsResultData: - type: object - additionalProperties: false - required: - - v - - workflow_id - - ok - properties: - v: - $ref: '#/components/schemas/ProtocolVersion' - workflow_id: - $ref: '#/components/schemas/WorkflowId' - ok: - type: boolean - seq: - $ref: '#/components/schemas/Sequence' - applied: - type: array - items: - type: string - skipped: - type: array - items: - type: string - failed: - $ref: '#/components/schemas/DocOpFailure' - code: - type: string - message: - type: string - description: - 'Optional arrays follow Go omitempty behavior; the FE normalizes - absent arrays to empty arrays. Only the canonical cloud failure shape is modeled. - Provenance: inventory "Message inventory" row doc_ops_result.' - DocOpFailure: - type: object - additionalProperties: false - required: - - index - - code - - message - properties: - index: - type: integer - minimum: 0 - op_id: - type: string - maxLength: 128 - code: - type: string - message: - type: string - DocResetFrame: - type: object - additionalProperties: false - required: - - type - - data - properties: - type: - type: string - const: doc_reset - data: - $ref: '#/components/schemas/DocResetData' - DocResetData: - type: object - additionalProperties: false - required: - - v - - workflow_id - - seq - properties: - v: - $ref: '#/components/schemas/ProtocolVersion' - workflow_id: - $ref: '#/components/schemas/WorkflowId' - seq: - $ref: '#/components/schemas/Sequence' - actor: - type: string - description: - 'Explicit lineage break; carries no update or snapshot. Provenance: - inventory "Message inventory" row doc_reset.' - AwarenessFrame: - type: object - additionalProperties: false - required: - - type - - data - properties: - type: - type: string - const: awareness - data: - $ref: '#/components/schemas/AwarenessData' - AwarenessData: - type: object - additionalProperties: false - required: - - v - - workflow_id - - actor - properties: - v: - $ref: '#/components/schemas/ProtocolVersion' - workflow_id: - $ref: '#/components/schemas/WorkflowId' - actor: - type: string - maxLength: 256 - state: - type: object - description: Ephemeral presence state, capped at 8 KiB encoded JSON. - expires_at: - type: integer - minimum: 0 - description: Unix seconds; server overwrites/stamps expiry before fanout. - description: - 'Bidirectional protocol capability; neither inspected FE revision - emits it. Provenance: inventory "Message inventory" row awareness.' - DocOp: - description: - Five operation payloads emitted by the inspected 02b executable - lineage. Current checked-in PoC producers mint only add_node and delete_node. - oneOf: - - $ref: '#/components/schemas/AddNodeOp' - - $ref: '#/components/schemas/DeleteNodeOp' - - $ref: '#/components/schemas/ClearOp' - - $ref: '#/components/schemas/ConnectOp' - - $ref: '#/components/schemas/SetWidgetOp' - discriminator: - propertyName: op - mapping: - add_node: '#/components/schemas/AddNodeOp' - delete_node: '#/components/schemas/DeleteNodeOp' - clear: '#/components/schemas/ClearOp' - connect: '#/components/schemas/ConnectOp' - set_widget: '#/components/schemas/SetWidgetOp' - DocOpCommon: - type: object - required: - - op - - op_id - - actor - - base_version - - stamp - properties: - op: - type: string - op_id: - type: string - minLength: 1 - maxLength: 128 - description: Unique within a batch; minted once before dispatch. - actor: - type: string - minLength: 1 - maxLength: 256 - pattern: ^(agent:[^:]+:[^:]+|human:[^:]+:[^:]+|system:mint)$ - base_version: - type: integer - stamp: - type: array - prefixItems: - - type: integer - - type: string - minLength: 1 - minItems: 2 - maxItems: 2 - description: Ordering stamp [base_version, actor]. - description: Provenance inventory "Common emitted envelope". - NodeId: - description: - NodeId is imported from the shared package in 02b; observed link - seams explicitly accept string or number, so the wire contract preserves both. - oneOf: - - type: string - - type: number - AddNodeOp: - allOf: - - $ref: '#/components/schemas/DocOpCommon' - - type: object - additionalProperties: false - required: - - op - - node_id - - class_type - - pos - - node - properties: - op: - type: string - const: add_node - op_id: - type: string - minLength: 1 - maxLength: 128 - actor: - type: string - minLength: 1 - maxLength: 256 - base_version: - type: integer - stamp: - type: array - prefixItems: - - type: integer - - type: string - minLength: 1 - minItems: 2 - maxItems: 2 - node_id: - $ref: '#/components/schemas/NodeId' - class_type: - type: string - pos: - type: array - prefixItems: - - type: number - - type: number - minItems: 2 - maxItems: 2 - node: - type: object - additionalProperties: true - DeleteNodeOp: - allOf: - - $ref: '#/components/schemas/DocOpCommon' - - type: object - additionalProperties: false - required: - - op - - node_id - - removed_links - properties: - op: - type: string - const: delete_node - op_id: - type: string - minLength: 1 - maxLength: 128 - actor: - type: string - minLength: 1 - maxLength: 256 - base_version: - type: integer - stamp: - type: array - minItems: 2 - maxItems: 2 - node_id: - $ref: '#/components/schemas/NodeId' - removed_links: - type: array - items: - $ref: '#/components/schemas/NodeId' - ClearOp: - allOf: - - $ref: '#/components/schemas/DocOpCommon' - - type: object - additionalProperties: false - required: - - op - - removed_nodes - properties: - op: - type: string - const: clear - op_id: - type: string - minLength: 1 - maxLength: 128 - actor: - type: string - minLength: 1 - maxLength: 256 - base_version: - type: integer - stamp: - type: array - minItems: 2 - maxItems: 2 - removed_nodes: - type: array - items: - $ref: '#/components/schemas/NodeId' - ConnectOp: - allOf: - - $ref: '#/components/schemas/DocOpCommon' - - type: object - additionalProperties: false - required: - - op - - link_id - - from_node - - from_slot - - to_node - - to_slot - - link_type - properties: - op: - type: string - const: connect - op_id: - type: string - minLength: 1 - maxLength: 128 - actor: - type: string - minLength: 1 - maxLength: 256 - base_version: - type: integer - stamp: - type: array - minItems: 2 - maxItems: 2 - link_id: - $ref: '#/components/schemas/NodeId' - from_node: - $ref: '#/components/schemas/NodeId' - from_slot: - type: integer - to_node: - $ref: '#/components/schemas/NodeId' - to_slot: - type: integer - link_type: - type: string - SetWidgetOp: - allOf: - - $ref: '#/components/schemas/DocOpCommon' - - type: object - additionalProperties: false - required: - - op - - node_id - - widget - - value - - old - properties: - op: - type: string - const: set_widget - op_id: - type: string - minLength: 1 - maxLength: 128 - actor: - type: string - minLength: 1 - maxLength: 256 - base_version: - type: integer - stamp: - type: array - minItems: 2 - maxItems: 2 - node_id: - $ref: '#/components/schemas/NodeId' - widget: - type: string - value: {} - old: {} - path: - type: array - items: - type: string - inner_widget: - type: string - description: - Root form omits path and inner_widget; interior form includes both. - value and old accept any JSON value. Provenance inventory "Additional operation - payloads emitted on 02b". From 3051159dec43153c5113a9d1627dc83ffc09a8c5 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Thu, 10 Sep 2026 21:24:26 -0700 Subject: [PATCH 13/16] test: pin doc frame parsing to the authoritative ingest schema contentEncoding is annotation-only, so neither the OpenAPI source nor the Zod schema generated from it rejects a malformed update_b64. Cloud validates base64 in code (validateB64); parseServerDocFrame does the same here. This test binds the two halves: every frame the authoritative zServerDocFrame accepts must also parse, and each malformed update_b64 that the schema admits must be rejected. Fixtures isolate one decode guard each - length, character set, single-padding canonicality, double-padding canonicality - so removing any guard fails the test. atob alone accepts AQE, "AQ== ", AQB= and AR==. Addresses review feedback: https://github.com/Comfy-Org/ComfyUI_frontend/pull/16191#discussion_r3936081208 https://github.com/Comfy-Org/ComfyUI_frontend/pull/16191#discussion_r3936081202 --- .../agent/crdt/docFrameWireContract.test.ts | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts diff --git a/src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts b/src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts new file mode 100644 index 00000000000..ab98a395d1e --- /dev/null +++ b/src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts @@ -0,0 +1,33 @@ +import { zDocUpdateFrame, zServerDocFrame } from '@comfyorg/ingest-types/zod' +import { describe, expect, it } from 'vitest' + +import { encodeBase64, parseServerDocFrame } from './docFrameClient' + +const docUpdateFrame = (update_b64: string) => ({ + type: 'doc_update', + data: { v: 1, workflow_id: 'wf-1', seq: 1, update_b64 } +}) + +const wellFormedFrames = [ + docUpdateFrame(encodeBase64(Uint8Array.of(1, 2, 3))), + { type: 'doc_reset', data: { v: 1, workflow_id: 'wf-1', seq: 7 } } +] + +describe('doc frame wire contract', () => { + it('parses every frame the authoritative ingest schema accepts', () => { + for (const frame of wellFormedFrames) { + expect(zServerDocFrame.safeParse(frame).success).toBe(true) + expect(parseServerDocFrame(frame)).not.toBeNull() + } + }) + + it.for(['not base64!', 'AQE', 'AQ== ', 'AQB=', 'AR=='])( + 'rejects update_b64 %j, which the wire schema admits', + (update_b64) => { + const frame = docUpdateFrame(update_b64) + + expect(zDocUpdateFrame.safeParse(frame).success).toBe(true) + expect(parseServerDocFrame(frame)).toBeNull() + } + ) +}) From 2df412c5d1bf421cf3e4426bf341260bdaca3e31 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Sat, 3 Oct 2026 10:13:45 -0700 Subject: [PATCH 14/16] test: adapt doc frame contract coverage --- .../in-app-agent-docframe-typegen.md | 21 +++-- .../agent/crdt/docFrameWireContract.test.ts | 76 ++++++++++++++++--- 2 files changed, 78 insertions(+), 19 deletions(-) diff --git a/docs/architecture/in-app-agent-docframe-typegen.md b/docs/architecture/in-app-agent-docframe-typegen.md index e24896d8279..67c0f420cd1 100644 --- a/docs/architecture/in-app-agent-docframe-typegen.md +++ b/docs/architecture/in-app-agent-docframe-typegen.md @@ -1,7 +1,8 @@ # In-App Agent doc-frame type-generation contract -The CRDT doc-frame wire contract is owned by Comfy Cloud's ingest service. The frontend consumes it -as a generated artifact and does not maintain a second protocol definition. +The CRDT doc-frame wire contract is owned by Comfy Cloud's ingest service. The frontend consumes its +generated types and schemas, then applies stricter runtime validation in a handwritten adapter before +exposing frontend domain objects. ## Contract @@ -9,7 +10,7 @@ as a generated artifact and does not maintain a second protocol definition. cloud services/ingest/openapi.yaml (authority) ├──▶ cloud common/websocket/docframes (generated Go models) └──▶ packages/ingest-types (generated TS types + Zod schemas) - └──▶ src/workbench/extensions/agent/crdt + └──▶ docFrameClient.ts (validation + domain adapter) ``` - `ServerDocFrame`, `DocUpdateFrame`/`DocUpdateData`, `DocResetFrame`/`DocResetData`, @@ -22,14 +23,18 @@ cloud services/ingest/openapi.yaml (authority) that mapping must remain at the adapter boundary. - Generated types describe the `{type,data}` bytes; they do not implement CRDT application, authority, or mutation semantics. +- `parseServerDocFrame` deliberately validates constraints that generated Zod cannot express and + maps snake-case wire fields to frontend domain names. Its compatibility tests bind representative + generated frames to that adapter; they do not claim that the handwritten parser accepts every + value admitted by the generated schema. ## Validation the generated schema cannot provide -`update_b64` is declared `type: string` with a base64 `contentEncoding` annotation. Both OpenAPI -and the Zod schema generated from it treat that annotation as documentation, so neither rejects a -malformed payload. Cloud validates base64 in code (`validateB64` in `common/websocket/messages`), -and the frontend does the same in `parseServerDocFrame`. Schema conformance is therefore necessary -but not sufficient, and `docFrameWireContract.test.ts` pins both halves. +`update_b64` is an unconstrained string in the authoritative OpenAPI contract, so its generated Zod +schema also accepts malformed payloads. Cloud validates base64 in code (`validateB64` in +`common/websocket/messages`), and the frontend does the same in `parseServerDocFrame`. Schema +conformance is therefore necessary but not sufficient, and `docFrameWireContract.test.ts` pins both +halves. ## References diff --git a/src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts b/src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts index ab98a395d1e..45d0d68fe4a 100644 --- a/src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts +++ b/src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts @@ -3,22 +3,76 @@ import { describe, expect, it } from 'vitest' import { encodeBase64, parseServerDocFrame } from './docFrameClient' -const docUpdateFrame = (update_b64: string) => ({ - type: 'doc_update', - data: { v: 1, workflow_id: 'wf-1', seq: 1, update_b64 } -}) +function docUpdateFrame(update_b64: string) { + return { + type: 'doc_update', + data: { + v: 1, + workflow_id: 'wf-1', + seq: 1, + lineage_seq: 1, + update_b64 + } + } +} -const wellFormedFrames = [ - docUpdateFrame(encodeBase64(Uint8Array.of(1, 2, 3))), - { type: 'doc_reset', data: { v: 1, workflow_id: 'wf-1', seq: 7 } } +const representativeFrames = [ + { + wire: docUpdateFrame(encodeBase64(Uint8Array.of(1, 2, 3))), + parsedType: 'doc_update' + }, + { + wire: { + type: 'doc_reset', + data: { v: 1, workflow_id: 'wf-1', seq: 7, lineage_seq: 2 } + }, + parsedType: 'doc_reset' + }, + { + wire: { + type: 'doc_ops_result', + data: { + v: 1, + workflow_id: 'wf-1', + ok: false, + seq: 8, + applied: ['op-1'], + skipped: ['op-3'], + failed: { index: 1, op_id: 'op-2', code: 'invalid', message: 'bad op' } + } + }, + parsedType: 'doc_ops_result' + } ] describe('doc frame wire contract', () => { - it('parses every frame the authoritative ingest schema accepts', () => { - for (const frame of wellFormedFrames) { - expect(zServerDocFrame.safeParse(frame).success).toBe(true) - expect(parseServerDocFrame(frame)).not.toBeNull() + it.for(representativeFrames)( + 'parses representative generated $parsedType frames', + ({ wire, parsedType }) => { + expect(zServerDocFrame.safeParse(wire).success).toBe(true) + expect(parseServerDocFrame(wire)).toMatchObject({ type: parsedType }) } + ) + + it('maps the generated doc_ops_result failed field at the adapter boundary', () => { + const frame = representativeFrames[2].wire + + expect(parseServerDocFrame(frame)).toEqual({ + type: 'doc_ops_result', + data: { + workflowId: 'wf-1', + ok: false, + seq: 8, + applied: ['op-1'], + skipped: ['op-3'], + failed: { + index: 1, + op_id: 'op-2', + code: 'invalid', + message: 'bad op' + } + } + }) }) it.for(['not base64!', 'AQE', 'AQ== ', 'AQB=', 'AR=='])( From 2bbb13cfdb5eb0cd26a0e12ee08d37a9f1143f81 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Sat, 3 Oct 2026 11:16:39 -0700 Subject: [PATCH 15/16] test: bind doc frame schema to adapter --- .../in-app-agent-docframe-typegen.md | 25 ++++--- .../extensions/agent/crdt/docFrameClient.ts | 33 ++++++--- .../agent/crdt/docFrameWireContract.test.ts | 69 ++++++++++++------- 3 files changed, 83 insertions(+), 44 deletions(-) diff --git a/docs/architecture/in-app-agent-docframe-typegen.md b/docs/architecture/in-app-agent-docframe-typegen.md index 67c0f420cd1..5d6c2179e1e 100644 --- a/docs/architecture/in-app-agent-docframe-typegen.md +++ b/docs/architecture/in-app-agent-docframe-typegen.md @@ -1,8 +1,9 @@ # In-App Agent doc-frame type-generation contract -The CRDT doc-frame wire contract is owned by Comfy Cloud's ingest service. The frontend consumes its -generated types and schemas, then applies stricter runtime validation in a handwritten adapter before -exposing frontend domain objects. +The CRDT doc-frame wire contract is owned by Comfy Cloud's ingest service. The frontend imports its +generated types and schemas. Its production WebSocket boundary remains a handwritten adapter that +independently validates raw JSON before exposing frontend domain objects; a compatibility test feeds +generated schema output through that adapter to detect disagreement between the two representations. ## Contract @@ -23,18 +24,22 @@ cloud services/ingest/openapi.yaml (authority) that mapping must remain at the adapter boundary. - Generated types describe the `{type,data}` bytes; they do not implement CRDT application, authority, or mutation semantics. -- `parseServerDocFrame` deliberately validates constraints that generated Zod cannot express and - maps snake-case wire fields to frontend domain names. Its compatibility tests bind representative - generated frames to that adapter; they do not claim that the handwritten parser accepts every - value admitted by the generated schema. +- `parseServerDocFrame` does not invoke Zod in production. It independently validates raw WebSocket + values, converts the generated schemas' `bigint` int64 output to safe numeric domain values, and + maps snake-case wire fields to frontend names. Its compatibility tests pass representative + generated outputs through that adapter and assert their complete mapped payloads; they do not + claim that the handwritten parser accepts every value admitted by the generated schema. ## Validation the generated schema cannot provide `update_b64` is an unconstrained string in the authoritative OpenAPI contract, so its generated Zod schema also accepts malformed payloads. Cloud validates base64 in code (`validateB64` in -`common/websocket/messages`), and the frontend does the same in `parseServerDocFrame`. Schema -conformance is therefore necessary but not sufficient, and `docFrameWireContract.test.ts` pins both -halves. +`common/websocket/messages`), and the frontend independently validates it in +`parseServerDocFrame`. The adapter can therefore reject schema-conforming input. Conversely, the +adapter accepts some raw frames that the generated schema rejects, such as a `doc_update` without +`lineage_seq`, because the frontend domain object does not use that field. The compatibility test +pins representative generated outputs plus these intentional boundary differences rather than +treating schema conformance as a prerequisite for adapter acceptance. ## References diff --git a/src/workbench/extensions/agent/crdt/docFrameClient.ts b/src/workbench/extensions/agent/crdt/docFrameClient.ts index fcfb9e14e27..ed5abbdf1e3 100644 --- a/src/workbench/extensions/agent/crdt/docFrameClient.ts +++ b/src/workbench/extensions/agent/crdt/docFrameClient.ts @@ -201,6 +201,17 @@ function isSequence(value: unknown): value is number { return typeof value === 'number' && Number.isSafeInteger(value) && value >= 0 } +function parseSequence(value: unknown): number | null { + if (isSequence(value)) return value + if ( + typeof value === 'bigint' && + value >= 0n && + value <= BigInt(Number.MAX_SAFE_INTEGER) + ) + return Number(value) + return null +} + function isValidOpId(value: unknown): value is string { return ( typeof value === 'string' && @@ -283,11 +294,9 @@ export function parseServerDocFrame(value: unknown): ServerDocFrame | null { ) return null - if ( - frame.type === 'doc_update' && - isSequence(data.seq) && - typeof data.update_b64 === 'string' - ) { + if (frame.type === 'doc_update' && typeof data.update_b64 === 'string') { + const seq = parseSequence(data.seq) + if (seq === null) return null const update = decodeBase64(data.update_b64) if (update === null) return null if (!isAbsent(data.op_ids) && !isStringArray(data.op_ids)) return null @@ -296,7 +305,7 @@ export function parseServerDocFrame(value: unknown): ServerDocFrame | null { type: frame.type, data: { workflowId: data.workflow_id, - seq: data.seq, + seq, update, ...(actor !== undefined && { actor }), ...(isStringArray(data.op_ids) && { @@ -327,6 +336,8 @@ export function parseServerDocFrame(value: unknown): ServerDocFrame | null { if (applied === null || skipped === null) return null const code = parseBoundedString(data.code, MAX_ERROR_CODE_LENGTH) const message = parseBoundedString(data.message, MAX_ERROR_MESSAGE_LENGTH) + const seq = isAbsent(data.seq) ? undefined : parseSequence(data.seq) + if (seq === null) return null let failed: DocOpFailure | undefined if (!isAbsent(data.failed)) { const parsedFailure = parseDocOpFailure(data.failed) @@ -339,7 +350,7 @@ export function parseServerDocFrame(value: unknown): ServerDocFrame | null { ok: data.ok, applied, skipped, - ...(isSequence(data.seq) && { seq: data.seq }), + ...(seq !== undefined && { seq }), ...(code !== undefined && { code }), ...(message !== undefined && { message }), ...(failed !== undefined && { failed }) @@ -349,14 +360,16 @@ export function parseServerDocFrame(value: unknown): ServerDocFrame | null { if (frame.type === 'doc_reset') { const reset: Partial> = data - if (!isSequence(reset.seq) || !isSequence(reset.lineage_seq)) return null + const seq = parseSequence(reset.seq) + const lineageSeq = parseSequence(reset.lineage_seq) + if (seq === null || lineageSeq === null) return null const actor = parseAdvisoryActor(reset.actor) return { type: frame.type, data: { workflowId: data.workflow_id, - seq: reset.seq, - lineageSeq: reset.lineage_seq, + seq, + lineageSeq, ...(actor !== undefined && { actor }) } } diff --git a/src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts b/src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts index 45d0d68fe4a..c466cf247b4 100644 --- a/src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts +++ b/src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts @@ -19,14 +19,24 @@ function docUpdateFrame(update_b64: string) { const representativeFrames = [ { wire: docUpdateFrame(encodeBase64(Uint8Array.of(1, 2, 3))), - parsedType: 'doc_update' + expected: { + type: 'doc_update', + data: { + workflowId: 'wf-1', + seq: 1, + update: Uint8Array.of(1, 2, 3) + } + } }, { wire: { type: 'doc_reset', data: { v: 1, workflow_id: 'wf-1', seq: 7, lineage_seq: 2 } }, - parsedType: 'doc_reset' + expected: { + type: 'doc_reset', + data: { workflowId: 'wf-1', seq: 7, lineageSeq: 2 } + } }, { wire: { @@ -41,23 +51,7 @@ const representativeFrames = [ failed: { index: 1, op_id: 'op-2', code: 'invalid', message: 'bad op' } } }, - parsedType: 'doc_ops_result' - } -] - -describe('doc frame wire contract', () => { - it.for(representativeFrames)( - 'parses representative generated $parsedType frames', - ({ wire, parsedType }) => { - expect(zServerDocFrame.safeParse(wire).success).toBe(true) - expect(parseServerDocFrame(wire)).toMatchObject({ type: parsedType }) - } - ) - - it('maps the generated doc_ops_result failed field at the adapter boundary', () => { - const frame = representativeFrames[2].wire - - expect(parseServerDocFrame(frame)).toEqual({ + expected: { type: 'doc_ops_result', data: { workflowId: 'wf-1', @@ -72,16 +66,43 @@ describe('doc frame wire contract', () => { message: 'bad op' } } - }) - }) + } + } +] + +describe('doc frame wire contract', () => { + it.for(representativeFrames)( + 'adapts representative generated $wire.type frames without losing payload fields', + ({ wire, expected }) => { + const generatedFrame = zServerDocFrame.parse(wire) + + expect(parseServerDocFrame(generatedFrame)).toEqual(expected) + } + ) it.for(['not base64!', 'AQE', 'AQ== ', 'AQB=', 'AR=='])( 'rejects update_b64 %j, which the wire schema admits', (update_b64) => { - const frame = docUpdateFrame(update_b64) + const generatedFrame = zDocUpdateFrame.parse(docUpdateFrame(update_b64)) - expect(zDocUpdateFrame.safeParse(frame).success).toBe(true) - expect(parseServerDocFrame(frame)).toBeNull() + expect(parseServerDocFrame(generatedFrame)).toBeNull() } ) + + it.for([null, '', {}])('rejects empty external input %#', (value) => { + expect(parseServerDocFrame(value)).toBeNull() + }) + + it('rejects a generated int64 sequence outside the frontend safe-integer domain', () => { + const wire = docUpdateFrame(encodeBase64(Uint8Array.of(1))) + const generatedFrame = zDocUpdateFrame.parse({ + ...wire, + data: { + ...wire.data, + seq: BigInt(Number.MAX_SAFE_INTEGER) + 1n + } + }) + + expect(parseServerDocFrame(generatedFrame)).toBeNull() + }) }) From 019b5df961c71b63d25c796b0099edde49ebbf32 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Sat, 3 Oct 2026 11:37:44 -0700 Subject: [PATCH 16/16] fix: preserve results with invalid advisory seq --- .../extensions/agent/crdt/docFrameClient.ts | 3 +-- .../agent/crdt/docFrameWireContract.test.ts | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/workbench/extensions/agent/crdt/docFrameClient.ts b/src/workbench/extensions/agent/crdt/docFrameClient.ts index ed5abbdf1e3..8c67c821600 100644 --- a/src/workbench/extensions/agent/crdt/docFrameClient.ts +++ b/src/workbench/extensions/agent/crdt/docFrameClient.ts @@ -337,7 +337,6 @@ export function parseServerDocFrame(value: unknown): ServerDocFrame | null { const code = parseBoundedString(data.code, MAX_ERROR_CODE_LENGTH) const message = parseBoundedString(data.message, MAX_ERROR_MESSAGE_LENGTH) const seq = isAbsent(data.seq) ? undefined : parseSequence(data.seq) - if (seq === null) return null let failed: DocOpFailure | undefined if (!isAbsent(data.failed)) { const parsedFailure = parseDocOpFailure(data.failed) @@ -350,7 +349,7 @@ export function parseServerDocFrame(value: unknown): ServerDocFrame | null { ok: data.ok, applied, skipped, - ...(seq !== undefined && { seq }), + ...(seq !== undefined && seq !== null && { seq }), ...(code !== undefined && { code }), ...(message !== undefined && { message }), ...(failed !== undefined && { failed }) diff --git a/src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts b/src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts index c466cf247b4..7ea8e3c6c53 100644 --- a/src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts +++ b/src/workbench/extensions/agent/crdt/docFrameWireContract.test.ts @@ -105,4 +105,24 @@ describe('doc frame wire contract', () => { expect(parseServerDocFrame(generatedFrame)).toBeNull() }) + + it('accepts a generated int64 sequence at the frontend safe-integer boundary', () => { + const wire = docUpdateFrame(encodeBase64(Uint8Array.of(1))) + const generatedFrame = zDocUpdateFrame.parse({ + ...wire, + data: { + ...wire.data, + seq: BigInt(Number.MAX_SAFE_INTEGER) + } + }) + + expect(parseServerDocFrame(generatedFrame)).toEqual({ + type: 'doc_update', + data: { + workflowId: 'wf-1', + seq: Number.MAX_SAFE_INTEGER, + update: Uint8Array.of(1) + } + }) + }) })