@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
package/src/dashboard/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Dashboard module exports
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
DashboardValidator,
|
|
7
|
-
createDashboardValidator,
|
|
8
|
-
} from './DashboardValidator';
|
|
9
|
-
|
|
10
|
-
export type {
|
|
11
|
-
DashboardValidationError,
|
|
12
|
-
DashboardValidationResult,
|
|
13
|
-
DashboardValidationContext,
|
|
14
|
-
} from './DashboardValidator';
|
|
@@ -1,691 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test, beforeEach } from 'bun:test';
|
|
2
|
-
import { CanvasDiscovery } from './CanvasDiscovery';
|
|
3
|
-
import type { DiscoveredCanvasWithContent } from './types';
|
|
4
|
-
import type { FileTree, FileInfo, DirectoryInfo } from '@principal-ai/repository-abstraction';
|
|
5
|
-
|
|
6
|
-
describe('CanvasDiscovery', () => {
|
|
7
|
-
let discovery: CanvasDiscovery;
|
|
8
|
-
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
discovery = new CanvasDiscovery();
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
describe('discover() - Canvas Files', () => {
|
|
14
|
-
test('discovers canvas files in repository root', async () => {
|
|
15
|
-
const fileTree = createMockFileTree([
|
|
16
|
-
'.principal-views/my-flow.canvas',
|
|
17
|
-
'.principal-views/api-flow.otel.canvas',
|
|
18
|
-
]);
|
|
19
|
-
|
|
20
|
-
const result = await discovery.discover(fileTree);
|
|
21
|
-
|
|
22
|
-
expect(result.canvases).toHaveLength(2);
|
|
23
|
-
expect(result.canvases[0]).toMatchObject({
|
|
24
|
-
id: 'api-flow.otel', // non-regular types get suffix to prevent ID collisions
|
|
25
|
-
name: 'Api Flow',
|
|
26
|
-
basename: 'api-flow',
|
|
27
|
-
type: 'otel',
|
|
28
|
-
scope: 'root',
|
|
29
|
-
packageName: undefined,
|
|
30
|
-
});
|
|
31
|
-
expect(result.canvases[1]).toMatchObject({
|
|
32
|
-
id: 'my-flow',
|
|
33
|
-
name: 'My Flow',
|
|
34
|
-
basename: 'my-flow',
|
|
35
|
-
type: 'regular',
|
|
36
|
-
scope: 'root',
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
test('discovers canvas files in packages with package prefix', async () => {
|
|
41
|
-
const fileTree = createMockFileTree([
|
|
42
|
-
'packages/subsystems-core/.principal-views/auth-flow.canvas',
|
|
43
|
-
'packages/api/.principal-views/request-flow.otel.canvas',
|
|
44
|
-
'packages/subsystems-core/package.json',
|
|
45
|
-
'packages/api/package.json',
|
|
46
|
-
]);
|
|
47
|
-
|
|
48
|
-
const result = await discovery.discover(fileTree, {
|
|
49
|
-
fileReader: async (path) => {
|
|
50
|
-
if (path.endsWith('core/package.json')) {
|
|
51
|
-
return JSON.stringify({ name: 'core' });
|
|
52
|
-
}
|
|
53
|
-
if (path.endsWith('api/package.json')) {
|
|
54
|
-
return JSON.stringify({ name: 'api' });
|
|
55
|
-
}
|
|
56
|
-
return '';
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
expect(result.canvases).toHaveLength(2);
|
|
61
|
-
expect(result.canvases.map(c => c.id)).toEqual([
|
|
62
|
-
'api/request-flow.otel', // non-regular types get suffix
|
|
63
|
-
'core/auth-flow',
|
|
64
|
-
]);
|
|
65
|
-
expect(result.canvases[0].packageName).toBe('api');
|
|
66
|
-
expect(result.canvases[1].packageName).toBe('core');
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
test('handles mixed root and package canvas files', async () => {
|
|
70
|
-
const fileTree = createMockFileTree([
|
|
71
|
-
'.principal-views/root-flow.canvas',
|
|
72
|
-
'packages/subsystems-core/.principal-views/core-flow.canvas',
|
|
73
|
-
'packages/subsystems-core/package.json',
|
|
74
|
-
]);
|
|
75
|
-
|
|
76
|
-
const result = await discovery.discover(fileTree, {
|
|
77
|
-
fileReader: async (path) => {
|
|
78
|
-
if (path.endsWith('package.json')) {
|
|
79
|
-
return JSON.stringify({ name: 'core' });
|
|
80
|
-
}
|
|
81
|
-
return '';
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
expect(result.canvases).toHaveLength(2);
|
|
86
|
-
// Package canvases come first
|
|
87
|
-
expect(result.canvases[0].id).toBe('core/core-flow');
|
|
88
|
-
expect(result.canvases[0].scope).toBe('package');
|
|
89
|
-
expect(result.canvases[1].id).toBe('root-flow');
|
|
90
|
-
expect(result.canvases[1].scope).toBe('root');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
test('correctly strips .otel.canvas extension', async () => {
|
|
94
|
-
const fileTree = createMockFileTree([
|
|
95
|
-
'.principal-views/test.otel.canvas',
|
|
96
|
-
]);
|
|
97
|
-
|
|
98
|
-
const result = await discovery.discover(fileTree);
|
|
99
|
-
|
|
100
|
-
expect(result.canvases[0].basename).toBe('test');
|
|
101
|
-
expect(result.canvases[0].type).toBe('otel');
|
|
102
|
-
// ID includes type suffix to prevent collisions with regular canvas of same name
|
|
103
|
-
expect(result.canvases[0].id).toBe('test.otel');
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
test('parses canvas content when fileReader and includeContent provided', async () => {
|
|
107
|
-
const mockCanvas = { nodes: [], edges: [], pv: { name: 'Test' } };
|
|
108
|
-
const fileTree = createMockFileTree([
|
|
109
|
-
'.principal-views/test.canvas',
|
|
110
|
-
]);
|
|
111
|
-
|
|
112
|
-
const result = await discovery.discover(fileTree, {
|
|
113
|
-
fileReader: async (_path) => JSON.stringify(mockCanvas),
|
|
114
|
-
includeContent: true,
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
expect(result.canvases[0]).toHaveProperty('content');
|
|
118
|
-
expect((result.canvases[0] as DiscoveredCanvasWithContent).content).toEqual(mockCanvas);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
test('handles parse errors gracefully', async () => {
|
|
122
|
-
const fileTree = createMockFileTree([
|
|
123
|
-
'.principal-views/bad.canvas',
|
|
124
|
-
]);
|
|
125
|
-
|
|
126
|
-
const result = await discovery.discover(fileTree, {
|
|
127
|
-
fileReader: async (_path) => 'invalid json',
|
|
128
|
-
includeContent: true,
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
expect(result.canvases).toHaveLength(1);
|
|
132
|
-
// Parse error + required canvas validation error
|
|
133
|
-
expect(result.errors).toHaveLength(2);
|
|
134
|
-
expect(result.errors.some(e => e.path === '.principal-views/bad.canvas' && e.error.includes('JSON'))).toBe(true);
|
|
135
|
-
expect(result.errors.some(e => e.error.includes('Missing required resources.canvas'))).toBe(true);
|
|
136
|
-
// Flat .canvas files are now supported, so no deprecation error
|
|
137
|
-
expect(result.storyboards).toHaveLength(1); // Should create a standalone storyboard
|
|
138
|
-
expect(result.storyboards[0].workflows).toHaveLength(0); // No workflows for flat canvas
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
test('discovers hierarchical canvas files in storyboard subdirectories', async () => {
|
|
142
|
-
const fileTree = createMockFileTree([
|
|
143
|
-
'.principal-views/checkout-flow/checkout-flow.otel.canvas',
|
|
144
|
-
'.principal-views/user-flow/user-flow.canvas',
|
|
145
|
-
]);
|
|
146
|
-
|
|
147
|
-
const result = await discovery.discover(fileTree);
|
|
148
|
-
|
|
149
|
-
expect(result.canvases).toHaveLength(2);
|
|
150
|
-
expect(result.canvases[0]).toMatchObject({
|
|
151
|
-
id: 'checkout-flow.otel', // non-regular types get suffix
|
|
152
|
-
name: 'Checkout Flow',
|
|
153
|
-
basename: 'checkout-flow',
|
|
154
|
-
type: 'otel',
|
|
155
|
-
scope: 'root',
|
|
156
|
-
});
|
|
157
|
-
expect(result.canvases[1]).toMatchObject({
|
|
158
|
-
id: 'user-flow',
|
|
159
|
-
name: 'User Flow',
|
|
160
|
-
basename: 'user-flow',
|
|
161
|
-
type: 'regular',
|
|
162
|
-
scope: 'root',
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
test('discovers hierarchical canvas files in package subdirectories', async () => {
|
|
167
|
-
const fileTree = createMockFileTree([
|
|
168
|
-
'packages/subsystems-core/.principal-views/auth-flow/auth-flow.canvas',
|
|
169
|
-
'packages/api/.principal-views/request-flow/request-flow.otel.canvas',
|
|
170
|
-
'packages/subsystems-core/package.json',
|
|
171
|
-
'packages/api/package.json',
|
|
172
|
-
]);
|
|
173
|
-
|
|
174
|
-
const result = await discovery.discover(fileTree, {
|
|
175
|
-
fileReader: async (path) => {
|
|
176
|
-
if (path.endsWith('core/package.json')) {
|
|
177
|
-
return JSON.stringify({ name: 'core' });
|
|
178
|
-
}
|
|
179
|
-
if (path.endsWith('api/package.json')) {
|
|
180
|
-
return JSON.stringify({ name: 'api' });
|
|
181
|
-
}
|
|
182
|
-
return '';
|
|
183
|
-
},
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
expect(result.canvases).toHaveLength(2);
|
|
187
|
-
expect(result.canvases[0]).toMatchObject({
|
|
188
|
-
id: 'api/request-flow.otel', // non-regular types get suffix
|
|
189
|
-
name: 'Request Flow',
|
|
190
|
-
basename: 'request-flow',
|
|
191
|
-
type: 'otel',
|
|
192
|
-
scope: 'package',
|
|
193
|
-
packageName: 'api',
|
|
194
|
-
});
|
|
195
|
-
expect(result.canvases[1]).toMatchObject({
|
|
196
|
-
id: 'core/auth-flow',
|
|
197
|
-
name: 'Auth Flow',
|
|
198
|
-
basename: 'auth-flow',
|
|
199
|
-
type: 'regular',
|
|
200
|
-
scope: 'package',
|
|
201
|
-
packageName: 'core',
|
|
202
|
-
});
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
test('handles mixed flat and hierarchical canvas structures', async () => {
|
|
206
|
-
const fileTree = createMockFileTree([
|
|
207
|
-
'.principal-views/flat.canvas',
|
|
208
|
-
'.principal-views/storyboard/hierarchical.canvas',
|
|
209
|
-
]);
|
|
210
|
-
|
|
211
|
-
const result = await discovery.discover(fileTree);
|
|
212
|
-
|
|
213
|
-
expect(result.canvases).toHaveLength(2);
|
|
214
|
-
// Both should be discovered
|
|
215
|
-
expect(result.canvases.map(c => c.basename).sort()).toEqual(['flat', 'hierarchical']);
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
describe('caching', () => {
|
|
221
|
-
test('caches package discovery by fileTree SHA', async () => {
|
|
222
|
-
const fileTree = createMockFileTree([
|
|
223
|
-
'packages/subsystems-core/package.json',
|
|
224
|
-
]);
|
|
225
|
-
|
|
226
|
-
let readCount = 0;
|
|
227
|
-
const fileReader = async (_path: string) => {
|
|
228
|
-
readCount++;
|
|
229
|
-
return JSON.stringify({ name: 'core' });
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
// First call
|
|
233
|
-
await discovery.discover(fileTree, { fileReader });
|
|
234
|
-
const firstCount = readCount;
|
|
235
|
-
|
|
236
|
-
// Second call with same SHA
|
|
237
|
-
await discovery.discover(fileTree, { fileReader });
|
|
238
|
-
const secondCount = readCount;
|
|
239
|
-
|
|
240
|
-
// Should not re-read package.json (cached)
|
|
241
|
-
expect(secondCount).toBe(firstCount);
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
test('clearCache() invalidates package cache', async () => {
|
|
245
|
-
const fileTree = createMockFileTree([
|
|
246
|
-
'packages/subsystems-core/package.json',
|
|
247
|
-
]);
|
|
248
|
-
|
|
249
|
-
let readCount = 0;
|
|
250
|
-
const fileReader = async (_path: string) => {
|
|
251
|
-
readCount++;
|
|
252
|
-
return JSON.stringify({ name: 'core' });
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
await discovery.discover(fileTree, { fileReader });
|
|
256
|
-
const firstCount = readCount;
|
|
257
|
-
|
|
258
|
-
discovery.clearCache();
|
|
259
|
-
|
|
260
|
-
await discovery.discover(fileTree, { fileReader });
|
|
261
|
-
const secondCount = readCount;
|
|
262
|
-
|
|
263
|
-
// Should re-read after cache clear
|
|
264
|
-
expect(secondCount).toBeGreaterThan(firstCount);
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
describe('sorting', () => {
|
|
269
|
-
test('sorts package canvases before root canvases', async () => {
|
|
270
|
-
const fileTree = createMockFileTree([
|
|
271
|
-
'.principal-views/zzz-root.canvas',
|
|
272
|
-
'packages/aaa/.principal-views/pkg.canvas',
|
|
273
|
-
'packages/aaa/package.json',
|
|
274
|
-
]);
|
|
275
|
-
|
|
276
|
-
const result = await discovery.discover(fileTree, {
|
|
277
|
-
fileReader: async (path) => {
|
|
278
|
-
if (path.includes('package.json')) {
|
|
279
|
-
return JSON.stringify({ name: 'aaa' });
|
|
280
|
-
}
|
|
281
|
-
return '';
|
|
282
|
-
},
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
expect(result.canvases[0].id).toBe('aaa/pkg');
|
|
286
|
-
expect(result.canvases[1].id).toBe('zzz-root');
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
test('sorts packages alphabetically', async () => {
|
|
290
|
-
const fileTree = createMockFileTree([
|
|
291
|
-
'packages/zzz/.principal-views/file.canvas',
|
|
292
|
-
'packages/aaa/.principal-views/file.canvas',
|
|
293
|
-
'packages/zzz/package.json',
|
|
294
|
-
'packages/aaa/package.json',
|
|
295
|
-
]);
|
|
296
|
-
|
|
297
|
-
const result = await discovery.discover(fileTree, {
|
|
298
|
-
fileReader: async (path) => {
|
|
299
|
-
if (path.includes('zzz/package.json')) {
|
|
300
|
-
return JSON.stringify({ name: 'zzz' });
|
|
301
|
-
}
|
|
302
|
-
if (path.includes('aaa/package.json')) {
|
|
303
|
-
return JSON.stringify({ name: 'aaa' });
|
|
304
|
-
}
|
|
305
|
-
return '';
|
|
306
|
-
},
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
expect(result.canvases[0].id).toBe('aaa/file');
|
|
310
|
-
expect(result.canvases[1].id).toBe('zzz/file');
|
|
311
|
-
});
|
|
312
|
-
});
|
|
313
|
-
|
|
314
|
-
describe('edge cases', () => {
|
|
315
|
-
test('handles empty file tree', async () => {
|
|
316
|
-
const fileTree = createMockFileTree([]);
|
|
317
|
-
|
|
318
|
-
const result = await discovery.discover(fileTree);
|
|
319
|
-
|
|
320
|
-
expect(result.canvases).toHaveLength(0);
|
|
321
|
-
expect(result.testTraces).toHaveLength(0);
|
|
322
|
-
expect(result.errors).toHaveLength(0);
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
test('handles files without extensions', async () => {
|
|
326
|
-
const fileTree = createMockFileTree([
|
|
327
|
-
'.principal-views/noextension',
|
|
328
|
-
'__executions__/noextension',
|
|
329
|
-
]);
|
|
330
|
-
|
|
331
|
-
const result = await discovery.discover(fileTree);
|
|
332
|
-
|
|
333
|
-
expect(result.canvases).toHaveLength(0);
|
|
334
|
-
expect(result.testTraces).toHaveLength(0);
|
|
335
|
-
});
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
describe('isRelevantPath()', () => {
|
|
339
|
-
test('returns true for canvas files in .principal-views', () => {
|
|
340
|
-
expect(discovery.isRelevantPath('.principal-views/flow.canvas')).toBe(true);
|
|
341
|
-
expect(discovery.isRelevantPath('.principal-views/flow.otel.canvas')).toBe(true);
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
test('returns true for hierarchical canvas files', () => {
|
|
345
|
-
expect(discovery.isRelevantPath('.principal-views/storyboard/flow.canvas')).toBe(true);
|
|
346
|
-
expect(discovery.isRelevantPath('.principal-views/storyboard/flow.otel.canvas')).toBe(true);
|
|
347
|
-
});
|
|
348
|
-
|
|
349
|
-
test('returns true for workflow files', () => {
|
|
350
|
-
expect(discovery.isRelevantPath('.principal-views/storyboard/scenario/scenario.workflow.json')).toBe(true);
|
|
351
|
-
});
|
|
352
|
-
|
|
353
|
-
test('returns true for test trace files', () => {
|
|
354
|
-
expect(discovery.isRelevantPath('.principal-views/storyboard/scenario/execution-1.otel.json')).toBe(true);
|
|
355
|
-
});
|
|
356
|
-
|
|
357
|
-
test('returns true for package-scoped files', () => {
|
|
358
|
-
expect(discovery.isRelevantPath('packages/subsystems-core/.principal-views/flow.canvas')).toBe(true);
|
|
359
|
-
expect(discovery.isRelevantPath('packages/subsystems-core/.principal-views/storyboard/flow.otel.canvas')).toBe(true);
|
|
360
|
-
expect(discovery.isRelevantPath('packages/subsystems-core/.principal-views/storyboard/scenario/scenario.workflow.json')).toBe(true);
|
|
361
|
-
});
|
|
362
|
-
|
|
363
|
-
test('returns false for non-.principal-views files', () => {
|
|
364
|
-
expect(discovery.isRelevantPath('src/index.ts')).toBe(false);
|
|
365
|
-
expect(discovery.isRelevantPath('package.json')).toBe(false);
|
|
366
|
-
expect(discovery.isRelevantPath('README.md')).toBe(false);
|
|
367
|
-
});
|
|
368
|
-
|
|
369
|
-
test('returns false for unrelated files in .principal-views', () => {
|
|
370
|
-
expect(discovery.isRelevantPath('.principal-views/README.md')).toBe(false);
|
|
371
|
-
expect(discovery.isRelevantPath('.principal-views/config.json')).toBe(false);
|
|
372
|
-
});
|
|
373
|
-
});
|
|
374
|
-
|
|
375
|
-
describe('getRelevantPaths()', () => {
|
|
376
|
-
test('returns only relevant paths from file tree', () => {
|
|
377
|
-
const fileTree = createMockFileTree([
|
|
378
|
-
'.principal-views/flow.canvas',
|
|
379
|
-
'.principal-views/storyboard/flow.otel.canvas',
|
|
380
|
-
'.principal-views/storyboard/scenario/scenario.workflow.json',
|
|
381
|
-
'.principal-views/storyboard/scenario/exec.otel.json',
|
|
382
|
-
'src/index.ts',
|
|
383
|
-
'package.json',
|
|
384
|
-
'README.md',
|
|
385
|
-
]);
|
|
386
|
-
|
|
387
|
-
const relevantPaths = discovery.getRelevantPaths(fileTree);
|
|
388
|
-
|
|
389
|
-
expect(relevantPaths.size).toBe(4);
|
|
390
|
-
expect(relevantPaths.has('.principal-views/flow.canvas')).toBe(true);
|
|
391
|
-
expect(relevantPaths.has('.principal-views/storyboard/flow.otel.canvas')).toBe(true);
|
|
392
|
-
expect(relevantPaths.has('.principal-views/storyboard/scenario/scenario.workflow.json')).toBe(true);
|
|
393
|
-
expect(relevantPaths.has('.principal-views/storyboard/scenario/exec.otel.json')).toBe(true);
|
|
394
|
-
expect(relevantPaths.has('src/index.ts')).toBe(false);
|
|
395
|
-
});
|
|
396
|
-
|
|
397
|
-
test('returns empty set for file tree with no relevant files', () => {
|
|
398
|
-
const fileTree = createMockFileTree([
|
|
399
|
-
'src/index.ts',
|
|
400
|
-
'package.json',
|
|
401
|
-
]);
|
|
402
|
-
|
|
403
|
-
const relevantPaths = discovery.getRelevantPaths(fileTree);
|
|
404
|
-
|
|
405
|
-
expect(relevantPaths.size).toBe(0);
|
|
406
|
-
});
|
|
407
|
-
});
|
|
408
|
-
|
|
409
|
-
describe('filterRelevantGitChanges()', () => {
|
|
410
|
-
test('filters git status to only relevant files', () => {
|
|
411
|
-
const fileTree = createMockFileTree([
|
|
412
|
-
'.principal-views/flow.canvas',
|
|
413
|
-
'.principal-views/storyboard/flow.otel.canvas',
|
|
414
|
-
'src/index.ts',
|
|
415
|
-
]);
|
|
416
|
-
|
|
417
|
-
const gitStatus = createMockGitStatus({
|
|
418
|
-
modifiedFiles: ['.principal-views/flow.canvas', 'src/index.ts'],
|
|
419
|
-
untrackedFiles: [],
|
|
420
|
-
stagedFiles: [],
|
|
421
|
-
deletedFiles: [],
|
|
422
|
-
});
|
|
423
|
-
|
|
424
|
-
const filtered = discovery.filterRelevantGitChanges(fileTree, gitStatus);
|
|
425
|
-
|
|
426
|
-
expect(filtered).not.toBeNull();
|
|
427
|
-
expect(filtered!.modifiedFiles).toEqual(['.principal-views/flow.canvas']);
|
|
428
|
-
});
|
|
429
|
-
|
|
430
|
-
test('returns null when no relevant changes', () => {
|
|
431
|
-
const fileTree = createMockFileTree([
|
|
432
|
-
'.principal-views/flow.canvas',
|
|
433
|
-
'src/index.ts',
|
|
434
|
-
]);
|
|
435
|
-
|
|
436
|
-
const gitStatus = createMockGitStatus({
|
|
437
|
-
modifiedFiles: ['src/index.ts', 'package.json'],
|
|
438
|
-
untrackedFiles: [],
|
|
439
|
-
stagedFiles: [],
|
|
440
|
-
deletedFiles: [],
|
|
441
|
-
});
|
|
442
|
-
|
|
443
|
-
const filtered = discovery.filterRelevantGitChanges(fileTree, gitStatus);
|
|
444
|
-
|
|
445
|
-
expect(filtered).toBeNull();
|
|
446
|
-
});
|
|
447
|
-
|
|
448
|
-
test('includes new untracked files matching discovery patterns', () => {
|
|
449
|
-
const fileTree = createMockFileTree([
|
|
450
|
-
'.principal-views/existing.canvas',
|
|
451
|
-
]);
|
|
452
|
-
|
|
453
|
-
const gitStatus = createMockGitStatus({
|
|
454
|
-
modifiedFiles: [],
|
|
455
|
-
untrackedFiles: ['.principal-views/new-flow.canvas', 'src/newfile.ts'],
|
|
456
|
-
stagedFiles: [],
|
|
457
|
-
deletedFiles: [],
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
const filtered = discovery.filterRelevantGitChanges(fileTree, gitStatus);
|
|
461
|
-
|
|
462
|
-
expect(filtered).not.toBeNull();
|
|
463
|
-
expect(filtered!.untrackedFiles).toEqual(['.principal-views/new-flow.canvas']);
|
|
464
|
-
});
|
|
465
|
-
|
|
466
|
-
test('includes deleted relevant files', () => {
|
|
467
|
-
const fileTree = createMockFileTree([
|
|
468
|
-
'.principal-views/remaining.canvas',
|
|
469
|
-
]);
|
|
470
|
-
|
|
471
|
-
const gitStatus = createMockGitStatus({
|
|
472
|
-
modifiedFiles: [],
|
|
473
|
-
untrackedFiles: [],
|
|
474
|
-
stagedFiles: [],
|
|
475
|
-
deletedFiles: ['.principal-views/deleted.canvas', 'src/deleted.ts'],
|
|
476
|
-
});
|
|
477
|
-
|
|
478
|
-
// Note: deleted files won't be in relevantPaths since they're not in fileTree
|
|
479
|
-
// But the filter should still work based on pattern matching for deleted files
|
|
480
|
-
const filtered = discovery.filterRelevantGitChanges(fileTree, gitStatus);
|
|
481
|
-
|
|
482
|
-
// Since .principal-views/deleted.canvas is not in fileTree, it won't be filtered as "existing"
|
|
483
|
-
// This is expected behavior - we can only filter to paths we know about
|
|
484
|
-
expect(filtered).toBeNull();
|
|
485
|
-
});
|
|
486
|
-
|
|
487
|
-
test('handles all change types together', () => {
|
|
488
|
-
const fileTree = createMockFileTree([
|
|
489
|
-
'.principal-views/modified.canvas',
|
|
490
|
-
'.principal-views/storyboard/flow.otel.canvas',
|
|
491
|
-
'src/index.ts',
|
|
492
|
-
]);
|
|
493
|
-
|
|
494
|
-
const gitStatus = createMockGitStatus({
|
|
495
|
-
modifiedFiles: ['.principal-views/modified.canvas', 'src/index.ts'],
|
|
496
|
-
untrackedFiles: ['.principal-views/new.canvas', 'src/new.ts'],
|
|
497
|
-
stagedFiles: ['.principal-views/staged.workflow.json'],
|
|
498
|
-
deletedFiles: ['other/deleted.ts'],
|
|
499
|
-
});
|
|
500
|
-
|
|
501
|
-
const filtered = discovery.filterRelevantGitChanges(fileTree, gitStatus);
|
|
502
|
-
|
|
503
|
-
expect(filtered).not.toBeNull();
|
|
504
|
-
expect(filtered!.modifiedFiles).toEqual(['.principal-views/modified.canvas']);
|
|
505
|
-
expect(filtered!.untrackedFiles).toEqual(['.principal-views/new.canvas']);
|
|
506
|
-
expect(filtered!.stagedFiles).toEqual(['.principal-views/staged.workflow.json']);
|
|
507
|
-
expect(filtered!.deletedFiles).toEqual([]);
|
|
508
|
-
});
|
|
509
|
-
});
|
|
510
|
-
|
|
511
|
-
describe('validateRequiredCanvases', () => {
|
|
512
|
-
test('no errors when no canvases exist (no .principal-views)', async () => {
|
|
513
|
-
const fileTree = createMockFileTree([
|
|
514
|
-
'src/index.ts',
|
|
515
|
-
]);
|
|
516
|
-
|
|
517
|
-
const result = await discovery.discover(fileTree);
|
|
518
|
-
|
|
519
|
-
// No canvas files means nothing to validate
|
|
520
|
-
expect(result.errors).toHaveLength(0);
|
|
521
|
-
});
|
|
522
|
-
|
|
523
|
-
test('error when resources.canvas is missing', async () => {
|
|
524
|
-
const fileTree = createMockFileTree([
|
|
525
|
-
'.principal-views/docs.canvas',
|
|
526
|
-
]);
|
|
527
|
-
|
|
528
|
-
const result = await discovery.discover(fileTree);
|
|
529
|
-
|
|
530
|
-
const resourcesError = result.errors.find(e => e.error.includes('Missing required resources.canvas'));
|
|
531
|
-
expect(resourcesError).toBeDefined();
|
|
532
|
-
expect(resourcesError!.path).toBe('.principal-views');
|
|
533
|
-
});
|
|
534
|
-
|
|
535
|
-
test('no error when resources.canvas exists but spans.canvas is missing', async () => {
|
|
536
|
-
const fileTree = createMockFileTree([
|
|
537
|
-
'.principal-views/resources.canvas',
|
|
538
|
-
]);
|
|
539
|
-
|
|
540
|
-
const result = await discovery.discover(fileTree);
|
|
541
|
-
|
|
542
|
-
const resourcesError = result.errors.find(e => e.error.includes('Missing required resources.canvas'));
|
|
543
|
-
expect(resourcesError).toBeUndefined();
|
|
544
|
-
|
|
545
|
-
const spansError = result.errors.find(e => e.error.includes('Missing required spans.canvas'));
|
|
546
|
-
expect(spansError).toBeDefined();
|
|
547
|
-
});
|
|
548
|
-
|
|
549
|
-
test('no error when resources.canvas and spans.canvas exist but .otel.canvas is missing', async () => {
|
|
550
|
-
const fileTree = createMockFileTree([
|
|
551
|
-
'.principal-views/resources.canvas',
|
|
552
|
-
'.principal-views/architecture.spans.canvas',
|
|
553
|
-
]);
|
|
554
|
-
|
|
555
|
-
const result = await discovery.discover(fileTree);
|
|
556
|
-
|
|
557
|
-
const resourcesError = result.errors.find(e => e.error.includes('Missing required resources.canvas'));
|
|
558
|
-
expect(resourcesError).toBeUndefined();
|
|
559
|
-
|
|
560
|
-
const spansError = result.errors.find(e => e.error.includes('Missing required spans.canvas'));
|
|
561
|
-
expect(spansError).toBeUndefined();
|
|
562
|
-
|
|
563
|
-
const otelError = result.errors.find(e => e.error.includes('Missing required .otel.canvas'));
|
|
564
|
-
expect(otelError).toBeDefined();
|
|
565
|
-
});
|
|
566
|
-
|
|
567
|
-
test('no errors when all required canvases exist', async () => {
|
|
568
|
-
const fileTree = createMockFileTree([
|
|
569
|
-
'.principal-views/resources.canvas',
|
|
570
|
-
'.principal-views/architecture.spans.canvas',
|
|
571
|
-
'.principal-views/my-feature/my-feature.otel.canvas',
|
|
572
|
-
]);
|
|
573
|
-
|
|
574
|
-
const result = await discovery.discover(fileTree);
|
|
575
|
-
|
|
576
|
-
const resourcesError = result.errors.find(e => e.error.includes('Missing required resources.canvas'));
|
|
577
|
-
expect(resourcesError).toBeUndefined();
|
|
578
|
-
|
|
579
|
-
const spansError = result.errors.find(e => e.error.includes('Missing required spans.canvas'));
|
|
580
|
-
expect(spansError).toBeUndefined();
|
|
581
|
-
|
|
582
|
-
const otelError = result.errors.find(e => e.error.includes('Missing required .otel.canvas'));
|
|
583
|
-
expect(otelError).toBeUndefined();
|
|
584
|
-
});
|
|
585
|
-
|
|
586
|
-
test('accepts architecture.resources.canvas naming convention', async () => {
|
|
587
|
-
const fileTree = createMockFileTree([
|
|
588
|
-
'.principal-views/architecture.resources.canvas',
|
|
589
|
-
'.principal-views/architecture.spans.canvas',
|
|
590
|
-
'.principal-views/feature/feature.otel.canvas',
|
|
591
|
-
]);
|
|
592
|
-
|
|
593
|
-
const result = await discovery.discover(fileTree);
|
|
594
|
-
|
|
595
|
-
const resourcesError = result.errors.find(e => e.error.includes('Missing required resources.canvas'));
|
|
596
|
-
expect(resourcesError).toBeUndefined();
|
|
597
|
-
});
|
|
598
|
-
|
|
599
|
-
test('only checks dependency chain - stops at first missing level', async () => {
|
|
600
|
-
// Only resources.canvas is missing - should not report spans or otel errors
|
|
601
|
-
const fileTree = createMockFileTree([
|
|
602
|
-
'.principal-views/docs.canvas',
|
|
603
|
-
]);
|
|
604
|
-
|
|
605
|
-
const result = await discovery.discover(fileTree);
|
|
606
|
-
|
|
607
|
-
// Should only have the resources.canvas error
|
|
608
|
-
const resourcesError = result.errors.find(e => e.error.includes('Missing required resources.canvas'));
|
|
609
|
-
expect(resourcesError).toBeDefined();
|
|
610
|
-
|
|
611
|
-
// Should NOT have spans or otel errors since we stop at first missing level
|
|
612
|
-
const spansError = result.errors.find(e => e.error.includes('Missing required spans.canvas'));
|
|
613
|
-
expect(spansError).toBeUndefined();
|
|
614
|
-
|
|
615
|
-
const otelError = result.errors.find(e => e.error.includes('Missing required .otel.canvas'));
|
|
616
|
-
expect(otelError).toBeUndefined();
|
|
617
|
-
});
|
|
618
|
-
});
|
|
619
|
-
});
|
|
620
|
-
|
|
621
|
-
/**
|
|
622
|
-
* Helper to create mock FileTree for testing
|
|
623
|
-
*/
|
|
624
|
-
function createMockFileTree(paths: string[]): FileTree {
|
|
625
|
-
const allFiles: FileInfo[] = paths.map(path => ({
|
|
626
|
-
path,
|
|
627
|
-
relativePath: path,
|
|
628
|
-
name: path.split('/').pop() || '',
|
|
629
|
-
extension: path.split('.').pop() || '',
|
|
630
|
-
size: 100,
|
|
631
|
-
lastModified: new Date(),
|
|
632
|
-
isDirectory: false,
|
|
633
|
-
}));
|
|
634
|
-
|
|
635
|
-
const root: DirectoryInfo = {
|
|
636
|
-
path: '/',
|
|
637
|
-
name: '',
|
|
638
|
-
relativePath: '',
|
|
639
|
-
children: [],
|
|
640
|
-
fileCount: allFiles.length,
|
|
641
|
-
totalSize: allFiles.length * 100,
|
|
642
|
-
depth: 0,
|
|
643
|
-
};
|
|
644
|
-
|
|
645
|
-
return {
|
|
646
|
-
sha: 'test-sha-' + Math.random(),
|
|
647
|
-
root,
|
|
648
|
-
allFiles,
|
|
649
|
-
allDirectories: [],
|
|
650
|
-
stats: {
|
|
651
|
-
totalFiles: allFiles.length,
|
|
652
|
-
totalDirectories: 0,
|
|
653
|
-
totalSize: allFiles.length * 100,
|
|
654
|
-
maxDepth: 3,
|
|
655
|
-
},
|
|
656
|
-
metadata: {
|
|
657
|
-
id: 'test',
|
|
658
|
-
timestamp: new Date(),
|
|
659
|
-
sourceType: 'test',
|
|
660
|
-
sourceInfo: {},
|
|
661
|
-
},
|
|
662
|
-
};
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
/**
|
|
666
|
-
* Helper to create mock GitStatusWithFiles for testing
|
|
667
|
-
*/
|
|
668
|
-
function createMockGitStatus(overrides: {
|
|
669
|
-
modifiedFiles?: string[];
|
|
670
|
-
untrackedFiles?: string[];
|
|
671
|
-
stagedFiles?: string[];
|
|
672
|
-
deletedFiles?: string[];
|
|
673
|
-
createdFiles?: string[];
|
|
674
|
-
}) {
|
|
675
|
-
return {
|
|
676
|
-
repoPath: '/test/repo',
|
|
677
|
-
branch: 'main',
|
|
678
|
-
isDirty: true,
|
|
679
|
-
hasUntracked: (overrides.untrackedFiles?.length ?? 0) > 0,
|
|
680
|
-
hasStaged: (overrides.stagedFiles?.length ?? 0) > 0,
|
|
681
|
-
ahead: 0,
|
|
682
|
-
behind: 0,
|
|
683
|
-
watchingEnabled: false,
|
|
684
|
-
modifiedFiles: overrides.modifiedFiles ?? [],
|
|
685
|
-
untrackedFiles: overrides.untrackedFiles ?? [],
|
|
686
|
-
stagedFiles: overrides.stagedFiles ?? [],
|
|
687
|
-
deletedFiles: overrides.deletedFiles ?? [],
|
|
688
|
-
createdFiles: overrides.createdFiles ?? [],
|
|
689
|
-
hash: 'test-hash',
|
|
690
|
-
};
|
|
691
|
-
}
|