@principal-ai/principal-view-core 0.11.9 → 0.12.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/dist/index.d.ts +20 -36
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -40
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +59 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +60 -0
- package/dist/node.js.map +1 -0
- package/package.json +7 -1
- package/src/index.ts +85 -114
- package/src/node.ts +183 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,49 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @principal-ai/principal-view-core
|
|
3
|
-
*
|
|
3
|
+
* Browser-safe exports (no Node.js dependencies)
|
|
4
|
+
*
|
|
5
|
+
* This is the main entry point for the package and only includes browser-compatible code.
|
|
6
|
+
* Includes types, canvas utilities, YAML parsing, and narrative rendering.
|
|
7
|
+
*
|
|
8
|
+
* BREAKING CHANGE (v0.12.0):
|
|
9
|
+
* The main export now only includes browser-safe functionality.
|
|
10
|
+
*
|
|
11
|
+
* For Node.js-specific functionality (file system, code generation, rules engine, etc.), use:
|
|
12
|
+
* import { ... } from '@principal-ai/principal-view-core/node'
|
|
13
|
+
*
|
|
14
|
+
* For explicit browser usage (same as main export):
|
|
15
|
+
* import { ... } from '@principal-ai/principal-view-core/browser'
|
|
4
16
|
*/
|
|
5
|
-
export
|
|
6
|
-
export {
|
|
7
|
-
export type { ProcessingResult } from './EventProcessor';
|
|
8
|
-
export { ValidationEngine } from './ValidationEngine';
|
|
9
|
-
export { ConfigurationValidator } from './ConfigurationValidator';
|
|
10
|
-
export type { ConfigurationValidationError, ConfigurationValidationResult, } from './ConfigurationValidator';
|
|
11
|
-
export { GraphInstrumentationHelper } from './helpers/GraphInstrumentationHelper';
|
|
12
|
-
export { PathBasedEventProcessor } from './PathBasedEventProcessor';
|
|
13
|
-
export type { LogEntry } from './PathBasedEventProcessor';
|
|
14
|
-
export { PathMatcher } from './utils/PathMatcher';
|
|
15
|
-
export { GraphConverter } from './utils/GraphConverter';
|
|
17
|
+
export type { GraphConfiguration, NodeState, EdgeState, NodeTypeDefinition, EdgeTypeDefinition, Violation, GraphEvent, NodeEvent, EdgeEvent, StateEvent, ComponentLibrary, LogLevel, GraphMetrics, Warning, ValidationResult, EventStream, ConnectionRule, LibraryNodeComponent, LibraryEdgeComponent, ComponentActivityEvent, ComponentActionEvent, EdgeAnimationEvent, PathBasedEvent, JsonValue, JsonObject, } from './types';
|
|
18
|
+
export type { ConfigurationFile, ConfigurationLoadResult } from './ConfigurationLoader';
|
|
16
19
|
export * from './types/canvas';
|
|
17
20
|
export { CanvasConverter } from './utils/CanvasConverter';
|
|
18
21
|
export type { ReactFlowNode, ReactFlowEdge } from './utils/CanvasConverter';
|
|
19
|
-
export { EventValidator, createValidatedEmitter, EventValidationError } from './telemetry/event-validator';
|
|
20
|
-
export type { ValidationResult } from './telemetry/event-validator';
|
|
21
|
-
export { analyzeCoverage } from './telemetry/coverage';
|
|
22
|
-
export type { CoverageMetrics, NodeCoverage, CanvasNode as CoverageCanvasNode } from './telemetry/coverage';
|
|
23
|
-
export { generateTypes, TypeScriptGenerator, generatorRegistry } from './codegen/type-generator';
|
|
24
|
-
export type { CodegenOptions, CodegenResult, CodeGenerator } from './codegen/type-generator';
|
|
25
|
-
export { traceToCanvas, traceToCanvasJson } from './utils/TraceToCanvas';
|
|
26
|
-
export type { TraceSpan, TraceExport, TraceToCanvasOptions, TraceCanvasResult, } from './utils/TraceToCanvas';
|
|
27
|
-
export { SessionManager } from './SessionManager';
|
|
28
|
-
export type { SessionStatus, SessionResult, SessionMetadata, EventSession, CreateSessionOptions, EndSessionOptions, SessionChangeCallback, SessionManagerConfig, } from './SessionManager';
|
|
29
|
-
export { EventRecorderService } from './EventRecorderService';
|
|
30
|
-
export type { ProtocolMessageType, ProtocolMessage, SessionStartMessage, SessionEndMessage, LogMessage, LogBatchMessage, PingMessage, PongMessage, ErrorMessage, AckMessage, IncomingMessage, OutgoingMessage, RecordingMode, EventCallback, EventBatchCallback, ConnectionState, EventRecorderServiceConfig, } from './EventRecorderService';
|
|
31
|
-
export { ConfigurationLoader } from './ConfigurationLoader';
|
|
32
|
-
export type { ConfigurationFile, ConfigurationLoadResult } from './ConfigurationLoader';
|
|
33
22
|
export { parseYaml, isYamlFile, getConfigNameFromFilename } from './utils/YamlParser';
|
|
34
23
|
export type { YamlParseResult } from './utils/YamlParser';
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export
|
|
38
|
-
export type {
|
|
39
|
-
export {
|
|
40
|
-
export * from './rules';
|
|
41
|
-
export { renderNarrative, parseTemplate, selectScenario, matchesCondition, hasEventMatching, computeAggregates, evaluateAssertion, getNestedValue, setNestedValue, createNarrativeValidator, NarrativeValidator, } from './narrative';
|
|
42
|
-
export type { NarrativeTemplate, NarrativeScenario, NarrativeMode, ScenarioCondition, ScenarioTemplate, Assertion, FlowDirective, LogTemplates, FormattingOptions, OtelEvent, OtelSignal, NarrativeContext, NarrativeResult, ScenarioMatchResult, SpanTreeNode, NarrativeValidationContext, NarrativeViolation, NarrativeValidationResult, } from './narrative';
|
|
24
|
+
export { renderNarrative } from './narrative/template-renderer';
|
|
25
|
+
export { parseTemplate } from './narrative/template-parser';
|
|
26
|
+
export { selectScenario, matchesCondition, hasEventMatching, computeAggregates, evaluateAssertion, getNestedValue, setNestedValue, } from './narrative/scenario-matcher';
|
|
27
|
+
export type { NarrativeTemplate, NarrativeScenario, NarrativeMode, ScenarioCondition, ScenarioTemplate, Assertion, FlowDirective, LogTemplates, FormattingOptions, OtelEvent, OtelSignal, NarrativeContext, NarrativeResult, ScenarioMatchResult, SpanTreeNode, } from './narrative/types';
|
|
28
|
+
export type { OtelAttributes, OtelAttributeValue, OtelLog, OtelSpan, OtelResource, OtelSeverity, OtelSeverityText, OtelSeverityNumber, OtelSpanKind, OtelSpanStatus, } from './types/otel';
|
|
43
29
|
export { CanvasDiscovery } from './discovery/CanvasDiscovery';
|
|
44
30
|
export type { DiscoveredCanvas, DiscoveredExecution, CanvasDiscoveryResult, DiscoveryOptions, CanvasType, ExecutionType, DiscoveredCanvasWithContent, DiscoveredExecutionWithContent, CanvasDiscoveryResultWithContent, } from './discovery/types';
|
|
45
31
|
export { ExecutionValidator, createExecutionValidator } from './execution/ExecutionValidator';
|
|
46
32
|
export type { ExecutionData, ValidationError, ExecutionValidationResult, } from './execution/ExecutionValidator';
|
|
47
|
-
export { ExecutionLoader, createExecutionLoader } from './execution/ExecutionLoader';
|
|
48
|
-
export type { ExecutionFile, ExecutionLoadResult, } from './execution/ExecutionLoader';
|
|
49
33
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,YAAY,EACV,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,UAAU,GACX,MAAM,SAAS,CAAC;AAGjB,YAAY,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAGxF,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG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(no Node.js dependencies)
|
|
4
|
+
*
|
|
5
|
+
* This is the main entry point for the package and only includes browser-compatible code.
|
|
6
|
+
* Includes types, canvas utilities, YAML parsing, and narrative rendering.
|
|
7
|
+
*
|
|
8
|
+
* BREAKING CHANGE (v0.12.0):
|
|
9
|
+
* The main export now only includes browser-safe functionality.
|
|
10
|
+
*
|
|
11
|
+
* For Node.js-specific functionality (file system, code generation, rules engine, etc.), use:
|
|
12
|
+
* import { ... } from '@principal-ai/principal-view-core/node'
|
|
13
|
+
*
|
|
14
|
+
* For explicit browser usage (same as main export):
|
|
15
|
+
* import { ... } from '@principal-ai/principal-view-core/browser'
|
|
4
16
|
*/
|
|
5
|
-
// Export all types
|
|
6
|
-
export * from './types';
|
|
7
|
-
// Export core classes
|
|
8
|
-
export { EventProcessor } from './EventProcessor';
|
|
9
|
-
export { ValidationEngine } from './ValidationEngine';
|
|
10
|
-
export { ConfigurationValidator } from './ConfigurationValidator';
|
|
11
|
-
// Export helpers
|
|
12
|
-
export { GraphInstrumentationHelper } from './helpers/GraphInstrumentationHelper';
|
|
13
|
-
// Export path-based processing (Milestone 1 & 2)
|
|
14
|
-
export { PathBasedEventProcessor } from './PathBasedEventProcessor';
|
|
15
|
-
// Export path utilities
|
|
16
|
-
export { PathMatcher } from './utils/PathMatcher';
|
|
17
|
-
export { GraphConverter } from './utils/GraphConverter';
|
|
18
17
|
// Export Canvas types and converter
|
|
19
18
|
export * from './types/canvas';
|
|
20
19
|
export { CanvasConverter } from './utils/CanvasConverter';
|
|
21
|
-
// Export
|
|
22
|
-
export { EventValidator, createValidatedEmitter, EventValidationError } from './telemetry/event-validator';
|
|
23
|
-
// Export telemetry coverage analysis
|
|
24
|
-
export { analyzeCoverage } from './telemetry/coverage';
|
|
25
|
-
// Export code generation
|
|
26
|
-
export { generateTypes, TypeScriptGenerator, generatorRegistry } from './codegen/type-generator';
|
|
27
|
-
// Export trace-to-canvas conversion
|
|
28
|
-
export { traceToCanvas, traceToCanvasJson } from './utils/TraceToCanvas';
|
|
29
|
-
// Export session management (Event Recording System)
|
|
30
|
-
export { SessionManager } from './SessionManager';
|
|
31
|
-
// Export event recorder service
|
|
32
|
-
export { EventRecorderService } from './EventRecorderService';
|
|
33
|
-
// Export configuration loading (Phase 2: Multi-config support)
|
|
34
|
-
export { ConfigurationLoader } from './ConfigurationLoader';
|
|
20
|
+
// Export YAML parsing (browser-compatible)
|
|
35
21
|
export { parseYaml, isYamlFile, getConfigNameFromFilename } from './utils/YamlParser';
|
|
36
|
-
// Export
|
|
37
|
-
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// Export narrative template system
|
|
43
|
-
export { renderNarrative, parseTemplate, selectScenario, matchesCondition, hasEventMatching, computeAggregates, evaluateAssertion, getNestedValue, setNestedValue, createNarrativeValidator, NarrativeValidator, } from './narrative';
|
|
44
|
-
// Export canvas and execution discovery
|
|
22
|
+
// Export narrative template system (browser-safe)
|
|
23
|
+
// Import directly from files to avoid pulling in Node.js validator
|
|
24
|
+
export { renderNarrative } from './narrative/template-renderer';
|
|
25
|
+
export { parseTemplate } from './narrative/template-parser';
|
|
26
|
+
export { selectScenario, matchesCondition, hasEventMatching, computeAggregates, evaluateAssertion, getNestedValue, setNestedValue, } from './narrative/scenario-matcher';
|
|
27
|
+
// Export canvas and execution discovery (browser-safe)
|
|
45
28
|
export { CanvasDiscovery } from './discovery/CanvasDiscovery';
|
|
46
|
-
// Export execution validation
|
|
29
|
+
// Export execution validation (browser-safe - no Node.js dependencies)
|
|
47
30
|
export { ExecutionValidator, createExecutionValidator } from './execution/ExecutionValidator';
|
|
48
|
-
//
|
|
49
|
-
|
|
31
|
+
// NOTE: The following require Node.js dependencies and are NOT exported in the main bundle.
|
|
32
|
+
// Use '@principal-ai/principal-view-core/node' for Node.js-specific functionality:
|
|
33
|
+
//
|
|
34
|
+
// - EventProcessor, ValidationEngine, ConfigurationValidator (Node.js processing)
|
|
35
|
+
// - GraphInstrumentationHelper, PathBasedEventProcessor (Node.js utilities)
|
|
36
|
+
// - PathMatcher, GraphConverter (Node.js utilities)
|
|
37
|
+
// - EventValidator, createValidatedEmitter (Node.js telemetry)
|
|
38
|
+
// - analyzeCoverage (file system - uses fs/promises, path, glob)
|
|
39
|
+
// - generateTypes, TypeScriptGenerator, generatorRegistry (code generation - file system)
|
|
40
|
+
// - traceToCanvas, traceToCanvasJson (trace utilities)
|
|
41
|
+
// - SessionManager, EventRecorderService (session management)
|
|
42
|
+
// - ConfigurationLoader, LibraryLoader (file system loaders)
|
|
43
|
+
// - LibraryConverter (library utilities)
|
|
44
|
+
// - Rules engine (OpenTelemetry dependencies)
|
|
45
|
+
// - NarrativeValidator, createNarrativeValidator (Node.js validator)
|
|
46
|
+
// - ExecutionLoader, createExecutionLoader (file system loader)
|
|
47
|
+
//
|
|
48
|
+
// Example:
|
|
49
|
+
// import { ConfigurationLoader, analyzeCoverage } from '@principal-ai/principal-view-core/node';
|
|
50
50
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAkCH,oCAAoC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,2CAA2C;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAGtF,kDAAkD;AAClD,mEAAmE;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,cAAc,GACf,MAAM,8BAA8B,CAAC;AAiCtC,uDAAuD;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAa9D,uEAAuE;AACvE,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAO9F,4FAA4F;AAC5F,mFAAmF;AACnF,EAAE;AACF,kFAAkF;AAClF,4EAA4E;AAC5E,oDAAoD;AACpD,+DAA+D;AAC/D,iEAAiE;AACjE,0FAA0F;AAC1F,uDAAuD;AACvD,8DAA8D;AAC9D,6DAA6D;AAC7D,yCAAyC;AACzC,8CAA8C;AAC9C,qEAAqE;AACrE,gEAAgE;AAChE,EAAE;AACF,WAAW;AACX,iGAAiG"}
|
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @principal-ai/principal-view-core/node
|
|
3
|
+
* Node.js-specific exports (require Node.js runtime)
|
|
4
|
+
*
|
|
5
|
+
* This entry point includes all functionality that depends on Node.js modules
|
|
6
|
+
* such as fs, path, glob, and other Node.js-only dependencies.
|
|
7
|
+
*
|
|
8
|
+
* For browser environments, use:
|
|
9
|
+
* - '@principal-ai/principal-view-core/browser' for browser-safe functionality
|
|
10
|
+
*
|
|
11
|
+
* For Node.js environments, you can use either:
|
|
12
|
+
* - '@principal-ai/principal-view-core' for all functionality (browser + Node.js)
|
|
13
|
+
* - '@principal-ai/principal-view-core/node' for Node.js-specific functionality only
|
|
14
|
+
*/
|
|
15
|
+
export * from './types';
|
|
16
|
+
export { EventProcessor } from './EventProcessor';
|
|
17
|
+
export type { ProcessingResult } from './EventProcessor';
|
|
18
|
+
export { ValidationEngine } from './ValidationEngine';
|
|
19
|
+
export { ConfigurationValidator } from './ConfigurationValidator';
|
|
20
|
+
export type { ConfigurationValidationError, ConfigurationValidationResult, } from './ConfigurationValidator';
|
|
21
|
+
export { GraphInstrumentationHelper } from './helpers/GraphInstrumentationHelper';
|
|
22
|
+
export { PathBasedEventProcessor } from './PathBasedEventProcessor';
|
|
23
|
+
export type { LogEntry } from './PathBasedEventProcessor';
|
|
24
|
+
export { PathMatcher } from './utils/PathMatcher';
|
|
25
|
+
export { GraphConverter } from './utils/GraphConverter';
|
|
26
|
+
export * from './types/canvas';
|
|
27
|
+
export { CanvasConverter } from './utils/CanvasConverter';
|
|
28
|
+
export type { ReactFlowNode, ReactFlowEdge } from './utils/CanvasConverter';
|
|
29
|
+
export { EventValidator, createValidatedEmitter, EventValidationError } from './telemetry/event-validator';
|
|
30
|
+
export type { ValidationResult } from './telemetry/event-validator';
|
|
31
|
+
export { analyzeCoverage } from './telemetry/coverage';
|
|
32
|
+
export type { CoverageMetrics, NodeCoverage, CanvasNode as CoverageCanvasNode } from './telemetry/coverage';
|
|
33
|
+
export { generateTypes, TypeScriptGenerator, generatorRegistry } from './codegen/type-generator';
|
|
34
|
+
export type { CodegenOptions, CodegenResult, CodeGenerator } from './codegen/type-generator';
|
|
35
|
+
export { traceToCanvas, traceToCanvasJson } from './utils/TraceToCanvas';
|
|
36
|
+
export type { TraceSpan, TraceExport, TraceToCanvasOptions, TraceCanvasResult, } from './utils/TraceToCanvas';
|
|
37
|
+
export { SessionManager } from './SessionManager';
|
|
38
|
+
export type { SessionStatus, SessionResult, SessionMetadata, EventSession, CreateSessionOptions, EndSessionOptions, SessionChangeCallback, SessionManagerConfig, } from './SessionManager';
|
|
39
|
+
export { EventRecorderService } from './EventRecorderService';
|
|
40
|
+
export type { ProtocolMessageType, ProtocolMessage, SessionStartMessage, SessionEndMessage, LogMessage, LogBatchMessage, PingMessage, PongMessage, ErrorMessage, AckMessage, IncomingMessage, OutgoingMessage, RecordingMode, EventCallback, EventBatchCallback, ConnectionState, EventRecorderServiceConfig, } from './EventRecorderService';
|
|
41
|
+
export { ConfigurationLoader } from './ConfigurationLoader';
|
|
42
|
+
export type { ConfigurationFile, ConfigurationLoadResult } from './ConfigurationLoader';
|
|
43
|
+
export { parseYaml, isYamlFile, getConfigNameFromFilename } from './utils/YamlParser';
|
|
44
|
+
export type { YamlParseResult } from './utils/YamlParser';
|
|
45
|
+
export { LibraryLoader } from './LibraryLoader';
|
|
46
|
+
export { LibraryConverter } from './utils/LibraryConverter';
|
|
47
|
+
export type { CreateNodeOptions, CreateEdgeOptions } from './utils/LibraryConverter';
|
|
48
|
+
export type { FileSystemAdapter } from '@principal-ai/repository-abstraction';
|
|
49
|
+
export { InMemoryFileSystemAdapter } from '@principal-ai/repository-abstraction';
|
|
50
|
+
export * from './rules';
|
|
51
|
+
export { renderNarrative, parseTemplate, selectScenario, matchesCondition, hasEventMatching, computeAggregates, evaluateAssertion, getNestedValue, setNestedValue, createNarrativeValidator, NarrativeValidator, } from './narrative';
|
|
52
|
+
export type { NarrativeTemplate, NarrativeScenario, NarrativeMode, ScenarioCondition, ScenarioTemplate, Assertion, FlowDirective, LogTemplates, FormattingOptions, OtelEvent, OtelSignal, NarrativeContext, NarrativeResult, ScenarioMatchResult, SpanTreeNode, NarrativeValidationContext, NarrativeViolation, NarrativeValidationResult, } from './narrative';
|
|
53
|
+
export { CanvasDiscovery } from './discovery/CanvasDiscovery';
|
|
54
|
+
export type { DiscoveredCanvas, DiscoveredExecution, CanvasDiscoveryResult, DiscoveryOptions, CanvasType, ExecutionType, DiscoveredCanvasWithContent, DiscoveredExecutionWithContent, CanvasDiscoveryResultWithContent, } from './discovery/types';
|
|
55
|
+
export { ExecutionValidator, createExecutionValidator } from './execution/ExecutionValidator';
|
|
56
|
+
export type { ExecutionData, ValidationError, ExecutionValidationResult, } from './execution/ExecutionValidator';
|
|
57
|
+
export { ExecutionLoader, createExecutionLoader } from './execution/ExecutionLoader';
|
|
58
|
+
export type { ExecutionFile, ExecutionLoadResult, } from './execution/ExecutionLoader';
|
|
59
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/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ChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,0BAA0B,EAC1B,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,2BAA2B,EAC3B,8BAA8B,EAC9B,gCAAgC,GACjC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC9F,YAAY,EACV,aAAa,EACb,eAAe,EACf,yBAAyB,GAC1B,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACrF,YAAY,EACV,aAAa,EACb,mBAAmB,GACpB,MAAM,6BAA6B,CAAC"}
|
package/dist/node.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @principal-ai/principal-view-core/node
|
|
3
|
+
* Node.js-specific exports (require Node.js runtime)
|
|
4
|
+
*
|
|
5
|
+
* This entry point includes all functionality that depends on Node.js modules
|
|
6
|
+
* such as fs, path, glob, and other Node.js-only dependencies.
|
|
7
|
+
*
|
|
8
|
+
* For browser environments, use:
|
|
9
|
+
* - '@principal-ai/principal-view-core/browser' for browser-safe functionality
|
|
10
|
+
*
|
|
11
|
+
* For Node.js environments, you can use either:
|
|
12
|
+
* - '@principal-ai/principal-view-core' for all functionality (browser + Node.js)
|
|
13
|
+
* - '@principal-ai/principal-view-core/node' for Node.js-specific functionality only
|
|
14
|
+
*/
|
|
15
|
+
// Export all types (safe in all environments)
|
|
16
|
+
export * from './types';
|
|
17
|
+
// Export core classes (Node.js processing)
|
|
18
|
+
export { EventProcessor } from './EventProcessor';
|
|
19
|
+
export { ValidationEngine } from './ValidationEngine';
|
|
20
|
+
export { ConfigurationValidator } from './ConfigurationValidator';
|
|
21
|
+
// Export helpers
|
|
22
|
+
export { GraphInstrumentationHelper } from './helpers/GraphInstrumentationHelper';
|
|
23
|
+
// Export path-based processing (Milestone 1 & 2)
|
|
24
|
+
export { PathBasedEventProcessor } from './PathBasedEventProcessor';
|
|
25
|
+
// Export path utilities
|
|
26
|
+
export { PathMatcher } from './utils/PathMatcher';
|
|
27
|
+
export { GraphConverter } from './utils/GraphConverter';
|
|
28
|
+
// Export Canvas types and converter
|
|
29
|
+
export * from './types/canvas';
|
|
30
|
+
export { CanvasConverter } from './utils/CanvasConverter';
|
|
31
|
+
// Export telemetry event validation
|
|
32
|
+
export { EventValidator, createValidatedEmitter, EventValidationError } from './telemetry/event-validator';
|
|
33
|
+
// Export telemetry coverage analysis (Node.js only - uses fs/promises, path, glob)
|
|
34
|
+
export { analyzeCoverage } from './telemetry/coverage';
|
|
35
|
+
// Export code generation (Node.js only - file system operations)
|
|
36
|
+
export { generateTypes, TypeScriptGenerator, generatorRegistry } from './codegen/type-generator';
|
|
37
|
+
// Export trace-to-canvas conversion
|
|
38
|
+
export { traceToCanvas, traceToCanvasJson } from './utils/TraceToCanvas';
|
|
39
|
+
// Export session management (Event Recording System)
|
|
40
|
+
export { SessionManager } from './SessionManager';
|
|
41
|
+
// Export event recorder service
|
|
42
|
+
export { EventRecorderService } from './EventRecorderService';
|
|
43
|
+
// Export configuration loading (Node.js only - file system)
|
|
44
|
+
export { ConfigurationLoader } from './ConfigurationLoader';
|
|
45
|
+
export { parseYaml, isYamlFile, getConfigNameFromFilename } from './utils/YamlParser';
|
|
46
|
+
// Export component library support (Node.js only - file system)
|
|
47
|
+
export { LibraryLoader } from './LibraryLoader';
|
|
48
|
+
export { LibraryConverter } from './utils/LibraryConverter';
|
|
49
|
+
export { InMemoryFileSystemAdapter } from '@principal-ai/repository-abstraction';
|
|
50
|
+
// Export rules engine (Node.js only - OpenTelemetry dependencies)
|
|
51
|
+
export * from './rules';
|
|
52
|
+
// Export narrative template system (full system including Node.js validator)
|
|
53
|
+
export { renderNarrative, parseTemplate, selectScenario, matchesCondition, hasEventMatching, computeAggregates, evaluateAssertion, getNestedValue, setNestedValue, createNarrativeValidator, NarrativeValidator, } from './narrative';
|
|
54
|
+
// Export canvas and execution discovery
|
|
55
|
+
export { CanvasDiscovery } from './discovery/CanvasDiscovery';
|
|
56
|
+
// Export execution validation
|
|
57
|
+
export { ExecutionValidator, createExecutionValidator } from './execution/ExecutionValidator';
|
|
58
|
+
// Export execution loading (Node.js only - file system)
|
|
59
|
+
export { ExecutionLoader, createExecutionLoader } from './execution/ExecutionLoader';
|
|
60
|
+
//# sourceMappingURL=node.js.map
|
package/dist/node.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,8CAA8C;AAC9C,cAAc,SAAS,CAAC;AAExB,2CAA2C;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAMlE,iBAAiB;AACjB,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,iDAAiD;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,wBAAwB;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,qB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,6BAA6B,CAAC;AAa9D,8BAA8B;AAC9B,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAO9F,wDAAwD;AACxD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@principal-ai/principal-view-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Core logic and types for graph-based principal view framework",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -16,6 +16,12 @@
|
|
|
16
16
|
"import": "./dist/browser.js",
|
|
17
17
|
"require": "./dist/browser.js",
|
|
18
18
|
"default": "./dist/browser.js"
|
|
19
|
+
},
|
|
20
|
+
"./node": {
|
|
21
|
+
"types": "./dist/node.d.ts",
|
|
22
|
+
"import": "./dist/node.js",
|
|
23
|
+
"require": "./dist/node.js",
|
|
24
|
+
"default": "./dist/node.js"
|
|
19
25
|
}
|
|
20
26
|
},
|
|
21
27
|
"files": [
|
package/src/index.ts
CHANGED
|
@@ -1,117 +1,66 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @principal-ai/principal-view-core
|
|
3
|
-
*
|
|
3
|
+
* Browser-safe exports (no Node.js dependencies)
|
|
4
|
+
*
|
|
5
|
+
* This is the main entry point for the package and only includes browser-compatible code.
|
|
6
|
+
* Includes types, canvas utilities, YAML parsing, and narrative rendering.
|
|
7
|
+
*
|
|
8
|
+
* BREAKING CHANGE (v0.12.0):
|
|
9
|
+
* The main export now only includes browser-safe functionality.
|
|
10
|
+
*
|
|
11
|
+
* For Node.js-specific functionality (file system, code generation, rules engine, etc.), use:
|
|
12
|
+
* import { ... } from '@principal-ai/principal-view-core/node'
|
|
13
|
+
*
|
|
14
|
+
* For explicit browser usage (same as main export):
|
|
15
|
+
* import { ... } from '@principal-ai/principal-view-core/browser'
|
|
4
16
|
*/
|
|
5
17
|
|
|
6
|
-
// Export
|
|
7
|
-
export * from './types';
|
|
8
|
-
|
|
9
|
-
// Export core classes
|
|
10
|
-
export { EventProcessor } from './EventProcessor';
|
|
11
|
-
export type { ProcessingResult } from './EventProcessor';
|
|
12
|
-
|
|
13
|
-
export { ValidationEngine } from './ValidationEngine';
|
|
14
|
-
|
|
15
|
-
export { ConfigurationValidator } from './ConfigurationValidator';
|
|
18
|
+
// Export essential types only
|
|
16
19
|
export type {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
GraphConfiguration,
|
|
21
|
+
NodeState,
|
|
22
|
+
EdgeState,
|
|
23
|
+
NodeTypeDefinition,
|
|
24
|
+
EdgeTypeDefinition,
|
|
25
|
+
Violation,
|
|
26
|
+
GraphEvent,
|
|
27
|
+
NodeEvent,
|
|
28
|
+
EdgeEvent,
|
|
29
|
+
StateEvent,
|
|
30
|
+
ComponentLibrary,
|
|
31
|
+
LogLevel,
|
|
32
|
+
GraphMetrics,
|
|
33
|
+
Warning,
|
|
34
|
+
ValidationResult,
|
|
35
|
+
EventStream,
|
|
36
|
+
ConnectionRule,
|
|
37
|
+
LibraryNodeComponent,
|
|
38
|
+
LibraryEdgeComponent,
|
|
39
|
+
ComponentActivityEvent,
|
|
40
|
+
ComponentActionEvent,
|
|
41
|
+
EdgeAnimationEvent,
|
|
42
|
+
PathBasedEvent,
|
|
43
|
+
JsonValue,
|
|
44
|
+
JsonObject,
|
|
45
|
+
} from './types';
|
|
46
|
+
|
|
47
|
+
// Export types from ConfigurationLoader (interfaces only, no implementation)
|
|
48
|
+
export type { ConfigurationFile, ConfigurationLoadResult } from './ConfigurationLoader';
|
|
31
49
|
|
|
32
50
|
// Export Canvas types and converter
|
|
33
51
|
export * from './types/canvas';
|
|
34
52
|
export { CanvasConverter } from './utils/CanvasConverter';
|
|
35
53
|
export type { ReactFlowNode, ReactFlowEdge } from './utils/CanvasConverter';
|
|
36
54
|
|
|
37
|
-
// Export
|
|
38
|
-
export { EventValidator, createValidatedEmitter, EventValidationError } from './telemetry/event-validator';
|
|
39
|
-
export type { ValidationResult } from './telemetry/event-validator';
|
|
40
|
-
|
|
41
|
-
// Export telemetry coverage analysis
|
|
42
|
-
export { analyzeCoverage } from './telemetry/coverage';
|
|
43
|
-
export type { CoverageMetrics, NodeCoverage, CanvasNode as CoverageCanvasNode } from './telemetry/coverage';
|
|
44
|
-
|
|
45
|
-
// Export code generation
|
|
46
|
-
export { generateTypes, TypeScriptGenerator, generatorRegistry } from './codegen/type-generator';
|
|
47
|
-
export type { CodegenOptions, CodegenResult, CodeGenerator } from './codegen/type-generator';
|
|
48
|
-
|
|
49
|
-
// Export trace-to-canvas conversion
|
|
50
|
-
export { traceToCanvas, traceToCanvasJson } from './utils/TraceToCanvas';
|
|
51
|
-
export type {
|
|
52
|
-
TraceSpan,
|
|
53
|
-
TraceExport,
|
|
54
|
-
TraceToCanvasOptions,
|
|
55
|
-
TraceCanvasResult,
|
|
56
|
-
} from './utils/TraceToCanvas';
|
|
57
|
-
|
|
58
|
-
// Export session management (Event Recording System)
|
|
59
|
-
export { SessionManager } from './SessionManager';
|
|
60
|
-
export type {
|
|
61
|
-
SessionStatus,
|
|
62
|
-
SessionResult,
|
|
63
|
-
SessionMetadata,
|
|
64
|
-
EventSession,
|
|
65
|
-
CreateSessionOptions,
|
|
66
|
-
EndSessionOptions,
|
|
67
|
-
SessionChangeCallback,
|
|
68
|
-
SessionManagerConfig,
|
|
69
|
-
} from './SessionManager';
|
|
70
|
-
|
|
71
|
-
// Export event recorder service
|
|
72
|
-
export { EventRecorderService } from './EventRecorderService';
|
|
73
|
-
export type {
|
|
74
|
-
ProtocolMessageType,
|
|
75
|
-
ProtocolMessage,
|
|
76
|
-
SessionStartMessage,
|
|
77
|
-
SessionEndMessage,
|
|
78
|
-
LogMessage,
|
|
79
|
-
LogBatchMessage,
|
|
80
|
-
PingMessage,
|
|
81
|
-
PongMessage,
|
|
82
|
-
ErrorMessage,
|
|
83
|
-
AckMessage,
|
|
84
|
-
IncomingMessage,
|
|
85
|
-
OutgoingMessage,
|
|
86
|
-
RecordingMode,
|
|
87
|
-
EventCallback,
|
|
88
|
-
EventBatchCallback,
|
|
89
|
-
ConnectionState,
|
|
90
|
-
EventRecorderServiceConfig,
|
|
91
|
-
} from './EventRecorderService';
|
|
92
|
-
|
|
93
|
-
// Export configuration loading (Phase 2: Multi-config support)
|
|
94
|
-
export { ConfigurationLoader } from './ConfigurationLoader';
|
|
95
|
-
export type { ConfigurationFile, ConfigurationLoadResult } from './ConfigurationLoader';
|
|
55
|
+
// Export YAML parsing (browser-compatible)
|
|
96
56
|
export { parseYaml, isYamlFile, getConfigNameFromFilename } from './utils/YamlParser';
|
|
97
57
|
export type { YamlParseResult } from './utils/YamlParser';
|
|
98
58
|
|
|
99
|
-
// Export
|
|
100
|
-
|
|
101
|
-
export {
|
|
102
|
-
export
|
|
103
|
-
|
|
104
|
-
// Re-export FileSystemAdapter from repository-abstraction
|
|
105
|
-
export type { FileSystemAdapter } from '@principal-ai/repository-abstraction';
|
|
106
|
-
export { InMemoryFileSystemAdapter } from '@principal-ai/repository-abstraction';
|
|
107
|
-
|
|
108
|
-
// Export rules engine
|
|
109
|
-
export * from './rules';
|
|
110
|
-
|
|
111
|
-
// Export narrative template system
|
|
59
|
+
// Export narrative template system (browser-safe)
|
|
60
|
+
// Import directly from files to avoid pulling in Node.js validator
|
|
61
|
+
export { renderNarrative } from './narrative/template-renderer';
|
|
62
|
+
export { parseTemplate } from './narrative/template-parser';
|
|
112
63
|
export {
|
|
113
|
-
renderNarrative,
|
|
114
|
-
parseTemplate,
|
|
115
64
|
selectScenario,
|
|
116
65
|
matchesCondition,
|
|
117
66
|
hasEventMatching,
|
|
@@ -119,9 +68,7 @@ export {
|
|
|
119
68
|
evaluateAssertion,
|
|
120
69
|
getNestedValue,
|
|
121
70
|
setNestedValue,
|
|
122
|
-
|
|
123
|
-
NarrativeValidator,
|
|
124
|
-
} from './narrative';
|
|
71
|
+
} from './narrative/scenario-matcher';
|
|
125
72
|
export type {
|
|
126
73
|
NarrativeTemplate,
|
|
127
74
|
NarrativeScenario,
|
|
@@ -138,12 +85,23 @@ export type {
|
|
|
138
85
|
NarrativeResult,
|
|
139
86
|
ScenarioMatchResult,
|
|
140
87
|
SpanTreeNode,
|
|
141
|
-
|
|
142
|
-
NarrativeViolation,
|
|
143
|
-
NarrativeValidationResult,
|
|
144
|
-
} from './narrative';
|
|
88
|
+
} from './narrative/types';
|
|
145
89
|
|
|
146
|
-
// Export
|
|
90
|
+
// Export OTEL types
|
|
91
|
+
export type {
|
|
92
|
+
OtelAttributes,
|
|
93
|
+
OtelAttributeValue,
|
|
94
|
+
OtelLog,
|
|
95
|
+
OtelSpan,
|
|
96
|
+
OtelResource,
|
|
97
|
+
OtelSeverity,
|
|
98
|
+
OtelSeverityText,
|
|
99
|
+
OtelSeverityNumber,
|
|
100
|
+
OtelSpanKind,
|
|
101
|
+
OtelSpanStatus,
|
|
102
|
+
} from './types/otel';
|
|
103
|
+
|
|
104
|
+
// Export canvas and execution discovery (browser-safe)
|
|
147
105
|
export { CanvasDiscovery } from './discovery/CanvasDiscovery';
|
|
148
106
|
export type {
|
|
149
107
|
DiscoveredCanvas,
|
|
@@ -157,7 +115,7 @@ export type {
|
|
|
157
115
|
CanvasDiscoveryResultWithContent,
|
|
158
116
|
} from './discovery/types';
|
|
159
117
|
|
|
160
|
-
// Export execution validation
|
|
118
|
+
// Export execution validation (browser-safe - no Node.js dependencies)
|
|
161
119
|
export { ExecutionValidator, createExecutionValidator } from './execution/ExecutionValidator';
|
|
162
120
|
export type {
|
|
163
121
|
ExecutionData,
|
|
@@ -165,9 +123,22 @@ export type {
|
|
|
165
123
|
ExecutionValidationResult,
|
|
166
124
|
} from './execution/ExecutionValidator';
|
|
167
125
|
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
126
|
+
// NOTE: The following require Node.js dependencies and are NOT exported in the main bundle.
|
|
127
|
+
// Use '@principal-ai/principal-view-core/node' for Node.js-specific functionality:
|
|
128
|
+
//
|
|
129
|
+
// - EventProcessor, ValidationEngine, ConfigurationValidator (Node.js processing)
|
|
130
|
+
// - GraphInstrumentationHelper, PathBasedEventProcessor (Node.js utilities)
|
|
131
|
+
// - PathMatcher, GraphConverter (Node.js utilities)
|
|
132
|
+
// - EventValidator, createValidatedEmitter (Node.js telemetry)
|
|
133
|
+
// - analyzeCoverage (file system - uses fs/promises, path, glob)
|
|
134
|
+
// - generateTypes, TypeScriptGenerator, generatorRegistry (code generation - file system)
|
|
135
|
+
// - traceToCanvas, traceToCanvasJson (trace utilities)
|
|
136
|
+
// - SessionManager, EventRecorderService (session management)
|
|
137
|
+
// - ConfigurationLoader, LibraryLoader (file system loaders)
|
|
138
|
+
// - LibraryConverter (library utilities)
|
|
139
|
+
// - Rules engine (OpenTelemetry dependencies)
|
|
140
|
+
// - NarrativeValidator, createNarrativeValidator (Node.js validator)
|
|
141
|
+
// - ExecutionLoader, createExecutionLoader (file system loader)
|
|
142
|
+
//
|
|
143
|
+
// Example:
|
|
144
|
+
// import { ConfigurationLoader, analyzeCoverage } from '@principal-ai/principal-view-core/node';
|
package/src/node.ts
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @principal-ai/principal-view-core/node
|
|
3
|
+
* Node.js-specific exports (require Node.js runtime)
|
|
4
|
+
*
|
|
5
|
+
* This entry point includes all functionality that depends on Node.js modules
|
|
6
|
+
* such as fs, path, glob, and other Node.js-only dependencies.
|
|
7
|
+
*
|
|
8
|
+
* For browser environments, use:
|
|
9
|
+
* - '@principal-ai/principal-view-core/browser' for browser-safe functionality
|
|
10
|
+
*
|
|
11
|
+
* For Node.js environments, you can use either:
|
|
12
|
+
* - '@principal-ai/principal-view-core' for all functionality (browser + Node.js)
|
|
13
|
+
* - '@principal-ai/principal-view-core/node' for Node.js-specific functionality only
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// Export all types (safe in all environments)
|
|
17
|
+
export * from './types';
|
|
18
|
+
|
|
19
|
+
// Export core classes (Node.js processing)
|
|
20
|
+
export { EventProcessor } from './EventProcessor';
|
|
21
|
+
export type { ProcessingResult } from './EventProcessor';
|
|
22
|
+
|
|
23
|
+
export { ValidationEngine } from './ValidationEngine';
|
|
24
|
+
|
|
25
|
+
export { ConfigurationValidator } from './ConfigurationValidator';
|
|
26
|
+
export type {
|
|
27
|
+
ConfigurationValidationError,
|
|
28
|
+
ConfigurationValidationResult,
|
|
29
|
+
} from './ConfigurationValidator';
|
|
30
|
+
|
|
31
|
+
// Export helpers
|
|
32
|
+
export { GraphInstrumentationHelper } from './helpers/GraphInstrumentationHelper';
|
|
33
|
+
|
|
34
|
+
// Export path-based processing (Milestone 1 & 2)
|
|
35
|
+
export { PathBasedEventProcessor } from './PathBasedEventProcessor';
|
|
36
|
+
export type { LogEntry } from './PathBasedEventProcessor';
|
|
37
|
+
|
|
38
|
+
// Export path utilities
|
|
39
|
+
export { PathMatcher } from './utils/PathMatcher';
|
|
40
|
+
export { GraphConverter } from './utils/GraphConverter';
|
|
41
|
+
|
|
42
|
+
// Export Canvas types and converter
|
|
43
|
+
export * from './types/canvas';
|
|
44
|
+
export { CanvasConverter } from './utils/CanvasConverter';
|
|
45
|
+
export type { ReactFlowNode, ReactFlowEdge } from './utils/CanvasConverter';
|
|
46
|
+
|
|
47
|
+
// Export telemetry event validation
|
|
48
|
+
export { EventValidator, createValidatedEmitter, EventValidationError } from './telemetry/event-validator';
|
|
49
|
+
export type { ValidationResult } from './telemetry/event-validator';
|
|
50
|
+
|
|
51
|
+
// Export telemetry coverage analysis (Node.js only - uses fs/promises, path, glob)
|
|
52
|
+
export { analyzeCoverage } from './telemetry/coverage';
|
|
53
|
+
export type { CoverageMetrics, NodeCoverage, CanvasNode as CoverageCanvasNode } from './telemetry/coverage';
|
|
54
|
+
|
|
55
|
+
// Export code generation (Node.js only - file system operations)
|
|
56
|
+
export { generateTypes, TypeScriptGenerator, generatorRegistry } from './codegen/type-generator';
|
|
57
|
+
export type { CodegenOptions, CodegenResult, CodeGenerator } from './codegen/type-generator';
|
|
58
|
+
|
|
59
|
+
// Export trace-to-canvas conversion
|
|
60
|
+
export { traceToCanvas, traceToCanvasJson } from './utils/TraceToCanvas';
|
|
61
|
+
export type {
|
|
62
|
+
TraceSpan,
|
|
63
|
+
TraceExport,
|
|
64
|
+
TraceToCanvasOptions,
|
|
65
|
+
TraceCanvasResult,
|
|
66
|
+
} from './utils/TraceToCanvas';
|
|
67
|
+
|
|
68
|
+
// Export session management (Event Recording System)
|
|
69
|
+
export { SessionManager } from './SessionManager';
|
|
70
|
+
export type {
|
|
71
|
+
SessionStatus,
|
|
72
|
+
SessionResult,
|
|
73
|
+
SessionMetadata,
|
|
74
|
+
EventSession,
|
|
75
|
+
CreateSessionOptions,
|
|
76
|
+
EndSessionOptions,
|
|
77
|
+
SessionChangeCallback,
|
|
78
|
+
SessionManagerConfig,
|
|
79
|
+
} from './SessionManager';
|
|
80
|
+
|
|
81
|
+
// Export event recorder service
|
|
82
|
+
export { EventRecorderService } from './EventRecorderService';
|
|
83
|
+
export type {
|
|
84
|
+
ProtocolMessageType,
|
|
85
|
+
ProtocolMessage,
|
|
86
|
+
SessionStartMessage,
|
|
87
|
+
SessionEndMessage,
|
|
88
|
+
LogMessage,
|
|
89
|
+
LogBatchMessage,
|
|
90
|
+
PingMessage,
|
|
91
|
+
PongMessage,
|
|
92
|
+
ErrorMessage,
|
|
93
|
+
AckMessage,
|
|
94
|
+
IncomingMessage,
|
|
95
|
+
OutgoingMessage,
|
|
96
|
+
RecordingMode,
|
|
97
|
+
EventCallback,
|
|
98
|
+
EventBatchCallback,
|
|
99
|
+
ConnectionState,
|
|
100
|
+
EventRecorderServiceConfig,
|
|
101
|
+
} from './EventRecorderService';
|
|
102
|
+
|
|
103
|
+
// Export configuration loading (Node.js only - file system)
|
|
104
|
+
export { ConfigurationLoader } from './ConfigurationLoader';
|
|
105
|
+
export type { ConfigurationFile, ConfigurationLoadResult } from './ConfigurationLoader';
|
|
106
|
+
export { parseYaml, isYamlFile, getConfigNameFromFilename } from './utils/YamlParser';
|
|
107
|
+
export type { YamlParseResult } from './utils/YamlParser';
|
|
108
|
+
|
|
109
|
+
// Export component library support (Node.js only - file system)
|
|
110
|
+
export { LibraryLoader } from './LibraryLoader';
|
|
111
|
+
export { LibraryConverter } from './utils/LibraryConverter';
|
|
112
|
+
export type { CreateNodeOptions, CreateEdgeOptions } from './utils/LibraryConverter';
|
|
113
|
+
|
|
114
|
+
// Re-export FileSystemAdapter from repository-abstraction
|
|
115
|
+
export type { FileSystemAdapter } from '@principal-ai/repository-abstraction';
|
|
116
|
+
export { InMemoryFileSystemAdapter } from '@principal-ai/repository-abstraction';
|
|
117
|
+
|
|
118
|
+
// Export rules engine (Node.js only - OpenTelemetry dependencies)
|
|
119
|
+
export * from './rules';
|
|
120
|
+
|
|
121
|
+
// Export narrative template system (full system including Node.js validator)
|
|
122
|
+
export {
|
|
123
|
+
renderNarrative,
|
|
124
|
+
parseTemplate,
|
|
125
|
+
selectScenario,
|
|
126
|
+
matchesCondition,
|
|
127
|
+
hasEventMatching,
|
|
128
|
+
computeAggregates,
|
|
129
|
+
evaluateAssertion,
|
|
130
|
+
getNestedValue,
|
|
131
|
+
setNestedValue,
|
|
132
|
+
createNarrativeValidator,
|
|
133
|
+
NarrativeValidator,
|
|
134
|
+
} from './narrative';
|
|
135
|
+
export type {
|
|
136
|
+
NarrativeTemplate,
|
|
137
|
+
NarrativeScenario,
|
|
138
|
+
NarrativeMode,
|
|
139
|
+
ScenarioCondition,
|
|
140
|
+
ScenarioTemplate,
|
|
141
|
+
Assertion,
|
|
142
|
+
FlowDirective,
|
|
143
|
+
LogTemplates,
|
|
144
|
+
FormattingOptions,
|
|
145
|
+
OtelEvent,
|
|
146
|
+
OtelSignal,
|
|
147
|
+
NarrativeContext,
|
|
148
|
+
NarrativeResult,
|
|
149
|
+
ScenarioMatchResult,
|
|
150
|
+
SpanTreeNode,
|
|
151
|
+
NarrativeValidationContext,
|
|
152
|
+
NarrativeViolation,
|
|
153
|
+
NarrativeValidationResult,
|
|
154
|
+
} from './narrative';
|
|
155
|
+
|
|
156
|
+
// Export canvas and execution discovery
|
|
157
|
+
export { CanvasDiscovery } from './discovery/CanvasDiscovery';
|
|
158
|
+
export type {
|
|
159
|
+
DiscoveredCanvas,
|
|
160
|
+
DiscoveredExecution,
|
|
161
|
+
CanvasDiscoveryResult,
|
|
162
|
+
DiscoveryOptions,
|
|
163
|
+
CanvasType,
|
|
164
|
+
ExecutionType,
|
|
165
|
+
DiscoveredCanvasWithContent,
|
|
166
|
+
DiscoveredExecutionWithContent,
|
|
167
|
+
CanvasDiscoveryResultWithContent,
|
|
168
|
+
} from './discovery/types';
|
|
169
|
+
|
|
170
|
+
// Export execution validation
|
|
171
|
+
export { ExecutionValidator, createExecutionValidator } from './execution/ExecutionValidator';
|
|
172
|
+
export type {
|
|
173
|
+
ExecutionData,
|
|
174
|
+
ValidationError,
|
|
175
|
+
ExecutionValidationResult,
|
|
176
|
+
} from './execution/ExecutionValidator';
|
|
177
|
+
|
|
178
|
+
// Export execution loading (Node.js only - file system)
|
|
179
|
+
export { ExecutionLoader, createExecutionLoader } from './execution/ExecutionLoader';
|
|
180
|
+
export type {
|
|
181
|
+
ExecutionFile,
|
|
182
|
+
ExecutionLoadResult,
|
|
183
|
+
} from './execution/ExecutionLoader';
|