@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,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.buildAgentSessionFixture = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const agent_monitoring_1 = require("@principal-ai/agent-monitoring");
|
|
9
|
+
function repoLabel(nf) {
|
|
10
|
+
if (nf.repository?.repo)
|
|
11
|
+
return nf.repository.repo;
|
|
12
|
+
if (nf.repository?.gitRoot)
|
|
13
|
+
return node_path_1.default.basename(nf.repository.gitRoot);
|
|
14
|
+
return "";
|
|
15
|
+
}
|
|
16
|
+
function repoRoot(nf) {
|
|
17
|
+
return nf.repository?.gitRoot ?? "";
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Extract a model id from a model value — agents set it inconsistently
|
|
21
|
+
* (opencode stores `{ providerID, modelID }`-shaped objects, cline / grok /
|
|
22
|
+
* pi store a plain string id).
|
|
23
|
+
*/
|
|
24
|
+
function modelIdOf(value) {
|
|
25
|
+
if (typeof value === "string" && value.length > 0)
|
|
26
|
+
return value;
|
|
27
|
+
if (value && typeof value === "object") {
|
|
28
|
+
const o = value;
|
|
29
|
+
for (const key of ["modelID", "id"]) {
|
|
30
|
+
if (typeof o[key] === "string" && o[key].length > 0) {
|
|
31
|
+
return o[key];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
/** Pull the model id from one event — normalized `data.model` first, then the
|
|
38
|
+
* raw opencode `info` blob (the bridge only copies `info.model` onto
|
|
39
|
+
* normalized events when the session's created event carried it). */
|
|
40
|
+
function eventModelId(e) {
|
|
41
|
+
const direct = modelIdOf(e.data?.["model"]);
|
|
42
|
+
if (direct)
|
|
43
|
+
return direct;
|
|
44
|
+
const raw = e.raw;
|
|
45
|
+
return modelIdOf(raw?.data?.info?.model);
|
|
46
|
+
}
|
|
47
|
+
/** Distinct model ids across a session's events, in first-seen order. */
|
|
48
|
+
function collectModels(events) {
|
|
49
|
+
const seen = new Set();
|
|
50
|
+
const models = [];
|
|
51
|
+
for (const e of events) {
|
|
52
|
+
const id = eventModelId(e);
|
|
53
|
+
if (id && !seen.has(id)) {
|
|
54
|
+
seen.add(id);
|
|
55
|
+
models.push(id);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return models;
|
|
59
|
+
}
|
|
60
|
+
function buildAgentSessionFixture(options) {
|
|
61
|
+
const { agent, sessionId, sessionMeta, normalizedEvents, rawEventCount } = options;
|
|
62
|
+
const sessionName = sessionMeta.sessionName || "opencode";
|
|
63
|
+
const agentEvents = (0, agent_monitoring_1.accumulateToAgentSessionEvents)(normalizedEvents, sessionName);
|
|
64
|
+
// Rewrite layer item paths (repo-relative displayPath) back to absolute
|
|
65
|
+
// paths. Layer snapshots reflect accumulated state across events, so build a
|
|
66
|
+
// global displayPath -> absolutePath map from every event's files/dependencies.
|
|
67
|
+
const repoBreakdown = new Map();
|
|
68
|
+
const displayToAbs = new Map();
|
|
69
|
+
for (const e of agentEvents) {
|
|
70
|
+
for (const f of [...e.files, ...e.dependencies]) {
|
|
71
|
+
if (typeof f === "object" && f && "displayPath" in f) {
|
|
72
|
+
const nf = f;
|
|
73
|
+
if (nf.displayPath && !displayToAbs.has(nf.displayPath)) {
|
|
74
|
+
displayToAbs.set(nf.displayPath, nf.absolutePath);
|
|
75
|
+
}
|
|
76
|
+
const label = repoLabel(nf);
|
|
77
|
+
if (!repoBreakdown.has(label)) {
|
|
78
|
+
repoBreakdown.set(label, { root: repoRoot(nf), files: new Set(), edits: new Set() });
|
|
79
|
+
}
|
|
80
|
+
repoBreakdown.get(label).files.add(nf.absolutePath);
|
|
81
|
+
if (!repoBreakdown.get(label).root)
|
|
82
|
+
repoBreakdown.get(label).root = repoRoot(nf);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const events = agentEvents.map((e) => {
|
|
87
|
+
const files = e.files.map((f) => typeof f === "string" ? f : f.absolutePath);
|
|
88
|
+
const dependencies = e.dependencies.map((f) => typeof f === "string" ? f : f.absolutePath);
|
|
89
|
+
if (e.operation === "editing") {
|
|
90
|
+
for (const f of files) {
|
|
91
|
+
const label = [...repoBreakdown.entries()].find(([, v]) => v.files.has(f))?.[0] ?? "";
|
|
92
|
+
if (!repoBreakdown.has(label)) {
|
|
93
|
+
repoBreakdown.set(label, { root: "", files: new Set(), edits: new Set() });
|
|
94
|
+
}
|
|
95
|
+
repoBreakdown.get(label).edits.add(f);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const layers = e.layers.map((l) => ({
|
|
99
|
+
...l,
|
|
100
|
+
items: l.items.map((item) => {
|
|
101
|
+
const abs = item.path.startsWith("/") ? item.path : displayToAbs.get(item.path) ?? item.path;
|
|
102
|
+
return { ...item, path: abs };
|
|
103
|
+
}),
|
|
104
|
+
}));
|
|
105
|
+
return { ...e, files, dependencies, layers };
|
|
106
|
+
});
|
|
107
|
+
const session = {
|
|
108
|
+
sessionId,
|
|
109
|
+
agent,
|
|
110
|
+
sessionName,
|
|
111
|
+
sessionTask: sessionMeta.sessionTask,
|
|
112
|
+
workingDirectory: sessionMeta.workingDirectory,
|
|
113
|
+
rawEventCount: rawEventCount ?? normalizedEvents.length,
|
|
114
|
+
agentEventCount: events.length,
|
|
115
|
+
repos: [...repoBreakdown.entries()].map(([repo, v]) => ({
|
|
116
|
+
repo,
|
|
117
|
+
root: v.root,
|
|
118
|
+
files: v.files.size,
|
|
119
|
+
edits: v.edits.size,
|
|
120
|
+
})),
|
|
121
|
+
models: collectModels(normalizedEvents),
|
|
122
|
+
};
|
|
123
|
+
return {
|
|
124
|
+
generatedFrom: `${agent} session ${sessionId}`,
|
|
125
|
+
session,
|
|
126
|
+
events,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
exports.buildAgentSessionFixture = buildAgentSessionFixture;
|
|
130
|
+
//# sourceMappingURL=fixture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture.js","sourceRoot":"","sources":["../../src/agent-sessions/fixture.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAC7B,qEAKwC;AAiFxC,SAAS,SAAS,CAAC,EAAwD;IACzE,IAAI,EAAE,CAAC,UAAU,EAAE,IAAI;QAAE,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;IACnD,IAAI,EAAE,CAAC,UAAU,EAAE,OAAO;QAAE,OAAO,mBAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACxE,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,QAAQ,CAAC,EAAyC;IACzD,OAAO,EAAE,CAAC,UAAU,EAAE,OAAO,IAAI,EAAE,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAChE,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QACtC,MAAM,CAAC,GAAG,KAAgC,CAAC;QAC3C,KAAK,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE;YACnC,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,KAAK,QAAQ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Summary, FixtureAgentSessionEvent, FixtureHighlightLayer, FixtureLayerItem, } from "./fixture";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent-sessions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,YAAY,EACV,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildAgentSessionFixture = void 0;
|
|
4
|
+
var fixture_1 = require("./fixture");
|
|
5
|
+
Object.defineProperty(exports, "buildAgentSessionFixture", { enumerable: true, get: function () { return fixture_1.buildAgentSessionFixture; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent-sessions/index.ts"],"names":[],"mappings":";;;AAAA,qCAAqD;AAA5C,mHAAA,wBAAwB,OAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auxiliary Manifest Validator
|
|
3
|
+
*
|
|
4
|
+
* Own-file checks for `.principal-views/auxiliary.manifest.json`:
|
|
5
|
+
* - area names are unique
|
|
6
|
+
* - declared paths exist on disk
|
|
7
|
+
* - paths don't overlap each other (within or across areas)
|
|
8
|
+
*
|
|
9
|
+
* Cross-file overlap with scope paths lives in `validateAreaScopeDisjoint`,
|
|
10
|
+
* mirroring the way `validateScopeNamespaceNesting` handles cross-canvas
|
|
11
|
+
* checks for scopes/namespaces.
|
|
12
|
+
*/
|
|
13
|
+
import type { FileSystemAdapter } from '@principal-ai/repository-abstraction';
|
|
14
|
+
import type { AuxiliaryManifest } from '../types/auxiliary';
|
|
15
|
+
export interface AuxiliaryManifestValidationContext {
|
|
16
|
+
/** Parsed manifest. When absent, validation is a no-op (manifest is optional). */
|
|
17
|
+
manifest?: AuxiliaryManifest;
|
|
18
|
+
/** Path to the manifest file — used in violation messages. */
|
|
19
|
+
manifestPath?: string;
|
|
20
|
+
/** Repo root for resolving area paths against the filesystem. */
|
|
21
|
+
basePath: string;
|
|
22
|
+
}
|
|
23
|
+
export interface AuxiliaryManifestViolation {
|
|
24
|
+
ruleId: string;
|
|
25
|
+
severity: 'error' | 'warn';
|
|
26
|
+
file: string;
|
|
27
|
+
path?: string;
|
|
28
|
+
message: string;
|
|
29
|
+
impact: string;
|
|
30
|
+
suggestion: string;
|
|
31
|
+
}
|
|
32
|
+
export interface AuxiliaryManifestValidationResult {
|
|
33
|
+
valid: boolean;
|
|
34
|
+
violations: AuxiliaryManifestViolation[];
|
|
35
|
+
}
|
|
36
|
+
export declare class AuxiliaryManifestValidator {
|
|
37
|
+
private fsAdapter;
|
|
38
|
+
constructor(fsAdapter: FileSystemAdapter);
|
|
39
|
+
validate(context: AuxiliaryManifestValidationContext): Promise<AuxiliaryManifestValidationResult>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=AuxiliaryManifestValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuxiliaryManifestValidator.d.ts","sourceRoot":"","sources":["../../src/auxiliary/AuxiliaryManifestValidator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,MAAM,WAAW,kCAAkC;IACjD,kFAAkF;IAClF,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAE7B,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iCAAiC;IAChD,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,0BAA0B,EAAE,CAAC;CAC1C;AAID,qBAAa,0BAA0B;IACzB,OAAO,CAAC,SAAS;gBAAT,SAAS,EAAE,iBAAiB;IAE1C,QAAQ,CAAC,OAAO,EAAE,kCAAkC,GAAG,OAAO,CAAC,iCAAiC,CAAC;CAmFxG"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Auxiliary Manifest Validator
|
|
4
|
+
*
|
|
5
|
+
* Own-file checks for `.principal-views/auxiliary.manifest.json`:
|
|
6
|
+
* - area names are unique
|
|
7
|
+
* - declared paths exist on disk
|
|
8
|
+
* - paths don't overlap each other (within or across areas)
|
|
9
|
+
*
|
|
10
|
+
* Cross-file overlap with scope paths lives in `validateAreaScopeDisjoint`,
|
|
11
|
+
* mirroring the way `validateScopeNamespaceNesting` handles cross-canvas
|
|
12
|
+
* checks for scopes/namespaces.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.AuxiliaryManifestValidator = void 0;
|
|
16
|
+
const path_helpers_1 = require("../events/path-helpers");
|
|
17
|
+
const DEFAULT_MANIFEST_PATH = '.principal-views/auxiliary.manifest.json';
|
|
18
|
+
class AuxiliaryManifestValidator {
|
|
19
|
+
constructor(fsAdapter) {
|
|
20
|
+
this.fsAdapter = fsAdapter;
|
|
21
|
+
}
|
|
22
|
+
async validate(context) {
|
|
23
|
+
const violations = [];
|
|
24
|
+
const { manifest, basePath } = context;
|
|
25
|
+
const file = context.manifestPath || DEFAULT_MANIFEST_PATH;
|
|
26
|
+
if (!manifest) {
|
|
27
|
+
return { valid: true, violations };
|
|
28
|
+
}
|
|
29
|
+
const areas = manifest.areas || [];
|
|
30
|
+
// Unique area names
|
|
31
|
+
const seenNames = new Map();
|
|
32
|
+
areas.forEach((area, idx) => {
|
|
33
|
+
const count = seenNames.get(area.name) ?? 0;
|
|
34
|
+
seenNames.set(area.name, count + 1);
|
|
35
|
+
if (count === 1) {
|
|
36
|
+
violations.push({
|
|
37
|
+
ruleId: 'auxiliary-area-name-duplicate',
|
|
38
|
+
severity: 'error',
|
|
39
|
+
file,
|
|
40
|
+
path: `areas[${idx}].name`,
|
|
41
|
+
message: `Area name "${area.name}" is declared more than once`,
|
|
42
|
+
impact: 'Duplicate names make diagnostics ambiguous — a violation cannot be tied back to a single area',
|
|
43
|
+
suggestion: 'Rename one of the areas so names are unique across the manifest.',
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
// Path existence + collect for overlap pass
|
|
48
|
+
const declaredPaths = [];
|
|
49
|
+
for (let areaIdx = 0; areaIdx < areas.length; areaIdx++) {
|
|
50
|
+
const area = areas[areaIdx];
|
|
51
|
+
const paths = area.paths || [];
|
|
52
|
+
for (let pathIdx = 0; pathIdx < paths.length; pathIdx++) {
|
|
53
|
+
const p = paths[pathIdx];
|
|
54
|
+
declaredPaths.push({ areaName: area.name, areaIndex: areaIdx, pathIndex: pathIdx, path: p });
|
|
55
|
+
const resolved = this.fsAdapter.join(basePath, p);
|
|
56
|
+
if (!(await this.fsAdapter.exists(resolved))) {
|
|
57
|
+
violations.push({
|
|
58
|
+
ruleId: 'auxiliary-area-path-missing',
|
|
59
|
+
severity: 'warn',
|
|
60
|
+
file,
|
|
61
|
+
path: `areas[${areaIdx}].paths[${pathIdx}]`,
|
|
62
|
+
message: `Path "${p}" declared by area "${area.name}" does not exist`,
|
|
63
|
+
impact: 'The manifest documents a folder that is not present in the repository',
|
|
64
|
+
suggestion: 'Verify the path exists relative to the repository root, or remove it from the area declaration.',
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// Path overlap. Unlike scopes, areas have no dotted-name hierarchy, so
|
|
70
|
+
// parent-child nesting between two areas is just as ambiguous as a flat
|
|
71
|
+
// overlap — both are flagged.
|
|
72
|
+
for (let i = 0; i < declaredPaths.length; i++) {
|
|
73
|
+
for (let j = i + 1; j < declaredPaths.length; j++) {
|
|
74
|
+
const a = declaredPaths[i];
|
|
75
|
+
const b = declaredPaths[j];
|
|
76
|
+
const relationship = (0, path_helpers_1.pathsOverlap)(a.path, b.path);
|
|
77
|
+
if (relationship === 'none')
|
|
78
|
+
continue;
|
|
79
|
+
const sameArea = a.areaName === b.areaName;
|
|
80
|
+
violations.push({
|
|
81
|
+
ruleId: sameArea ? 'auxiliary-area-paths-self-overlap' : 'auxiliary-area-paths-overlap',
|
|
82
|
+
severity: 'error',
|
|
83
|
+
file,
|
|
84
|
+
path: sameArea
|
|
85
|
+
? `areas[${a.areaIndex}].paths`
|
|
86
|
+
: undefined,
|
|
87
|
+
message: sameArea
|
|
88
|
+
? `Area "${a.areaName}" declares overlapping paths "${a.path}" and "${b.path}"`
|
|
89
|
+
: `Paths overlap between areas "${a.areaName}" ("${a.path}") and "${b.areaName}" ("${b.path}")`,
|
|
90
|
+
impact: 'Two area declarations covering the same file make ownership ambiguous',
|
|
91
|
+
suggestion: 'Make the paths disjoint. If one folder genuinely sits inside another area, drop the redundant entry.',
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const errors = violations.filter((v) => v.severity === 'error');
|
|
96
|
+
return { valid: errors.length === 0, violations };
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.AuxiliaryManifestValidator = AuxiliaryManifestValidator;
|
|
100
|
+
//# sourceMappingURL=AuxiliaryManifestValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuxiliaryManifestValidator.js","sourceRoot":"","sources":["../../src/auxiliary/AuxiliaryManifestValidator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAIH,yDAAsD;AA4BtD,MAAM,qBAAqB,GAAG,0CAA0C,CAAC;AAEzE,MAAa,0BAA0B;IACrC,YAAoB,SAA4B;QAA5B,cAAS,GAAT,SAAS,CAAmB;IAAG,CAAC;IAEpD,KAAK,CAAC,QAAQ,CAAC,OAA2C;QACxD,MAAM,UAAU,GAAiC,EAAE,CAAC;QACpD,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;QACvC,MAAM,IAAI,GAAG,OAAO,CAAC,YAAY,IAAI,qBAAqB,CAAC;QAE3D,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;SACpC;QAED,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC;QAEnC,oBAAoB;QACpB,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC5C,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;YAC1B,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5C,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;YACpC,IAAI,KAAK,KAAK,CAAC,EAAE;gBACf,UAAU,CAAC,IAAI,CAAC;oBACd,MAAM,EAAE,+BAA+B;oBACvC,QAAQ,EAAE,OAAO;oBACjB,IAAI;oBACJ,IAAI,EAAE,SAAS,GAAG,QAAQ;oBAC1B,OAAO,EAAE,cAA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AC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC;QAChE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACpD,CAAC;CACF;AAtFD,gEAsFC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auxiliary module
|
|
3
|
+
*
|
|
4
|
+
* Validation for `auxiliary.manifest.json` — the catalog of project regions
|
|
5
|
+
* that sit outside the OTEL telemetry surface (docs, .github, etc.).
|
|
6
|
+
*/
|
|
7
|
+
export { AuxiliaryManifestValidator, type AuxiliaryManifestValidationContext, type AuxiliaryManifestValidationResult, type AuxiliaryManifestViolation, } from './AuxiliaryManifestValidator';
|
|
8
|
+
export { validateAreaScopeDisjoint, type ValidateAreaScopeDisjointInput, } from './validateAreaScopeDisjoint';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auxiliary/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,0BAA0B,EAC1B,KAAK,kCAAkC,EACvC,KAAK,iCAAiC,EACtC,KAAK,0BAA0B,GAChC,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,yBAAyB,EACzB,KAAK,8BAA8B,GACpC,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Auxiliary module
|
|
4
|
+
*
|
|
5
|
+
* Validation for `auxiliary.manifest.json` — the catalog of project regions
|
|
6
|
+
* that sit outside the OTEL telemetry surface (docs, .github, etc.).
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.validateAreaScopeDisjoint = exports.AuxiliaryManifestValidator = void 0;
|
|
10
|
+
var AuxiliaryManifestValidator_1 = require("./AuxiliaryManifestValidator");
|
|
11
|
+
Object.defineProperty(exports, "AuxiliaryManifestValidator", { enumerable: true, get: function () { return AuxiliaryManifestValidator_1.AuxiliaryManifestValidator; } });
|
|
12
|
+
var validateAreaScopeDisjoint_1 = require("./validateAreaScopeDisjoint");
|
|
13
|
+
Object.defineProperty(exports, "validateAreaScopeDisjoint", { enumerable: true, get: function () { return validateAreaScopeDisjoint_1.validateAreaScopeDisjoint; } });
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auxiliary/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2EAKsC;AAJpC,wIAAA,0BAA0B,OAAA;AAM5B,yEAGqC;AAFnC,sIAAA,yBAAyB,OAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Area / Scope Disjointness Validator
|
|
3
|
+
*
|
|
4
|
+
* Cross-file check: project-area paths declared in
|
|
5
|
+
* `auxiliary.manifest.json` must be disjoint from every scope path declared
|
|
6
|
+
* in `architecture.scopes.canvas`. Areas and scopes carve up the repo into
|
|
7
|
+
* non-overlapping regions — any overlap (parent-child or otherwise) means a
|
|
8
|
+
* file is claimed by both an OTEL scope and an auxiliary area, which makes
|
|
9
|
+
* ownership ambiguous.
|
|
10
|
+
*
|
|
11
|
+
* Mirrors `validateScopeNamespaceNesting`'s cross-canvas pattern: takes both
|
|
12
|
+
* inputs, returns violations.
|
|
13
|
+
*/
|
|
14
|
+
import type { AuxiliaryManifest } from '../types/auxiliary';
|
|
15
|
+
import type { ExtendedCanvas } from '../types/canvas';
|
|
16
|
+
import type { AuxiliaryManifestViolation } from './AuxiliaryManifestValidator';
|
|
17
|
+
export interface ValidateAreaScopeDisjointInput {
|
|
18
|
+
manifest: AuxiliaryManifest;
|
|
19
|
+
manifestPath?: string;
|
|
20
|
+
scopesCanvas?: ExtendedCanvas;
|
|
21
|
+
scopesCanvasPath?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function validateAreaScopeDisjoint(input: ValidateAreaScopeDisjointInput): AuxiliaryManifestViolation[];
|
|
24
|
+
//# sourceMappingURL=validateAreaScopeDisjoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateAreaScopeDisjoint.d.ts","sourceRoot":"","sources":["../../src/auxiliary/validateAreaScopeDisjoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE/E,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAID,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,8BAA8B,GACpC,0BAA0B,EAAE,CAwC9B"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Area / Scope Disjointness Validator
|
|
4
|
+
*
|
|
5
|
+
* Cross-file check: project-area paths declared in
|
|
6
|
+
* `auxiliary.manifest.json` must be disjoint from every scope path declared
|
|
7
|
+
* in `architecture.scopes.canvas`. Areas and scopes carve up the repo into
|
|
8
|
+
* non-overlapping regions — any overlap (parent-child or otherwise) means a
|
|
9
|
+
* file is claimed by both an OTEL scope and an auxiliary area, which makes
|
|
10
|
+
* ownership ambiguous.
|
|
11
|
+
*
|
|
12
|
+
* Mirrors `validateScopeNamespaceNesting`'s cross-canvas pattern: takes both
|
|
13
|
+
* inputs, returns violations.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.validateAreaScopeDisjoint = void 0;
|
|
17
|
+
const canvas_1 = require("../types/canvas");
|
|
18
|
+
const path_helpers_1 = require("../events/path-helpers");
|
|
19
|
+
const DEFAULT_MANIFEST_PATH = '.principal-views/auxiliary.manifest.json';
|
|
20
|
+
function validateAreaScopeDisjoint(input) {
|
|
21
|
+
const { manifest, scopesCanvas } = input;
|
|
22
|
+
const manifestFile = input.manifestPath || DEFAULT_MANIFEST_PATH;
|
|
23
|
+
if (!scopesCanvas)
|
|
24
|
+
return [];
|
|
25
|
+
const scopePaths = [];
|
|
26
|
+
for (const node of scopesCanvas.nodes || []) {
|
|
27
|
+
if (!(0, canvas_1.isOtelScopeNode)(node))
|
|
28
|
+
continue;
|
|
29
|
+
const scope = node.otel?.scope;
|
|
30
|
+
const paths = node.paths;
|
|
31
|
+
if (!scope || !paths || paths.length === 0)
|
|
32
|
+
continue;
|
|
33
|
+
for (const p of paths)
|
|
34
|
+
scopePaths.push({ scope, path: p });
|
|
35
|
+
}
|
|
36
|
+
if (scopePaths.length === 0)
|
|
37
|
+
return [];
|
|
38
|
+
const violations = [];
|
|
39
|
+
const areas = manifest.areas || [];
|
|
40
|
+
areas.forEach((area, areaIdx) => {
|
|
41
|
+
(area.paths || []).forEach((areaPath, pathIdx) => {
|
|
42
|
+
for (const sp of scopePaths) {
|
|
43
|
+
const relationship = (0, path_helpers_1.pathsOverlap)(areaPath, sp.path);
|
|
44
|
+
if (relationship === 'none')
|
|
45
|
+
continue;
|
|
46
|
+
violations.push({
|
|
47
|
+
ruleId: 'auxiliary-area-scope-overlap',
|
|
48
|
+
severity: 'error',
|
|
49
|
+
file: manifestFile,
|
|
50
|
+
path: `areas[${areaIdx}].paths[${pathIdx}]`,
|
|
51
|
+
message: `Area "${area.name}" path "${areaPath}" overlaps scope "${sp.scope}" path "${sp.path}"`,
|
|
52
|
+
impact: 'A file claimed by both an OTEL scope and an auxiliary area has ambiguous ownership — the manifest is meant to catalog regions outside the telemetry surface',
|
|
53
|
+
suggestion: 'Make the area path disjoint from every scope path. If the folder is genuinely runtime code, drop it from the manifest; if it is auxiliary, narrow the scope path or move the folder.',
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
return violations;
|
|
59
|
+
}
|
|
60
|
+
exports.validateAreaScopeDisjoint = validateAreaScopeDisjoint;
|
|
61
|
+
//# sourceMappingURL=validateAreaScopeDisjoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateAreaScopeDisjoint.js","sourceRoot":"","sources":["../../src/auxiliary/validateAreaScopeDisjoint.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAIH,4CAAkD;AAClD,yDAAsD;AAUtD,MAAM,qBAAqB,GAAG,0CAA0C,CAAC;AAEzE,SAAgB,yBAAyB,CACvC,KAAqC;IAErC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IACzC,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,IAAI,qBAAqB,CAAC;IAEjE,IAAI,CAAC,YAAY;QAAE,OAAO,EAAE,CAAC;IAE7B,MAAM,UAAU,GAA2C,EAAE,CAAC;IAC9D,KAAK,MAAM,IAAI,IAAI,YAAY,CAAC,KAAK,IAAI,EAAE,EAAE;QAC3C,IAAI,CAAC,IAAA,wBAAe,EAAC,IAAI,CAAC;YAAE,SAAS;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACrD,KAAK,MAAM,CAAC,IAAI,KAAK;YAAE,UAAU,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;KAC5D;IAED,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEvC,MAAM,UAAU,GAAiC,EAAE,CAAC;IACpD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC;IAEnC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;QAC9B,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE;YAC/C,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE;gBAC3B,MAAM,YAAY,GAAG,IAAA,2BAAY,EAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;gBACrD,IAAI,YAAY,KAAK,MAAM;oBAAE,SAAS;gBAEtC,UAAU,CAAC,IAAI,CAAC;oBACd,MAAM,EAAE,8BAA8B;oBACtC,QAAQ,EAAE,OAAO;oBACjB,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,SAAS,OAAO,WAAW,OAAO,GAAG;oBAC3C,OAAO,EAAE,SAAS,IAAI,CAAC,IAAI,WAAW,QAAQ,qBAAqB,EAAE,CAAC,KAAK,WAAW,EAAE,CAAC,IAAI,GAAG;oBAChG,MAAM,EAAE,6JAA6J;oBACrK,UAAU,EAAE,sLAAsL;iBACnM,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC;AA1CD,8DA0CC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Code Generation CLI
|
|
4
|
+
*
|
|
5
|
+
* Generate types from canvas files.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* npx @principal-ai/subsystems-core codegen my-flow.canvas
|
|
9
|
+
* npx @principal-ai/subsystems-core codegen --lang typescript --output types/ my-flow.canvas
|
|
10
|
+
*
|
|
11
|
+
* Similar to:
|
|
12
|
+
* - graphql-codegen (GraphQL)
|
|
13
|
+
* - openapi-generator (OpenAPI)
|
|
14
|
+
* - protoc (Protobuf)
|
|
15
|
+
*/
|
|
16
|
+
interface CliOptions {
|
|
17
|
+
language: 'typescript' | 'python' | 'go' | 'rust';
|
|
18
|
+
output?: string;
|
|
19
|
+
readonly?: boolean;
|
|
20
|
+
strictNullChecks?: boolean;
|
|
21
|
+
includeDocComments?: boolean;
|
|
22
|
+
namespace?: string;
|
|
23
|
+
watch?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Parse command line arguments
|
|
27
|
+
*/
|
|
28
|
+
declare function parseArgs(args: string[]): {
|
|
29
|
+
options: CliOptions;
|
|
30
|
+
canvasFiles: string[];
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Generate types for a canvas file
|
|
34
|
+
*/
|
|
35
|
+
declare function generateTypesForFile(canvasPath: string, options: CliOptions): string;
|
|
36
|
+
/**
|
|
37
|
+
* Main entry point
|
|
38
|
+
*/
|
|
39
|
+
declare function main(): void;
|
|
40
|
+
export { main, parseArgs, generateTypesForFile };
|
|
41
|
+
//# sourceMappingURL=codegen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/cli/codegen.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;AAQH,UAAU,UAAU;IAClB,QAAQ,EAAE,YAAY,GAAG,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,iBAAS,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAAE,OAAO,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,CAuDjF;AAED;;GAEG;AACH,iBAAS,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,UA2DpE;AAkED;;GAEG;AACH,iBAAS,IAAI,SAuDZ;AAOD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC"}
|