@principal-ai/subsystems-core 0.29.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -110
- package/dist/index.d.ts +7 -75
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -205
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +5 -61
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +9 -131
- package/dist/node.js.map +1 -1
- package/dist/types/index.d.ts +3 -348
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -19
- package/dist/types/index.js.map +1 -1
- package/dist/types/subsystem-model.d.ts +34 -3
- package/dist/types/subsystem-model.d.ts.map +1 -1
- package/dist/types/subsystem-model.js.map +1 -1
- package/package.json +7 -24
- package/schemas/subsystem-model.schema.json +52 -1
- package/src/index.ts +7 -580
- package/src/node.ts +21 -262
- package/src/types/index.ts +3 -456
- package/src/types/subsystem-model.ts +39 -3
- package/dist/ConfigurationLoader.d.ts +0 -76
- package/dist/ConfigurationLoader.d.ts.map +0 -1
- package/dist/ConfigurationLoader.js +0 -148
- package/dist/ConfigurationLoader.js.map +0 -1
- package/dist/ConfigurationValidator.d.ts +0 -31
- package/dist/ConfigurationValidator.d.ts.map +0 -1
- package/dist/ConfigurationValidator.js +0 -239
- package/dist/ConfigurationValidator.js.map +0 -1
- package/dist/EventProcessor.d.ts +0 -49
- package/dist/EventProcessor.d.ts.map +0 -1
- package/dist/EventProcessor.js +0 -220
- package/dist/EventProcessor.js.map +0 -1
- package/dist/EventRecorderService.d.ts +0 -305
- package/dist/EventRecorderService.d.ts.map +0 -1
- package/dist/EventRecorderService.js +0 -467
- package/dist/EventRecorderService.js.map +0 -1
- package/dist/LibraryLoader.d.ts +0 -65
- package/dist/LibraryLoader.d.ts.map +0 -1
- package/dist/LibraryLoader.js +0 -197
- package/dist/LibraryLoader.js.map +0 -1
- package/dist/PathBasedEventProcessor.d.ts +0 -77
- package/dist/PathBasedEventProcessor.d.ts.map +0 -1
- package/dist/PathBasedEventProcessor.js +0 -136
- package/dist/PathBasedEventProcessor.js.map +0 -1
- package/dist/SessionManager.d.ts +0 -194
- package/dist/SessionManager.d.ts.map +0 -1
- package/dist/SessionManager.js +0 -302
- package/dist/SessionManager.js.map +0 -1
- package/dist/ValidationEngine.d.ts +0 -31
- package/dist/ValidationEngine.d.ts.map +0 -1
- package/dist/ValidationEngine.js +0 -162
- package/dist/ValidationEngine.js.map +0 -1
- package/dist/auxiliary/AuxiliaryManifestValidator.d.ts +0 -41
- package/dist/auxiliary/AuxiliaryManifestValidator.d.ts.map +0 -1
- package/dist/auxiliary/AuxiliaryManifestValidator.js +0 -100
- package/dist/auxiliary/AuxiliaryManifestValidator.js.map +0 -1
- package/dist/auxiliary/index.d.ts +0 -9
- package/dist/auxiliary/index.d.ts.map +0 -1
- package/dist/auxiliary/index.js +0 -14
- package/dist/auxiliary/index.js.map +0 -1
- package/dist/auxiliary/validateAreaScopeDisjoint.d.ts +0 -24
- package/dist/auxiliary/validateAreaScopeDisjoint.d.ts.map +0 -1
- package/dist/auxiliary/validateAreaScopeDisjoint.js +0 -61
- package/dist/auxiliary/validateAreaScopeDisjoint.js.map +0 -1
- package/dist/cli/codegen.d.ts +0 -41
- package/dist/cli/codegen.d.ts.map +0 -1
- package/dist/cli/codegen.js +0 -257
- package/dist/cli/codegen.js.map +0 -1
- package/dist/codegen/type-generator.d.ts +0 -123
- package/dist/codegen/type-generator.d.ts.map +0 -1
- package/dist/codegen/type-generator.js +0 -433
- package/dist/codegen/type-generator.js.map +0 -1
- package/dist/codegen/usage-example.d.ts +0 -103
- package/dist/codegen/usage-example.d.ts.map +0 -1
- package/dist/codegen/usage-example.js +0 -258
- package/dist/codegen/usage-example.js.map +0 -1
- package/dist/dashboard/DashboardValidator.d.ts +0 -85
- package/dist/dashboard/DashboardValidator.d.ts.map +0 -1
- package/dist/dashboard/DashboardValidator.js +0 -775
- package/dist/dashboard/DashboardValidator.js.map +0 -1
- package/dist/dashboard/index.d.ts +0 -6
- package/dist/dashboard/index.d.ts.map +0 -1
- package/dist/dashboard/index.js +0 -10
- package/dist/dashboard/index.js.map +0 -1
- package/dist/discovery/CanvasDiscovery.d.ts +0 -160
- package/dist/discovery/CanvasDiscovery.d.ts.map +0 -1
- package/dist/discovery/CanvasDiscovery.js +0 -865
- package/dist/discovery/CanvasDiscovery.js.map +0 -1
- package/dist/discovery/CanvasFileManifest.d.ts +0 -86
- package/dist/discovery/CanvasFileManifest.d.ts.map +0 -1
- package/dist/discovery/CanvasFileManifest.js +0 -338
- package/dist/discovery/CanvasFileManifest.js.map +0 -1
- package/dist/discovery/LibraryDiscovery.d.ts +0 -108
- package/dist/discovery/LibraryDiscovery.d.ts.map +0 -1
- package/dist/discovery/LibraryDiscovery.js +0 -263
- package/dist/discovery/LibraryDiscovery.js.map +0 -1
- package/dist/discovery/types.d.ts +0 -403
- package/dist/discovery/types.d.ts.map +0 -1
- package/dist/discovery/types.js +0 -6
- package/dist/discovery/types.js.map +0 -1
- package/dist/events/EventsCanvasValidator.d.ts +0 -139
- package/dist/events/EventsCanvasValidator.d.ts.map +0 -1
- package/dist/events/EventsCanvasValidator.js +0 -281
- package/dist/events/EventsCanvasValidator.js.map +0 -1
- package/dist/events/NamespacePathIndex.d.ts +0 -61
- package/dist/events/NamespacePathIndex.d.ts.map +0 -1
- package/dist/events/NamespacePathIndex.js +0 -74
- package/dist/events/NamespacePathIndex.js.map +0 -1
- package/dist/events/OtelEventPathsValidator.d.ts +0 -75
- package/dist/events/OtelEventPathsValidator.d.ts.map +0 -1
- package/dist/events/OtelEventPathsValidator.js +0 -126
- package/dist/events/OtelEventPathsValidator.js.map +0 -1
- package/dist/events/ScopeEventsValidator.d.ts +0 -68
- package/dist/events/ScopeEventsValidator.d.ts.map +0 -1
- package/dist/events/ScopeEventsValidator.js +0 -91
- package/dist/events/ScopeEventsValidator.js.map +0 -1
- package/dist/events/index.d.ts +0 -9
- package/dist/events/index.d.ts.map +0 -1
- package/dist/events/index.js +0 -12
- package/dist/events/index.js.map +0 -1
- package/dist/events/path-helpers.d.ts +0 -33
- package/dist/events/path-helpers.d.ts.map +0 -1
- package/dist/events/path-helpers.js +0 -59
- package/dist/events/path-helpers.js.map +0 -1
- package/dist/execution/ExecutionLoader.d.ts +0 -135
- package/dist/execution/ExecutionLoader.d.ts.map +0 -1
- package/dist/execution/ExecutionLoader.js +0 -266
- package/dist/execution/ExecutionLoader.js.map +0 -1
- package/dist/execution/ExecutionValidator.d.ts +0 -94
- package/dist/execution/ExecutionValidator.d.ts.map +0 -1
- package/dist/execution/ExecutionValidator.js +0 -503
- package/dist/execution/ExecutionValidator.js.map +0 -1
- package/dist/generated/graph-converter-execution.types.d.ts +0 -177
- package/dist/generated/graph-converter-execution.types.d.ts.map +0 -1
- package/dist/generated/graph-converter-execution.types.js +0 -12
- package/dist/generated/graph-converter-execution.types.js.map +0 -1
- package/dist/helpers/GraphInstrumentationHelper.d.ts +0 -93
- package/dist/helpers/GraphInstrumentationHelper.d.ts.map +0 -1
- package/dist/helpers/GraphInstrumentationHelper.js +0 -252
- package/dist/helpers/GraphInstrumentationHelper.js.map +0 -1
- package/dist/matchers/SpanMatcher.d.ts +0 -107
- package/dist/matchers/SpanMatcher.d.ts.map +0 -1
- package/dist/matchers/SpanMatcher.js +0 -274
- package/dist/matchers/SpanMatcher.js.map +0 -1
- package/dist/orchestration/TraceOrchestrator.d.ts +0 -71
- package/dist/orchestration/TraceOrchestrator.d.ts.map +0 -1
- package/dist/orchestration/TraceOrchestrator.js +0 -416
- package/dist/orchestration/TraceOrchestrator.js.map +0 -1
- package/dist/parsers/OtlpTraceParser.d.ts +0 -131
- package/dist/parsers/OtlpTraceParser.d.ts.map +0 -1
- package/dist/parsers/OtlpTraceParser.js +0 -310
- package/dist/parsers/OtlpTraceParser.js.map +0 -1
- package/dist/registry/CompositeRegistry.d.ts +0 -71
- package/dist/registry/CompositeRegistry.d.ts.map +0 -1
- package/dist/registry/CompositeRegistry.js +0 -113
- package/dist/registry/CompositeRegistry.js.map +0 -1
- package/dist/registry/EventRegistry.d.ts +0 -79
- package/dist/registry/EventRegistry.d.ts.map +0 -1
- package/dist/registry/EventRegistry.js +0 -165
- package/dist/registry/EventRegistry.js.map +0 -1
- package/dist/registry/LocalRegistry.d.ts +0 -111
- package/dist/registry/LocalRegistry.d.ts.map +0 -1
- package/dist/registry/LocalRegistry.js +0 -335
- package/dist/registry/LocalRegistry.js.map +0 -1
- package/dist/registry/RemoteRegistry.d.ts +0 -122
- package/dist/registry/RemoteRegistry.d.ts.map +0 -1
- package/dist/registry/RemoteRegistry.js +0 -399
- package/dist/registry/RemoteRegistry.js.map +0 -1
- package/dist/registry/VersionRegistry.d.ts +0 -51
- package/dist/registry/VersionRegistry.d.ts.map +0 -1
- package/dist/registry/VersionRegistry.js +0 -105
- package/dist/registry/VersionRegistry.js.map +0 -1
- package/dist/rules/config.d.ts +0 -57
- package/dist/rules/config.d.ts.map +0 -1
- package/dist/rules/config.js +0 -382
- package/dist/rules/config.js.map +0 -1
- package/dist/rules/engine.d.ts +0 -70
- package/dist/rules/engine.d.ts.map +0 -1
- package/dist/rules/engine.js +0 -373
- package/dist/rules/engine.js.map +0 -1
- package/dist/rules/implementations/connection-type-references.d.ts +0 -7
- package/dist/rules/implementations/connection-type-references.d.ts.map +0 -1
- package/dist/rules/implementations/connection-type-references.js +0 -107
- package/dist/rules/implementations/connection-type-references.js.map +0 -1
- package/dist/rules/implementations/dead-end-states.d.ts +0 -17
- package/dist/rules/implementations/dead-end-states.d.ts.map +0 -1
- package/dist/rules/implementations/dead-end-states.js +0 -75
- package/dist/rules/implementations/dead-end-states.js.map +0 -1
- package/dist/rules/implementations/index.d.ts +0 -23
- package/dist/rules/implementations/index.d.ts.map +0 -1
- package/dist/rules/implementations/index.js +0 -73
- package/dist/rules/implementations/index.js.map +0 -1
- package/dist/rules/implementations/minimum-node-sources.d.ts +0 -24
- package/dist/rules/implementations/minimum-node-sources.d.ts.map +0 -1
- package/dist/rules/implementations/minimum-node-sources.js +0 -59
- package/dist/rules/implementations/minimum-node-sources.js.map +0 -1
- package/dist/rules/implementations/no-unknown-fields.d.ts +0 -7
- package/dist/rules/implementations/no-unknown-fields.d.ts.map +0 -1
- package/dist/rules/implementations/no-unknown-fields.js +0 -216
- package/dist/rules/implementations/no-unknown-fields.js.map +0 -1
- package/dist/rules/implementations/orphaned-edge-types.d.ts +0 -7
- package/dist/rules/implementations/orphaned-edge-types.d.ts.map +0 -1
- package/dist/rules/implementations/orphaned-edge-types.js +0 -50
- package/dist/rules/implementations/orphaned-edge-types.js.map +0 -1
- package/dist/rules/implementations/orphaned-node-types.d.ts +0 -7
- package/dist/rules/implementations/orphaned-node-types.d.ts.map +0 -1
- package/dist/rules/implementations/orphaned-node-types.js +0 -53
- package/dist/rules/implementations/orphaned-node-types.js.map +0 -1
- package/dist/rules/implementations/required-metadata.d.ts +0 -7
- package/dist/rules/implementations/required-metadata.d.ts.map +0 -1
- package/dist/rules/implementations/required-metadata.js +0 -48
- package/dist/rules/implementations/required-metadata.js.map +0 -1
- package/dist/rules/implementations/state-transition-references.d.ts +0 -7
- package/dist/rules/implementations/state-transition-references.d.ts.map +0 -1
- package/dist/rules/implementations/state-transition-references.js +0 -138
- package/dist/rules/implementations/state-transition-references.js.map +0 -1
- package/dist/rules/implementations/unreachable-states.d.ts +0 -7
- package/dist/rules/implementations/unreachable-states.d.ts.map +0 -1
- package/dist/rules/implementations/unreachable-states.js +0 -83
- package/dist/rules/implementations/unreachable-states.js.map +0 -1
- package/dist/rules/implementations/valid-action-patterns.d.ts +0 -17
- package/dist/rules/implementations/valid-action-patterns.d.ts.map +0 -1
- package/dist/rules/implementations/valid-action-patterns.js +0 -112
- package/dist/rules/implementations/valid-action-patterns.js.map +0 -1
- package/dist/rules/implementations/valid-color-format.d.ts +0 -7
- package/dist/rules/implementations/valid-color-format.d.ts.map +0 -1
- package/dist/rules/implementations/valid-color-format.js +0 -94
- package/dist/rules/implementations/valid-color-format.js.map +0 -1
- package/dist/rules/implementations/valid-edge-types.d.ts +0 -7
- package/dist/rules/implementations/valid-edge-types.d.ts.map +0 -1
- package/dist/rules/implementations/valid-edge-types.js +0 -248
- package/dist/rules/implementations/valid-edge-types.js.map +0 -1
- package/dist/rules/implementations/valid-node-types.d.ts +0 -7
- package/dist/rules/implementations/valid-node-types.d.ts.map +0 -1
- package/dist/rules/implementations/valid-node-types.js +0 -187
- package/dist/rules/implementations/valid-node-types.js.map +0 -1
- package/dist/rules/index.d.ts +0 -28
- package/dist/rules/index.d.ts.map +0 -1
- package/dist/rules/index.js +0 -70
- package/dist/rules/index.js.map +0 -1
- package/dist/rules/types.d.ts +0 -309
- package/dist/rules/types.d.ts.map +0 -1
- package/dist/rules/types.js +0 -40
- package/dist/rules/types.js.map +0 -1
- package/dist/scopes/ScopePathIndex.d.ts +0 -56
- package/dist/scopes/ScopePathIndex.d.ts.map +0 -1
- package/dist/scopes/ScopePathIndex.js +0 -67
- package/dist/scopes/ScopePathIndex.js.map +0 -1
- package/dist/scopes/ScopesCanvasValidator.d.ts +0 -76
- package/dist/scopes/ScopesCanvasValidator.d.ts.map +0 -1
- package/dist/scopes/ScopesCanvasValidator.js +0 -221
- package/dist/scopes/ScopesCanvasValidator.js.map +0 -1
- package/dist/scopes/index.d.ts +0 -12
- package/dist/scopes/index.d.ts.map +0 -1
- package/dist/scopes/index.js +0 -30
- package/dist/scopes/index.js.map +0 -1
- package/dist/scopes/utils.d.ts +0 -85
- package/dist/scopes/utils.d.ts.map +0 -1
- package/dist/scopes/utils.js +0 -143
- package/dist/scopes/utils.js.map +0 -1
- package/dist/scopes/validateScopeNamespaceNesting.d.ts +0 -38
- package/dist/scopes/validateScopeNamespaceNesting.d.ts.map +0 -1
- package/dist/scopes/validateScopeNamespaceNesting.js +0 -69
- package/dist/scopes/validateScopeNamespaceNesting.js.map +0 -1
- package/dist/spans/index.d.ts +0 -12
- package/dist/spans/index.d.ts.map +0 -1
- package/dist/spans/index.js +0 -25
- package/dist/spans/index.js.map +0 -1
- package/dist/spans/utils.d.ts +0 -70
- package/dist/spans/utils.d.ts.map +0 -1
- package/dist/spans/utils.js +0 -205
- package/dist/spans/utils.js.map +0 -1
- package/dist/storyboard/builder.d.ts +0 -135
- package/dist/storyboard/builder.d.ts.map +0 -1
- package/dist/storyboard/builder.js +0 -235
- package/dist/storyboard/builder.js.map +0 -1
- package/dist/storyboard/index.d.ts +0 -9
- package/dist/storyboard/index.d.ts.map +0 -1
- package/dist/storyboard/index.js +0 -18
- package/dist/storyboard/index.js.map +0 -1
- package/dist/storyboard/types.d.ts +0 -101
- package/dist/storyboard/types.d.ts.map +0 -1
- package/dist/storyboard/types.js +0 -10
- package/dist/storyboard/types.js.map +0 -1
- package/dist/telemetry/coverage.d.ts +0 -92
- package/dist/telemetry/coverage.d.ts.map +0 -1
- package/dist/telemetry/coverage.js +0 -335
- package/dist/telemetry/coverage.js.map +0 -1
- package/dist/telemetry/event-validator.d.ts +0 -86
- package/dist/telemetry/event-validator.d.ts.map +0 -1
- package/dist/telemetry/event-validator.js +0 -257
- package/dist/telemetry/event-validator.js.map +0 -1
- package/dist/types/audit.d.ts +0 -236
- package/dist/types/audit.d.ts.map +0 -1
- package/dist/types/audit.js +0 -53
- package/dist/types/audit.js.map +0 -1
- package/dist/types/auxiliary.d.ts +0 -54
- package/dist/types/auxiliary.d.ts.map +0 -1
- package/dist/types/auxiliary.js +0 -27
- package/dist/types/auxiliary.js.map +0 -1
- package/dist/types/canvas-scope.d.ts +0 -156
- package/dist/types/canvas-scope.d.ts.map +0 -1
- package/dist/types/canvas-scope.js +0 -62
- package/dist/types/canvas-scope.js.map +0 -1
- package/dist/types/canvas.d.ts +0 -1138
- package/dist/types/canvas.d.ts.map +0 -1
- package/dist/types/canvas.js +0 -178
- package/dist/types/canvas.js.map +0 -1
- package/dist/types/dashboard.d.ts +0 -170
- package/dist/types/dashboard.d.ts.map +0 -1
- package/dist/types/dashboard.js +0 -14
- package/dist/types/dashboard.js.map +0 -1
- package/dist/types/library.d.ts +0 -227
- package/dist/types/library.d.ts.map +0 -1
- package/dist/types/library.js +0 -16
- package/dist/types/library.js.map +0 -1
- package/dist/types/otel.d.ts +0 -465
- package/dist/types/otel.d.ts.map +0 -1
- package/dist/types/otel.js +0 -163
- package/dist/types/otel.js.map +0 -1
- package/dist/types/path-based-config.d.ts +0 -235
- package/dist/types/path-based-config.d.ts.map +0 -1
- package/dist/types/path-based-config.js +0 -11
- package/dist/types/path-based-config.js.map +0 -1
- package/dist/types/registered-trace.d.ts +0 -337
- package/dist/types/registered-trace.d.ts.map +0 -1
- package/dist/types/registered-trace.js +0 -16
- package/dist/types/registered-trace.js.map +0 -1
- package/dist/types/resource-match.d.ts +0 -207
- package/dist/types/resource-match.d.ts.map +0 -1
- package/dist/types/resource-match.js +0 -74
- package/dist/types/resource-match.js.map +0 -1
- package/dist/types/version-registry.d.ts +0 -137
- package/dist/types/version-registry.d.ts.map +0 -1
- package/dist/types/version-registry.js +0 -10
- package/dist/types/version-registry.js.map +0 -1
- package/dist/utils/CanvasConverter.d.ts +0 -148
- package/dist/utils/CanvasConverter.d.ts.map +0 -1
- package/dist/utils/CanvasConverter.js +0 -530
- package/dist/utils/CanvasConverter.js.map +0 -1
- package/dist/utils/GraphConverter.d.ts +0 -18
- package/dist/utils/GraphConverter.d.ts.map +0 -1
- package/dist/utils/GraphConverter.js +0 -80
- package/dist/utils/GraphConverter.js.map +0 -1
- package/dist/utils/PathMatcher.d.ts +0 -55
- package/dist/utils/PathMatcher.d.ts.map +0 -1
- package/dist/utils/PathMatcher.js +0 -178
- package/dist/utils/PathMatcher.js.map +0 -1
- package/dist/utils/TraceToCanvas.d.ts +0 -83
- package/dist/utils/TraceToCanvas.d.ts.map +0 -1
- package/dist/utils/TraceToCanvas.js +0 -336
- package/dist/utils/TraceToCanvas.js.map +0 -1
- package/dist/utils/YamlParser.d.ts +0 -36
- package/dist/utils/YamlParser.d.ts.map +0 -1
- package/dist/utils/YamlParser.js +0 -92
- package/dist/utils/YamlParser.js.map +0 -1
- package/dist/utils/registeredTraceHelpers.d.ts +0 -76
- package/dist/utils/registeredTraceHelpers.d.ts.map +0 -1
- package/dist/utils/registeredTraceHelpers.js +0 -203
- package/dist/utils/registeredTraceHelpers.js.map +0 -1
- package/dist/utils/traceAggregation.d.ts +0 -25
- package/dist/utils/traceAggregation.d.ts.map +0 -1
- package/dist/utils/traceAggregation.js +0 -140
- package/dist/utils/traceAggregation.js.map +0 -1
- package/dist/validation/OtelCanvasValidator.d.ts +0 -40
- package/dist/validation/OtelCanvasValidator.d.ts.map +0 -1
- package/dist/validation/OtelCanvasValidator.js +0 -59
- package/dist/validation/OtelCanvasValidator.js.map +0 -1
- package/dist/validation/index.d.ts +0 -8
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js +0 -13
- package/dist/validation/index.js.map +0 -1
- package/dist/validation/libraryValidation.d.ts +0 -53
- package/dist/validation/libraryValidation.d.ts.map +0 -1
- package/dist/validation/libraryValidation.js +0 -115
- package/dist/validation/libraryValidation.js.map +0 -1
- package/dist/workflow/edge-derivation.d.ts +0 -111
- package/dist/workflow/edge-derivation.d.ts.map +0 -1
- package/dist/workflow/edge-derivation.js +0 -174
- package/dist/workflow/edge-derivation.js.map +0 -1
- package/dist/workflow/edge-validation.d.ts +0 -170
- package/dist/workflow/edge-validation.d.ts.map +0 -1
- package/dist/workflow/edge-validation.js +0 -332
- package/dist/workflow/edge-validation.js.map +0 -1
- package/dist/workflow/example.d.ts +0 -11
- package/dist/workflow/example.d.ts.map +0 -1
- package/dist/workflow/example.js +0 -310
- package/dist/workflow/example.js.map +0 -1
- package/dist/workflow/index.d.ts +0 -20
- package/dist/workflow/index.d.ts.map +0 -1
- package/dist/workflow/index.js +0 -49
- package/dist/workflow/index.js.map +0 -1
- package/dist/workflow/scenario-matcher.d.ts +0 -63
- package/dist/workflow/scenario-matcher.d.ts.map +0 -1
- package/dist/workflow/scenario-matcher.js +0 -215
- package/dist/workflow/scenario-matcher.js.map +0 -1
- package/dist/workflow/template-parser.d.ts +0 -73
- package/dist/workflow/template-parser.d.ts.map +0 -1
- package/dist/workflow/template-parser.js +0 -280
- package/dist/workflow/template-parser.js.map +0 -1
- package/dist/workflow/template-renderer.d.ts +0 -45
- package/dist/workflow/template-renderer.d.ts.map +0 -1
- package/dist/workflow/template-renderer.js +0 -401
- package/dist/workflow/template-renderer.js.map +0 -1
- package/dist/workflow/types.d.ts +0 -393
- package/dist/workflow/types.d.ts.map +0 -1
- package/dist/workflow/types.js +0 -40
- package/dist/workflow/types.js.map +0 -1
- package/dist/workflow/validator.d.ts +0 -363
- package/dist/workflow/validator.d.ts.map +0 -1
- package/dist/workflow/validator.js +0 -2283
- package/dist/workflow/validator.js.map +0 -1
- package/schemas/auxiliary.manifest.schema.json +0 -56
- package/src/ConfigurationLoader.test.ts +0 -466
- package/src/ConfigurationLoader.ts +0 -184
- package/src/ConfigurationValidator.test.ts +0 -200
- package/src/ConfigurationValidator.ts +0 -273
- package/src/EventProcessor.test.ts +0 -405
- package/src/EventProcessor.ts +0 -256
- package/src/EventRecorderService.test.ts +0 -543
- package/src/EventRecorderService.ts +0 -741
- package/src/LibraryLoader.ts +0 -194
- package/src/PathBasedEventProcessor.test.ts +0 -336
- package/src/PathBasedEventProcessor.ts +0 -196
- package/src/SessionManager.test.ts +0 -424
- package/src/SessionManager.ts +0 -471
- package/src/ValidationEngine.test.ts +0 -520
- package/src/ValidationEngine.ts +0 -200
- package/src/auxiliary/AuxiliaryManifestValidator.test.ts +0 -93
- package/src/auxiliary/AuxiliaryManifestValidator.ts +0 -132
- package/src/auxiliary/index.ts +0 -18
- package/src/auxiliary/validateAreaScopeDisjoint.test.ts +0 -85
- package/src/auxiliary/validateAreaScopeDisjoint.ts +0 -72
- package/src/cli/codegen.ts +0 -286
- package/src/codegen/type-generator.test.ts +0 -219
- package/src/codegen/type-generator.ts +0 -560
- package/src/codegen/usage-example.ts +0 -357
- package/src/dashboard/DashboardValidator.ts +0 -904
- package/src/dashboard/index.ts +0 -14
- package/src/discovery/CanvasDiscovery.test.ts +0 -691
- package/src/discovery/CanvasDiscovery.ts +0 -1114
- package/src/discovery/CanvasFileManifest.test.ts +0 -521
- package/src/discovery/CanvasFileManifest.ts +0 -419
- package/src/discovery/LibraryDiscovery.test.ts +0 -329
- package/src/discovery/LibraryDiscovery.ts +0 -386
- package/src/discovery/types.ts +0 -453
- package/src/events/EventsCanvasValidator.test.ts +0 -191
- package/src/events/EventsCanvasValidator.ts +0 -428
- package/src/events/NamespacePathIndex.test.ts +0 -97
- package/src/events/NamespacePathIndex.ts +0 -100
- package/src/events/OtelEventPathsValidator.test.ts +0 -243
- package/src/events/OtelEventPathsValidator.ts +0 -191
- package/src/events/ScopeEventsValidator.test.ts +0 -173
- package/src/events/ScopeEventsValidator.ts +0 -158
- package/src/events/index.ts +0 -27
- package/src/events/path-helpers.ts +0 -53
- package/src/execution/ExecutionLoader.test.ts +0 -378
- package/src/execution/ExecutionLoader.ts +0 -331
- package/src/execution/ExecutionValidator.test.ts +0 -503
- package/src/execution/ExecutionValidator.ts +0 -617
- package/src/generated/graph-converter-execution.types.ts +0 -193
- package/src/helpers/GraphInstrumentationHelper.test.ts +0 -364
- package/src/helpers/GraphInstrumentationHelper.ts +0 -323
- package/src/matchers/SpanMatcher.test.ts +0 -1105
- package/src/matchers/SpanMatcher.ts +0 -381
- package/src/orchestration/TraceOrchestrator.ts +0 -560
- package/src/orchestration/__tests__/TraceOrchestrator.test.ts +0 -1098
- package/src/parsers/OtlpTraceParser.ts +0 -401
- package/src/parsers/__tests__/OtlpTraceParser.test.ts +0 -197
- package/src/registry/CompositeRegistry.ts +0 -140
- package/src/registry/EventRegistry.test.ts +0 -387
- package/src/registry/EventRegistry.ts +0 -191
- package/src/registry/LocalRegistry.ts +0 -416
- package/src/registry/RemoteRegistry.ts +0 -499
- package/src/registry/VersionRegistry.test.ts +0 -223
- package/src/registry/VersionRegistry.ts +0 -121
- package/src/rules/config.test.ts +0 -277
- package/src/rules/config.ts +0 -450
- package/src/rules/engine.test.ts +0 -331
- package/src/rules/engine.ts +0 -448
- package/src/rules/implementations/connection-type-references.ts +0 -117
- package/src/rules/implementations/dead-end-states.ts +0 -101
- package/src/rules/implementations/index.ts +0 -66
- package/src/rules/implementations/minimum-node-sources.ts +0 -84
- package/src/rules/implementations/no-unknown-fields.ts +0 -372
- package/src/rules/implementations/orphaned-edge-types.ts +0 -55
- package/src/rules/implementations/orphaned-node-types.ts +0 -58
- package/src/rules/implementations/required-metadata.ts +0 -52
- package/src/rules/implementations/state-transition-references.ts +0 -155
- package/src/rules/implementations/unreachable-states.ts +0 -94
- package/src/rules/implementations/valid-action-patterns.ts +0 -140
- package/src/rules/implementations/valid-color-format.ts +0 -152
- package/src/rules/implementations/valid-edge-types.ts +0 -273
- package/src/rules/implementations/valid-node-types.ts +0 -200
- package/src/rules/index.ts +0 -92
- package/src/rules/types.ts +0 -426
- package/src/scopes/ScopePathIndex.test.ts +0 -94
- package/src/scopes/ScopePathIndex.ts +0 -89
- package/src/scopes/ScopesCanvasValidator.test.ts +0 -127
- package/src/scopes/ScopesCanvasValidator.ts +0 -305
- package/src/scopes/__tests__/utils.test.ts +0 -383
- package/src/scopes/index.ts +0 -42
- package/src/scopes/utils.ts +0 -182
- package/src/scopes/validateScopeNamespaceNesting.test.ts +0 -127
- package/src/scopes/validateScopeNamespaceNesting.ts +0 -88
- package/src/spans/index.ts +0 -24
- package/src/spans/utils.ts +0 -249
- package/src/storyboard/builder.ts +0 -308
- package/src/storyboard/index.ts +0 -26
- package/src/storyboard/types.ts +0 -117
- package/src/telemetry/coverage.ts +0 -480
- package/src/telemetry/event-validator.ts +0 -312
- package/src/types/audit.ts +0 -314
- package/src/types/auxiliary.ts +0 -63
- package/src/types/canvas-scope.ts +0 -190
- package/src/types/canvas.test.ts +0 -199
- package/src/types/canvas.ts +0 -1395
- package/src/types/dashboard.ts +0 -257
- package/src/types/library.ts +0 -283
- package/src/types/otel.test.ts +0 -219
- package/src/types/otel.ts +0 -620
- package/src/types/path-based-config.ts +0 -285
- package/src/types/registered-trace.ts +0 -432
- package/src/types/resource-match.ts +0 -263
- package/src/types/version-registry.ts +0 -150
- package/src/utils/CanvasConverter.ts +0 -670
- package/src/utils/GraphConverter.test.ts +0 -322
- package/src/utils/GraphConverter.ts +0 -84
- package/src/utils/PathMatcher.test.ts +0 -139
- package/src/utils/PathMatcher.ts +0 -185
- package/src/utils/TraceToCanvas.test.ts +0 -310
- package/src/utils/TraceToCanvas.ts +0 -510
- package/src/utils/YamlParser.ts +0 -77
- package/src/utils/registeredTraceHelpers.ts +0 -251
- package/src/utils/traceAggregation.test.ts +0 -385
- package/src/utils/traceAggregation.ts +0 -173
- package/src/validation/OtelCanvasValidator.ts +0 -86
- package/src/validation/index.ts +0 -17
- package/src/validation/libraryValidation.ts +0 -206
- package/src/workflow/README.md +0 -408
- package/src/workflow/__tests__/edge-derivation.test.ts +0 -449
- package/src/workflow/__tests__/edge-validation.test.ts +0 -417
- package/src/workflow/__tests__/scenario-matcher.test.ts +0 -225
- package/src/workflow/__tests__/template-parser.test.ts +0 -276
- package/src/workflow/__tests__/template-renderer.test.ts +0 -509
- package/src/workflow/__tests__/types.test.ts +0 -187
- package/src/workflow/__tests__/validator.test.ts +0 -3225
- package/src/workflow/edge-derivation.ts +0 -265
- package/src/workflow/edge-validation.ts +0 -503
- package/src/workflow/example.ts +0 -330
- package/src/workflow/index.ts +0 -86
- package/src/workflow/scenario-matcher.ts +0 -253
- package/src/workflow/template-parser.ts +0 -350
- package/src/workflow/template-renderer.ts +0 -453
- package/src/workflow/types.ts +0 -511
- package/src/workflow/validator.ts +0 -2737
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OTEL Canvas Validator
|
|
3
|
-
*
|
|
4
|
-
* Validates that OTEL canvas files do not use explicit fill/color fields on event nodes.
|
|
5
|
-
* OTEL event nodes must use scope-based coloring exclusively for consistency.
|
|
6
|
-
*/
|
|
7
|
-
import type { ExtendedCanvas } from '../types/canvas';
|
|
8
|
-
/**
|
|
9
|
-
* OTEL canvas validation violation
|
|
10
|
-
*/
|
|
11
|
-
export interface OtelCanvasViolation {
|
|
12
|
-
/** Rule ID that detected this violation */
|
|
13
|
-
ruleId: string;
|
|
14
|
-
/** Severity level */
|
|
15
|
-
severity: 'error' | 'warn';
|
|
16
|
-
/** File path where violation occurred */
|
|
17
|
-
file: string;
|
|
18
|
-
/** JSON path within file (optional) */
|
|
19
|
-
path?: string;
|
|
20
|
-
/** Human-readable description of what's wrong */
|
|
21
|
-
message: string;
|
|
22
|
-
/** Why this matters */
|
|
23
|
-
impact: string;
|
|
24
|
-
/** How to fix it */
|
|
25
|
-
suggestion: string;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Validates OTEL canvas files
|
|
29
|
-
*/
|
|
30
|
-
export declare class OtelCanvasValidator {
|
|
31
|
-
/**
|
|
32
|
-
* Validate an OTEL canvas for explicit color usage on event nodes
|
|
33
|
-
*
|
|
34
|
-
* @param canvas - The canvas to validate
|
|
35
|
-
* @param canvasPath - Path to the canvas file (for error reporting)
|
|
36
|
-
* @returns Array of violations found
|
|
37
|
-
*/
|
|
38
|
-
validate(canvas: ExtendedCanvas, canvasPath: string): OtelCanvasViolation[];
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=OtelCanvasValidator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OtelCanvasValidator.d.ts","sourceRoot":"","sources":["../../src/validation/OtelCanvasValidator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IAEf,qBAAqB;IACrB,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAE3B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IAEb,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAEhB,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IAEf,oBAAoB;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,mBAAmB;IAC9B;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,mBAAmB,EAAE;CAsC5E"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* OTEL Canvas Validator
|
|
4
|
-
*
|
|
5
|
-
* Validates that OTEL canvas files do not use explicit fill/color fields on event nodes.
|
|
6
|
-
* OTEL event nodes must use scope-based coloring exclusively for consistency.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.OtelCanvasValidator = void 0;
|
|
10
|
-
const canvas_1 = require("../types/canvas");
|
|
11
|
-
/**
|
|
12
|
-
* Validates OTEL canvas files
|
|
13
|
-
*/
|
|
14
|
-
class OtelCanvasValidator {
|
|
15
|
-
/**
|
|
16
|
-
* Validate an OTEL canvas for explicit color usage on event nodes
|
|
17
|
-
*
|
|
18
|
-
* @param canvas - The canvas to validate
|
|
19
|
-
* @param canvasPath - Path to the canvas file (for error reporting)
|
|
20
|
-
* @returns Array of violations found
|
|
21
|
-
*/
|
|
22
|
-
validate(canvas, canvasPath) {
|
|
23
|
-
const violations = [];
|
|
24
|
-
// Check all nodes in the canvas - only validate otel-event nodes
|
|
25
|
-
for (const node of canvas.nodes || []) {
|
|
26
|
-
if ((0, canvas_1.isOtelEventNode)(node)) {
|
|
27
|
-
// Check for deprecated fill field
|
|
28
|
-
if (node.fill !== undefined) {
|
|
29
|
-
const scopeHint = node.otel?.scope || 'your-scope';
|
|
30
|
-
violations.push({
|
|
31
|
-
ruleId: 'otel-event-explicit-fill-color',
|
|
32
|
-
severity: 'error',
|
|
33
|
-
file: canvasPath,
|
|
34
|
-
path: `nodes[id="${node.id}"].fill`,
|
|
35
|
-
message: `OTEL event node "${node.id}" has explicit fill color which is not allowed`,
|
|
36
|
-
impact: 'OTEL event nodes must use scope-based coloring for consistency. Explicit colors defeat this purpose.',
|
|
37
|
-
suggestion: `Remove the "fill" field and set the color on the otel-scope node for "${scopeHint}" in your .scopes.canvas file`,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
// Check for deprecated color field
|
|
41
|
-
if (node.color !== undefined) {
|
|
42
|
-
const scopeHint = node.otel?.scope || 'your-scope';
|
|
43
|
-
violations.push({
|
|
44
|
-
ruleId: 'otel-event-explicit-color',
|
|
45
|
-
severity: 'error',
|
|
46
|
-
file: canvasPath,
|
|
47
|
-
path: `nodes[id="${node.id}"].color`,
|
|
48
|
-
message: `OTEL event node "${node.id}" has explicit color which is not allowed`,
|
|
49
|
-
impact: 'OTEL event nodes must use scope-based coloring for consistency. Explicit colors defeat this purpose.',
|
|
50
|
-
suggestion: `Remove the "color" field and set the color on the otel-scope node for "${scopeHint}" in your .scopes.canvas file`,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return violations;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.OtelCanvasValidator = OtelCanvasValidator;
|
|
59
|
-
//# sourceMappingURL=OtelCanvasValidator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OtelCanvasValidator.js","sourceRoot":"","sources":["../../src/validation/OtelCanvasValidator.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,4CAAkD;AA4BlD;;GAEG;AACH,MAAa,mBAAmB;IAC9B;;;;;;OAMG;IACH,QAAQ,CAAC,MAAsB,EAAE,UAAkB;QACjD,MAAM,UAAU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
|
|
5
|
-
*/
|
|
6
|
-
export { validateLibraryStructure, type LibraryValidationError, type LibraryValidationErrorType, type LibraryValidationResult, } from './libraryValidation';
|
|
7
|
-
export { OtelCanvasValidator, type OtelCanvasViolation, } from './OtelCanvasValidator';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,wBAAwB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,GAC7B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,mBAAmB,EACnB,KAAK,mBAAmB,GACzB,MAAM,uBAAuB,CAAC"}
|
package/dist/validation/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Validation Module
|
|
4
|
-
*
|
|
5
|
-
* Exports validation functions for various Principal View data structures.
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.OtelCanvasValidator = exports.validateLibraryStructure = void 0;
|
|
9
|
-
var libraryValidation_1 = require("./libraryValidation");
|
|
10
|
-
Object.defineProperty(exports, "validateLibraryStructure", { enumerable: true, get: function () { return libraryValidation_1.validateLibraryStructure; } });
|
|
11
|
-
var OtelCanvasValidator_1 = require("./OtelCanvasValidator");
|
|
12
|
-
Object.defineProperty(exports, "OtelCanvasValidator", { enumerable: true, get: function () { return OtelCanvasValidator_1.OtelCanvasValidator; } });
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,yDAK6B;AAJ3B,6HAAA,wBAAwB,OAAA;AAM1B,6DAG+B;AAF7B,0HAAA,mBAAmB,OAAA"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Library Validation
|
|
3
|
-
*
|
|
4
|
-
* Standalone validation functions for ComponentLibrary schema.
|
|
5
|
-
* Used by both LibraryLoader (core), LibraryDiscovery, and CLI validation.
|
|
6
|
-
*/
|
|
7
|
-
import type { ComponentLibrary } from '../types/library';
|
|
8
|
-
/**
|
|
9
|
-
* Types of library validation errors
|
|
10
|
-
*/
|
|
11
|
-
export type LibraryValidationErrorType = 'parse-error' | 'validation-error' | 'schema-error' | 'scopes-canvas-required';
|
|
12
|
-
/**
|
|
13
|
-
* A library validation error
|
|
14
|
-
*
|
|
15
|
-
* Unified type used across LibraryLoader, LibraryDiscovery, and CLI validation.
|
|
16
|
-
*/
|
|
17
|
-
export interface LibraryValidationError {
|
|
18
|
-
/** Error message */
|
|
19
|
-
message: string;
|
|
20
|
-
/** Path to the invalid field or file */
|
|
21
|
-
path: string;
|
|
22
|
-
/** Error category */
|
|
23
|
-
type?: LibraryValidationErrorType;
|
|
24
|
-
/** Optional suggestion for fixing the error */
|
|
25
|
-
suggestion?: string;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Result of library structure validation
|
|
29
|
-
*/
|
|
30
|
-
export interface LibraryValidationResult {
|
|
31
|
-
/** Whether validation passed */
|
|
32
|
-
valid: boolean;
|
|
33
|
-
/** List of validation errors (empty if valid) */
|
|
34
|
-
errors: LibraryValidationError[];
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Validate a ComponentLibrary structure
|
|
38
|
-
*
|
|
39
|
-
* This validates the core schema requirements:
|
|
40
|
-
* - Required fields (version, name, nodeComponents, edgeComponents)
|
|
41
|
-
* - Event schemas structure
|
|
42
|
-
* - Top-level scopes (color required unless external)
|
|
43
|
-
* - Resources structure and owned-scopes references
|
|
44
|
-
* - Connection rules references
|
|
45
|
-
*
|
|
46
|
-
* Note: This does NOT validate unknown fields or icon names.
|
|
47
|
-
* The CLI adds those supplementary validations.
|
|
48
|
-
*
|
|
49
|
-
* @param library - The library object to validate
|
|
50
|
-
* @returns Validation result with any errors
|
|
51
|
-
*/
|
|
52
|
-
export declare function validateLibraryStructure(library: ComponentLibrary): LibraryValidationResult;
|
|
53
|
-
//# sourceMappingURL=libraryValidation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"libraryValidation.d.ts","sourceRoot":"","sources":["../../src/validation/libraryValidation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAClC,aAAa,GACb,kBAAkB,GAClB,cAAc,GACd,wBAAwB,CAAC;AAE7B;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,IAAI,CAAC,EAAE,0BAA0B,CAAC;IAClC,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,gCAAgC;IAChC,KAAK,EAAE,OAAO,CAAC;IACf,iDAAiD;IACjD,MAAM,EAAE,sBAAsB,EAAE,CAAC;CAClC;AAOD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,gBAAgB,GAAG,uBAAuB,CA4I3F"}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Library Validation
|
|
4
|
-
*
|
|
5
|
-
* Standalone validation functions for ComponentLibrary schema.
|
|
6
|
-
* Used by both LibraryLoader (core), LibraryDiscovery, and CLI validation.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.validateLibraryStructure = void 0;
|
|
10
|
-
/** Helper to create a schema error */
|
|
11
|
-
function schemaError(message, path, suggestion) {
|
|
12
|
-
return { message, path, type: 'schema-error', suggestion };
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Validate a ComponentLibrary structure
|
|
16
|
-
*
|
|
17
|
-
* This validates the core schema requirements:
|
|
18
|
-
* - Required fields (version, name, nodeComponents, edgeComponents)
|
|
19
|
-
* - Event schemas structure
|
|
20
|
-
* - Top-level scopes (color required unless external)
|
|
21
|
-
* - Resources structure and owned-scopes references
|
|
22
|
-
* - Connection rules references
|
|
23
|
-
*
|
|
24
|
-
* Note: This does NOT validate unknown fields or icon names.
|
|
25
|
-
* The CLI adds those supplementary validations.
|
|
26
|
-
*
|
|
27
|
-
* @param library - The library object to validate
|
|
28
|
-
* @returns Validation result with any errors
|
|
29
|
-
*/
|
|
30
|
-
function validateLibraryStructure(library) {
|
|
31
|
-
const errors = [];
|
|
32
|
-
// Required fields
|
|
33
|
-
if (!library.version) {
|
|
34
|
-
errors.push(schemaError('Missing required field "version"', 'version', 'Add: version: "1.0.0"'));
|
|
35
|
-
}
|
|
36
|
-
if (!library.name) {
|
|
37
|
-
errors.push(schemaError('Missing required field "name"', 'name', 'Add: name: "my-library"'));
|
|
38
|
-
}
|
|
39
|
-
// Validate event schemas if present
|
|
40
|
-
if (library.eventSchemas !== undefined) {
|
|
41
|
-
if (typeof library.eventSchemas !== 'object' || library.eventSchemas === null) {
|
|
42
|
-
errors.push(schemaError('Field "eventSchemas" must be an object', 'eventSchemas', 'Use: eventSchemas: { "my-event": { description: "...", attributes: {} } }'));
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
for (const [eventName, schema] of Object.entries(library.eventSchemas)) {
|
|
46
|
-
if (!schema.description) {
|
|
47
|
-
errors.push(schemaError(`Event schema "${eventName}" is missing required field "description"`, `eventSchemas.${eventName}.description`, 'Add a description for this event schema'));
|
|
48
|
-
}
|
|
49
|
-
if (!schema.attributes || typeof schema.attributes !== 'object') {
|
|
50
|
-
errors.push(schemaError(`Event schema "${eventName}" is missing or has invalid "attributes" field`, `eventSchemas.${eventName}.attributes`, 'Add: attributes: {} (can be empty but must be present)'));
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
// Validate each attribute
|
|
54
|
-
const validTypes = ['string', 'number', 'boolean', 'object', 'array'];
|
|
55
|
-
for (const [attrName, attrSchema] of Object.entries(schema.attributes)) {
|
|
56
|
-
if (!attrSchema.type) {
|
|
57
|
-
errors.push(schemaError(`Event schema "${eventName}" attribute "${attrName}" is missing required field "type"`, `eventSchemas.${eventName}.attributes.${attrName}.type`, `Add type: one of ${validTypes.join(', ')}`));
|
|
58
|
-
}
|
|
59
|
-
else if (!validTypes.includes(attrSchema.type)) {
|
|
60
|
-
errors.push(schemaError(`Event schema "${eventName}" attribute "${attrName}" has invalid type "${attrSchema.type}"`, `eventSchemas.${eventName}.attributes.${attrName}.type`, `Valid types: ${validTypes.join(', ')}`));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
// Note: scopes validation removed - scopes field is deprecated
|
|
68
|
-
// The CLI validate.ts will show an error if library.scopes is present
|
|
69
|
-
// Validate resources if present
|
|
70
|
-
if (library.resources !== undefined) {
|
|
71
|
-
if (typeof library.resources !== 'object' || library.resources === null || Array.isArray(library.resources)) {
|
|
72
|
-
errors.push(schemaError('Field "resources" must be an object', 'resources', 'Use: resources: { my-service: { "service.name": "my-service", ... } }'));
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
for (const [serviceId, resourceAttrs] of Object.entries(library.resources)) {
|
|
76
|
-
if (typeof resourceAttrs !== 'object' || Array.isArray(resourceAttrs) || resourceAttrs === null) {
|
|
77
|
-
errors.push(schemaError(`Resource "${serviceId}" must be an object`, `resources.${serviceId}`, 'Use: { "service.name": "...", "owned-scopes": [...] }'));
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
// Check that service.name is present (required)
|
|
81
|
-
if (!resourceAttrs['service.name']) {
|
|
82
|
-
errors.push(schemaError(`Resource "${serviceId}" is missing required attribute "service.name"`, `resources.${serviceId}`, 'Add: "service.name": "my-service-name"'));
|
|
83
|
-
}
|
|
84
|
-
// Validate owned-scopes
|
|
85
|
-
const ownedScopes = resourceAttrs['owned-scopes'];
|
|
86
|
-
if (ownedScopes !== undefined) {
|
|
87
|
-
if (!Array.isArray(ownedScopes)) {
|
|
88
|
-
errors.push(schemaError(`Resource "${serviceId}" owned-scopes must be an array`, `resources.${serviceId}.owned-scopes`, 'Use: owned-scopes: ["scope-name-1", "scope-name-2"]'));
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
for (const scope of ownedScopes) {
|
|
92
|
-
if (typeof scope !== 'string') {
|
|
93
|
-
errors.push(schemaError(`Resource "${serviceId}" owned-scopes contains non-string value`, `resources.${serviceId}.owned-scopes`, 'All owned-scopes entries must be strings'));
|
|
94
|
-
}
|
|
95
|
-
// Note: Scope existence validation removed - scopes are now defined in .scopes.canvas
|
|
96
|
-
// The CLI will validate that owned-scopes exist in .scopes.canvas
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
// Validate other attributes are strings (except owned-scopes)
|
|
101
|
-
for (const [attrName, attrValue] of Object.entries(resourceAttrs)) {
|
|
102
|
-
if (attrName !== 'owned-scopes' && typeof attrValue !== 'string') {
|
|
103
|
-
errors.push(schemaError(`Resource "${serviceId}" attribute "${attrName}" must have a string value`, `resources.${serviceId}.${attrName}`, 'Resource attributes (except owned-scopes) must be strings'));
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return {
|
|
110
|
-
valid: errors.length === 0,
|
|
111
|
-
errors,
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
exports.validateLibraryStructure = validateLibraryStructure;
|
|
115
|
-
//# sourceMappingURL=libraryValidation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"libraryValidation.js","sourceRoot":"","sources":["../../src/validation/libraryValidation.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAuCH,sCAAsC;AACtC,SAAS,WAAW,CAAC,OAAe,EAAE,IAAY,EAAE,UAAmB;IACrE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC;AAC7D,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,wBAAwB,CAAC,OAAyB;IAChE,MAAM,MAAM,GAA6B,EAAE,CAAC;IAE5C,kBAAkB;IAClB,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;QACpB,MAAM,CAAC,IAAI,CAAC,WAAW,CACrB,kCAAkC,EAClC,SAAS,EACT,uBAAuB,CACxB,CAAC,CAAC;KACJ;IAED,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;QACjB,MAAM,CAAC,IAAI,CAAC,WAAW,CACrB,+BAA+B,EAC/B,MAAM,EACN,yBAAyB,CAC1B,CAAC,CAAC;KACJ;IAED,oCAAoC;IACpC,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE;QACtC,IAAI,OAAO,OAAO,CAAC,YAAY,KAAK,QAAQ,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,EAAE;YAC7E,MAAM,CAAC,IAAI,CAAC,WAAW,CACrB,wCAAwC,EACxC,cAAc,EACd,2EAA2E,CAC5E,CAAC,CAAC;SACJ;aAAM;YACL,KAAK,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;gBACtE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;oBACvB,MAAM,CAAC,IAAI,CAAC,WAAW,CACrB,iBAAiB,SAAS,2CAA2C,EACrE,gBAAgB,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EACrC,0CAA0C,CAC3C,CAAC,CAAC;6BACJ;4BACD,sFAAsF;4BACtF,kEAAkE;yBACnE;qBACF;iBACF;gBAED,8DAA8D;gBAC9D,KAAK,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;oBACjE,IAAI,QAAQ,KAAK,cAAc,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;wBAChE,MAAM,CAAC,IAAI,CAAC,WAAW,CACrB,aAAa,SAAS,gBAAgB,QAAQ,4BAA4B,EAC1E,aAAa,SAAS,IAAI,QAAQ,EAAE,EACpC,2DAA2D,CAC5D,CAAC,CAAC;qBACJ;iBACF;aACF;SACF;KACF;IAED,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;QAC1B,MAAM;KACP,CAAC;AACJ,CAAC;AA5ID,4DA4IC"}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Edge Derivation from Workflows
|
|
3
|
-
*
|
|
4
|
-
* Extracts span context from workflow event templates and derives
|
|
5
|
-
* expected edges (span transitions) for validation against spans.canvas.
|
|
6
|
-
*
|
|
7
|
-
* @see .principal-views/WORKFLOW-SPAN-INTEGRATION.md
|
|
8
|
-
*/
|
|
9
|
-
import type { WorkflowTemplate, WorkflowScenario } from './types';
|
|
10
|
-
/**
|
|
11
|
-
* A derived edge representing a span transition observed in a workflow
|
|
12
|
-
*/
|
|
13
|
-
export interface DerivedEdge {
|
|
14
|
-
/** Source span name (exact) */
|
|
15
|
-
fromSpan: string;
|
|
16
|
-
/** Target span name (exact) */
|
|
17
|
-
toSpan: string;
|
|
18
|
-
/** Workflow file where this edge was observed */
|
|
19
|
-
workflowFile?: string;
|
|
20
|
-
/** Scenario ID where this edge was observed */
|
|
21
|
-
scenarioId: string;
|
|
22
|
-
/** Event names that caused this transition */
|
|
23
|
-
eventNames: string[];
|
|
24
|
-
/** Execution order (1-based) within the scenario */
|
|
25
|
-
sequenceNumber: number;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Result of edge derivation from a single workflow
|
|
29
|
-
*/
|
|
30
|
-
export interface WorkflowEdgeDerivationResult {
|
|
31
|
-
/** Workflow name */
|
|
32
|
-
workflowName: string;
|
|
33
|
-
/** Root span for this workflow */
|
|
34
|
-
rootSpan: string | undefined;
|
|
35
|
-
/** All spans referenced in this workflow */
|
|
36
|
-
referencedSpans: string[];
|
|
37
|
-
/** Derived edges per scenario */
|
|
38
|
-
scenarioEdges: Array<{
|
|
39
|
-
scenarioId: string;
|
|
40
|
-
edges: DerivedEdge[];
|
|
41
|
-
}>;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Result of edge derivation across all workflows
|
|
45
|
-
*/
|
|
46
|
-
export interface EdgeDerivationResult {
|
|
47
|
-
/** All derived edges (deduplicated) */
|
|
48
|
-
edges: DerivedEdge[];
|
|
49
|
-
/** Per-workflow breakdown */
|
|
50
|
-
workflows: WorkflowEdgeDerivationResult[];
|
|
51
|
-
/** All unique spans referenced across workflows */
|
|
52
|
-
allSpans: string[];
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Extract span context from a workflow's event templates
|
|
56
|
-
*
|
|
57
|
-
* @param scenario - Workflow scenario to analyze
|
|
58
|
-
* @param rootSpan - Default span for events without explicit span
|
|
59
|
-
* @returns Array of { eventName, span } entries in template order
|
|
60
|
-
*/
|
|
61
|
-
export declare function extractEventSpans(scenario: WorkflowScenario, rootSpan: string | undefined): Array<{
|
|
62
|
-
eventName: string;
|
|
63
|
-
span: string;
|
|
64
|
-
}>;
|
|
65
|
-
/**
|
|
66
|
-
* Derive edges from span transitions in event sequence
|
|
67
|
-
*
|
|
68
|
-
* Identifies when consecutive events are in different spans,
|
|
69
|
-
* which represents a potential edge (call relationship).
|
|
70
|
-
*
|
|
71
|
-
* Note: This captures temporal order, not parent-child nesting.
|
|
72
|
-
* We observe "span A was active, then span B was active" but
|
|
73
|
-
* cannot infer nesting without actual trace data.
|
|
74
|
-
*
|
|
75
|
-
* @param eventSpans - Event-span mappings in order
|
|
76
|
-
* @param scenarioId - ID of the scenario being analyzed
|
|
77
|
-
* @returns Array of derived edges
|
|
78
|
-
*/
|
|
79
|
-
export declare function deriveEdgesFromSequence(eventSpans: Array<{
|
|
80
|
-
eventName: string;
|
|
81
|
-
span: string;
|
|
82
|
-
}>, scenarioId: string): DerivedEdge[];
|
|
83
|
-
/**
|
|
84
|
-
* Derive all edges from a workflow template
|
|
85
|
-
*
|
|
86
|
-
* @param workflow - Workflow template to analyze
|
|
87
|
-
* @param workflowFile - Optional file path for tracking
|
|
88
|
-
* @returns Edge derivation result for this workflow
|
|
89
|
-
*/
|
|
90
|
-
export declare function deriveWorkflowEdges(workflow: WorkflowTemplate, workflowFile?: string): WorkflowEdgeDerivationResult;
|
|
91
|
-
/**
|
|
92
|
-
* Derive edges from multiple workflows
|
|
93
|
-
*
|
|
94
|
-
* @param workflows - Array of { workflow, filePath } pairs
|
|
95
|
-
* @returns Combined edge derivation result
|
|
96
|
-
*/
|
|
97
|
-
export declare function deriveEdgesFromWorkflows(workflows: Array<{
|
|
98
|
-
workflow: WorkflowTemplate;
|
|
99
|
-
filePath?: string;
|
|
100
|
-
}>): EdgeDerivationResult;
|
|
101
|
-
/**
|
|
102
|
-
* Group derived edges by source and target for display
|
|
103
|
-
*
|
|
104
|
-
* @param edges - Derived edges to group
|
|
105
|
-
* @returns Map of edge key to list of workflows/scenarios containing it
|
|
106
|
-
*/
|
|
107
|
-
export declare function groupEdgesBySources(edges: DerivedEdge[]): Map<string, Array<{
|
|
108
|
-
workflowFile?: string;
|
|
109
|
-
scenarioId: string;
|
|
110
|
-
}>>;
|
|
111
|
-
//# sourceMappingURL=edge-derivation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edge-derivation.d.ts","sourceRoot":"","sources":["../../src/workflow/edge-derivation.ts"],"names":[],"mapp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K,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EACtD,UAAU,EAAE,MAAM,GACjB,WAAW,EAAE,CA4Bf;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,gBAAgB,EAC1B,YAAY,CAAC,EAAE,MAAM,GACpB,4BAA4B,CAuC9B;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,KAAK,CAAC;IAAE,QAAQ,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAClE,oBAAoB,CA+BtB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,WAAW,EAAE,GACnB,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAcnE"}
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Edge Derivation from Workflows
|
|
4
|
-
*
|
|
5
|
-
* Extracts span context from workflow event templates and derives
|
|
6
|
-
* expected edges (span transitions) for validation against spans.canvas.
|
|
7
|
-
*
|
|
8
|
-
* @see .principal-views/WORKFLOW-SPAN-INTEGRATION.md
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.groupEdgesBySources = exports.deriveEdgesFromWorkflows = exports.deriveWorkflowEdges = exports.deriveEdgesFromSequence = exports.extractEventSpans = void 0;
|
|
12
|
-
const types_1 = require("./types");
|
|
13
|
-
/**
|
|
14
|
-
* Extract span context from a workflow's event templates
|
|
15
|
-
*
|
|
16
|
-
* @param scenario - Workflow scenario to analyze
|
|
17
|
-
* @param rootSpan - Default span for events without explicit span
|
|
18
|
-
* @returns Array of { eventName, span } entries in template order
|
|
19
|
-
*/
|
|
20
|
-
function extractEventSpans(scenario, rootSpan) {
|
|
21
|
-
const events = scenario.template.events;
|
|
22
|
-
if (!events) {
|
|
23
|
-
return [];
|
|
24
|
-
}
|
|
25
|
-
const result = [];
|
|
26
|
-
for (const [eventName, eventTemplate] of Object.entries(events)) {
|
|
27
|
-
const explicitSpan = (0, types_1.isEventTemplate)(eventTemplate)
|
|
28
|
-
? (0, types_1.getEventSpan)(eventTemplate)
|
|
29
|
-
: undefined;
|
|
30
|
-
// Use explicit span if provided, otherwise fall back to rootSpan
|
|
31
|
-
const span = explicitSpan ?? rootSpan;
|
|
32
|
-
if (span) {
|
|
33
|
-
result.push({ eventName, span });
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return result;
|
|
37
|
-
}
|
|
38
|
-
exports.extractEventSpans = extractEventSpans;
|
|
39
|
-
/**
|
|
40
|
-
* Derive edges from span transitions in event sequence
|
|
41
|
-
*
|
|
42
|
-
* Identifies when consecutive events are in different spans,
|
|
43
|
-
* which represents a potential edge (call relationship).
|
|
44
|
-
*
|
|
45
|
-
* Note: This captures temporal order, not parent-child nesting.
|
|
46
|
-
* We observe "span A was active, then span B was active" but
|
|
47
|
-
* cannot infer nesting without actual trace data.
|
|
48
|
-
*
|
|
49
|
-
* @param eventSpans - Event-span mappings in order
|
|
50
|
-
* @param scenarioId - ID of the scenario being analyzed
|
|
51
|
-
* @returns Array of derived edges
|
|
52
|
-
*/
|
|
53
|
-
function deriveEdgesFromSequence(eventSpans, scenarioId) {
|
|
54
|
-
const edges = [];
|
|
55
|
-
const seenEdges = new Set();
|
|
56
|
-
let sequenceNumber = 0;
|
|
57
|
-
for (let i = 0; i < eventSpans.length - 1; i++) {
|
|
58
|
-
const current = eventSpans[i];
|
|
59
|
-
const next = eventSpans[i + 1];
|
|
60
|
-
// Transition occurs when spans differ
|
|
61
|
-
if (current.span !== next.span) {
|
|
62
|
-
const edgeKey = `${current.span}->${next.span}`;
|
|
63
|
-
if (!seenEdges.has(edgeKey)) {
|
|
64
|
-
seenEdges.add(edgeKey);
|
|
65
|
-
sequenceNumber++;
|
|
66
|
-
edges.push({
|
|
67
|
-
fromSpan: current.span,
|
|
68
|
-
toSpan: next.span,
|
|
69
|
-
scenarioId,
|
|
70
|
-
eventNames: [current.eventName, next.eventName],
|
|
71
|
-
sequenceNumber,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return edges;
|
|
77
|
-
}
|
|
78
|
-
exports.deriveEdgesFromSequence = deriveEdgesFromSequence;
|
|
79
|
-
/**
|
|
80
|
-
* Derive all edges from a workflow template
|
|
81
|
-
*
|
|
82
|
-
* @param workflow - Workflow template to analyze
|
|
83
|
-
* @param workflowFile - Optional file path for tracking
|
|
84
|
-
* @returns Edge derivation result for this workflow
|
|
85
|
-
*/
|
|
86
|
-
function deriveWorkflowEdges(workflow, workflowFile) {
|
|
87
|
-
const rootSpan = (0, types_1.getWorkflowRootSpan)(workflow);
|
|
88
|
-
const allSpans = new Set();
|
|
89
|
-
const scenarioEdges = [];
|
|
90
|
-
if (rootSpan) {
|
|
91
|
-
allSpans.add(rootSpan);
|
|
92
|
-
}
|
|
93
|
-
for (const scenario of workflow.scenarios) {
|
|
94
|
-
const eventSpans = extractEventSpans(scenario, rootSpan);
|
|
95
|
-
// Collect all referenced spans
|
|
96
|
-
for (const { span } of eventSpans) {
|
|
97
|
-
allSpans.add(span);
|
|
98
|
-
}
|
|
99
|
-
// Derive edges from transitions
|
|
100
|
-
const edges = deriveEdgesFromSequence(eventSpans, scenario.id);
|
|
101
|
-
// Attach workflow file to each edge
|
|
102
|
-
if (workflowFile) {
|
|
103
|
-
for (const edge of edges) {
|
|
104
|
-
edge.workflowFile = workflowFile;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
scenarioEdges.push({
|
|
108
|
-
scenarioId: scenario.id,
|
|
109
|
-
edges,
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
return {
|
|
113
|
-
workflowName: workflow.name,
|
|
114
|
-
rootSpan,
|
|
115
|
-
referencedSpans: Array.from(allSpans),
|
|
116
|
-
scenarioEdges,
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
exports.deriveWorkflowEdges = deriveWorkflowEdges;
|
|
120
|
-
/**
|
|
121
|
-
* Derive edges from multiple workflows
|
|
122
|
-
*
|
|
123
|
-
* @param workflows - Array of { workflow, filePath } pairs
|
|
124
|
-
* @returns Combined edge derivation result
|
|
125
|
-
*/
|
|
126
|
-
function deriveEdgesFromWorkflows(workflows) {
|
|
127
|
-
const allSpans = new Set();
|
|
128
|
-
const workflowResults = [];
|
|
129
|
-
const edgeMap = new Map();
|
|
130
|
-
for (const { workflow, filePath } of workflows) {
|
|
131
|
-
const result = deriveWorkflowEdges(workflow, filePath);
|
|
132
|
-
workflowResults.push(result);
|
|
133
|
-
// Collect spans
|
|
134
|
-
for (const span of result.referencedSpans) {
|
|
135
|
-
allSpans.add(span);
|
|
136
|
-
}
|
|
137
|
-
// Collect and deduplicate edges
|
|
138
|
-
for (const scenarioResult of result.scenarioEdges) {
|
|
139
|
-
for (const edge of scenarioResult.edges) {
|
|
140
|
-
const key = `${edge.fromSpan}->${edge.toSpan}`;
|
|
141
|
-
if (!edgeMap.has(key)) {
|
|
142
|
-
edgeMap.set(key, edge);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return {
|
|
148
|
-
edges: Array.from(edgeMap.values()),
|
|
149
|
-
workflows: workflowResults,
|
|
150
|
-
allSpans: Array.from(allSpans),
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
exports.deriveEdgesFromWorkflows = deriveEdgesFromWorkflows;
|
|
154
|
-
/**
|
|
155
|
-
* Group derived edges by source and target for display
|
|
156
|
-
*
|
|
157
|
-
* @param edges - Derived edges to group
|
|
158
|
-
* @returns Map of edge key to list of workflows/scenarios containing it
|
|
159
|
-
*/
|
|
160
|
-
function groupEdgesBySources(edges) {
|
|
161
|
-
const grouped = new Map();
|
|
162
|
-
for (const edge of edges) {
|
|
163
|
-
const key = `${edge.fromSpan}->${edge.toSpan}`;
|
|
164
|
-
const sources = grouped.get(key) || [];
|
|
165
|
-
sources.push({
|
|
166
|
-
workflowFile: edge.workflowFile,
|
|
167
|
-
scenarioId: edge.scenarioId,
|
|
168
|
-
});
|
|
169
|
-
grouped.set(key, sources);
|
|
170
|
-
}
|
|
171
|
-
return grouped;
|
|
172
|
-
}
|
|
173
|
-
exports.groupEdgesBySources = groupEdgesBySources;
|
|
174
|
-
//# sourceMappingURL=edge-derivation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edge-derivation.js","sourceRoot":"","sources":["../../src/workflow/edge-derivation.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAGH,mCAA6E;AA2D7E;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAC/B,QAA0B,EAC1B,QAA4B;IAE5B,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;IACxC,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,EAAE,CAAC;KACX;IAED,MAAM,MAAM,GAA+C,EAAE,CAAC;IAE9D,KAAK,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAC/D,MAAM,YAAY,GAAG,IAAA,uBAAe,EAAC,aAAa,CAAC;YACjD,CAAC,CAAC,IAAA,oBAAY,EAAC,aAAa,CAAC;YAC7B,CAAC,CAAC,SAAS,CAAC;QAEd,iEAAiE;QACjE,MAAM,IAAI,GAAG,YAAY,IAAI,QAAQ,CAAC;QAEtC,IAAI,IAAI,EAAE;YACR,MAAM,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;SAClC;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAzBD,8CAyBC;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