@principal-ai/subsystems-core 0.29.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 +124 -0
- package/dist/ConfigurationLoader.d.ts +76 -0
- package/dist/ConfigurationLoader.d.ts.map +1 -0
- package/dist/ConfigurationLoader.js +148 -0
- package/dist/ConfigurationLoader.js.map +1 -0
- package/dist/ConfigurationValidator.d.ts +31 -0
- package/dist/ConfigurationValidator.d.ts.map +1 -0
- package/dist/ConfigurationValidator.js +239 -0
- package/dist/ConfigurationValidator.js.map +1 -0
- package/dist/EventProcessor.d.ts +49 -0
- package/dist/EventProcessor.d.ts.map +1 -0
- package/dist/EventProcessor.js +220 -0
- package/dist/EventProcessor.js.map +1 -0
- package/dist/EventRecorderService.d.ts +305 -0
- package/dist/EventRecorderService.d.ts.map +1 -0
- package/dist/EventRecorderService.js +467 -0
- package/dist/EventRecorderService.js.map +1 -0
- package/dist/LibraryLoader.d.ts +65 -0
- package/dist/LibraryLoader.d.ts.map +1 -0
- package/dist/LibraryLoader.js +197 -0
- package/dist/LibraryLoader.js.map +1 -0
- package/dist/PathBasedEventProcessor.d.ts +77 -0
- package/dist/PathBasedEventProcessor.d.ts.map +1 -0
- package/dist/PathBasedEventProcessor.js +136 -0
- package/dist/PathBasedEventProcessor.js.map +1 -0
- package/dist/SessionManager.d.ts +194 -0
- package/dist/SessionManager.d.ts.map +1 -0
- package/dist/SessionManager.js +302 -0
- package/dist/SessionManager.js.map +1 -0
- package/dist/ValidationEngine.d.ts +31 -0
- package/dist/ValidationEngine.d.ts.map +1 -0
- package/dist/ValidationEngine.js +162 -0
- package/dist/ValidationEngine.js.map +1 -0
- package/dist/agent-sessions/fixture.d.ts +80 -0
- package/dist/agent-sessions/fixture.d.ts.map +1 -0
- package/dist/agent-sessions/fixture.js +130 -0
- package/dist/agent-sessions/fixture.js.map +1 -0
- package/dist/agent-sessions/index.d.ts +3 -0
- package/dist/agent-sessions/index.d.ts.map +1 -0
- package/dist/agent-sessions/index.js +6 -0
- package/dist/agent-sessions/index.js.map +1 -0
- package/dist/auxiliary/AuxiliaryManifestValidator.d.ts +41 -0
- package/dist/auxiliary/AuxiliaryManifestValidator.d.ts.map +1 -0
- package/dist/auxiliary/AuxiliaryManifestValidator.js +100 -0
- package/dist/auxiliary/AuxiliaryManifestValidator.js.map +1 -0
- package/dist/auxiliary/index.d.ts +9 -0
- package/dist/auxiliary/index.d.ts.map +1 -0
- package/dist/auxiliary/index.js +14 -0
- package/dist/auxiliary/index.js.map +1 -0
- package/dist/auxiliary/validateAreaScopeDisjoint.d.ts +24 -0
- package/dist/auxiliary/validateAreaScopeDisjoint.d.ts.map +1 -0
- package/dist/auxiliary/validateAreaScopeDisjoint.js +61 -0
- package/dist/auxiliary/validateAreaScopeDisjoint.js.map +1 -0
- package/dist/cli/codegen.d.ts +41 -0
- package/dist/cli/codegen.d.ts.map +1 -0
- package/dist/cli/codegen.js +257 -0
- package/dist/cli/codegen.js.map +1 -0
- package/dist/codegen/type-generator.d.ts +123 -0
- package/dist/codegen/type-generator.d.ts.map +1 -0
- package/dist/codegen/type-generator.js +433 -0
- package/dist/codegen/type-generator.js.map +1 -0
- package/dist/codegen/usage-example.d.ts +103 -0
- package/dist/codegen/usage-example.d.ts.map +1 -0
- package/dist/codegen/usage-example.js +258 -0
- package/dist/codegen/usage-example.js.map +1 -0
- package/dist/dashboard/DashboardValidator.d.ts +85 -0
- package/dist/dashboard/DashboardValidator.d.ts.map +1 -0
- package/dist/dashboard/DashboardValidator.js +775 -0
- package/dist/dashboard/DashboardValidator.js.map +1 -0
- package/dist/dashboard/index.d.ts +6 -0
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.js +10 -0
- package/dist/dashboard/index.js.map +1 -0
- package/dist/discovery/CanvasDiscovery.d.ts +160 -0
- package/dist/discovery/CanvasDiscovery.d.ts.map +1 -0
- package/dist/discovery/CanvasDiscovery.js +865 -0
- package/dist/discovery/CanvasDiscovery.js.map +1 -0
- package/dist/discovery/CanvasFileManifest.d.ts +86 -0
- package/dist/discovery/CanvasFileManifest.d.ts.map +1 -0
- package/dist/discovery/CanvasFileManifest.js +338 -0
- package/dist/discovery/CanvasFileManifest.js.map +1 -0
- package/dist/discovery/LibraryDiscovery.d.ts +108 -0
- package/dist/discovery/LibraryDiscovery.d.ts.map +1 -0
- package/dist/discovery/LibraryDiscovery.js +263 -0
- package/dist/discovery/LibraryDiscovery.js.map +1 -0
- package/dist/discovery/types.d.ts +403 -0
- package/dist/discovery/types.d.ts.map +1 -0
- package/dist/discovery/types.js +6 -0
- package/dist/discovery/types.js.map +1 -0
- package/dist/events/EventsCanvasValidator.d.ts +139 -0
- package/dist/events/EventsCanvasValidator.d.ts.map +1 -0
- package/dist/events/EventsCanvasValidator.js +281 -0
- package/dist/events/EventsCanvasValidator.js.map +1 -0
- package/dist/events/NamespacePathIndex.d.ts +61 -0
- package/dist/events/NamespacePathIndex.d.ts.map +1 -0
- package/dist/events/NamespacePathIndex.js +74 -0
- package/dist/events/NamespacePathIndex.js.map +1 -0
- package/dist/events/OtelEventPathsValidator.d.ts +75 -0
- package/dist/events/OtelEventPathsValidator.d.ts.map +1 -0
- package/dist/events/OtelEventPathsValidator.js +126 -0
- package/dist/events/OtelEventPathsValidator.js.map +1 -0
- package/dist/events/ScopeEventsValidator.d.ts +68 -0
- package/dist/events/ScopeEventsValidator.d.ts.map +1 -0
- package/dist/events/ScopeEventsValidator.js +91 -0
- package/dist/events/ScopeEventsValidator.js.map +1 -0
- package/dist/events/index.d.ts +9 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +12 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/path-helpers.d.ts +33 -0
- package/dist/events/path-helpers.d.ts.map +1 -0
- package/dist/events/path-helpers.js +59 -0
- package/dist/events/path-helpers.js.map +1 -0
- package/dist/execution/ExecutionLoader.d.ts +135 -0
- package/dist/execution/ExecutionLoader.d.ts.map +1 -0
- package/dist/execution/ExecutionLoader.js +266 -0
- package/dist/execution/ExecutionLoader.js.map +1 -0
- package/dist/execution/ExecutionValidator.d.ts +94 -0
- package/dist/execution/ExecutionValidator.d.ts.map +1 -0
- package/dist/execution/ExecutionValidator.js +503 -0
- package/dist/execution/ExecutionValidator.js.map +1 -0
- package/dist/generated/graph-converter-execution.types.d.ts +177 -0
- package/dist/generated/graph-converter-execution.types.d.ts.map +1 -0
- package/dist/generated/graph-converter-execution.types.js +12 -0
- package/dist/generated/graph-converter-execution.types.js.map +1 -0
- package/dist/helpers/GraphInstrumentationHelper.d.ts +93 -0
- package/dist/helpers/GraphInstrumentationHelper.d.ts.map +1 -0
- package/dist/helpers/GraphInstrumentationHelper.js +252 -0
- package/dist/helpers/GraphInstrumentationHelper.js.map +1 -0
- package/dist/index.d.ts +82 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +214 -0
- package/dist/index.js.map +1 -0
- package/dist/matchers/SpanMatcher.d.ts +107 -0
- package/dist/matchers/SpanMatcher.d.ts.map +1 -0
- package/dist/matchers/SpanMatcher.js +274 -0
- package/dist/matchers/SpanMatcher.js.map +1 -0
- package/dist/node.d.ts +78 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +177 -0
- package/dist/node.js.map +1 -0
- package/dist/opencode/OpenCodeEventStore.d.ts +25 -0
- package/dist/opencode/OpenCodeEventStore.d.ts.map +1 -0
- package/dist/opencode/OpenCodeEventStore.js +182 -0
- package/dist/opencode/OpenCodeEventStore.js.map +1 -0
- package/dist/opencode/agent-sessions.d.ts +46 -0
- package/dist/opencode/agent-sessions.d.ts.map +1 -0
- package/dist/opencode/agent-sessions.js +302 -0
- package/dist/opencode/agent-sessions.js.map +1 -0
- package/dist/opencode/index.d.ts +6 -0
- package/dist/opencode/index.d.ts.map +1 -0
- package/dist/opencode/index.js +15 -0
- package/dist/opencode/index.js.map +1 -0
- package/dist/opencode/node-path-adapter.d.ts +25 -0
- package/dist/opencode/node-path-adapter.d.ts.map +1 -0
- package/dist/opencode/node-path-adapter.js +188 -0
- package/dist/opencode/node-path-adapter.js.map +1 -0
- package/dist/opencode/pipeline.d.ts +42 -0
- package/dist/opencode/pipeline.d.ts.map +1 -0
- package/dist/opencode/pipeline.js +90 -0
- package/dist/opencode/pipeline.js.map +1 -0
- package/dist/opencode/types.d.ts +39 -0
- package/dist/opencode/types.d.ts.map +1 -0
- package/dist/opencode/types.js +3 -0
- package/dist/opencode/types.js.map +1 -0
- package/dist/orchestration/TraceOrchestrator.d.ts +71 -0
- package/dist/orchestration/TraceOrchestrator.d.ts.map +1 -0
- package/dist/orchestration/TraceOrchestrator.js +416 -0
- package/dist/orchestration/TraceOrchestrator.js.map +1 -0
- package/dist/parsers/OtlpTraceParser.d.ts +131 -0
- package/dist/parsers/OtlpTraceParser.d.ts.map +1 -0
- package/dist/parsers/OtlpTraceParser.js +310 -0
- package/dist/parsers/OtlpTraceParser.js.map +1 -0
- package/dist/registry/CompositeRegistry.d.ts +71 -0
- package/dist/registry/CompositeRegistry.d.ts.map +1 -0
- package/dist/registry/CompositeRegistry.js +113 -0
- package/dist/registry/CompositeRegistry.js.map +1 -0
- package/dist/registry/EventRegistry.d.ts +79 -0
- package/dist/registry/EventRegistry.d.ts.map +1 -0
- package/dist/registry/EventRegistry.js +165 -0
- package/dist/registry/EventRegistry.js.map +1 -0
- package/dist/registry/LocalRegistry.d.ts +111 -0
- package/dist/registry/LocalRegistry.d.ts.map +1 -0
- package/dist/registry/LocalRegistry.js +335 -0
- package/dist/registry/LocalRegistry.js.map +1 -0
- package/dist/registry/RemoteRegistry.d.ts +122 -0
- package/dist/registry/RemoteRegistry.d.ts.map +1 -0
- package/dist/registry/RemoteRegistry.js +399 -0
- package/dist/registry/RemoteRegistry.js.map +1 -0
- package/dist/registry/VersionRegistry.d.ts +51 -0
- package/dist/registry/VersionRegistry.d.ts.map +1 -0
- package/dist/registry/VersionRegistry.js +105 -0
- package/dist/registry/VersionRegistry.js.map +1 -0
- package/dist/rules/config.d.ts +57 -0
- package/dist/rules/config.d.ts.map +1 -0
- package/dist/rules/config.js +382 -0
- package/dist/rules/config.js.map +1 -0
- package/dist/rules/engine.d.ts +70 -0
- package/dist/rules/engine.d.ts.map +1 -0
- package/dist/rules/engine.js +373 -0
- package/dist/rules/engine.js.map +1 -0
- package/dist/rules/implementations/connection-type-references.d.ts +7 -0
- package/dist/rules/implementations/connection-type-references.d.ts.map +1 -0
- package/dist/rules/implementations/connection-type-references.js +107 -0
- package/dist/rules/implementations/connection-type-references.js.map +1 -0
- package/dist/rules/implementations/dead-end-states.d.ts +17 -0
- package/dist/rules/implementations/dead-end-states.d.ts.map +1 -0
- package/dist/rules/implementations/dead-end-states.js +75 -0
- package/dist/rules/implementations/dead-end-states.js.map +1 -0
- package/dist/rules/implementations/index.d.ts +23 -0
- package/dist/rules/implementations/index.d.ts.map +1 -0
- package/dist/rules/implementations/index.js +73 -0
- package/dist/rules/implementations/index.js.map +1 -0
- package/dist/rules/implementations/minimum-node-sources.d.ts +24 -0
- package/dist/rules/implementations/minimum-node-sources.d.ts.map +1 -0
- package/dist/rules/implementations/minimum-node-sources.js +59 -0
- package/dist/rules/implementations/minimum-node-sources.js.map +1 -0
- package/dist/rules/implementations/no-unknown-fields.d.ts +7 -0
- package/dist/rules/implementations/no-unknown-fields.d.ts.map +1 -0
- package/dist/rules/implementations/no-unknown-fields.js +216 -0
- package/dist/rules/implementations/no-unknown-fields.js.map +1 -0
- package/dist/rules/implementations/orphaned-edge-types.d.ts +7 -0
- package/dist/rules/implementations/orphaned-edge-types.d.ts.map +1 -0
- package/dist/rules/implementations/orphaned-edge-types.js +50 -0
- package/dist/rules/implementations/orphaned-edge-types.js.map +1 -0
- package/dist/rules/implementations/orphaned-node-types.d.ts +7 -0
- package/dist/rules/implementations/orphaned-node-types.d.ts.map +1 -0
- package/dist/rules/implementations/orphaned-node-types.js +53 -0
- package/dist/rules/implementations/orphaned-node-types.js.map +1 -0
- package/dist/rules/implementations/required-metadata.d.ts +7 -0
- package/dist/rules/implementations/required-metadata.d.ts.map +1 -0
- package/dist/rules/implementations/required-metadata.js +48 -0
- package/dist/rules/implementations/required-metadata.js.map +1 -0
- package/dist/rules/implementations/state-transition-references.d.ts +7 -0
- package/dist/rules/implementations/state-transition-references.d.ts.map +1 -0
- package/dist/rules/implementations/state-transition-references.js +138 -0
- package/dist/rules/implementations/state-transition-references.js.map +1 -0
- package/dist/rules/implementations/unreachable-states.d.ts +7 -0
- package/dist/rules/implementations/unreachable-states.d.ts.map +1 -0
- package/dist/rules/implementations/unreachable-states.js +83 -0
- package/dist/rules/implementations/unreachable-states.js.map +1 -0
- package/dist/rules/implementations/valid-action-patterns.d.ts +17 -0
- package/dist/rules/implementations/valid-action-patterns.d.ts.map +1 -0
- package/dist/rules/implementations/valid-action-patterns.js +112 -0
- package/dist/rules/implementations/valid-action-patterns.js.map +1 -0
- package/dist/rules/implementations/valid-color-format.d.ts +7 -0
- package/dist/rules/implementations/valid-color-format.d.ts.map +1 -0
- package/dist/rules/implementations/valid-color-format.js +94 -0
- package/dist/rules/implementations/valid-color-format.js.map +1 -0
- package/dist/rules/implementations/valid-edge-types.d.ts +7 -0
- package/dist/rules/implementations/valid-edge-types.d.ts.map +1 -0
- package/dist/rules/implementations/valid-edge-types.js +248 -0
- package/dist/rules/implementations/valid-edge-types.js.map +1 -0
- package/dist/rules/implementations/valid-node-types.d.ts +7 -0
- package/dist/rules/implementations/valid-node-types.d.ts.map +1 -0
- package/dist/rules/implementations/valid-node-types.js +187 -0
- package/dist/rules/implementations/valid-node-types.js.map +1 -0
- package/dist/rules/index.d.ts +28 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +70 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/types.d.ts +309 -0
- package/dist/rules/types.d.ts.map +1 -0
- package/dist/rules/types.js +40 -0
- package/dist/rules/types.js.map +1 -0
- package/dist/scopes/ScopePathIndex.d.ts +56 -0
- package/dist/scopes/ScopePathIndex.d.ts.map +1 -0
- package/dist/scopes/ScopePathIndex.js +67 -0
- package/dist/scopes/ScopePathIndex.js.map +1 -0
- package/dist/scopes/ScopesCanvasValidator.d.ts +76 -0
- package/dist/scopes/ScopesCanvasValidator.d.ts.map +1 -0
- package/dist/scopes/ScopesCanvasValidator.js +221 -0
- package/dist/scopes/ScopesCanvasValidator.js.map +1 -0
- package/dist/scopes/index.d.ts +12 -0
- package/dist/scopes/index.d.ts.map +1 -0
- package/dist/scopes/index.js +30 -0
- package/dist/scopes/index.js.map +1 -0
- package/dist/scopes/utils.d.ts +85 -0
- package/dist/scopes/utils.d.ts.map +1 -0
- package/dist/scopes/utils.js +143 -0
- package/dist/scopes/utils.js.map +1 -0
- package/dist/scopes/validateScopeNamespaceNesting.d.ts +38 -0
- package/dist/scopes/validateScopeNamespaceNesting.d.ts.map +1 -0
- package/dist/scopes/validateScopeNamespaceNesting.js +69 -0
- package/dist/scopes/validateScopeNamespaceNesting.js.map +1 -0
- package/dist/spans/index.d.ts +12 -0
- package/dist/spans/index.d.ts.map +1 -0
- package/dist/spans/index.js +25 -0
- package/dist/spans/index.js.map +1 -0
- package/dist/spans/utils.d.ts +70 -0
- package/dist/spans/utils.d.ts.map +1 -0
- package/dist/spans/utils.js +205 -0
- package/dist/spans/utils.js.map +1 -0
- package/dist/storage/topic-types.d.ts +203 -0
- package/dist/storage/topic-types.d.ts.map +1 -0
- package/dist/storage/topic-types.js +60 -0
- package/dist/storage/topic-types.js.map +1 -0
- package/dist/storage/topicStore.d.ts +135 -0
- package/dist/storage/topicStore.d.ts.map +1 -0
- package/dist/storage/topicStore.js +389 -0
- package/dist/storage/topicStore.js.map +1 -0
- package/dist/storyboard/builder.d.ts +135 -0
- package/dist/storyboard/builder.d.ts.map +1 -0
- package/dist/storyboard/builder.js +235 -0
- package/dist/storyboard/builder.js.map +1 -0
- package/dist/storyboard/index.d.ts +9 -0
- package/dist/storyboard/index.d.ts.map +1 -0
- package/dist/storyboard/index.js +18 -0
- package/dist/storyboard/index.js.map +1 -0
- package/dist/storyboard/types.d.ts +101 -0
- package/dist/storyboard/types.d.ts.map +1 -0
- package/dist/storyboard/types.js +10 -0
- package/dist/storyboard/types.js.map +1 -0
- package/dist/telemetry/coverage.d.ts +92 -0
- package/dist/telemetry/coverage.d.ts.map +1 -0
- package/dist/telemetry/coverage.js +335 -0
- package/dist/telemetry/coverage.js.map +1 -0
- package/dist/telemetry/event-validator.d.ts +86 -0
- package/dist/telemetry/event-validator.d.ts.map +1 -0
- package/dist/telemetry/event-validator.js +257 -0
- package/dist/telemetry/event-validator.js.map +1 -0
- package/dist/types/audit.d.ts +236 -0
- package/dist/types/audit.d.ts.map +1 -0
- package/dist/types/audit.js +53 -0
- package/dist/types/audit.js.map +1 -0
- package/dist/types/auxiliary.d.ts +54 -0
- package/dist/types/auxiliary.d.ts.map +1 -0
- package/dist/types/auxiliary.js +27 -0
- package/dist/types/auxiliary.js.map +1 -0
- package/dist/types/canvas-scope.d.ts +156 -0
- package/dist/types/canvas-scope.d.ts.map +1 -0
- package/dist/types/canvas-scope.js +62 -0
- package/dist/types/canvas-scope.js.map +1 -0
- package/dist/types/canvas.d.ts +1138 -0
- package/dist/types/canvas.d.ts.map +1 -0
- package/dist/types/canvas.js +178 -0
- package/dist/types/canvas.js.map +1 -0
- package/dist/types/dashboard.d.ts +170 -0
- package/dist/types/dashboard.d.ts.map +1 -0
- package/dist/types/dashboard.js +14 -0
- package/dist/types/dashboard.js.map +1 -0
- package/dist/types/index.d.ts +352 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +39 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/library.d.ts +227 -0
- package/dist/types/library.d.ts.map +1 -0
- package/dist/types/library.js +16 -0
- package/dist/types/library.js.map +1 -0
- package/dist/types/otel.d.ts +465 -0
- package/dist/types/otel.d.ts.map +1 -0
- package/dist/types/otel.js +163 -0
- package/dist/types/otel.js.map +1 -0
- package/dist/types/path-based-config.d.ts +235 -0
- package/dist/types/path-based-config.d.ts.map +1 -0
- package/dist/types/path-based-config.js +11 -0
- package/dist/types/path-based-config.js.map +1 -0
- package/dist/types/registered-trace.d.ts +337 -0
- package/dist/types/registered-trace.d.ts.map +1 -0
- package/dist/types/registered-trace.js +16 -0
- package/dist/types/registered-trace.js.map +1 -0
- package/dist/types/resource-match.d.ts +207 -0
- package/dist/types/resource-match.d.ts.map +1 -0
- package/dist/types/resource-match.js +74 -0
- package/dist/types/resource-match.js.map +1 -0
- package/dist/types/subsystem-model.d.ts +265 -0
- package/dist/types/subsystem-model.d.ts.map +1 -0
- package/dist/types/subsystem-model.js +35 -0
- package/dist/types/subsystem-model.js.map +1 -0
- package/dist/types/version-registry.d.ts +137 -0
- package/dist/types/version-registry.d.ts.map +1 -0
- package/dist/types/version-registry.js +10 -0
- package/dist/types/version-registry.js.map +1 -0
- package/dist/utils/CanvasConverter.d.ts +148 -0
- package/dist/utils/CanvasConverter.d.ts.map +1 -0
- package/dist/utils/CanvasConverter.js +530 -0
- package/dist/utils/CanvasConverter.js.map +1 -0
- package/dist/utils/GraphConverter.d.ts +18 -0
- package/dist/utils/GraphConverter.d.ts.map +1 -0
- package/dist/utils/GraphConverter.js +80 -0
- package/dist/utils/GraphConverter.js.map +1 -0
- package/dist/utils/PathMatcher.d.ts +55 -0
- package/dist/utils/PathMatcher.d.ts.map +1 -0
- package/dist/utils/PathMatcher.js +178 -0
- package/dist/utils/PathMatcher.js.map +1 -0
- package/dist/utils/TraceToCanvas.d.ts +83 -0
- package/dist/utils/TraceToCanvas.d.ts.map +1 -0
- package/dist/utils/TraceToCanvas.js +336 -0
- package/dist/utils/TraceToCanvas.js.map +1 -0
- package/dist/utils/YamlParser.d.ts +36 -0
- package/dist/utils/YamlParser.d.ts.map +1 -0
- package/dist/utils/YamlParser.js +92 -0
- package/dist/utils/YamlParser.js.map +1 -0
- package/dist/utils/registeredTraceHelpers.d.ts +76 -0
- package/dist/utils/registeredTraceHelpers.d.ts.map +1 -0
- package/dist/utils/registeredTraceHelpers.js +203 -0
- package/dist/utils/registeredTraceHelpers.js.map +1 -0
- package/dist/utils/traceAggregation.d.ts +25 -0
- package/dist/utils/traceAggregation.d.ts.map +1 -0
- package/dist/utils/traceAggregation.js +140 -0
- package/dist/utils/traceAggregation.js.map +1 -0
- package/dist/validation/OtelCanvasValidator.d.ts +40 -0
- package/dist/validation/OtelCanvasValidator.d.ts.map +1 -0
- package/dist/validation/OtelCanvasValidator.js +59 -0
- package/dist/validation/OtelCanvasValidator.js.map +1 -0
- package/dist/validation/index.d.ts +8 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +13 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/libraryValidation.d.ts +53 -0
- package/dist/validation/libraryValidation.d.ts.map +1 -0
- package/dist/validation/libraryValidation.js +115 -0
- package/dist/validation/libraryValidation.js.map +1 -0
- package/dist/workflow/edge-derivation.d.ts +111 -0
- package/dist/workflow/edge-derivation.d.ts.map +1 -0
- package/dist/workflow/edge-derivation.js +174 -0
- package/dist/workflow/edge-derivation.js.map +1 -0
- package/dist/workflow/edge-validation.d.ts +170 -0
- package/dist/workflow/edge-validation.d.ts.map +1 -0
- package/dist/workflow/edge-validation.js +332 -0
- package/dist/workflow/edge-validation.js.map +1 -0
- package/dist/workflow/example.d.ts +11 -0
- package/dist/workflow/example.d.ts.map +1 -0
- package/dist/workflow/example.js +310 -0
- package/dist/workflow/example.js.map +1 -0
- package/dist/workflow/index.d.ts +20 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +49 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/scenario-matcher.d.ts +63 -0
- package/dist/workflow/scenario-matcher.d.ts.map +1 -0
- package/dist/workflow/scenario-matcher.js +215 -0
- package/dist/workflow/scenario-matcher.js.map +1 -0
- package/dist/workflow/template-parser.d.ts +73 -0
- package/dist/workflow/template-parser.d.ts.map +1 -0
- package/dist/workflow/template-parser.js +280 -0
- package/dist/workflow/template-parser.js.map +1 -0
- package/dist/workflow/template-renderer.d.ts +45 -0
- package/dist/workflow/template-renderer.d.ts.map +1 -0
- package/dist/workflow/template-renderer.js +401 -0
- package/dist/workflow/template-renderer.js.map +1 -0
- package/dist/workflow/types.d.ts +393 -0
- package/dist/workflow/types.d.ts.map +1 -0
- package/dist/workflow/types.js +40 -0
- package/dist/workflow/types.js.map +1 -0
- package/dist/workflow/validator.d.ts +363 -0
- package/dist/workflow/validator.d.ts.map +1 -0
- package/dist/workflow/validator.js +2283 -0
- package/dist/workflow/validator.js.map +1 -0
- package/package.json +84 -0
- package/schemas/auxiliary.manifest.schema.json +56 -0
- package/schemas/subsystem-model.schema.json +767 -0
- package/src/ConfigurationLoader.test.ts +466 -0
- package/src/ConfigurationLoader.ts +184 -0
- package/src/ConfigurationValidator.test.ts +200 -0
- package/src/ConfigurationValidator.ts +273 -0
- package/src/EventProcessor.test.ts +405 -0
- package/src/EventProcessor.ts +256 -0
- package/src/EventRecorderService.test.ts +543 -0
- package/src/EventRecorderService.ts +741 -0
- package/src/LibraryLoader.ts +194 -0
- package/src/PathBasedEventProcessor.test.ts +336 -0
- package/src/PathBasedEventProcessor.ts +196 -0
- package/src/SessionManager.test.ts +424 -0
- package/src/SessionManager.ts +471 -0
- package/src/ValidationEngine.test.ts +520 -0
- package/src/ValidationEngine.ts +200 -0
- package/src/agent-sessions/fixture.ts +225 -0
- package/src/agent-sessions/index.ts +10 -0
- package/src/auxiliary/AuxiliaryManifestValidator.test.ts +93 -0
- package/src/auxiliary/AuxiliaryManifestValidator.ts +132 -0
- package/src/auxiliary/index.ts +18 -0
- package/src/auxiliary/validateAreaScopeDisjoint.test.ts +85 -0
- package/src/auxiliary/validateAreaScopeDisjoint.ts +72 -0
- package/src/browser-safety.test.ts +170 -0
- package/src/cli/codegen.ts +286 -0
- package/src/codegen/type-generator.test.ts +219 -0
- package/src/codegen/type-generator.ts +560 -0
- package/src/codegen/usage-example.ts +357 -0
- package/src/dashboard/DashboardValidator.ts +904 -0
- package/src/dashboard/index.ts +14 -0
- package/src/discovery/CanvasDiscovery.test.ts +691 -0
- package/src/discovery/CanvasDiscovery.ts +1114 -0
- package/src/discovery/CanvasFileManifest.test.ts +521 -0
- package/src/discovery/CanvasFileManifest.ts +419 -0
- package/src/discovery/LibraryDiscovery.test.ts +329 -0
- package/src/discovery/LibraryDiscovery.ts +386 -0
- package/src/discovery/types.ts +453 -0
- package/src/events/EventsCanvasValidator.test.ts +191 -0
- package/src/events/EventsCanvasValidator.ts +428 -0
- package/src/events/NamespacePathIndex.test.ts +97 -0
- package/src/events/NamespacePathIndex.ts +100 -0
- package/src/events/OtelEventPathsValidator.test.ts +243 -0
- package/src/events/OtelEventPathsValidator.ts +191 -0
- package/src/events/ScopeEventsValidator.test.ts +173 -0
- package/src/events/ScopeEventsValidator.ts +158 -0
- package/src/events/index.ts +27 -0
- package/src/events/path-helpers.ts +53 -0
- package/src/execution/ExecutionLoader.test.ts +378 -0
- package/src/execution/ExecutionLoader.ts +331 -0
- package/src/execution/ExecutionValidator.test.ts +503 -0
- package/src/execution/ExecutionValidator.ts +617 -0
- package/src/generated/graph-converter-execution.types.ts +193 -0
- package/src/helpers/GraphInstrumentationHelper.test.ts +364 -0
- package/src/helpers/GraphInstrumentationHelper.ts +323 -0
- package/src/index.ts +587 -0
- package/src/matchers/SpanMatcher.test.ts +1105 -0
- package/src/matchers/SpanMatcher.ts +381 -0
- package/src/node.ts +316 -0
- package/src/opencode/EVENT_MAPPING.md +82 -0
- package/src/opencode/OpenCodeEventStore.ts +214 -0
- package/src/opencode/__fixtures__/event-shapes.json +443 -0
- package/src/opencode/__fixtures__/session-events.json +13491 -0
- package/src/opencode/agent-sessions.ts +376 -0
- package/src/opencode/index.ts +23 -0
- package/src/opencode/node-path-adapter.ts +205 -0
- package/src/opencode/pipeline.ts +141 -0
- package/src/opencode/types.ts +43 -0
- package/src/orchestration/TraceOrchestrator.ts +560 -0
- package/src/orchestration/__tests__/TraceOrchestrator.test.ts +1098 -0
- package/src/parsers/OtlpTraceParser.ts +401 -0
- package/src/parsers/__tests__/OtlpTraceParser.test.ts +197 -0
- package/src/registry/CompositeRegistry.ts +140 -0
- package/src/registry/EventRegistry.test.ts +387 -0
- package/src/registry/EventRegistry.ts +191 -0
- package/src/registry/LocalRegistry.ts +416 -0
- package/src/registry/RemoteRegistry.ts +499 -0
- package/src/registry/VersionRegistry.test.ts +223 -0
- package/src/registry/VersionRegistry.ts +121 -0
- package/src/rules/config.test.ts +277 -0
- package/src/rules/config.ts +450 -0
- package/src/rules/engine.test.ts +331 -0
- package/src/rules/engine.ts +448 -0
- package/src/rules/implementations/connection-type-references.ts +117 -0
- package/src/rules/implementations/dead-end-states.ts +101 -0
- package/src/rules/implementations/index.ts +66 -0
- package/src/rules/implementations/minimum-node-sources.ts +84 -0
- package/src/rules/implementations/no-unknown-fields.ts +372 -0
- package/src/rules/implementations/orphaned-edge-types.ts +55 -0
- package/src/rules/implementations/orphaned-node-types.ts +58 -0
- package/src/rules/implementations/required-metadata.ts +52 -0
- package/src/rules/implementations/state-transition-references.ts +155 -0
- package/src/rules/implementations/unreachable-states.ts +94 -0
- package/src/rules/implementations/valid-action-patterns.ts +140 -0
- package/src/rules/implementations/valid-color-format.ts +152 -0
- package/src/rules/implementations/valid-edge-types.ts +273 -0
- package/src/rules/implementations/valid-node-types.ts +200 -0
- package/src/rules/index.ts +92 -0
- package/src/rules/types.ts +426 -0
- package/src/scopes/ScopePathIndex.test.ts +94 -0
- package/src/scopes/ScopePathIndex.ts +89 -0
- package/src/scopes/ScopesCanvasValidator.test.ts +127 -0
- package/src/scopes/ScopesCanvasValidator.ts +305 -0
- package/src/scopes/__tests__/utils.test.ts +383 -0
- package/src/scopes/index.ts +42 -0
- package/src/scopes/utils.ts +182 -0
- package/src/scopes/validateScopeNamespaceNesting.test.ts +127 -0
- package/src/scopes/validateScopeNamespaceNesting.ts +88 -0
- package/src/spans/index.ts +24 -0
- package/src/spans/utils.ts +249 -0
- package/src/storage/topic-types.ts +235 -0
- package/src/storage/topicStore.test.ts +193 -0
- package/src/storage/topicStore.ts +489 -0
- package/src/storyboard/builder.ts +308 -0
- package/src/storyboard/index.ts +26 -0
- package/src/storyboard/types.ts +117 -0
- package/src/telemetry/coverage.ts +480 -0
- package/src/telemetry/event-validator.ts +312 -0
- package/src/types/audit.ts +314 -0
- package/src/types/auxiliary.ts +63 -0
- package/src/types/canvas-scope.ts +190 -0
- package/src/types/canvas.test.ts +199 -0
- package/src/types/canvas.ts +1395 -0
- package/src/types/dashboard.ts +257 -0
- package/src/types/index.ts +460 -0
- package/src/types/library.ts +283 -0
- package/src/types/otel.test.ts +219 -0
- package/src/types/otel.ts +620 -0
- package/src/types/path-based-config.ts +285 -0
- package/src/types/registered-trace.ts +432 -0
- package/src/types/resource-match.ts +263 -0
- package/src/types/subsystem-model.ts +352 -0
- package/src/types/version-registry.ts +150 -0
- package/src/utils/CanvasConverter.ts +670 -0
- package/src/utils/GraphConverter.test.ts +322 -0
- package/src/utils/GraphConverter.ts +84 -0
- package/src/utils/PathMatcher.test.ts +139 -0
- package/src/utils/PathMatcher.ts +185 -0
- package/src/utils/TraceToCanvas.test.ts +310 -0
- package/src/utils/TraceToCanvas.ts +510 -0
- package/src/utils/YamlParser.ts +77 -0
- package/src/utils/registeredTraceHelpers.ts +251 -0
- package/src/utils/traceAggregation.test.ts +385 -0
- package/src/utils/traceAggregation.ts +173 -0
- package/src/validation/OtelCanvasValidator.ts +86 -0
- package/src/validation/index.ts +17 -0
- package/src/validation/libraryValidation.ts +206 -0
- package/src/workflow/README.md +408 -0
- package/src/workflow/__tests__/edge-derivation.test.ts +449 -0
- package/src/workflow/__tests__/edge-validation.test.ts +417 -0
- package/src/workflow/__tests__/scenario-matcher.test.ts +225 -0
- package/src/workflow/__tests__/template-parser.test.ts +276 -0
- package/src/workflow/__tests__/template-renderer.test.ts +509 -0
- package/src/workflow/__tests__/types.test.ts +187 -0
- package/src/workflow/__tests__/validator.test.ts +3225 -0
- package/src/workflow/edge-derivation.ts +265 -0
- package/src/workflow/edge-validation.ts +503 -0
- package/src/workflow/example.ts +330 -0
- package/src/workflow/index.ts +86 -0
- package/src/workflow/scenario-matcher.ts +253 -0
- package/src/workflow/template-parser.ts +350 -0
- package/src/workflow/template-renderer.ts +453 -0
- package/src/workflow/types.ts +511 -0
- package/src/workflow/validator.ts +2737 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.collectRepositories = exports.accumulateEvents = exports.normalizeEventsWithAdapter = exports.normalizeEvents = exports.opencodeRowsToUniversalEvents = exports.NodePathNormalizationAdapter = void 0;
|
|
4
|
+
const agent_monitoring_1 = require("@principal-ai/agent-monitoring");
|
|
5
|
+
const node_path_adapter_1 = require("./node-path-adapter");
|
|
6
|
+
Object.defineProperty(exports, "NodePathNormalizationAdapter", { enumerable: true, get: function () { return node_path_adapter_1.NodePathNormalizationAdapter; } });
|
|
7
|
+
/**
|
|
8
|
+
* Convert raw opencode event rows into universal events. Handles both string
|
|
9
|
+
* (SQLite TEXT, unparsed) and already-parsed object `data` payloads.
|
|
10
|
+
*/
|
|
11
|
+
function opencodeRowsToUniversalEvents(rows) {
|
|
12
|
+
const processor = new agent_monitoring_1.V1EventBridgeProcessor();
|
|
13
|
+
return rows.map((row) => processor.normalize({
|
|
14
|
+
type: row.type,
|
|
15
|
+
data: typeof row.data === "string"
|
|
16
|
+
? JSON.parse(row.data)
|
|
17
|
+
: row.data,
|
|
18
|
+
id: row.id,
|
|
19
|
+
aggregateId: row.aggregateId,
|
|
20
|
+
seq: row.seq,
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
exports.opencodeRowsToUniversalEvents = opencodeRowsToUniversalEvents;
|
|
24
|
+
/** Normalize raw universal events into repo-normalized universal events. */
|
|
25
|
+
async function normalizeEvents(events, workingDirectory = "", knownRoots) {
|
|
26
|
+
const { normalized } = await normalizeEventsWithAdapter(events, workingDirectory, knownRoots);
|
|
27
|
+
return normalized;
|
|
28
|
+
}
|
|
29
|
+
exports.normalizeEvents = normalizeEvents;
|
|
30
|
+
/**
|
|
31
|
+
* Like `normalizeEvents`, but also returns the adapter so callers can inspect
|
|
32
|
+
* `adapter.newlyDiscovered` for auto-registration of newly found git roots.
|
|
33
|
+
*/
|
|
34
|
+
async function normalizeEventsWithAdapter(events, workingDirectory = "", knownRoots) {
|
|
35
|
+
const adapter = new node_path_adapter_1.NodePathNormalizationAdapter(knownRoots);
|
|
36
|
+
const service = new agent_monitoring_1.PathNormalizationService(adapter);
|
|
37
|
+
const normalized = await service.normalizePathsBatch(events, workingDirectory);
|
|
38
|
+
return { normalized, adapter };
|
|
39
|
+
}
|
|
40
|
+
exports.normalizeEventsWithAdapter = normalizeEventsWithAdapter;
|
|
41
|
+
/** Compute the accumulated agent-session event rows for a normalized session. */
|
|
42
|
+
function accumulateEvents(normalizedEvents, sessionTitle = "") {
|
|
43
|
+
const accState = (0, agent_monitoring_1.createAccumulatedState)(sessionTitle);
|
|
44
|
+
return normalizedEvents.map((normalizedEvent) => ({
|
|
45
|
+
normalized: normalizedEvent,
|
|
46
|
+
accumulated: (0, agent_monitoring_1.eventOp)(accState, normalizedEvent),
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
exports.accumulateEvents = accumulateEvents;
|
|
50
|
+
/** Collect the distinct repositories referenced across a normalized session. */
|
|
51
|
+
function collectRepositories(normalizedEvents) {
|
|
52
|
+
const byRoot = new Map();
|
|
53
|
+
// Event-level repository context uses the RepositoryInfo shape (key: `root`).
|
|
54
|
+
const putEventRepo = (root, repo) => {
|
|
55
|
+
byRoot.set(root, {
|
|
56
|
+
root,
|
|
57
|
+
remoteUrl: repo.remoteUrl,
|
|
58
|
+
owner: repo.owner,
|
|
59
|
+
repo: repo.repo,
|
|
60
|
+
branch: repo.branch,
|
|
61
|
+
headCommit: repo.headCommit,
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
// Per-file repository uses the NormalizedPathInfo shape (key: `gitRoot`, no
|
|
65
|
+
// branch/headCommit). Normalize into the RepositoryInfo shape.
|
|
66
|
+
const putFileRepo = (root, repo) => {
|
|
67
|
+
const existing = byRoot.get(root);
|
|
68
|
+
byRoot.set(root, {
|
|
69
|
+
root,
|
|
70
|
+
remoteUrl: repo.remoteUrl ?? existing?.remoteUrl,
|
|
71
|
+
owner: repo.owner ?? existing?.owner,
|
|
72
|
+
repo: repo.repo ?? existing?.repo,
|
|
73
|
+
branch: existing?.branch,
|
|
74
|
+
headCommit: existing?.headCommit,
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
for (const event of normalizedEvents) {
|
|
78
|
+
if (event.repository?.root)
|
|
79
|
+
putEventRepo(event.repository.root, event.repository);
|
|
80
|
+
for (const file of event.files ?? []) {
|
|
81
|
+
const fileRepo = file.repository;
|
|
82
|
+
if (fileRepo?.gitRoot) {
|
|
83
|
+
putFileRepo(fileRepo.gitRoot, fileRepo);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return Array.from(byRoot.values());
|
|
88
|
+
}
|
|
89
|
+
exports.collectRepositories = collectRepositories;
|
|
90
|
+
//# sourceMappingURL=pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/opencode/pipeline.ts"],"names":[],"mappings":";;;AAAA,qEAQwC;AACxC,2DAAmE;AAE1D,6GAFA,gDAA4B,OAEA;AAoBrC;;;GAGG;AACH,SAAgB,6BAA6B,CAC3C,IAAwB;IAExB,MAAM,SAAS,GAAG,IAAI,yCAAsB,EAAE,CAAC;IAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CACtB,SAAS,CAAC,SAAS,CAAC;QAClB,IAAI,EAAE,GAAG,CAAC,IAKa;QACvB,IAAI,EACF,OAAO,GAAG,CAAC,IAAI,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I,CAAC,UAAU,CAAC;YACjC,IAAI,QAAQ,EAAE,OAAO,EAAE;gBACrB,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;aACzC;SACF;KACF;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AACrC,CAAC;AA5CD,kDA4CC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface OpenCodeRawEvent {
|
|
2
|
+
id: string;
|
|
3
|
+
aggregateId: string;
|
|
4
|
+
seq: number;
|
|
5
|
+
type: string;
|
|
6
|
+
data: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
export interface OpenCodeSessionEvents {
|
|
9
|
+
sessionId: string;
|
|
10
|
+
events: OpenCodeRawEvent[];
|
|
11
|
+
hasMore: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface OpenCodeEventRetriever {
|
|
14
|
+
readAggregate(sessionId: string, options?: {
|
|
15
|
+
after?: number;
|
|
16
|
+
limit?: number;
|
|
17
|
+
}): OpenCodeSessionEvents;
|
|
18
|
+
}
|
|
19
|
+
export interface OpenCodeStoreOptions {
|
|
20
|
+
dbPath?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SessionSummary {
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
slug: string;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
durationMs: number;
|
|
28
|
+
eventCount: number;
|
|
29
|
+
isFinished: boolean;
|
|
30
|
+
children: SessionSummary[];
|
|
31
|
+
}
|
|
32
|
+
export interface SessionListResult {
|
|
33
|
+
groups: Array<{
|
|
34
|
+
parent: SessionSummary;
|
|
35
|
+
children: SessionSummary[];
|
|
36
|
+
}>;
|
|
37
|
+
standalone: SessionSummary[];
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/opencode/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAA;IAC1B,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,CACX,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3C,qBAAqB,CAAA;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,cAAc,EAAE,CAAA;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,KAAK,CAAC;QACZ,MAAM,EAAE,cAAc,CAAA;QACtB,QAAQ,EAAE,cAAc,EAAE,CAAA;KAC3B,CAAC,CAAA;IACF,UAAU,EAAE,cAAc,EAAE,CAAA;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/opencode/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TraceOrchestrator - Coordinates the complete trace matching pipeline
|
|
3
|
+
*
|
|
4
|
+
* Pipeline:
|
|
5
|
+
* 1. Parse OTLP trace → extract resources and scopes
|
|
6
|
+
* 2. For each scope → lookup VersionSnapshot from registry
|
|
7
|
+
* 3. Match spans against workflows/scenarios
|
|
8
|
+
* 4. Categorize results into three categories
|
|
9
|
+
*/
|
|
10
|
+
import type { OtelExportTraceServiceRequest } from '../types/otel';
|
|
11
|
+
import type { RegisteredTrace, StoryboardRegistryInterface } from '../types/registered-trace';
|
|
12
|
+
/**
|
|
13
|
+
* Orchestrator configuration
|
|
14
|
+
*/
|
|
15
|
+
export interface TraceOrchestratorConfig {
|
|
16
|
+
registry: StoryboardRegistryInterface;
|
|
17
|
+
enableValidation?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Main orchestrator for trace matching
|
|
21
|
+
*/
|
|
22
|
+
export declare class TraceOrchestrator {
|
|
23
|
+
private config;
|
|
24
|
+
private parser;
|
|
25
|
+
constructor(config: TraceOrchestratorConfig);
|
|
26
|
+
/**
|
|
27
|
+
* Process an OTLP trace through the complete matching pipeline
|
|
28
|
+
*/
|
|
29
|
+
processTrace(otlpData: OtelExportTraceServiceRequest): Promise<RegisteredTrace>;
|
|
30
|
+
/**
|
|
31
|
+
* Lookup storyboards from registry for each scope
|
|
32
|
+
*/
|
|
33
|
+
private lookupStoryboardsForScopes;
|
|
34
|
+
/**
|
|
35
|
+
* Extract all spans with their scope information
|
|
36
|
+
*/
|
|
37
|
+
private extractAllSpans;
|
|
38
|
+
/**
|
|
39
|
+
* Match spans against storyboards and categorize results
|
|
40
|
+
*
|
|
41
|
+
* Flow:
|
|
42
|
+
* 1. For each span, find workflows where spanPattern matches span name (exact match)
|
|
43
|
+
* 2. For matched workflows, run scenario matching against span events
|
|
44
|
+
* 3. Categorize into: scenario matches, storyboard matches (orphaned), unmatched
|
|
45
|
+
*/
|
|
46
|
+
private matchSpans;
|
|
47
|
+
/**
|
|
48
|
+
* Match a span against a storyboard's workflows by spanPattern
|
|
49
|
+
*
|
|
50
|
+
* Returns the first workflow where spanPattern === span.spanName,
|
|
51
|
+
* then runs scenario matching on that workflow.
|
|
52
|
+
*/
|
|
53
|
+
private matchSpanToWorkflow;
|
|
54
|
+
/**
|
|
55
|
+
* Type guard to check if storyboard has content loaded
|
|
56
|
+
*/
|
|
57
|
+
private isStoryboardWithContent;
|
|
58
|
+
/**
|
|
59
|
+
* Convert ScopeSpan to OtelSpanData format
|
|
60
|
+
*/
|
|
61
|
+
private convertToOtelSpan;
|
|
62
|
+
/**
|
|
63
|
+
* Type guard to check if workflow has content loaded
|
|
64
|
+
*/
|
|
65
|
+
private isWorkflowWithContent;
|
|
66
|
+
/**
|
|
67
|
+
* Validate matches for common issues
|
|
68
|
+
*/
|
|
69
|
+
private validateMatches;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=TraceOrchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TraceOrchestrator.d.ts","sourceRoot":"","sources":["../../src/orchestration/TraceOrchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAgB,MAAM,eAAe,CAAC;AACjF,OAAO,KAAK,EACV,eAAe,EACf,2BAA2B,EAU5B,MAAM,2BAA2B,CAAC;AAwCnC;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,2BAA2B,CAAC;IACtC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,qBAAa,iBAAiB;IAGhB,OAAO,CAAC,MAAM;IAF1B,OAAO,CAAC,MAAM,CAAkB;gBAEZ,MAAM,EAAE,uBAAuB;IAInD;;OAEG;IACG,YAAY,CAAC,QAAQ,EAAE,6BAA6B,GAAG,OAAO,CAAC,eAAe,CAAC;IA0CrF;;OAEG;YACW,0BAA0B;IA6BxC;;OAEG;IACH,OAAO,CAAC,eAAe;IAwCvB;;;;;;;OAOG;YACW,UAAU;IA8HxB;;;;;OAKG;YACW,mBAAmB;IAgIjC;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAO/B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAyBzB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAM7B;;OAEG;IACH,OAAO,CAAC,eAAe;CAwCxB"}
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* TraceOrchestrator - Coordinates the complete trace matching pipeline
|
|
4
|
+
*
|
|
5
|
+
* Pipeline:
|
|
6
|
+
* 1. Parse OTLP trace → extract resources and scopes
|
|
7
|
+
* 2. For each scope → lookup VersionSnapshot from registry
|
|
8
|
+
* 3. Match spans against workflows/scenarios
|
|
9
|
+
* 4. Categorize results into three categories
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TraceOrchestrator = void 0;
|
|
13
|
+
const OtlpTraceParser_1 = require("../parsers/OtlpTraceParser");
|
|
14
|
+
const SpanMatcher_1 = require("../matchers/SpanMatcher");
|
|
15
|
+
const scenario_matcher_1 = require("../workflow/scenario-matcher");
|
|
16
|
+
/**
|
|
17
|
+
* Main orchestrator for trace matching
|
|
18
|
+
*/
|
|
19
|
+
class TraceOrchestrator {
|
|
20
|
+
constructor(config) {
|
|
21
|
+
this.config = config;
|
|
22
|
+
this.parser = new OtlpTraceParser_1.OtlpTraceParser();
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Process an OTLP trace through the complete matching pipeline
|
|
26
|
+
*/
|
|
27
|
+
async processTrace(otlpData) {
|
|
28
|
+
// Step 1: Parse trace to extract resources and basic info
|
|
29
|
+
const resources = this.parser.extractResources(otlpData);
|
|
30
|
+
const traceInfo = this.parser.extractTraceInfo(otlpData);
|
|
31
|
+
// Step 2: For each scope, lookup storyboards from registry
|
|
32
|
+
const scopeStoryboards = await this.lookupStoryboardsForScopes(resources);
|
|
33
|
+
// Step 3: Extract all spans with scope information
|
|
34
|
+
const allSpans = this.extractAllSpans(otlpData, resources);
|
|
35
|
+
// Step 4: Match spans against storyboards
|
|
36
|
+
const { scenarioMatches, storyboardMatches, unmatchedSpans } = await this.matchSpans(allSpans, scopeStoryboards);
|
|
37
|
+
// Step 5: Validate if enabled
|
|
38
|
+
const validationIssues = this.config.enableValidation
|
|
39
|
+
? this.validateMatches(scenarioMatches, storyboardMatches)
|
|
40
|
+
: undefined;
|
|
41
|
+
// Step 6: Build final RegisteredTrace
|
|
42
|
+
const registeredTrace = {
|
|
43
|
+
traceId: traceInfo.traceId,
|
|
44
|
+
name: traceInfo.name,
|
|
45
|
+
startTime: traceInfo.startTime,
|
|
46
|
+
endTime: traceInfo.endTime,
|
|
47
|
+
duration: traceInfo.duration,
|
|
48
|
+
spanCount: traceInfo.spanCount,
|
|
49
|
+
hasErrors: traceInfo.hasErrors,
|
|
50
|
+
resources,
|
|
51
|
+
scenarioMatches,
|
|
52
|
+
storyboardMatches,
|
|
53
|
+
unmatchedSpans,
|
|
54
|
+
validationIssues,
|
|
55
|
+
otlpData, // Include original OTLP data
|
|
56
|
+
};
|
|
57
|
+
return registeredTrace;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Lookup storyboards from registry for each scope
|
|
61
|
+
*/
|
|
62
|
+
async lookupStoryboardsForScopes(resources) {
|
|
63
|
+
const results = [];
|
|
64
|
+
for (const resource of resources) {
|
|
65
|
+
for (const scopeInfo of resource.scopes) {
|
|
66
|
+
const lookupResult = await this.config.registry.lookupByScope({
|
|
67
|
+
name: scopeInfo.scope.name,
|
|
68
|
+
version: scopeInfo.scope.version,
|
|
69
|
+
}, {
|
|
70
|
+
attributes: resource.attributes,
|
|
71
|
+
});
|
|
72
|
+
results.push({
|
|
73
|
+
scopeName: scopeInfo.scope.name,
|
|
74
|
+
scopeVersion: scopeInfo.scope.version,
|
|
75
|
+
lookupResult,
|
|
76
|
+
spanIds: scopeInfo.spanIds,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return results;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Extract all spans with their scope information
|
|
84
|
+
*/
|
|
85
|
+
extractAllSpans(otlpData, resources) {
|
|
86
|
+
const spans = [];
|
|
87
|
+
const seenSpanIds = new Set();
|
|
88
|
+
for (const resource of resources) {
|
|
89
|
+
for (const scopeInfo of resource.scopes) {
|
|
90
|
+
const scopeSpans = this.parser.getSpansForScope(otlpData, scopeInfo.scope.name);
|
|
91
|
+
for (const span of scopeSpans) {
|
|
92
|
+
// Deduplicate spans by spanId - getSpansForScope may return same spans
|
|
93
|
+
// when called multiple times for the same scope across different resources
|
|
94
|
+
if (seenSpanIds.has(span.spanId)) {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
seenSpanIds.add(span.spanId);
|
|
98
|
+
spans.push({
|
|
99
|
+
scopeName: scopeInfo.scope.name,
|
|
100
|
+
scopeVersion: scopeInfo.scope.version,
|
|
101
|
+
spanId: span.spanId,
|
|
102
|
+
spanName: span.spanName,
|
|
103
|
+
traceId: span.traceId,
|
|
104
|
+
parentSpanId: span.parentSpanId,
|
|
105
|
+
startTime: span.startTime,
|
|
106
|
+
endTime: span.endTime,
|
|
107
|
+
duration: span.duration,
|
|
108
|
+
attributes: span.attributes,
|
|
109
|
+
events: span.events,
|
|
110
|
+
status: span.status,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return spans;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Match spans against storyboards and categorize results
|
|
119
|
+
*
|
|
120
|
+
* Flow:
|
|
121
|
+
* 1. For each span, find workflows where spanPattern matches span name (exact match)
|
|
122
|
+
* 2. For matched workflows, run scenario matching against span events
|
|
123
|
+
* 3. Categorize into: scenario matches, storyboard matches (orphaned), unmatched
|
|
124
|
+
*/
|
|
125
|
+
async matchSpans(spans, scopeStoryboards) {
|
|
126
|
+
const scenarioMatches = [];
|
|
127
|
+
const storyboardMatches = [];
|
|
128
|
+
const unmatchedSpansList = [];
|
|
129
|
+
const matchedSpanIds = new Set();
|
|
130
|
+
// For each scope with storyboards
|
|
131
|
+
for (const scopeWithStoryboards of scopeStoryboards) {
|
|
132
|
+
if (!scopeWithStoryboards.lookupResult.found) {
|
|
133
|
+
// Lookup failed → all spans are unmatched with specific reason
|
|
134
|
+
const scopeSpans = spans.filter((s) => s.scopeName === scopeWithStoryboards.scopeName);
|
|
135
|
+
const reason = scopeWithStoryboards.lookupResult.reason === 'scope_not_owned'
|
|
136
|
+
? `Scope "${scopeWithStoryboards.scopeName}" is not registered in any owned-scopes. Add it to library.yaml resources.owned-scopes`
|
|
137
|
+
: `Scope "${scopeWithStoryboards.scopeName}" is registered but has no storyboards defined in .principal-views/`;
|
|
138
|
+
for (const span of scopeSpans) {
|
|
139
|
+
unmatchedSpansList.push({
|
|
140
|
+
spanId: span.spanId,
|
|
141
|
+
parentSpanId: span.parentSpanId,
|
|
142
|
+
spanName: span.spanName,
|
|
143
|
+
scopeName: span.scopeName,
|
|
144
|
+
scopeVersion: span.scopeVersion,
|
|
145
|
+
timestamp: span.startTime,
|
|
146
|
+
duration: span.duration,
|
|
147
|
+
reason,
|
|
148
|
+
attributes: span.attributes,
|
|
149
|
+
});
|
|
150
|
+
// Mark as processed so we don't add it again in the final loop
|
|
151
|
+
matchedSpanIds.add(span.spanId);
|
|
152
|
+
}
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
// Get spans for this scope
|
|
156
|
+
const scopeSpans = spans.filter((s) => s.scopeName === scopeWithStoryboards.scopeName);
|
|
157
|
+
// Match against each storyboard's workflows
|
|
158
|
+
for (const storyboard of scopeWithStoryboards.lookupResult.snapshot.storyboards) {
|
|
159
|
+
// Validate that content is loaded
|
|
160
|
+
const sbWithContent = storyboard;
|
|
161
|
+
if (!this.isStoryboardWithContent(sbWithContent)) {
|
|
162
|
+
console.error('[TraceOrchestrator] Storyboard content not loaded:', storyboard.id);
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
// Get canvas for node highlighting (optional)
|
|
166
|
+
const canvas = sbWithContent.canvas;
|
|
167
|
+
const spanMatcher = canvas?.content
|
|
168
|
+
? new SpanMatcher_1.SpanMatcher(canvas.content)
|
|
169
|
+
: null;
|
|
170
|
+
// Match each span against workflows by spanPattern (exact match)
|
|
171
|
+
for (const span of scopeSpans) {
|
|
172
|
+
// Skip if already matched by another storyboard
|
|
173
|
+
if (matchedSpanIds.has(span.spanId))
|
|
174
|
+
continue;
|
|
175
|
+
// Find workflow where spanPattern matches span name
|
|
176
|
+
const workflowMatch = await this.matchSpanToWorkflow(span, sbWithContent, scopeWithStoryboards.scopeName, spanMatcher);
|
|
177
|
+
if (workflowMatch) {
|
|
178
|
+
matchedSpanIds.add(span.spanId);
|
|
179
|
+
if (workflowMatch.type === 'scenario') {
|
|
180
|
+
scenarioMatches.push(workflowMatch.match);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
storyboardMatches.push(workflowMatch.match);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// Collect unmatched spans (spans that didn't match any workflow's spanPattern)
|
|
190
|
+
for (const span of spans) {
|
|
191
|
+
if (!matchedSpanIds.has(span.spanId)) {
|
|
192
|
+
const scopeData = scopeStoryboards.find((s) => s.scopeName === span.scopeName);
|
|
193
|
+
let reason;
|
|
194
|
+
if (!scopeData || !scopeData.lookupResult.found) {
|
|
195
|
+
// This shouldn't happen as we already processed these in the loop above,
|
|
196
|
+
// but handle it defensively
|
|
197
|
+
if (scopeData && !scopeData.lookupResult.found) {
|
|
198
|
+
reason = scopeData.lookupResult.reason === 'scope_not_owned'
|
|
199
|
+
? `Scope "${span.scopeName}" is not registered in any owned-scopes`
|
|
200
|
+
: `Scope "${span.scopeName}" has no storyboards`;
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
reason = `Scope "${span.scopeName}" not found in trace resources`;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
reason = `No workflow spanPattern matched span "${span.spanName}"`;
|
|
208
|
+
}
|
|
209
|
+
unmatchedSpansList.push({
|
|
210
|
+
spanId: span.spanId,
|
|
211
|
+
parentSpanId: span.parentSpanId,
|
|
212
|
+
spanName: span.spanName,
|
|
213
|
+
scopeName: span.scopeName,
|
|
214
|
+
scopeVersion: span.scopeVersion,
|
|
215
|
+
timestamp: span.startTime,
|
|
216
|
+
duration: span.duration,
|
|
217
|
+
reason,
|
|
218
|
+
attributes: span.attributes,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
const unmatchedSpans = {
|
|
223
|
+
spans: unmatchedSpansList,
|
|
224
|
+
};
|
|
225
|
+
return { scenarioMatches, storyboardMatches, unmatchedSpans };
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Match a span against a storyboard's workflows by spanPattern
|
|
229
|
+
*
|
|
230
|
+
* Returns the first workflow where spanPattern === span.spanName,
|
|
231
|
+
* then runs scenario matching on that workflow.
|
|
232
|
+
*/
|
|
233
|
+
async matchSpanToWorkflow(span, storyboard, scopeName, spanMatcher) {
|
|
234
|
+
// Try each workflow in the storyboard
|
|
235
|
+
for (const workflow of storyboard.workflows) {
|
|
236
|
+
const wfWithContent = workflow;
|
|
237
|
+
if (!this.isWorkflowWithContent(wfWithContent)) {
|
|
238
|
+
console.error('[TraceOrchestrator] Workflow content not loaded:', workflow.id);
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
// Check if span name matches workflow's spanPattern (exact match)
|
|
242
|
+
const spanPattern = wfWithContent.content.spanPattern;
|
|
243
|
+
if (!spanPattern || span.spanName !== spanPattern) {
|
|
244
|
+
continue; // spanPattern doesn't match, try next workflow
|
|
245
|
+
}
|
|
246
|
+
// spanPattern matched! Now run scenario matching
|
|
247
|
+
// Convert span events to OtelEvent format for scenario matcher
|
|
248
|
+
// Include span attributes so templates can access them via @span namespace
|
|
249
|
+
const otelEvents = span.events.map((e) => ({
|
|
250
|
+
name: e.name,
|
|
251
|
+
timestamp: e.timestamp,
|
|
252
|
+
attributes: e.attributes,
|
|
253
|
+
spanAttributes: span.attributes,
|
|
254
|
+
}));
|
|
255
|
+
// Get matched canvas node IDs (for visualization)
|
|
256
|
+
let matchedNodeIds = [];
|
|
257
|
+
if (spanMatcher) {
|
|
258
|
+
const otelSpan = this.convertToOtelSpan(span);
|
|
259
|
+
const matchResult = spanMatcher.matchSpan(otelSpan, { attributes: [] });
|
|
260
|
+
matchedNodeIds = matchResult.matchedNodeIds;
|
|
261
|
+
}
|
|
262
|
+
// Run scenario matching
|
|
263
|
+
const scenarioMatchResult = (0, scenario_matcher_1.selectScenario)(wfWithContent.content, otelEvents);
|
|
264
|
+
if (scenarioMatchResult.recommendedScenario &&
|
|
265
|
+
scenarioMatchResult.recommendedScenario.matchPercentage > 0) {
|
|
266
|
+
// Category 1: Scenario Match
|
|
267
|
+
const detail = scenarioMatchResult.recommendedScenario;
|
|
268
|
+
const matchedSpans = matchedNodeIds.length > 0
|
|
269
|
+
? matchedNodeIds.map((nodeId) => ({
|
|
270
|
+
spanId: span.spanId,
|
|
271
|
+
parentSpanId: span.parentSpanId,
|
|
272
|
+
spanName: span.spanName,
|
|
273
|
+
nodeId,
|
|
274
|
+
timestamp: span.startTime,
|
|
275
|
+
duration: span.duration,
|
|
276
|
+
events: detail.matchedEventNames,
|
|
277
|
+
attributes: span.attributes,
|
|
278
|
+
matchConfidence: 'exact',
|
|
279
|
+
}))
|
|
280
|
+
: [{
|
|
281
|
+
spanId: span.spanId,
|
|
282
|
+
parentSpanId: span.parentSpanId,
|
|
283
|
+
spanName: span.spanName,
|
|
284
|
+
nodeId: 'workflow-root',
|
|
285
|
+
timestamp: span.startTime,
|
|
286
|
+
duration: span.duration,
|
|
287
|
+
events: detail.matchedEventNames,
|
|
288
|
+
attributes: span.attributes,
|
|
289
|
+
matchConfidence: 'exact',
|
|
290
|
+
}];
|
|
291
|
+
return {
|
|
292
|
+
type: 'scenario',
|
|
293
|
+
match: {
|
|
294
|
+
storyboardId: storyboard.id,
|
|
295
|
+
storyboardName: storyboard.name,
|
|
296
|
+
workflowId: wfWithContent.id,
|
|
297
|
+
workflowName: wfWithContent.name,
|
|
298
|
+
scenarioId: detail.scenario.id,
|
|
299
|
+
scopeName,
|
|
300
|
+
scopeVersion: span.scopeVersion,
|
|
301
|
+
matchedSpans,
|
|
302
|
+
coveragePercent: detail.matchPercentage,
|
|
303
|
+
matchType: detail.matchPercentage === 100 ? 'full' : 'partial',
|
|
304
|
+
},
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
// Category 2: Storyboard Match (workflow matched, but scenario didn't)
|
|
309
|
+
const orphanedSpans = [{
|
|
310
|
+
spanId: span.spanId,
|
|
311
|
+
parentSpanId: span.parentSpanId,
|
|
312
|
+
spanName: span.spanName,
|
|
313
|
+
nodeId: matchedNodeIds[0] || 'workflow-root',
|
|
314
|
+
timestamp: span.startTime,
|
|
315
|
+
duration: span.duration,
|
|
316
|
+
reason: 'Workflow spanPattern matched but no scenario matched the observed events',
|
|
317
|
+
observedEvents: span.events.map((e) => e.name),
|
|
318
|
+
expectedEvents: wfWithContent.content.scenarios.flatMap((s) => Object.keys(s.template.events || {})),
|
|
319
|
+
attributes: span.attributes,
|
|
320
|
+
}];
|
|
321
|
+
return {
|
|
322
|
+
type: 'storyboard',
|
|
323
|
+
match: {
|
|
324
|
+
storyboardId: storyboard.id,
|
|
325
|
+
storyboardName: storyboard.name,
|
|
326
|
+
workflowId: wfWithContent.id,
|
|
327
|
+
workflowName: wfWithContent.name,
|
|
328
|
+
scopeName,
|
|
329
|
+
scopeVersion: span.scopeVersion,
|
|
330
|
+
orphanedSpans,
|
|
331
|
+
},
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return null; // No workflow's spanPattern matched this span
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Type guard to check if storyboard has content loaded
|
|
339
|
+
*/
|
|
340
|
+
isStoryboardWithContent(storyboard) {
|
|
341
|
+
const canvas = storyboard.canvas;
|
|
342
|
+
return canvas?.content !== undefined;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Convert ScopeSpan to OtelSpanData format
|
|
346
|
+
*/
|
|
347
|
+
convertToOtelSpan(span) {
|
|
348
|
+
return {
|
|
349
|
+
traceId: span.traceId,
|
|
350
|
+
spanId: span.spanId,
|
|
351
|
+
name: span.spanName,
|
|
352
|
+
parentSpanId: span.parentSpanId,
|
|
353
|
+
kind: 1,
|
|
354
|
+
startTimeUnixNano: String(span.startTime * 1000000),
|
|
355
|
+
endTimeUnixNano: String(span.endTime * 1000000),
|
|
356
|
+
attributes: Object.entries(span.attributes || {}).map(([key, value]) => ({
|
|
357
|
+
key,
|
|
358
|
+
value: { stringValue: String(value) },
|
|
359
|
+
})),
|
|
360
|
+
events: span.events.map((e) => ({
|
|
361
|
+
timeUnixNano: String(e.timestamp * 1000000),
|
|
362
|
+
name: e.name,
|
|
363
|
+
attributes: Object.entries(e.attributes || {}).map(([key, value]) => ({
|
|
364
|
+
key,
|
|
365
|
+
value: { stringValue: String(value) },
|
|
366
|
+
})),
|
|
367
|
+
})),
|
|
368
|
+
status: span.status,
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Type guard to check if workflow has content loaded
|
|
373
|
+
*/
|
|
374
|
+
isWorkflowWithContent(workflow) {
|
|
375
|
+
return workflow.content !== undefined;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Validate matches for common issues
|
|
379
|
+
*/
|
|
380
|
+
validateMatches(scenarioMatches, storyboardMatches) {
|
|
381
|
+
const issues = [];
|
|
382
|
+
// Check for duplicate scenario matches (same workflow + scenario matched twice)
|
|
383
|
+
const scenarioKeys = new Set();
|
|
384
|
+
for (const match of scenarioMatches) {
|
|
385
|
+
// Include workflowId in key - different workflows can have same scenarioId (e.g., "success")
|
|
386
|
+
const key = `${match.storyboardId}:${match.workflowId}:${match.scenarioId}:${match.scopeName}`;
|
|
387
|
+
if (scenarioKeys.has(key)) {
|
|
388
|
+
issues.push({
|
|
389
|
+
level: 'warning',
|
|
390
|
+
category: 'matching',
|
|
391
|
+
message: `Duplicate scenario match detected for scope ${match.scopeName}`,
|
|
392
|
+
spanId: match.matchedSpans[0]?.spanId,
|
|
393
|
+
scopeName: match.scopeName,
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
scenarioKeys.add(key);
|
|
397
|
+
}
|
|
398
|
+
// Check for orphaned spans with no clear reason
|
|
399
|
+
for (const match of storyboardMatches) {
|
|
400
|
+
for (const orphan of match.orphanedSpans) {
|
|
401
|
+
if (!orphan.reason || orphan.reason.trim() === '') {
|
|
402
|
+
issues.push({
|
|
403
|
+
level: 'warning',
|
|
404
|
+
category: 'matching',
|
|
405
|
+
message: 'Orphaned span has no reason',
|
|
406
|
+
spanId: orphan.spanId,
|
|
407
|
+
scopeName: match.scopeName,
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return issues;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
exports.TraceOrchestrator = TraceOrchestrator;
|
|
416
|
+
//# sourceMappingURL=TraceOrchestrator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TraceOrchestrator.js","sourceRoot":"","sources":["../../src/orchestration/TraceOrchestrator.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAkBH,gEAA6D;AAC7D,yDAAsD;AACtD,mEAA8D;AA2C9D;;GAEG;AACH,MAAa,iBAAiB;IAG5B,YAAoB,MAA+B;QAA/B,WAAM,G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