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