@decaf-ts/ui-decorators 0.20.9 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui-decorators.cjs +1 -1
- package/dist/ui-decorators.cjs.map +1 -1
- package/dist/ui-decorators.js +1 -1
- package/dist/ui-decorators.js.map +1 -1
- package/lib/cjs/index.cjs +3 -3
- package/lib/esm/index.js +3 -3
- package/lib/types/index.d.cts +3 -3
- package/lib/types/index.d.mts +3 -3
- package/package.json +2 -18
- package/lib/cjs/graph/GraphExecutionStateMapper.cjs +0 -97
- package/lib/cjs/graph/GraphExecutionStateMapper.cjs.map +0 -1
- package/lib/cjs/graph/GraphResolution.cjs +0 -17
- package/lib/cjs/graph/GraphResolution.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphConnectionPolicy.cjs +0 -20
- package/lib/cjs/graph/catalog/GraphConnectionPolicy.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphCredentialReference.cjs +0 -15
- package/lib/cjs/graph/catalog/GraphCredentialReference.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphCredentialRequirement.cjs +0 -16
- package/lib/cjs/graph/catalog/GraphCredentialRequirement.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphDynamicPortRule.cjs +0 -31
- package/lib/cjs/graph/catalog/GraphDynamicPortRule.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphIconReference.cjs +0 -22
- package/lib/cjs/graph/catalog/GraphIconReference.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphManifestCompiler.cjs +0 -307
- package/lib/cjs/graph/catalog/GraphManifestCompiler.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphNodeCapability.cjs +0 -23
- package/lib/cjs/graph/catalog/GraphNodeCapability.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphNodeDisplayManifest.cjs +0 -11
- package/lib/cjs/graph/catalog/GraphNodeDisplayManifest.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphNodeManifest.cjs +0 -23
- package/lib/cjs/graph/catalog/GraphNodeManifest.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphNodeManifestSerialization.cjs +0 -50
- package/lib/cjs/graph/catalog/GraphNodeManifestSerialization.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphNodeMethodManifest.cjs +0 -29
- package/lib/cjs/graph/catalog/GraphNodeMethodManifest.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphNodePolicyManifest.cjs +0 -18
- package/lib/cjs/graph/catalog/GraphNodePolicyManifest.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphParameterBase.cjs +0 -4
- package/lib/cjs/graph/catalog/GraphParameterBase.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphParameterDefinition.cjs +0 -29
- package/lib/cjs/graph/catalog/GraphParameterDefinition.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphParameterOption.cjs +0 -18
- package/lib/cjs/graph/catalog/GraphParameterOption.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphParameterValidation.cjs +0 -57
- package/lib/cjs/graph/catalog/GraphParameterValidation.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphPortManifest.cjs +0 -19
- package/lib/cjs/graph/catalog/GraphPortManifest.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphResourceLocatorMode.cjs +0 -19
- package/lib/cjs/graph/catalog/GraphResourceLocatorMode.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphValueSchema.cjs +0 -25
- package/lib/cjs/graph/catalog/GraphValueSchema.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphValueSchemaDerivation.cjs +0 -164
- package/lib/cjs/graph/catalog/GraphValueSchemaDerivation.cjs.map +0 -1
- package/lib/cjs/graph/catalog/GraphVisibilityExpression.cjs +0 -63
- package/lib/cjs/graph/catalog/GraphVisibilityExpression.cjs.map +0 -1
- package/lib/cjs/graph/catalog/index.cjs +0 -39
- package/lib/cjs/graph/catalog/index.cjs.map +0 -1
- package/lib/cjs/graph/constants.cjs +0 -320
- package/lib/cjs/graph/constants.cjs.map +0 -1
- package/lib/cjs/graph/decorators.cjs +0 -151
- package/lib/cjs/graph/decorators.cjs.map +0 -1
- package/lib/cjs/graph/document/GraphDecoratedWorkflowCompiler.cjs +0 -353
- package/lib/cjs/graph/document/GraphDecoratedWorkflowCompiler.cjs.map +0 -1
- package/lib/cjs/graph/document/GraphEdgeInstance.cjs +0 -4
- package/lib/cjs/graph/document/GraphEdgeInstance.cjs.map +0 -1
- package/lib/cjs/graph/document/GraphEndpoint.cjs +0 -27
- package/lib/cjs/graph/document/GraphEndpoint.cjs.map +0 -1
- package/lib/cjs/graph/document/GraphJsonValue.cjs +0 -82
- package/lib/cjs/graph/document/GraphJsonValue.cjs.map +0 -1
- package/lib/cjs/graph/document/GraphLoopConfiguration.cjs +0 -4
- package/lib/cjs/graph/document/GraphLoopConfiguration.cjs.map +0 -1
- package/lib/cjs/graph/document/GraphNodeBinding.cjs +0 -27
- package/lib/cjs/graph/document/GraphNodeBinding.cjs.map +0 -1
- package/lib/cjs/graph/document/GraphNodeInstance.cjs +0 -4
- package/lib/cjs/graph/document/GraphNodeInstance.cjs.map +0 -1
- package/lib/cjs/graph/document/GraphWorkflowDocument.cjs +0 -16
- package/lib/cjs/graph/document/GraphWorkflowDocument.cjs.map +0 -1
- package/lib/cjs/graph/document/GraphWorkflowDocumentBuilder.cjs +0 -309
- package/lib/cjs/graph/document/GraphWorkflowDocumentBuilder.cjs.map +0 -1
- package/lib/cjs/graph/document/GraphWorkflowDocumentReader.cjs +0 -78
- package/lib/cjs/graph/document/GraphWorkflowDocumentReader.cjs.map +0 -1
- package/lib/cjs/graph/document/GraphWorkflowDocumentSerializer.cjs +0 -70
- package/lib/cjs/graph/document/GraphWorkflowDocumentSerializer.cjs.map +0 -1
- package/lib/cjs/graph/document/GraphWorkflowUiState.cjs +0 -4
- package/lib/cjs/graph/document/GraphWorkflowUiState.cjs.map +0 -1
- package/lib/cjs/graph/document/index.cjs +0 -30
- package/lib/cjs/graph/document/index.cjs.map +0 -1
- package/lib/cjs/graph/index.cjs +0 -33
- package/lib/cjs/graph/index.cjs.map +0 -1
- package/lib/cjs/graph/nodes/agents/agent.cjs +0 -110
- package/lib/cjs/graph/nodes/agents/agent.cjs.map +0 -1
- package/lib/cjs/graph/nodes/base.cjs +0 -36
- package/lib/cjs/graph/nodes/base.cjs.map +0 -1
- package/lib/cjs/graph/nodes/boundary/input-value.cjs +0 -57
- package/lib/cjs/graph/nodes/boundary/input-value.cjs.map +0 -1
- package/lib/cjs/graph/nodes/category-styles.cjs +0 -38
- package/lib/cjs/graph/nodes/category-styles.cjs.map +0 -1
- package/lib/cjs/graph/nodes/flow-control/break.cjs +0 -63
- package/lib/cjs/graph/nodes/flow-control/break.cjs.map +0 -1
- package/lib/cjs/graph/nodes/flow-control/error-boundary.cjs +0 -67
- package/lib/cjs/graph/nodes/flow-control/error-boundary.cjs.map +0 -1
- package/lib/cjs/graph/nodes/flow-control/human-approval.cjs +0 -69
- package/lib/cjs/graph/nodes/flow-control/human-approval.cjs.map +0 -1
- package/lib/cjs/graph/nodes/flow-control/if.cjs +0 -71
- package/lib/cjs/graph/nodes/flow-control/if.cjs.map +0 -1
- package/lib/cjs/graph/nodes/flow-control/parallel.cjs +0 -61
- package/lib/cjs/graph/nodes/flow-control/parallel.cjs.map +0 -1
- package/lib/cjs/graph/nodes/flow-control/switch.cjs +0 -126
- package/lib/cjs/graph/nodes/flow-control/switch.cjs.map +0 -1
- package/lib/cjs/graph/nodes/index.cjs +0 -123
- package/lib/cjs/graph/nodes/index.cjs.map +0 -1
- package/lib/cjs/graph/nodes/loops/foreach.cjs +0 -86
- package/lib/cjs/graph/nodes/loops/foreach.cjs.map +0 -1
- package/lib/cjs/graph/nodes/loops/until.cjs +0 -74
- package/lib/cjs/graph/nodes/loops/until.cjs.map +0 -1
- package/lib/cjs/graph/nodes/loops/while.cjs +0 -74
- package/lib/cjs/graph/nodes/loops/while.cjs.map +0 -1
- package/lib/cjs/graph/nodes/manifests.cjs +0 -342
- package/lib/cjs/graph/nodes/manifests.cjs.map +0 -1
- package/lib/cjs/graph/nodes/triggers/chat.cjs +0 -70
- package/lib/cjs/graph/nodes/triggers/chat.cjs.map +0 -1
- package/lib/cjs/graph/nodes/triggers/event.cjs +0 -58
- package/lib/cjs/graph/nodes/triggers/event.cjs.map +0 -1
- package/lib/cjs/graph/nodes/triggers/form.cjs +0 -59
- package/lib/cjs/graph/nodes/triggers/form.cjs.map +0 -1
- package/lib/cjs/graph/nodes/triggers/manual.cjs +0 -60
- package/lib/cjs/graph/nodes/triggers/manual.cjs.map +0 -1
- package/lib/cjs/graph/nodes/triggers/schedule.cjs +0 -60
- package/lib/cjs/graph/nodes/triggers/schedule.cjs.map +0 -1
- package/lib/cjs/graph/nodes/triggers/webhook.cjs +0 -62
- package/lib/cjs/graph/nodes/triggers/webhook.cjs.map +0 -1
- package/lib/cjs/graph/nodes/utility/code.cjs +0 -99
- package/lib/cjs/graph/nodes/utility/code.cjs.map +0 -1
- package/lib/cjs/graph/nodes/utility/delay.cjs +0 -61
- package/lib/cjs/graph/nodes/utility/delay.cjs.map +0 -1
- package/lib/cjs/graph/nodes/utility/log.cjs +0 -62
- package/lib/cjs/graph/nodes/utility/log.cjs.map +0 -1
- package/lib/cjs/graph/nodes/utility/map.cjs +0 -61
- package/lib/cjs/graph/nodes/utility/map.cjs.map +0 -1
- package/lib/cjs/graph/nodes/utility/merge.cjs +0 -62
- package/lib/cjs/graph/nodes/utility/merge.cjs.map +0 -1
- package/lib/cjs/graph/nodes/utility/return.cjs +0 -61
- package/lib/cjs/graph/nodes/utility/return.cjs.map +0 -1
- package/lib/cjs/graph/nodes/utility/utility-log.cjs +0 -66
- package/lib/cjs/graph/nodes/utility/utility-log.cjs.map +0 -1
- package/lib/cjs/graph/overrides/Metadata.cjs +0 -23
- package/lib/cjs/graph/overrides/Metadata.cjs.map +0 -1
- package/lib/cjs/graph/overrides/Rendering.cjs +0 -4
- package/lib/cjs/graph/overrides/Rendering.cjs.map +0 -1
- package/lib/cjs/graph/overrides/index.cjs +0 -21
- package/lib/cjs/graph/overrides/index.cjs.map +0 -1
- package/lib/cjs/graph/overrides/overrides.cjs +0 -20
- package/lib/cjs/graph/overrides/overrides.cjs.map +0 -1
- package/lib/cjs/graph/reader.cjs +0 -301
- package/lib/cjs/graph/reader.cjs.map +0 -1
- package/lib/cjs/graph/registry.cjs +0 -67
- package/lib/cjs/graph/registry.cjs.map +0 -1
- package/lib/cjs/graph/snapshot.cjs +0 -695
- package/lib/cjs/graph/snapshot.cjs.map +0 -1
- package/lib/cjs/graph/types.cjs +0 -7
- package/lib/cjs/graph/types.cjs.map +0 -1
- package/lib/esm/graph/GraphExecutionStateMapper.js +0 -91
- package/lib/esm/graph/GraphExecutionStateMapper.js.map +0 -1
- package/lib/esm/graph/GraphResolution.js +0 -13
- package/lib/esm/graph/GraphResolution.js.map +0 -1
- package/lib/esm/graph/catalog/GraphConnectionPolicy.js +0 -16
- package/lib/esm/graph/catalog/GraphConnectionPolicy.js.map +0 -1
- package/lib/esm/graph/catalog/GraphCredentialReference.js +0 -9
- package/lib/esm/graph/catalog/GraphCredentialReference.js.map +0 -1
- package/lib/esm/graph/catalog/GraphCredentialRequirement.js +0 -12
- package/lib/esm/graph/catalog/GraphCredentialRequirement.js.map +0 -1
- package/lib/esm/graph/catalog/GraphDynamicPortRule.js +0 -25
- package/lib/esm/graph/catalog/GraphDynamicPortRule.js.map +0 -1
- package/lib/esm/graph/catalog/GraphIconReference.js +0 -18
- package/lib/esm/graph/catalog/GraphIconReference.js.map +0 -1
- package/lib/esm/graph/catalog/GraphManifestCompiler.js +0 -303
- package/lib/esm/graph/catalog/GraphManifestCompiler.js.map +0 -1
- package/lib/esm/graph/catalog/GraphNodeCapability.js +0 -17
- package/lib/esm/graph/catalog/GraphNodeCapability.js.map +0 -1
- package/lib/esm/graph/catalog/GraphNodeDisplayManifest.js +0 -7
- package/lib/esm/graph/catalog/GraphNodeDisplayManifest.js.map +0 -1
- package/lib/esm/graph/catalog/GraphNodeManifest.js +0 -17
- package/lib/esm/graph/catalog/GraphNodeManifest.js.map +0 -1
- package/lib/esm/graph/catalog/GraphNodeManifestSerialization.js +0 -42
- package/lib/esm/graph/catalog/GraphNodeManifestSerialization.js.map +0 -1
- package/lib/esm/graph/catalog/GraphNodeMethodManifest.js +0 -23
- package/lib/esm/graph/catalog/GraphNodeMethodManifest.js.map +0 -1
- package/lib/esm/graph/catalog/GraphNodePolicyManifest.js +0 -14
- package/lib/esm/graph/catalog/GraphNodePolicyManifest.js.map +0 -1
- package/lib/esm/graph/catalog/GraphParameterBase.js +0 -2
- package/lib/esm/graph/catalog/GraphParameterBase.js.map +0 -1
- package/lib/esm/graph/catalog/GraphParameterDefinition.js +0 -23
- package/lib/esm/graph/catalog/GraphParameterDefinition.js.map +0 -1
- package/lib/esm/graph/catalog/GraphParameterOption.js +0 -13
- package/lib/esm/graph/catalog/GraphParameterOption.js.map +0 -1
- package/lib/esm/graph/catalog/GraphParameterValidation.js +0 -50
- package/lib/esm/graph/catalog/GraphParameterValidation.js.map +0 -1
- package/lib/esm/graph/catalog/GraphPortManifest.js +0 -13
- package/lib/esm/graph/catalog/GraphPortManifest.js.map +0 -1
- package/lib/esm/graph/catalog/GraphResourceLocatorMode.js +0 -13
- package/lib/esm/graph/catalog/GraphResourceLocatorMode.js.map +0 -1
- package/lib/esm/graph/catalog/GraphValueSchema.js +0 -19
- package/lib/esm/graph/catalog/GraphValueSchema.js.map +0 -1
- package/lib/esm/graph/catalog/GraphValueSchemaDerivation.js +0 -156
- package/lib/esm/graph/catalog/GraphValueSchemaDerivation.js.map +0 -1
- package/lib/esm/graph/catalog/GraphVisibilityExpression.js +0 -58
- package/lib/esm/graph/catalog/GraphVisibilityExpression.js.map +0 -1
- package/lib/esm/graph/catalog/index.js +0 -22
- package/lib/esm/graph/catalog/index.js.map +0 -1
- package/lib/esm/graph/constants.js +0 -335
- package/lib/esm/graph/constants.js.map +0 -1
- package/lib/esm/graph/decorators.js +0 -141
- package/lib/esm/graph/decorators.js.map +0 -1
- package/lib/esm/graph/document/GraphDecoratedWorkflowCompiler.js +0 -347
- package/lib/esm/graph/document/GraphDecoratedWorkflowCompiler.js.map +0 -1
- package/lib/esm/graph/document/GraphEdgeInstance.js +0 -2
- package/lib/esm/graph/document/GraphEdgeInstance.js.map +0 -1
- package/lib/esm/graph/document/GraphEndpoint.js +0 -21
- package/lib/esm/graph/document/GraphEndpoint.js.map +0 -1
- package/lib/esm/graph/document/GraphJsonValue.js +0 -73
- package/lib/esm/graph/document/GraphJsonValue.js.map +0 -1
- package/lib/esm/graph/document/GraphLoopConfiguration.js +0 -2
- package/lib/esm/graph/document/GraphLoopConfiguration.js.map +0 -1
- package/lib/esm/graph/document/GraphNodeBinding.js +0 -22
- package/lib/esm/graph/document/GraphNodeBinding.js.map +0 -1
- package/lib/esm/graph/document/GraphNodeInstance.js +0 -2
- package/lib/esm/graph/document/GraphNodeInstance.js.map +0 -1
- package/lib/esm/graph/document/GraphWorkflowDocument.js +0 -12
- package/lib/esm/graph/document/GraphWorkflowDocument.js.map +0 -1
- package/lib/esm/graph/document/GraphWorkflowDocumentBuilder.js +0 -303
- package/lib/esm/graph/document/GraphWorkflowDocumentBuilder.js.map +0 -1
- package/lib/esm/graph/document/GraphWorkflowDocumentReader.js +0 -62
- package/lib/esm/graph/document/GraphWorkflowDocumentReader.js.map +0 -1
- package/lib/esm/graph/document/GraphWorkflowDocumentSerializer.js +0 -63
- package/lib/esm/graph/document/GraphWorkflowDocumentSerializer.js.map +0 -1
- package/lib/esm/graph/document/GraphWorkflowUiState.js +0 -2
- package/lib/esm/graph/document/GraphWorkflowUiState.js.map +0 -1
- package/lib/esm/graph/document/index.js +0 -13
- package/lib/esm/graph/document/index.js.map +0 -1
- package/lib/esm/graph/index.js +0 -16
- package/lib/esm/graph/index.js.map +0 -1
- package/lib/esm/graph/nodes/agents/agent.js +0 -101
- package/lib/esm/graph/nodes/agents/agent.js.map +0 -1
- package/lib/esm/graph/nodes/base.js +0 -31
- package/lib/esm/graph/nodes/base.js.map +0 -1
- package/lib/esm/graph/nodes/boundary/input-value.js +0 -48
- package/lib/esm/graph/nodes/boundary/input-value.js.map +0 -1
- package/lib/esm/graph/nodes/category-styles.js +0 -34
- package/lib/esm/graph/nodes/category-styles.js.map +0 -1
- package/lib/esm/graph/nodes/flow-control/break.js +0 -54
- package/lib/esm/graph/nodes/flow-control/break.js.map +0 -1
- package/lib/esm/graph/nodes/flow-control/error-boundary.js +0 -58
- package/lib/esm/graph/nodes/flow-control/error-boundary.js.map +0 -1
- package/lib/esm/graph/nodes/flow-control/human-approval.js +0 -60
- package/lib/esm/graph/nodes/flow-control/human-approval.js.map +0 -1
- package/lib/esm/graph/nodes/flow-control/if.js +0 -62
- package/lib/esm/graph/nodes/flow-control/if.js.map +0 -1
- package/lib/esm/graph/nodes/flow-control/parallel.js +0 -52
- package/lib/esm/graph/nodes/flow-control/parallel.js.map +0 -1
- package/lib/esm/graph/nodes/flow-control/switch.js +0 -117
- package/lib/esm/graph/nodes/flow-control/switch.js.map +0 -1
- package/lib/esm/graph/nodes/index.js +0 -105
- package/lib/esm/graph/nodes/index.js.map +0 -1
- package/lib/esm/graph/nodes/loops/foreach.js +0 -77
- package/lib/esm/graph/nodes/loops/foreach.js.map +0 -1
- package/lib/esm/graph/nodes/loops/until.js +0 -65
- package/lib/esm/graph/nodes/loops/until.js.map +0 -1
- package/lib/esm/graph/nodes/loops/while.js +0 -65
- package/lib/esm/graph/nodes/loops/while.js.map +0 -1
- package/lib/esm/graph/nodes/manifests.js +0 -338
- package/lib/esm/graph/nodes/manifests.js.map +0 -1
- package/lib/esm/graph/nodes/triggers/chat.js +0 -61
- package/lib/esm/graph/nodes/triggers/chat.js.map +0 -1
- package/lib/esm/graph/nodes/triggers/event.js +0 -49
- package/lib/esm/graph/nodes/triggers/event.js.map +0 -1
- package/lib/esm/graph/nodes/triggers/form.js +0 -50
- package/lib/esm/graph/nodes/triggers/form.js.map +0 -1
- package/lib/esm/graph/nodes/triggers/manual.js +0 -51
- package/lib/esm/graph/nodes/triggers/manual.js.map +0 -1
- package/lib/esm/graph/nodes/triggers/schedule.js +0 -51
- package/lib/esm/graph/nodes/triggers/schedule.js.map +0 -1
- package/lib/esm/graph/nodes/triggers/webhook.js +0 -53
- package/lib/esm/graph/nodes/triggers/webhook.js.map +0 -1
- package/lib/esm/graph/nodes/utility/code.js +0 -90
- package/lib/esm/graph/nodes/utility/code.js.map +0 -1
- package/lib/esm/graph/nodes/utility/delay.js +0 -52
- package/lib/esm/graph/nodes/utility/delay.js.map +0 -1
- package/lib/esm/graph/nodes/utility/log.js +0 -53
- package/lib/esm/graph/nodes/utility/log.js.map +0 -1
- package/lib/esm/graph/nodes/utility/map.js +0 -52
- package/lib/esm/graph/nodes/utility/map.js.map +0 -1
- package/lib/esm/graph/nodes/utility/merge.js +0 -53
- package/lib/esm/graph/nodes/utility/merge.js.map +0 -1
- package/lib/esm/graph/nodes/utility/return.js +0 -52
- package/lib/esm/graph/nodes/utility/return.js.map +0 -1
- package/lib/esm/graph/nodes/utility/utility-log.js +0 -57
- package/lib/esm/graph/nodes/utility/utility-log.js.map +0 -1
- package/lib/esm/graph/overrides/Metadata.js +0 -20
- package/lib/esm/graph/overrides/Metadata.js.map +0 -1
- package/lib/esm/graph/overrides/Rendering.js +0 -2
- package/lib/esm/graph/overrides/Rendering.js.map +0 -1
- package/lib/esm/graph/overrides/index.js +0 -4
- package/lib/esm/graph/overrides/index.js.map +0 -1
- package/lib/esm/graph/overrides/overrides.js +0 -17
- package/lib/esm/graph/overrides/overrides.js.map +0 -1
- package/lib/esm/graph/reader.js +0 -288
- package/lib/esm/graph/reader.js.map +0 -1
- package/lib/esm/graph/registry.js +0 -59
- package/lib/esm/graph/registry.js.map +0 -1
- package/lib/esm/graph/snapshot.js +0 -680
- package/lib/esm/graph/snapshot.js.map +0 -1
- package/lib/esm/graph/types.js +0 -2
- package/lib/esm/graph/types.js.map +0 -1
- package/lib/types/graph/GraphExecutionStateMapper.d.cts +0 -66
- package/lib/types/graph/GraphExecutionStateMapper.d.mts +0 -66
- package/lib/types/graph/GraphResolution.d.cts +0 -53
- package/lib/types/graph/GraphResolution.d.mts +0 -53
- package/lib/types/graph/catalog/GraphConnectionPolicy.d.cts +0 -9
- package/lib/types/graph/catalog/GraphConnectionPolicy.d.mts +0 -9
- package/lib/types/graph/catalog/GraphCredentialReference.d.cts +0 -6
- package/lib/types/graph/catalog/GraphCredentialReference.d.mts +0 -6
- package/lib/types/graph/catalog/GraphCredentialRequirement.d.cts +0 -7
- package/lib/types/graph/catalog/GraphCredentialRequirement.d.mts +0 -7
- package/lib/types/graph/catalog/GraphDynamicPortRule.d.cts +0 -22
- package/lib/types/graph/catalog/GraphDynamicPortRule.d.mts +0 -22
- package/lib/types/graph/catalog/GraphIconReference.d.cts +0 -12
- package/lib/types/graph/catalog/GraphIconReference.d.mts +0 -12
- package/lib/types/graph/catalog/GraphManifestCompiler.d.cts +0 -14
- package/lib/types/graph/catalog/GraphManifestCompiler.d.mts +0 -14
- package/lib/types/graph/catalog/GraphNodeCapability.d.cts +0 -4
- package/lib/types/graph/catalog/GraphNodeCapability.d.mts +0 -4
- package/lib/types/graph/catalog/GraphNodeDisplayManifest.d.cts +0 -33
- package/lib/types/graph/catalog/GraphNodeDisplayManifest.d.mts +0 -33
- package/lib/types/graph/catalog/GraphNodeManifest.d.cts +0 -26
- package/lib/types/graph/catalog/GraphNodeManifest.d.mts +0 -26
- package/lib/types/graph/catalog/GraphNodeManifestSerialization.d.cts +0 -7
- package/lib/types/graph/catalog/GraphNodeManifestSerialization.d.mts +0 -7
- package/lib/types/graph/catalog/GraphNodeMethodManifest.d.cts +0 -10
- package/lib/types/graph/catalog/GraphNodeMethodManifest.d.mts +0 -10
- package/lib/types/graph/catalog/GraphNodePolicyManifest.d.cts +0 -46
- package/lib/types/graph/catalog/GraphNodePolicyManifest.d.mts +0 -46
- package/lib/types/graph/catalog/GraphParameterBase.d.cts +0 -14
- package/lib/types/graph/catalog/GraphParameterBase.d.mts +0 -14
- package/lib/types/graph/catalog/GraphParameterDefinition.d.cts +0 -66
- package/lib/types/graph/catalog/GraphParameterDefinition.d.mts +0 -66
- package/lib/types/graph/catalog/GraphParameterOption.d.cts +0 -8
- package/lib/types/graph/catalog/GraphParameterOption.d.mts +0 -8
- package/lib/types/graph/catalog/GraphParameterValidation.d.cts +0 -25
- package/lib/types/graph/catalog/GraphParameterValidation.d.mts +0 -25
- package/lib/types/graph/catalog/GraphPortManifest.d.cts +0 -21
- package/lib/types/graph/catalog/GraphPortManifest.d.mts +0 -21
- package/lib/types/graph/catalog/GraphResourceLocatorMode.d.cts +0 -10
- package/lib/types/graph/catalog/GraphResourceLocatorMode.d.mts +0 -10
- package/lib/types/graph/catalog/GraphValueSchema.d.cts +0 -44
- package/lib/types/graph/catalog/GraphValueSchema.d.mts +0 -44
- package/lib/types/graph/catalog/GraphValueSchemaDerivation.d.cts +0 -9
- package/lib/types/graph/catalog/GraphValueSchemaDerivation.d.mts +0 -9
- package/lib/types/graph/catalog/GraphVisibilityExpression.d.cts +0 -22
- package/lib/types/graph/catalog/GraphVisibilityExpression.d.mts +0 -22
- package/lib/types/graph/catalog/index.d.cts +0 -21
- package/lib/types/graph/catalog/index.d.mts +0 -21
- package/lib/types/graph/constants.d.cts +0 -544
- package/lib/types/graph/constants.d.mts +0 -544
- package/lib/types/graph/decorators.d.cts +0 -69
- package/lib/types/graph/decorators.d.mts +0 -69
- package/lib/types/graph/document/GraphDecoratedWorkflowCompiler.d.cts +0 -47
- package/lib/types/graph/document/GraphDecoratedWorkflowCompiler.d.mts +0 -47
- package/lib/types/graph/document/GraphEdgeInstance.d.cts +0 -12
- package/lib/types/graph/document/GraphEdgeInstance.d.mts +0 -12
- package/lib/types/graph/document/GraphEndpoint.d.cts +0 -13
- package/lib/types/graph/document/GraphEndpoint.d.mts +0 -13
- package/lib/types/graph/document/GraphJsonValue.d.cts +0 -11
- package/lib/types/graph/document/GraphJsonValue.d.mts +0 -11
- package/lib/types/graph/document/GraphLoopConfiguration.d.cts +0 -24
- package/lib/types/graph/document/GraphLoopConfiguration.d.mts +0 -24
- package/lib/types/graph/document/GraphNodeBinding.d.cts +0 -21
- package/lib/types/graph/document/GraphNodeBinding.d.mts +0 -21
- package/lib/types/graph/document/GraphNodeInstance.d.cts +0 -36
- package/lib/types/graph/document/GraphNodeInstance.d.mts +0 -36
- package/lib/types/graph/document/GraphWorkflowDocument.d.cts +0 -33
- package/lib/types/graph/document/GraphWorkflowDocument.d.mts +0 -33
- package/lib/types/graph/document/GraphWorkflowDocumentBuilder.d.cts +0 -72
- package/lib/types/graph/document/GraphWorkflowDocumentBuilder.d.mts +0 -72
- package/lib/types/graph/document/GraphWorkflowDocumentReader.d.cts +0 -21
- package/lib/types/graph/document/GraphWorkflowDocumentReader.d.mts +0 -21
- package/lib/types/graph/document/GraphWorkflowDocumentSerializer.d.cts +0 -5
- package/lib/types/graph/document/GraphWorkflowDocumentSerializer.d.mts +0 -5
- package/lib/types/graph/document/GraphWorkflowUiState.d.cts +0 -37
- package/lib/types/graph/document/GraphWorkflowUiState.d.mts +0 -37
- package/lib/types/graph/document/index.d.cts +0 -12
- package/lib/types/graph/document/index.d.mts +0 -12
- package/lib/types/graph/index.d.cts +0 -15
- package/lib/types/graph/index.d.mts +0 -15
- package/lib/types/graph/nodes/agents/agent.d.cts +0 -44
- package/lib/types/graph/nodes/agents/agent.d.mts +0 -44
- package/lib/types/graph/nodes/base.d.cts +0 -28
- package/lib/types/graph/nodes/base.d.mts +0 -28
- package/lib/types/graph/nodes/boundary/input-value.d.cts +0 -13
- package/lib/types/graph/nodes/boundary/input-value.d.mts +0 -13
- package/lib/types/graph/nodes/category-styles.d.cts +0 -8
- package/lib/types/graph/nodes/category-styles.d.mts +0 -8
- package/lib/types/graph/nodes/flow-control/break.d.cts +0 -15
- package/lib/types/graph/nodes/flow-control/break.d.mts +0 -15
- package/lib/types/graph/nodes/flow-control/error-boundary.d.cts +0 -12
- package/lib/types/graph/nodes/flow-control/error-boundary.d.mts +0 -12
- package/lib/types/graph/nodes/flow-control/human-approval.d.cts +0 -13
- package/lib/types/graph/nodes/flow-control/human-approval.d.mts +0 -13
- package/lib/types/graph/nodes/flow-control/if.d.cts +0 -16
- package/lib/types/graph/nodes/flow-control/if.d.mts +0 -16
- package/lib/types/graph/nodes/flow-control/parallel.d.cts +0 -11
- package/lib/types/graph/nodes/flow-control/parallel.d.mts +0 -11
- package/lib/types/graph/nodes/flow-control/switch.d.cts +0 -21
- package/lib/types/graph/nodes/flow-control/switch.d.mts +0 -21
- package/lib/types/graph/nodes/index.d.cts +0 -79
- package/lib/types/graph/nodes/index.d.mts +0 -79
- package/lib/types/graph/nodes/loops/foreach.d.cts +0 -19
- package/lib/types/graph/nodes/loops/foreach.d.mts +0 -19
- package/lib/types/graph/nodes/loops/until.d.cts +0 -16
- package/lib/types/graph/nodes/loops/until.d.mts +0 -16
- package/lib/types/graph/nodes/loops/while.d.cts +0 -16
- package/lib/types/graph/nodes/loops/while.d.mts +0 -16
- package/lib/types/graph/nodes/manifests.d.cts +0 -62
- package/lib/types/graph/nodes/manifests.d.mts +0 -62
- package/lib/types/graph/nodes/triggers/chat.d.cts +0 -13
- package/lib/types/graph/nodes/triggers/chat.d.mts +0 -13
- package/lib/types/graph/nodes/triggers/event.d.cts +0 -10
- package/lib/types/graph/nodes/triggers/event.d.mts +0 -10
- package/lib/types/graph/nodes/triggers/form.d.cts +0 -11
- package/lib/types/graph/nodes/triggers/form.d.mts +0 -11
- package/lib/types/graph/nodes/triggers/manual.d.cts +0 -12
- package/lib/types/graph/nodes/triggers/manual.d.mts +0 -12
- package/lib/types/graph/nodes/triggers/schedule.d.cts +0 -11
- package/lib/types/graph/nodes/triggers/schedule.d.mts +0 -11
- package/lib/types/graph/nodes/triggers/webhook.d.cts +0 -11
- package/lib/types/graph/nodes/triggers/webhook.d.mts +0 -11
- package/lib/types/graph/nodes/utility/code.d.cts +0 -31
- package/lib/types/graph/nodes/utility/code.d.mts +0 -31
- package/lib/types/graph/nodes/utility/delay.d.cts +0 -11
- package/lib/types/graph/nodes/utility/delay.d.mts +0 -11
- package/lib/types/graph/nodes/utility/log.d.cts +0 -13
- package/lib/types/graph/nodes/utility/log.d.mts +0 -13
- package/lib/types/graph/nodes/utility/map.d.cts +0 -11
- package/lib/types/graph/nodes/utility/map.d.mts +0 -11
- package/lib/types/graph/nodes/utility/merge.d.cts +0 -12
- package/lib/types/graph/nodes/utility/merge.d.mts +0 -12
- package/lib/types/graph/nodes/utility/return.d.cts +0 -11
- package/lib/types/graph/nodes/utility/return.d.mts +0 -11
- package/lib/types/graph/nodes/utility/utility-log.d.cts +0 -15
- package/lib/types/graph/nodes/utility/utility-log.d.mts +0 -15
- package/lib/types/graph/overrides/Metadata.d.cts +0 -43
- package/lib/types/graph/overrides/Metadata.d.mts +0 -43
- package/lib/types/graph/overrides/Rendering.d.cts +0 -5
- package/lib/types/graph/overrides/Rendering.d.mts +0 -5
- package/lib/types/graph/overrides/index.d.cts +0 -3
- package/lib/types/graph/overrides/index.d.mts +0 -3
- package/lib/types/graph/overrides/overrides.d.cts +0 -1
- package/lib/types/graph/overrides/overrides.d.mts +0 -1
- package/lib/types/graph/reader.d.cts +0 -16
- package/lib/types/graph/reader.d.mts +0 -16
- package/lib/types/graph/registry.d.cts +0 -40
- package/lib/types/graph/registry.d.mts +0 -40
- package/lib/types/graph/snapshot.d.cts +0 -176
- package/lib/types/graph/snapshot.d.mts +0 -176
- package/lib/types/graph/types.d.cts +0 -289
- package/lib/types/graph/types.d.mts +0 -289
|
@@ -1,680 +0,0 @@
|
|
|
1
|
-
import { graphLeafPortsOf, graphWorkflowDefinitionOf } from "./reader.js";
|
|
2
|
-
import { isGraphJsonSafeValue } from "./document/GraphJsonValue.js";
|
|
3
|
-
import { graphValueSchemaFromValidation, } from "./catalog/GraphValueSchemaDerivation.js";
|
|
4
|
-
const GRAPH_LEGACY_BOUNDARY_ALIASES = ["$workflow", "workflow", "graph"];
|
|
5
|
-
const GRAPH_CONSTRUCTOR_DATA_KEYS = [
|
|
6
|
-
"node",
|
|
7
|
-
"modelClass",
|
|
8
|
-
"sourceClass",
|
|
9
|
-
"constructor",
|
|
10
|
-
"definition",
|
|
11
|
-
"executor",
|
|
12
|
-
];
|
|
13
|
-
export const GRAPH_WORKFLOW_SNAPSHOT_VERSION = 1;
|
|
14
|
-
function isPlainObject(value) {
|
|
15
|
-
return (!!value &&
|
|
16
|
-
typeof value === "object" &&
|
|
17
|
-
!Array.isArray(value) &&
|
|
18
|
-
!(value instanceof Date));
|
|
19
|
-
}
|
|
20
|
-
function cloneValue(value) {
|
|
21
|
-
if (Array.isArray(value)) {
|
|
22
|
-
return value.map((entry) => cloneValue(entry));
|
|
23
|
-
}
|
|
24
|
-
if (value instanceof Date) {
|
|
25
|
-
return new Date(value.getTime());
|
|
26
|
-
}
|
|
27
|
-
if (isPlainObject(value)) {
|
|
28
|
-
const cloned = {};
|
|
29
|
-
for (const [key, entry] of Object.entries(value)) {
|
|
30
|
-
cloned[key] = cloneValue(entry);
|
|
31
|
-
}
|
|
32
|
-
return cloned;
|
|
33
|
-
}
|
|
34
|
-
return value;
|
|
35
|
-
}
|
|
36
|
-
function asString(value) {
|
|
37
|
-
if (value === undefined || value === null)
|
|
38
|
-
return undefined;
|
|
39
|
-
return typeof value === "string" ? value : String(value);
|
|
40
|
-
}
|
|
41
|
-
function isWorkflowDefinitionLike(value) {
|
|
42
|
-
return (isPlainObject(value) &&
|
|
43
|
-
typeof value.name === "string" &&
|
|
44
|
-
typeof value.tag === "string" &&
|
|
45
|
-
typeof value.kind === "string" &&
|
|
46
|
-
Array.isArray(value.inputs) &&
|
|
47
|
-
Array.isArray(value.outputs) &&
|
|
48
|
-
Array.isArray(value.nodes) &&
|
|
49
|
-
Array.isArray(value.relations));
|
|
50
|
-
}
|
|
51
|
-
function snapshotNodeKey(node) {
|
|
52
|
-
return node.ref?.id ?? node.id ?? node.ref?.path ?? node.ref?.property;
|
|
53
|
-
}
|
|
54
|
-
function snapshotEdgeKey(edge) {
|
|
55
|
-
return (edge.id ??
|
|
56
|
-
[edge.sourceRef ?? edge.source, edge.sourcePort, edge.targetRef ?? edge.target, edge.targetPort]
|
|
57
|
-
.filter(Boolean)
|
|
58
|
-
.join("::"));
|
|
59
|
-
}
|
|
60
|
-
function normalizeValueEntries(entries, definitions) {
|
|
61
|
-
const byPath = new Map();
|
|
62
|
-
if (Array.isArray(entries)) {
|
|
63
|
-
for (const entry of entries) {
|
|
64
|
-
if (!entry?.path)
|
|
65
|
-
continue;
|
|
66
|
-
byPath.set(entry.path, cloneValue(entry));
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
else if (isPlainObject(entries)) {
|
|
70
|
-
for (const [path, value] of Object.entries(entries)) {
|
|
71
|
-
byPath.set(path, { path, value: cloneValue(value) });
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
const normalized = definitions.map((definition) => {
|
|
75
|
-
const path = definition.path ?? definition.property;
|
|
76
|
-
const current = byPath.get(path);
|
|
77
|
-
const entry = {
|
|
78
|
-
label: definition.label,
|
|
79
|
-
type: definition.type,
|
|
80
|
-
required: definition.required,
|
|
81
|
-
model: definition.model,
|
|
82
|
-
metadata: cloneValue(definition.graph?.metadata ??
|
|
83
|
-
definition.element?.props ??
|
|
84
|
-
definition.prop?.props ??
|
|
85
|
-
{}),
|
|
86
|
-
...current,
|
|
87
|
-
path,
|
|
88
|
-
};
|
|
89
|
-
if (!Object.keys(entry.metadata || {}).length) {
|
|
90
|
-
delete entry.metadata;
|
|
91
|
-
}
|
|
92
|
-
return entry;
|
|
93
|
-
});
|
|
94
|
-
for (const entry of byPath.values()) {
|
|
95
|
-
if (normalized.some((current) => current.path === entry.path))
|
|
96
|
-
continue;
|
|
97
|
-
normalized.push(cloneValue(entry));
|
|
98
|
-
}
|
|
99
|
-
return normalized;
|
|
100
|
-
}
|
|
101
|
-
function normalizeNodes(nodes, definitions) {
|
|
102
|
-
const byKey = new Map();
|
|
103
|
-
const result = [];
|
|
104
|
-
for (const definition of definitions) {
|
|
105
|
-
const node = {
|
|
106
|
-
id: definition.id,
|
|
107
|
-
ref: {
|
|
108
|
-
id: definition.id,
|
|
109
|
-
kind: definition.kind,
|
|
110
|
-
},
|
|
111
|
-
label: definition.label,
|
|
112
|
-
kind: definition.kind,
|
|
113
|
-
data: definition.node !== undefined ? { node: cloneValue(definition.node) } : undefined,
|
|
114
|
-
metadata: cloneValue(definition.metadata),
|
|
115
|
-
};
|
|
116
|
-
result.push(node);
|
|
117
|
-
byKey.set(definition.id, node);
|
|
118
|
-
}
|
|
119
|
-
for (const entry of nodes || []) {
|
|
120
|
-
const key = snapshotNodeKey(entry);
|
|
121
|
-
const current = key ? byKey.get(key) : undefined;
|
|
122
|
-
if (current) {
|
|
123
|
-
const merged = {
|
|
124
|
-
...current,
|
|
125
|
-
...cloneValue(entry),
|
|
126
|
-
id: entry.id || current.id,
|
|
127
|
-
ref: {
|
|
128
|
-
...current.ref,
|
|
129
|
-
...entry.ref,
|
|
130
|
-
id: entry.ref?.id ?? current.ref?.id ?? current.id,
|
|
131
|
-
},
|
|
132
|
-
position: entry.position ? cloneValue(entry.position) : current.position,
|
|
133
|
-
size: entry.size ? cloneValue(entry.size) : current.size,
|
|
134
|
-
ports: {
|
|
135
|
-
...(current.ports || {}),
|
|
136
|
-
...(entry.ports || {}),
|
|
137
|
-
},
|
|
138
|
-
data: {
|
|
139
|
-
...(current.data || {}),
|
|
140
|
-
...(entry.data || {}),
|
|
141
|
-
},
|
|
142
|
-
metadata: {
|
|
143
|
-
...(current.metadata || {}),
|
|
144
|
-
...(entry.metadata || {}),
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
|
-
if (key)
|
|
148
|
-
byKey.set(key, merged);
|
|
149
|
-
const index = result.findIndex((value) => value.id === current.id);
|
|
150
|
-
if (index >= 0)
|
|
151
|
-
result[index] = merged;
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
const cloned = cloneValue(entry);
|
|
155
|
-
result.push(cloned);
|
|
156
|
-
if (key)
|
|
157
|
-
byKey.set(key, cloned);
|
|
158
|
-
}
|
|
159
|
-
return result;
|
|
160
|
-
}
|
|
161
|
-
function normalizeEdges(edges, relations) {
|
|
162
|
-
const byKey = new Map();
|
|
163
|
-
const result = [];
|
|
164
|
-
for (const [index, relation] of relations.entries()) {
|
|
165
|
-
const source = asString(relation.source) ?? `source-${index}`;
|
|
166
|
-
const target = asString(relation.target) ?? `target-${index}`;
|
|
167
|
-
const edge = {
|
|
168
|
-
id: relation.label || `${source}:${relation.sourcePort ?? "*"}->${target}:${relation.targetPort ?? "*"}`,
|
|
169
|
-
source,
|
|
170
|
-
sourceRef: source,
|
|
171
|
-
sourcePort: relation.sourcePort,
|
|
172
|
-
target,
|
|
173
|
-
targetRef: target,
|
|
174
|
-
targetPort: relation.targetPort,
|
|
175
|
-
label: relation.label,
|
|
176
|
-
metadata: cloneValue(relation.metadata),
|
|
177
|
-
};
|
|
178
|
-
result.push(edge);
|
|
179
|
-
byKey.set(edge.id, edge);
|
|
180
|
-
}
|
|
181
|
-
for (const entry of edges || []) {
|
|
182
|
-
const key = snapshotEdgeKey(entry);
|
|
183
|
-
const current = key ? byKey.get(key) : undefined;
|
|
184
|
-
if (current) {
|
|
185
|
-
const merged = {
|
|
186
|
-
...current,
|
|
187
|
-
...cloneValue(entry),
|
|
188
|
-
id: entry.id || current.id,
|
|
189
|
-
source: entry.source || current.source,
|
|
190
|
-
sourceRef: entry.sourceRef ?? current.sourceRef ?? entry.source ?? current.source,
|
|
191
|
-
target: entry.target || current.target,
|
|
192
|
-
targetRef: entry.targetRef ?? current.targetRef ?? entry.target ?? current.target,
|
|
193
|
-
// Labels are document-carried display semantics (§4.4.7): a row merged
|
|
194
|
-
// from a canvas clone that never carried its own label must not erase
|
|
195
|
-
// the relation row's label.
|
|
196
|
-
label: entry.label ?? current.label,
|
|
197
|
-
metadata: {
|
|
198
|
-
...(current.metadata || {}),
|
|
199
|
-
...(entry.metadata || {}),
|
|
200
|
-
},
|
|
201
|
-
};
|
|
202
|
-
if (key)
|
|
203
|
-
byKey.set(key, merged);
|
|
204
|
-
const index = result.findIndex((value) => value.id === current.id);
|
|
205
|
-
if (index >= 0)
|
|
206
|
-
result[index] = merged;
|
|
207
|
-
continue;
|
|
208
|
-
}
|
|
209
|
-
const cloned = cloneValue(entry);
|
|
210
|
-
result.push(cloned);
|
|
211
|
-
if (key)
|
|
212
|
-
byKey.set(key, cloned);
|
|
213
|
-
}
|
|
214
|
-
return result;
|
|
215
|
-
}
|
|
216
|
-
function normalizeWorkflowDefinition(definition, overrides = {}) {
|
|
217
|
-
return {
|
|
218
|
-
name: overrides.name ?? definition.name,
|
|
219
|
-
tag: overrides.tag ?? definition.tag,
|
|
220
|
-
kind: overrides.kind ?? definition.kind,
|
|
221
|
-
category: overrides.category ?? definition.category,
|
|
222
|
-
color: overrides.color ?? definition.color,
|
|
223
|
-
group: overrides.group ?? definition.group,
|
|
224
|
-
height: overrides.height ?? definition.height,
|
|
225
|
-
icon: overrides.icon ?? definition.icon,
|
|
226
|
-
labels: cloneValue(overrides.labels ?? definition.labels ?? []),
|
|
227
|
-
maxChildren: overrides.maxChildren ?? definition.maxChildren,
|
|
228
|
-
minWidth: overrides.minWidth ?? definition.minWidth,
|
|
229
|
-
width: overrides.width ?? definition.width,
|
|
230
|
-
metadata: cloneValue(overrides.metadata ??
|
|
231
|
-
("workflow" in definition ? definition.workflow : definition.metadata)),
|
|
232
|
-
inputs: cloneValue(overrides.inputs ?? definition.inputs ?? []),
|
|
233
|
-
outputs: cloneValue(overrides.outputs ?? definition.outputs ?? []),
|
|
234
|
-
nodes: cloneValue(overrides.nodes ?? definition.nodes ?? []),
|
|
235
|
-
relations: cloneValue(overrides.relations ?? definition.relations ?? []),
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
export function graphWorkflowSnapshotDefinitionOf(model) {
|
|
239
|
-
const definition = isWorkflowDefinitionLike(model)
|
|
240
|
-
? model
|
|
241
|
-
: graphWorkflowDefinitionOf(model);
|
|
242
|
-
return normalizeWorkflowDefinition(definition);
|
|
243
|
-
}
|
|
244
|
-
export function graphWorkflowSnapshotOf(model, input) {
|
|
245
|
-
const normalizedDefinition = normalizeWorkflowDefinition(graphWorkflowSnapshotDefinitionOf(model), input?.definition);
|
|
246
|
-
const inputPorts = graphLeafPortsOf(normalizedDefinition.inputs);
|
|
247
|
-
const outputPorts = graphLeafPortsOf(normalizedDefinition.outputs);
|
|
248
|
-
return {
|
|
249
|
-
version: GRAPH_WORKFLOW_SNAPSHOT_VERSION,
|
|
250
|
-
definition: normalizedDefinition,
|
|
251
|
-
state: {
|
|
252
|
-
inputs: normalizeValueEntries(input?.inputs, inputPorts),
|
|
253
|
-
outputs: normalizeValueEntries(input?.outputs, outputPorts),
|
|
254
|
-
nodes: normalizeNodes(input?.nodes, normalizedDefinition.nodes),
|
|
255
|
-
edges: normalizeEdges(input?.edges, normalizedDefinition.relations),
|
|
256
|
-
ui: cloneValue(input?.ui || {}),
|
|
257
|
-
metadata: cloneValue(input?.metadata || {}),
|
|
258
|
-
},
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
export function graphWorkflowSnapshotRestore(snapshot, model) {
|
|
262
|
-
if (!("version" in snapshot)) {
|
|
263
|
-
return graphWorkflowSnapshotOf(model ??
|
|
264
|
-
snapshot.definition ??
|
|
265
|
-
{}, snapshot);
|
|
266
|
-
}
|
|
267
|
-
const fullSnapshot = snapshot;
|
|
268
|
-
const definition = model
|
|
269
|
-
? graphWorkflowSnapshotDefinitionOf(model)
|
|
270
|
-
: fullSnapshot.definition;
|
|
271
|
-
return graphWorkflowSnapshotOf(definition, {
|
|
272
|
-
inputs: fullSnapshot.state.inputs,
|
|
273
|
-
outputs: fullSnapshot.state.outputs,
|
|
274
|
-
nodes: fullSnapshot.state.nodes,
|
|
275
|
-
edges: fullSnapshot.state.edges,
|
|
276
|
-
ui: fullSnapshot.state.ui,
|
|
277
|
-
metadata: fullSnapshot.state.metadata,
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
export function graphWorkflowSnapshotToJSON(snapshot, space) {
|
|
281
|
-
return JSON.stringify(snapshot, undefined, space);
|
|
282
|
-
}
|
|
283
|
-
export function graphWorkflowSnapshotFromJSON(input, model) {
|
|
284
|
-
const snapshot = typeof input === "string" ? JSON.parse(input) : input;
|
|
285
|
-
return graphWorkflowSnapshotRestore(snapshot, model);
|
|
286
|
-
}
|
|
287
|
-
export function graphWorkflowSnapshotInputValuesOf(snapshot) {
|
|
288
|
-
return Object.fromEntries(snapshot.state.inputs.map((entry) => [entry.path, cloneValue(entry.value)]));
|
|
289
|
-
}
|
|
290
|
-
export function graphWorkflowSnapshotOutputValuesOf(snapshot) {
|
|
291
|
-
return Object.fromEntries(snapshot.state.outputs.map((entry) => [entry.path, cloneValue(entry.value)]));
|
|
292
|
-
}
|
|
293
|
-
function dropUnsafeEntries(source) {
|
|
294
|
-
const result = {};
|
|
295
|
-
for (const [key, value] of Object.entries(source)) {
|
|
296
|
-
if (GRAPH_CONSTRUCTOR_DATA_KEYS.includes(key))
|
|
297
|
-
continue;
|
|
298
|
-
const sanitized = sanitizeToGraphJsonValue(value);
|
|
299
|
-
if (sanitized !== undefined)
|
|
300
|
-
result[key] = sanitized;
|
|
301
|
-
}
|
|
302
|
-
return result;
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Sanitizes a legacy snapshot into a JSON-safe payload while preserving its
|
|
306
|
-
* structural keys (`version`, `definition`, `state`). Constructor-key stripping
|
|
307
|
-
* still applies to the payload contents inside, so the canonical→legacy
|
|
308
|
-
* round trip stays lossless for persisted data.
|
|
309
|
-
*/
|
|
310
|
-
function sanitizeLegacySnapshotPayload(snapshot) {
|
|
311
|
-
return {
|
|
312
|
-
version: snapshot.version,
|
|
313
|
-
definition: dropUnsafeEntries((snapshot.definition ?? {})),
|
|
314
|
-
state: dropUnsafeEntries((snapshot.state ?? {})),
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
|
-
function sanitizeToGraphJsonValue(value) {
|
|
318
|
-
if (value === null)
|
|
319
|
-
return null;
|
|
320
|
-
const type = typeof value;
|
|
321
|
-
if (type === "string" || type === "boolean")
|
|
322
|
-
return value;
|
|
323
|
-
if (type === "number")
|
|
324
|
-
return Number.isFinite(value) ? value : undefined;
|
|
325
|
-
if (Array.isArray(value)) {
|
|
326
|
-
const items = [];
|
|
327
|
-
for (const item of value) {
|
|
328
|
-
const sanitized = sanitizeToGraphJsonValue(item);
|
|
329
|
-
if (sanitized !== undefined)
|
|
330
|
-
items.push(sanitized);
|
|
331
|
-
}
|
|
332
|
-
return items;
|
|
333
|
-
}
|
|
334
|
-
if (type === "object") {
|
|
335
|
-
return dropUnsafeEntries(value);
|
|
336
|
-
}
|
|
337
|
-
return undefined;
|
|
338
|
-
}
|
|
339
|
-
function boundaryAliasesFor(definition) {
|
|
340
|
-
const aliases = new Set(GRAPH_LEGACY_BOUNDARY_ALIASES);
|
|
341
|
-
if (definition.tag)
|
|
342
|
-
aliases.add(definition.tag);
|
|
343
|
-
if (definition.name)
|
|
344
|
-
aliases.add(definition.name);
|
|
345
|
-
return aliases;
|
|
346
|
-
}
|
|
347
|
-
function legacyEndpoint(refId, port, aliases, boundaryPortIds) {
|
|
348
|
-
const resolvedPort = port ?? "";
|
|
349
|
-
if (!refId || aliases.has(refId)) {
|
|
350
|
-
return { scope: "workflow", port: resolvedPort };
|
|
351
|
-
}
|
|
352
|
-
// The legacy decorated-root canvas rendered workflow input ports as draggable
|
|
353
|
-
// boundary badges (`input-{port}`, port handle `value`). Those bindings stay
|
|
354
|
-
// lossless only when the badge id folds back onto the workflow port it was
|
|
355
|
-
// drawn for (DECAF-50 §4.11); otherwise a workflow port would collapse into
|
|
356
|
-
// one shared boundary endpoint and drop real edges (§4.4.6 canonical form).
|
|
357
|
-
if (refId.startsWith("input-")) {
|
|
358
|
-
const workflowPortId = boundaryPortIds?.get(refId.slice("input-".length) ?? "");
|
|
359
|
-
if (workflowPortId) {
|
|
360
|
-
return {
|
|
361
|
-
scope: "workflow",
|
|
362
|
-
port: workflowPortId,
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
return { scope: "node", nodeId: refId, port: resolvedPort };
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Maps workflow input-property names to their legacy boundary-badge ids
|
|
370
|
-
* (`input-{property}`), so badges drawn on the canvas resolve back to the
|
|
371
|
-
* workflow port they represent (§4.11).
|
|
372
|
-
*/
|
|
373
|
-
function boundaryPortIdsFor(snapshot) {
|
|
374
|
-
const map = new Map();
|
|
375
|
-
for (const port of snapshot.definition.inputs) {
|
|
376
|
-
map.set(`input-${port.property}`, port.property);
|
|
377
|
-
}
|
|
378
|
-
return map;
|
|
379
|
-
}
|
|
380
|
-
/**
|
|
381
|
-
* Resolves the decorated definition's own edge labels by canonical endpoint
|
|
382
|
-
* pair, so converted legacy edges that never carried a label on the edge row
|
|
383
|
-
* (canvas-drawn clones merged over the relation rows) still restore the
|
|
384
|
-
* document-carried {@link GraphEdgeInstance.label} (§4.4.7) instead of losing
|
|
385
|
-
* the display affordance on save/reload.
|
|
386
|
-
*/
|
|
387
|
-
function legacyRelationLabelByEndpoint(snapshot, aliases, boundaryPortIds) {
|
|
388
|
-
const map = new Map();
|
|
389
|
-
for (const relation of snapshot.definition.relations) {
|
|
390
|
-
const label = typeof relation.label === "string" ? relation.label : undefined;
|
|
391
|
-
if (!label)
|
|
392
|
-
continue;
|
|
393
|
-
const sourceRef = typeof relation.source === "string" ? relation.source : undefined;
|
|
394
|
-
const targetRef = typeof relation.target === "string" ? relation.target : undefined;
|
|
395
|
-
map.set(edgePairKeyOf({
|
|
396
|
-
source: legacyEndpoint(sourceRef, relation.sourcePort, aliases, boundaryPortIds),
|
|
397
|
-
target: legacyEndpoint(targetRef, relation.targetPort, aliases, boundaryPortIds),
|
|
398
|
-
}), label);
|
|
399
|
-
}
|
|
400
|
-
return map;
|
|
401
|
-
}
|
|
402
|
-
function endpointToLegacyRef(endpoint) {
|
|
403
|
-
if (endpoint.scope === "workflow") {
|
|
404
|
-
return { refId: "$workflow", port: endpoint.port };
|
|
405
|
-
}
|
|
406
|
-
return { refId: endpoint.nodeId, port: endpoint.port };
|
|
407
|
-
}
|
|
408
|
-
function portInstanceFromDefinition(port, value) {
|
|
409
|
-
const instance = {
|
|
410
|
-
id: port.property,
|
|
411
|
-
label: port.label,
|
|
412
|
-
};
|
|
413
|
-
instance.schema = graphValueSchemaFromValidation(port.validation, port.type, port.model);
|
|
414
|
-
if (port.required)
|
|
415
|
-
instance.required = true;
|
|
416
|
-
if (value !== undefined)
|
|
417
|
-
instance.defaultValue = value;
|
|
418
|
-
const metadata = sanitizeToGraphJsonValue(port.graph ?? {});
|
|
419
|
-
if (metadata && Object.keys(metadata).length)
|
|
420
|
-
instance.metadata = metadata;
|
|
421
|
-
return instance;
|
|
422
|
-
}
|
|
423
|
-
function inputBindingsFromPorts(ports) {
|
|
424
|
-
if (!ports)
|
|
425
|
-
return undefined;
|
|
426
|
-
const bindings = {};
|
|
427
|
-
for (const [property, port] of Object.entries(ports)) {
|
|
428
|
-
if (port?.mode === "port") {
|
|
429
|
-
bindings[property] = { mode: "edge" };
|
|
430
|
-
}
|
|
431
|
-
else if ("value" in (port ?? {})) {
|
|
432
|
-
const value = sanitizeToGraphJsonValue(port.value);
|
|
433
|
-
bindings[property] = { mode: "literal", value: value ?? null };
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
return Object.keys(bindings).length ? bindings : undefined;
|
|
437
|
-
}
|
|
438
|
-
function nodeInstanceFromLegacy(node) {
|
|
439
|
-
const instance = {
|
|
440
|
-
id: node.id,
|
|
441
|
-
kind: node.kind ?? node.ref?.kind ?? node.id,
|
|
442
|
-
parameters: dropUnsafeEntries(node.data ?? {}),
|
|
443
|
-
};
|
|
444
|
-
if (node.label)
|
|
445
|
-
instance.label = node.label;
|
|
446
|
-
const bindings = inputBindingsFromPorts(node.ports);
|
|
447
|
-
if (bindings)
|
|
448
|
-
instance.inputBindings = bindings;
|
|
449
|
-
const metadata = sanitizeToGraphJsonValue(node.metadata ?? {});
|
|
450
|
-
if (metadata && Object.keys(metadata).length)
|
|
451
|
-
instance.metadata = metadata;
|
|
452
|
-
if (node.position || node.size || node.expanded !== undefined) {
|
|
453
|
-
const ui = {
|
|
454
|
-
position: node.position ? { x: node.position.x, y: node.position.y } : { x: 0, y: 0 },
|
|
455
|
-
};
|
|
456
|
-
if (node.size)
|
|
457
|
-
ui.size = { width: node.size.width, height: node.size.height };
|
|
458
|
-
if (node.expanded !== undefined)
|
|
459
|
-
ui.expanded = node.expanded;
|
|
460
|
-
instance.ui = ui;
|
|
461
|
-
}
|
|
462
|
-
return instance;
|
|
463
|
-
}
|
|
464
|
-
function edgeInstanceFromLegacy(edge, aliases, boundaryPortIds, relationLabelByPair) {
|
|
465
|
-
const source = legacyEndpoint(edge.sourceRef ?? edge.source, edge.sourcePort, aliases, boundaryPortIds);
|
|
466
|
-
const target = legacyEndpoint(edge.targetRef ?? edge.target, edge.targetPort, aliases, boundaryPortIds);
|
|
467
|
-
const instance = {
|
|
468
|
-
id: edge.id,
|
|
469
|
-
type: "data",
|
|
470
|
-
source,
|
|
471
|
-
target,
|
|
472
|
-
};
|
|
473
|
-
const label = edge.label ?? relationLabelByPair?.get(edgePairKeyOf({ source, target }));
|
|
474
|
-
if (label)
|
|
475
|
-
instance.label = label;
|
|
476
|
-
const metadata = sanitizeToGraphJsonValue(edge.metadata ?? {});
|
|
477
|
-
if (metadata && Object.keys(metadata).length)
|
|
478
|
-
instance.metadata = metadata;
|
|
479
|
-
return instance;
|
|
480
|
-
}
|
|
481
|
-
/** Endpoint-pair key for edge identity (canonical `GraphEndpoint` shape). */
|
|
482
|
-
function edgePairKeyOf(edge) {
|
|
483
|
-
const keyOf = (endpoint) => endpoint.scope === "node"
|
|
484
|
-
? `node:${endpoint.nodeId}:${endpoint.port}`
|
|
485
|
-
: `workflow:${endpoint.port}`;
|
|
486
|
-
return `${keyOf(edge.source)}->${keyOf(edge.target)}`;
|
|
487
|
-
}
|
|
488
|
-
/**
|
|
489
|
-
* Maps a legacy (pre-P7) canvas snapshot to the canonical
|
|
490
|
-
* {@link GraphWorkflowDocument} (DECAF-50 §4.4.6): legacy `node.data` becomes
|
|
491
|
-
* instance `parameters`, legacy `node.metadata` becomes instance `metadata`,
|
|
492
|
-
* workflow boundary badges (`input-{port}`) fold back onto their workflow
|
|
493
|
-
* ports, and edge labels missing from cloned edge rows are restored from the
|
|
494
|
-
* decorated definition's relation labels (§4.4.7).
|
|
495
|
-
*/
|
|
496
|
-
export function graphWorkflowDocumentFromLegacySnapshot(snapshot) {
|
|
497
|
-
const aliases = boundaryAliasesFor(snapshot.definition);
|
|
498
|
-
const boundaryPortIds = boundaryPortIdsFor(snapshot);
|
|
499
|
-
const relationLabelByPair = legacyRelationLabelByEndpoint(snapshot, aliases, boundaryPortIds);
|
|
500
|
-
const inputs = Object.fromEntries(snapshot.state.inputs.map((entry) => [entry.path, sanitizeToGraphJsonValue(entry.value)]));
|
|
501
|
-
const outputs = Object.fromEntries(snapshot.state.outputs.map((entry) => [entry.path, sanitizeToGraphJsonValue(entry.value)]));
|
|
502
|
-
const document = {
|
|
503
|
-
id: snapshot.definition.tag || snapshot.definition.name,
|
|
504
|
-
name: snapshot.definition.name,
|
|
505
|
-
inputs: snapshot.definition.inputs.map((port) => portInstanceFromDefinition(port, inputs[port.property])),
|
|
506
|
-
outputs: snapshot.definition.outputs.map((port) => portInstanceFromDefinition(port, outputs[port.property])),
|
|
507
|
-
nodes: snapshot.state.nodes.map(nodeInstanceFromLegacy),
|
|
508
|
-
edges: snapshot.state.edges.map((edge) => edgeInstanceFromLegacy(edge, aliases, boundaryPortIds, relationLabelByPair)),
|
|
509
|
-
};
|
|
510
|
-
if (snapshot.definition.metadata) {
|
|
511
|
-
const metadata = sanitizeToGraphJsonValue(snapshot.definition.metadata);
|
|
512
|
-
if (metadata && Object.keys(metadata).length)
|
|
513
|
-
document.metadata = metadata;
|
|
514
|
-
}
|
|
515
|
-
const ui = {};
|
|
516
|
-
const viewport = snapshot.state.ui?.["diagramMetadata"];
|
|
517
|
-
const parsedViewport = viewport?.["viewport"];
|
|
518
|
-
if (parsedViewport && typeof parsedViewport === "object") {
|
|
519
|
-
const v = parsedViewport;
|
|
520
|
-
const x = typeof v["x"] === "number" ? v["x"] : Number(v["x"]) || 0;
|
|
521
|
-
const y = typeof v["y"] === "number" ? v["y"] : Number(v["y"]) || 0;
|
|
522
|
-
const zoom = typeof v["scale"] === "number" ? v["scale"] : Number(v["scale"]) || 1;
|
|
523
|
-
ui.viewport = { x, y, zoom };
|
|
524
|
-
}
|
|
525
|
-
if (ui.viewport)
|
|
526
|
-
document.ui = ui;
|
|
527
|
-
return document;
|
|
528
|
-
}
|
|
529
|
-
/**
|
|
530
|
-
* Converts a legacy persisted snapshot into the canonical wrapper. The canonical
|
|
531
|
-
* `document` carries executable semantics; `editor.legacy` keeps the sanitized
|
|
532
|
-
* (constructor-free) legacy payload so a canonical→legacy round trip is lossless
|
|
533
|
-
* for persisted data.
|
|
534
|
-
*/
|
|
535
|
-
export function graphWorkflowSnapshotFromLegacy(snapshot) {
|
|
536
|
-
const document = graphWorkflowDocumentFromLegacySnapshot(snapshot);
|
|
537
|
-
const editor = {};
|
|
538
|
-
const sanitizedLegacy = sanitizeLegacySnapshotPayload(snapshot);
|
|
539
|
-
if (sanitizedLegacy && isGraphJsonSafeValue(sanitizedLegacy))
|
|
540
|
-
editor.legacy = sanitizedLegacy;
|
|
541
|
-
const ui = snapshot.state.ui;
|
|
542
|
-
if (ui) {
|
|
543
|
-
const duplicateCounts = ui["duplicateCounts"];
|
|
544
|
-
if (duplicateCounts && typeof duplicateCounts === "object") {
|
|
545
|
-
editor.duplicateCounts = duplicateCounts;
|
|
546
|
-
}
|
|
547
|
-
const diagramMetadata = ui["diagramMetadata"];
|
|
548
|
-
if (diagramMetadata && typeof diagramMetadata === "object") {
|
|
549
|
-
editor.diagramMetadata = sanitizeToGraphJsonValue(diagramMetadata);
|
|
550
|
-
}
|
|
551
|
-
const nodeConfigs = ui["nodeConfigs"];
|
|
552
|
-
if (nodeConfigs && typeof nodeConfigs === "object") {
|
|
553
|
-
editor.nodeConfigs = sanitizeToGraphJsonValue(nodeConfigs);
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
editor.nodePorts = {};
|
|
557
|
-
for (const node of snapshot.state.nodes) {
|
|
558
|
-
if (node.ports) {
|
|
559
|
-
editor.nodePorts[node.id] = sanitizeToGraphJsonValue(node.ports);
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
if (!Object.keys(editor.nodePorts).length)
|
|
563
|
-
delete editor.nodePorts;
|
|
564
|
-
const definitionDisplay = dropUnsafeEntries(snapshot.definition);
|
|
565
|
-
delete definitionDisplay["inputs"];
|
|
566
|
-
delete definitionDisplay["outputs"];
|
|
567
|
-
delete definitionDisplay["nodes"];
|
|
568
|
-
delete definitionDisplay["relations"];
|
|
569
|
-
editor.definitionDisplay = definitionDisplay;
|
|
570
|
-
const metadata = sanitizeToGraphJsonValue(snapshot.state.metadata ?? {});
|
|
571
|
-
return { document, editor, metadata: Object.keys(metadata).length ? metadata : undefined };
|
|
572
|
-
}
|
|
573
|
-
/**
|
|
574
|
-
* Reconstructs a legacy snapshot from a canonical wrapper. Uses the
|
|
575
|
-
* `editor.legacy` payload when present for exact round trips; otherwise it
|
|
576
|
-
* rebuilds a best-effort legacy snapshot from the document + editor state
|
|
577
|
-
* (constructors are never restored).
|
|
578
|
-
*/
|
|
579
|
-
export function graphWorkflowSnapshotToLegacy(snapshot) {
|
|
580
|
-
if (snapshot.editor?.legacy && isGraphJsonSafeValue(snapshot.editor.legacy)) {
|
|
581
|
-
return cloneValue(snapshot.editor.legacy);
|
|
582
|
-
}
|
|
583
|
-
const { document, editor } = snapshot;
|
|
584
|
-
const aliases = new Set(GRAPH_LEGACY_BOUNDARY_ALIASES);
|
|
585
|
-
if (document.id)
|
|
586
|
-
aliases.add(document.id);
|
|
587
|
-
if (document.name)
|
|
588
|
-
aliases.add(document.name);
|
|
589
|
-
const display = (editor?.definitionDisplay ?? {});
|
|
590
|
-
const definition = {
|
|
591
|
-
...cloneValue(display),
|
|
592
|
-
name: document.name,
|
|
593
|
-
tag: document.id || display["tag"] || document.name,
|
|
594
|
-
inputs: document.inputs.map((port) => portToLegacyDefinition(port)),
|
|
595
|
-
outputs: document.outputs.map((port) => portToLegacyDefinition(port)),
|
|
596
|
-
nodes: document.nodes.map((node) => ({ id: node.id, kind: node.kind })),
|
|
597
|
-
relations: document.edges.map((edge) => ({
|
|
598
|
-
id: edge.id,
|
|
599
|
-
source: endpointToLegacyRef(edge.source).refId,
|
|
600
|
-
sourcePort: edge.source.port,
|
|
601
|
-
target: endpointToLegacyRef(edge.target).refId,
|
|
602
|
-
targetPort: edge.target.port,
|
|
603
|
-
label: edge.label,
|
|
604
|
-
})),
|
|
605
|
-
};
|
|
606
|
-
const state = {
|
|
607
|
-
inputs: document.inputs.map((port) => ({
|
|
608
|
-
path: port.id,
|
|
609
|
-
value: cloneValue(port.defaultValue),
|
|
610
|
-
label: port.label,
|
|
611
|
-
required: port.required,
|
|
612
|
-
})),
|
|
613
|
-
outputs: document.outputs.map((port) => ({
|
|
614
|
-
path: port.id,
|
|
615
|
-
value: cloneValue(port.defaultValue),
|
|
616
|
-
label: port.label,
|
|
617
|
-
required: port.required,
|
|
618
|
-
})),
|
|
619
|
-
nodes: document.nodes.map((node) => ({
|
|
620
|
-
id: node.id,
|
|
621
|
-
ref: { id: node.id, kind: node.kind },
|
|
622
|
-
label: node.label,
|
|
623
|
-
kind: node.kind,
|
|
624
|
-
position: node.ui?.position ? { x: node.ui.position.x, y: node.ui.position.y } : undefined,
|
|
625
|
-
size: node.ui?.size ? { width: node.ui.size.width, height: node.ui.size.height } : undefined,
|
|
626
|
-
expanded: node.ui?.expanded,
|
|
627
|
-
ports: editor?.nodePorts?.[node.id] ?? undefined,
|
|
628
|
-
data: cloneValue(node.parameters ?? {}),
|
|
629
|
-
metadata: cloneValue(node.metadata ?? {}),
|
|
630
|
-
})),
|
|
631
|
-
edges: document.edges.map((edge) => {
|
|
632
|
-
const source = endpointToLegacyRef(edge.source);
|
|
633
|
-
const target = endpointToLegacyRef(edge.target);
|
|
634
|
-
const isBoundary = source.refId === "$workflow" || target.refId === "$workflow";
|
|
635
|
-
const isConnection = edge.type === "connection";
|
|
636
|
-
return {
|
|
637
|
-
id: edge.id,
|
|
638
|
-
source: source.refId,
|
|
639
|
-
sourceRef: source.refId,
|
|
640
|
-
sourcePort: source.port,
|
|
641
|
-
target: target.refId,
|
|
642
|
-
targetRef: target.refId,
|
|
643
|
-
targetPort: target.port,
|
|
644
|
-
label: edge.label,
|
|
645
|
-
type: isConnection ? "connection" : isBoundary ? "output" : "data",
|
|
646
|
-
metadata: cloneValue(edge.metadata ?? {}),
|
|
647
|
-
};
|
|
648
|
-
}),
|
|
649
|
-
ui: cloneValue({
|
|
650
|
-
...(editor?.duplicateCounts ? { duplicateCounts: editor.duplicateCounts } : {}),
|
|
651
|
-
...(editor?.diagramMetadata ? { diagramMetadata: editor.diagramMetadata } : {}),
|
|
652
|
-
...(editor?.nodeConfigs ? { nodeConfigs: editor.nodeConfigs } : {}),
|
|
653
|
-
}),
|
|
654
|
-
metadata: cloneValue(snapshot.metadata ?? {}),
|
|
655
|
-
};
|
|
656
|
-
return {
|
|
657
|
-
version: GRAPH_WORKFLOW_SNAPSHOT_VERSION,
|
|
658
|
-
definition,
|
|
659
|
-
state,
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
function portToLegacyDefinition(port) {
|
|
663
|
-
return {
|
|
664
|
-
property: port.id,
|
|
665
|
-
label: port.label,
|
|
666
|
-
required: port.required,
|
|
667
|
-
metadata: cloneValue(port.metadata ?? {}),
|
|
668
|
-
};
|
|
669
|
-
}
|
|
670
|
-
/** Normalizes any accepted snapshot/document form to a canonical wrapper. */
|
|
671
|
-
export function graphWorkflowSnapshotLikeToCanonical(value) {
|
|
672
|
-
if ("document" in value) {
|
|
673
|
-
return value;
|
|
674
|
-
}
|
|
675
|
-
if ("state" in value || "definition" in value) {
|
|
676
|
-
return graphWorkflowSnapshotFromLegacy(value);
|
|
677
|
-
}
|
|
678
|
-
return { document: value };
|
|
679
|
-
}
|
|
680
|
-
//# sourceMappingURL=snapshot.js.map
|