@cratis/screenplay-language 4.124.0 → 4.124.1
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 +50 -0
- package/dist/bundles/TypeReferenceSymbol.js +2 -0
- package/dist/bundles/TypeReferenceSymbol.js.map +1 -0
- package/dist/bundles/_virtual/_virtual/_rolldown/runtime.js +1 -0
- package/dist/bundles/bmp-word-characters.js +2 -0
- package/dist/bundles/bmp-word-characters.js.map +1 -0
- package/dist/bundles/case-authoring.js +3 -0
- package/dist/bundles/case-authoring.js.map +1 -0
- package/dist/bundles/code-actions.js +2 -0
- package/dist/bundles/code-actions.js.map +1 -0
- package/dist/bundles/compiler/Authoring/QuickFixes.js +5 -0
- package/dist/bundles/compiler/Authoring/QuickFixes.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/DeclaredDependencies.js +2 -0
- package/dist/bundles/compiler/Dependencies/DeclaredDependencies.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/DeclaredDependencyTargets.js +2 -0
- package/dist/bundles/compiler/Dependencies/DeclaredDependencyTargets.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/DependencyGraph.js +2 -0
- package/dist/bundles/compiler/Dependencies/DependencyGraph.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/DependencyKind.js +2 -0
- package/dist/bundles/compiler/Dependencies/DependencyKind.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/InvalidDependencyQuery.js +2 -0
- package/dist/bundles/compiler/Dependencies/InvalidDependencyQuery.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/SliceReferences.js +2 -0
- package/dist/bundles/compiler/Dependencies/SliceReferences.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/StronglyConnectedGroups.js +2 -0
- package/dist/bundles/compiler/Dependencies/StronglyConnectedGroups.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/index.js +1 -0
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +2 -0
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -0
- package/dist/bundles/compiler/Diagnostics/ProductionDestinationDiagnostics.js +2 -0
- package/dist/bundles/compiler/Diagnostics/ProductionDestinationDiagnostics.js.map +1 -0
- package/dist/bundles/compiler/Diagnostics/SourceLocation.js +2 -0
- package/dist/bundles/compiler/Diagnostics/SourceLocation.js.map +1 -0
- package/dist/bundles/compiler/Files/AuthoredOrder.js +2 -0
- package/dist/bundles/compiler/Files/AuthoredOrder.js.map +1 -0
- package/dist/bundles/compiler/Files/OrderingRoot.js +1 -0
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js +2 -0
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js.map +1 -0
- package/dist/bundles/compiler/Files/PlayFolderMerge.js +2 -0
- package/dist/bundles/compiler/Files/PlayFolderMerge.js.map +1 -0
- package/dist/bundles/compiler/Files/PlayImports.js +1 -0
- package/dist/bundles/compiler/Files/PlayPlacement.js +2 -0
- package/dist/bundles/compiler/Files/PlayPlacement.js.map +1 -0
- package/dist/bundles/compiler/Files/TimelineOrder.js +2 -0
- package/dist/bundles/compiler/Files/TimelineOrder.js.map +1 -0
- package/dist/bundles/compiler/Parsing/AuthorizeParser.js +2 -0
- package/dist/bundles/compiler/Parsing/AuthorizeParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CaptureParser.js +2 -0
- package/dist/bundles/compiler/Parsing/CaptureParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CodeBlockParser.js +3 -0
- package/dist/bundles/compiler/Parsing/CodeBlockParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CommandDestinationTypes.js +2 -0
- package/dist/bundles/compiler/Parsing/CommandDestinationTypes.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CommandParser.js +2 -0
- package/dist/bundles/compiler/Parsing/CommandParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CommandReadSources.js +2 -0
- package/dist/bundles/compiler/Parsing/CommandReadSources.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CommandResponseParser.js +2 -0
- package/dist/bundles/compiler/Parsing/CommandResponseParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CommandStreamCandidates.js +2 -0
- package/dist/bundles/compiler/Parsing/CommandStreamCandidates.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CompositeStreamIdValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/CompositeStreamIdValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CompositionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/CompositionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ConceptComplianceParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ConceptComplianceParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ConditionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ConditionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ConstraintParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ConstraintParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ConstraintPropertyValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/ConstraintPropertyValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/DeclarationParsers.js +2 -0
- package/dist/bundles/compiler/Parsing/DeclarationParsers.js.map +1 -0
- package/dist/bundles/compiler/Parsing/DependencySourceParser.js +2 -0
- package/dist/bundles/compiler/Parsing/DependencySourceParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/DependsOnParser.js +2 -0
- package/dist/bundles/compiler/Parsing/DependsOnParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/DescriptionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/DescriptionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/DocumentationParser.js +2 -0
- package/dist/bundles/compiler/Parsing/DocumentationParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/EventMetadataParser.js +2 -0
- package/dist/bundles/compiler/Parsing/EventMetadataParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/EventSourceParser.js +2 -0
- package/dist/bundles/compiler/Parsing/EventSourceParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/EventSourceValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/EventSourceValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/EventSubjectValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/EventSubjectValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ExpressionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ExpressionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/FeatureBody.js +2 -0
- package/dist/bundles/compiler/Parsing/FeatureBody.js.map +1 -0
- package/dist/bundles/compiler/Parsing/FileImportParser.js +2 -0
- package/dist/bundles/compiler/Parsing/FileImportParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/FileReferences.js +2 -0
- package/dist/bundles/compiler/Parsing/FileReferences.js.map +1 -0
- package/dist/bundles/compiler/Parsing/GuardedActionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/GuardedActionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/GuardedActionShadowing.js +2 -0
- package/dist/bundles/compiler/Parsing/GuardedActionShadowing.js.map +1 -0
- package/dist/bundles/compiler/Parsing/GuardedActionValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/GuardedActionValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/IdentifierComplianceValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/IdentifierComplianceValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/IdentityParser.js +2 -0
- package/dist/bundles/compiler/Parsing/IdentityParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/IdentityValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/IdentityValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ImplementationParser.js +3 -0
- package/dist/bundles/compiler/Parsing/ImplementationParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ImportDiscovery.js +1 -0
- package/dist/bundles/compiler/Parsing/InlineEventValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/InlineEventValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/InputUses.js +2 -0
- package/dist/bundles/compiler/Parsing/InputUses.js.map +1 -0
- package/dist/bundles/compiler/Parsing/InteractionAlternatives.js +2 -0
- package/dist/bundles/compiler/Parsing/InteractionAlternatives.js.map +1 -0
- package/dist/bundles/compiler/Parsing/LineReader.js +2 -0
- package/dist/bundles/compiler/Parsing/LineReader.js.map +1 -0
- package/dist/bundles/compiler/Parsing/LineText.js +2 -0
- package/dist/bundles/compiler/Parsing/LineText.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ModuleBody.js +2 -0
- package/dist/bundles/compiler/Parsing/ModuleBody.js.map +1 -0
- package/dist/bundles/compiler/Parsing/OperationParser.js +2 -0
- package/dist/bundles/compiler/Parsing/OperationParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/OperationValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/OperationValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ParserContext.js +2 -0
- package/dist/bundles/compiler/Parsing/ParserContext.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PersonaCallerValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/PersonaCallerValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PolicyParser.js +2 -0
- package/dist/bundles/compiler/Parsing/PolicyParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ProducesParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ProducesParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ProjectionExpressionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ProjectionExpressionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ProjectionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ProjectionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ProjectionTargetValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/ProjectionTargetValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PropertyLineParser.js +2 -0
- package/dist/bundles/compiler/Parsing/PropertyLineParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PublicEventMetadataValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/PublicEventMetadataValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PublicEventUsageCollector.js +2 -0
- package/dist/bundles/compiler/Parsing/PublicEventUsageCollector.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PublicEventUsageValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/PublicEventUsageValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PurposeParser.js +2 -0
- package/dist/bundles/compiler/Parsing/PurposeParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PurposeValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/PurposeValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/QueryParser.js +2 -0
- package/dist/bundles/compiler/Parsing/QueryParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ReactionIdentityParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ReactionIdentityParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ReactionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ReactionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ReactionRefusalValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/ReactionRefusalValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/RedeliveryValues.js +2 -0
- package/dist/bundles/compiler/Parsing/RedeliveryValues.js.map +1 -0
- package/dist/bundles/compiler/Parsing/RefusalDeclarations.js +2 -0
- package/dist/bundles/compiler/Parsing/RefusalDeclarations.js.map +1 -0
- package/dist/bundles/compiler/Parsing/RefusalValueWalker.js +2 -0
- package/dist/bundles/compiler/Parsing/RefusalValueWalker.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ResponseDateValues.js +2 -0
- package/dist/bundles/compiler/Parsing/ResponseDateValues.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ResponseValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/ResponseValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ScreenParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ScreenParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ScreenplayParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ScreenplayParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SeedParser.js +2 -0
- package/dist/bundles/compiler/Parsing/SeedParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SliceParser.js +2 -0
- package/dist/bundles/compiler/Parsing/SliceParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SourceLine.js +2 -0
- package/dist/bundles/compiler/Parsing/SourceLine.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SourceLineSplitter.js +3 -0
- package/dist/bundles/compiler/Parsing/SourceLineSplitter.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SourceOptionsParser.js +2 -0
- package/dist/bundles/compiler/Parsing/SourceOptionsParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationCaseParser.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationCaseParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationCaseValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationCaseValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationCommandExamples.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationCommandExamples.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationExampleParser.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationExampleParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationParser.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationRedeliveryValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationRedeliveryValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationResponseParser.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationResponseParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationRouteComparison.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationRouteComparison.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationStreamValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationStreamValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/StructuredValueParser.js +3 -0
- package/dist/bundles/compiler/Parsing/StructuredValueParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/TriggerDataParser.js +2 -0
- package/dist/bundles/compiler/Parsing/TriggerDataParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/UiBindingParser.js +2 -0
- package/dist/bundles/compiler/Parsing/UiBindingParser.js.map +1 -0
- package/dist/bundles/compiler/ScreenplayCompiler.js +2 -0
- package/dist/bundles/compiler/ScreenplayCompiler.js.map +1 -0
- package/dist/bundles/compiler/Syntax/AuthoringProductionResolver.js +2 -0
- package/dist/bundles/compiler/Syntax/AuthoringProductionResolver.js.map +1 -0
- package/dist/bundles/compiler/Syntax/CaptureEventsSource.js +2 -0
- package/dist/bundles/compiler/Syntax/CaptureEventsSource.js.map +1 -0
- package/dist/bundles/compiler/Syntax/DependencySources.js +2 -0
- package/dist/bundles/compiler/Syntax/DependencySources.js.map +1 -0
- package/dist/bundles/compiler/Syntax/EventDeclarations.js +2 -0
- package/dist/bundles/compiler/Syntax/EventDeclarations.js.map +1 -0
- package/dist/bundles/compiler/Syntax/EventSourceCatalog.js +2 -0
- package/dist/bundles/compiler/Syntax/EventSourceCatalog.js.map +1 -0
- package/dist/bundles/compiler/Syntax/EventSourceReadConfidence.js +2 -0
- package/dist/bundles/compiler/Syntax/EventSourceReadConfidence.js.map +1 -0
- package/dist/bundles/compiler/Syntax/ExactMathFacts.js +2 -0
- package/dist/bundles/compiler/Syntax/ExactMathFacts.js.map +1 -0
- package/dist/bundles/compiler/Syntax/ExactNumber.js +2 -0
- package/dist/bundles/compiler/Syntax/ExactNumber.js.map +1 -0
- package/dist/bundles/compiler/Syntax/InvalidSyntaxJson.js +2 -0
- package/dist/bundles/compiler/Syntax/InvalidSyntaxJson.js.map +1 -0
- package/dist/bundles/compiler/Syntax/LegacyWireProjection.js +2 -0
- package/dist/bundles/compiler/Syntax/LegacyWireProjection.js.map +1 -0
- package/dist/bundles/compiler/Syntax/Operations.js +2 -0
- package/dist/bundles/compiler/Syntax/Operations.js.map +1 -0
- package/dist/bundles/compiler/Syntax/PersonaCallers.js +2 -0
- package/dist/bundles/compiler/Syntax/PersonaCallers.js.map +1 -0
- package/dist/bundles/compiler/Syntax/ProductionDestinations.js +2 -0
- package/dist/bundles/compiler/Syntax/ProductionDestinations.js.map +1 -0
- package/dist/bundles/compiler/Syntax/PublicEventInvariants.js +2 -0
- package/dist/bundles/compiler/Syntax/PublicEventInvariants.js.map +1 -0
- package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js +2 -0
- package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js.map +1 -0
- package/dist/bundles/compiler/Syntax/SourceOptions.js +2 -0
- package/dist/bundles/compiler/Syntax/SourceOptions.js.map +1 -0
- package/dist/bundles/compiler/Syntax/SpecificationCaseOrigin.js +2 -0
- package/dist/bundles/compiler/Syntax/SpecificationCaseOrigin.js.map +1 -0
- package/dist/bundles/compiler/Syntax/StreamIdFormatter.js +2 -0
- package/dist/bundles/compiler/Syntax/StreamIdFormatter.js.map +1 -0
- package/dist/bundles/compiler/Syntax/StrictSyntaxJson.js +1 -0
- package/dist/bundles/compiler/Syntax/Structure.js +2 -0
- package/dist/bundles/compiler/Syntax/Structure.js.map +1 -0
- package/dist/bundles/compiler/Syntax/SyntaxCollections.js +2 -0
- package/dist/bundles/compiler/Syntax/SyntaxCollections.js.map +1 -0
- package/dist/bundles/compiler/Syntax/SyntaxInvariants.js +2 -0
- package/dist/bundles/compiler/Syntax/SyntaxInvariants.js.map +1 -0
- package/dist/bundles/compiler/Syntax/SyntaxJson.js +2 -0
- package/dist/bundles/compiler/Syntax/SyntaxJson.js.map +1 -0
- package/dist/bundles/compiler/Syntax/SyntaxMemberContracts.js +2 -0
- package/dist/bundles/compiler/Syntax/SyntaxMemberContracts.js.map +1 -0
- package/dist/bundles/compiler/Syntax/index.js +1 -0
- package/dist/bundles/compiler/Text/ImplementationHintText.js +2 -0
- package/dist/bundles/compiler/Text/ImplementationHintText.js.map +1 -0
- package/dist/bundles/compiler/Text/ReservedWords.js +2 -0
- package/dist/bundles/compiler/Text/ReservedWords.js.map +1 -0
- package/dist/bundles/compiler/Text/SourceStreamNames.js +2 -0
- package/dist/bundles/compiler/Text/SourceStreamNames.js.map +1 -0
- package/dist/bundles/compiler/Text/StringLiteral.js +3 -0
- package/dist/bundles/compiler/Text/StringLiteral.js.map +1 -0
- package/dist/bundles/compiler/Text/ordinalIgnoreCaseKey.js +2 -0
- package/dist/bundles/compiler/Text/ordinalIgnoreCaseKey.js.map +1 -0
- package/dist/bundles/compiler/Text/patterns.js +2 -0
- package/dist/bundles/compiler/Text/patterns.js.map +1 -0
- package/dist/bundles/compiler/index.js +1 -0
- package/dist/bundles/completion-items.js +21 -0
- package/dist/bundles/completion-items.js.map +1 -0
- package/dist/bundles/completion-planner.js +5 -0
- package/dist/bundles/completion-planner.js.map +1 -0
- package/dist/bundles/completions.js +2 -0
- package/dist/bundles/completions.js.map +1 -0
- package/dist/bundles/dependency-completions.js +3 -0
- package/dist/bundles/dependency-completions.js.map +1 -0
- package/dist/bundles/dependency-target-analysis.js +2 -0
- package/dist/bundles/dependency-target-analysis.js.map +1 -0
- package/dist/bundles/diagnostic-codes.js +2 -0
- package/dist/bundles/diagnostic-codes.js.map +1 -0
- package/dist/bundles/diagnostics.js +2 -0
- package/dist/bundles/diagnostics.js.map +1 -0
- package/dist/bundles/document-context.js +2 -0
- package/dist/bundles/document-context.js.map +1 -0
- package/dist/bundles/documentation-item.js +2 -0
- package/dist/bundles/documentation-item.js.map +1 -0
- package/dist/bundles/event-analysis-source.js +2 -0
- package/dist/bundles/event-analysis-source.js.map +1 -0
- package/dist/bundles/event-context-catalog.js +2 -0
- package/dist/bundles/event-context-catalog.js.map +1 -0
- package/dist/bundles/event-context.js +4 -0
- package/dist/bundles/event-context.js.map +1 -0
- package/dist/bundles/event-source-authoring.js +13 -0
- package/dist/bundles/event-source-authoring.js.map +1 -0
- package/dist/bundles/example-analysis.js +3 -0
- package/dist/bundles/example-analysis.js.map +1 -0
- package/dist/bundles/example-authoring.js +3 -0
- package/dist/bundles/example-authoring.js.map +1 -0
- package/dist/bundles/example-declaration-items.js +2 -0
- package/dist/bundles/example-declaration-items.js.map +1 -0
- package/dist/bundles/example-values.js +2 -0
- package/dist/bundles/example-values.js.map +1 -0
- package/dist/bundles/file-imports.js +2 -0
- package/dist/bundles/file-imports.js.map +1 -0
- package/dist/bundles/file-references.js +2 -0
- package/dist/bundles/file-references.js.map +1 -0
- package/dist/bundles/hover-content.js +6 -0
- package/dist/bundles/hover-content.js.map +1 -0
- package/dist/bundles/hover.js +2 -0
- package/dist/bundles/hover.js.map +1 -0
- package/dist/bundles/index.js +2 -104
- package/dist/bundles/index.js.map +1 -7
- package/dist/bundles/inlay-hints.js +2 -0
- package/dist/bundles/inlay-hints.js.map +1 -0
- package/dist/bundles/inline-completions.js +2 -0
- package/dist/bundles/inline-completions.js.map +1 -0
- package/dist/bundles/inline-event-validation.js +2 -0
- package/dist/bundles/inline-event-validation.js.map +1 -0
- package/dist/bundles/keyword-docs.js +2 -0
- package/dist/bundles/keyword-docs.js.map +1 -0
- package/dist/bundles/language.js +2 -0
- package/dist/bundles/language.js.map +1 -0
- package/dist/bundles/named-rule-context.js +2 -0
- package/dist/bundles/named-rule-context.js.map +1 -0
- package/dist/bundles/operation-authoring.js +7 -0
- package/dist/bundles/operation-authoring.js.map +1 -0
- package/dist/bundles/persona-analysis.js +2 -0
- package/dist/bundles/persona-analysis.js.map +1 -0
- package/dist/bundles/production-destinations.js +2 -0
- package/dist/bundles/production-destinations.js.map +1 -0
- package/dist/bundles/purpose-items.js +2 -0
- package/dist/bundles/purpose-items.js.map +1 -0
- package/dist/bundles/reaction-authoring.js +5 -0
- package/dist/bundles/reaction-authoring.js.map +1 -0
- package/dist/bundles/refusal-context.js +2 -0
- package/dist/bundles/refusal-context.js.map +1 -0
- package/dist/bundles/response-analysis.js +7 -0
- package/dist/bundles/response-analysis.js.map +1 -0
- package/dist/bundles/response-completions.js +2 -0
- package/dist/bundles/response-completions.js.map +1 -0
- package/dist/bundles/response-tokens.js +3 -0
- package/dist/bundles/response-tokens.js.map +1 -0
- package/dist/bundles/scope-items.js +18 -0
- package/dist/bundles/scope-items.js.map +1 -0
- package/dist/bundles/structure-completions.js +7 -0
- package/dist/bundles/structure-completions.js.map +1 -0
- package/dist/bundles/sub-language-registry.js +2 -0
- package/dist/bundles/sub-language-registry.js.map +1 -0
- package/dist/bundles/sub-languages/capture/CompletionProvider.js +2 -0
- package/dist/bundles/sub-languages/capture/CompletionProvider.js.map +1 -0
- package/dist/bundles/sub-languages/capture/HoverProvider.js +60 -0
- package/dist/bundles/sub-languages/capture/HoverProvider.js.map +1 -0
- package/dist/bundles/sub-languages/capture/Validator.js +2 -0
- package/dist/bundles/sub-languages/capture/Validator.js.map +1 -0
- package/dist/bundles/sub-languages/capture/index.js +2 -40
- package/dist/bundles/sub-languages/capture/index.js.map +1 -7
- package/dist/bundles/sub-languages/capture/language.js +2 -0
- package/dist/bundles/sub-languages/capture/language.js.map +1 -0
- package/dist/bundles/sub-languages/cdl.js +2 -0
- package/dist/bundles/sub-languages/cdl.js.map +1 -0
- package/dist/bundles/sub-languages/pdl.js +2 -0
- package/dist/bundles/sub-languages/pdl.js.map +1 -0
- package/dist/bundles/sub-languages/projection/CodeActionProvider.js +2 -0
- package/dist/bundles/sub-languages/projection/CodeActionProvider.js.map +1 -0
- package/dist/bundles/sub-languages/projection/CompletionProvider.js +2 -0
- package/dist/bundles/sub-languages/projection/CompletionProvider.js.map +1 -0
- package/dist/bundles/sub-languages/projection/HoverProvider.js +43 -0
- package/dist/bundles/sub-languages/projection/HoverProvider.js.map +1 -0
- package/dist/bundles/sub-languages/projection/Validator.js +5 -0
- package/dist/bundles/sub-languages/projection/Validator.js.map +1 -0
- package/dist/bundles/sub-languages/projection/index.js +3 -75
- package/dist/bundles/sub-languages/projection/index.js.map +1 -7
- package/dist/bundles/sub-languages/projection/language.js +2 -0
- package/dist/bundles/sub-languages/projection/language.js.map +1 -0
- package/dist/bundles/symbols.js +3 -0
- package/dist/bundles/symbols.js.map +1 -0
- package/dist/bundles/themes/screenplay-dark.js +2 -0
- package/dist/bundles/themes/screenplay-dark.js.map +1 -0
- package/dist/bundles/themes/screenplay-light.js +2 -0
- package/dist/bundles/themes/screenplay-light.js.map +1 -0
- package/dist/bundles/tokens.js +2 -0
- package/dist/bundles/tokens.js.map +1 -0
- package/dist/bundles/validation.js +3 -0
- package/dist/bundles/validation.js.map +1 -0
- package/package.json +4 -3
- package/dist/bundles/chunk-7GSRLVHB.js +0 -42
- package/dist/bundles/chunk-7GSRLVHB.js.map +0 -7
- package/dist/bundles/chunk-AYDF3IFZ.js +0 -2
- package/dist/bundles/chunk-AYDF3IFZ.js.map +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-context.js","names":["inString","inTemplate","index","line","character","map","lines","open","chain","currentIndent","indent","lineIndex","fences","lineIndent","headers"],"sources":["../../document-context.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// Matches SourceLineSplitter.CommentStart: // inside a double-quoted string or a\n// backtick template is content; a backslash escapes the next character only in a string.\nexport function withoutComment(line: string): string {\n let inString = false;\n let inTemplate = false;\n for (let index = 0; index < line.length; index++) {\n const character = line[index];\n if (character === '\\\\' && inString && index + 1 < line.length) {\n index++;\n } else if (character === '\"' && !inTemplate) {\n inString = !inString;\n } else if (character === '`' && !inString) {\n inTemplate = !inTemplate;\n } else if (!inString && !inTemplate && character === '/' && line[index + 1] === '/') {\n return line.slice(0, index);\n }\n }\n return line;\n}\n\nexport function indentOf(line: string): number {\n return line.length - line.trimStart().length;\n}\n\nexport function firstWord(line: string): string {\n return line.trim().split(/\\s+/)[0] ?? '';\n}\n\n// Marks every line that is a code fence or lives inside one, so structural\n// scanning never mistakes inline C#/TypeScript/HTML for Screenplay.\nexport function fenceMap(lines: string[]): boolean[] {\n const map: boolean[] = new Array(lines.length).fill(false);\n let open = false;\n for (let index = 0; index < lines.length; index++) {\n if (/^\\s*```(?:[a-z]+)?\\s*$/.test(lines[index]) && (!open || /^\\s*```\\s*$/.test(lines[index]))) {\n map[index] = true;\n open = !open;\n continue;\n }\n map[index] = open;\n }\n return map;\n}\n\n// Walks upward from a position and returns the chain of enclosing block openers,\n// innermost first — e.g. ['command', 'slice', 'feature', 'module']. A block opener\n// is any less-indented line above; its first word names the construct (for layout\n// slots this is the slot name, which callers treat as an unknown construct).\nexport function enclosingChain(\n lines: string[],\n fences: boolean[],\n lineIndex: number,\n indent: number,\n): string[] {\n const chain: string[] = [];\n let currentIndent = indent;\n for (let index = lineIndex - 1; index >= 0 && currentIndent > 0; index--) {\n if (fences[index]) continue;\n const line = withoutComment(lines[index]);\n if (line.trim().length === 0) continue;\n const lineIndent = indentOf(line);\n if (lineIndent < currentIndent) {\n chain.push(firstWord(line));\n currentIndent = lineIndent;\n }\n }\n return chain;\n}\n\n// Returns the full trimmed text of the nearest enclosing block opener above a\n// position — the same line enclosingChain's first entry is derived from, but kept\n// whole rather than reduced to its first word. Used where the construct is not\n// identified by a fixed leading keyword, such as a validation rule line, whose\n// first word is the property it applies to rather than \"rule\".\nexport function nearestEnclosingLine(\n lines: string[],\n fences: boolean[],\n lineIndex: number,\n indent: number,\n): string | undefined {\n for (let index = lineIndex - 1; index >= 0 && indent > 0; index--) {\n if (fences[index]) continue;\n const line = withoutComment(lines[index]);\n if (line.trim().length === 0) continue;\n if (indentOf(line) < indent) {\n return line.trim();\n }\n }\n return undefined;\n}\n\n// Like enclosingChain, but keeps each opener whole - 'slice StateView Name' rather than 'slice' - innermost first.\nexport function enclosingHeaders(\n lines: string[],\n fences: boolean[],\n lineIndex: number,\n indent: number,\n): string[] {\n const headers: string[] = [];\n let currentIndent = indent;\n for (let index = lineIndex - 1; index >= 0 && currentIndent > 0; index--) {\n if (fences[index]) continue;\n const line = withoutComment(lines[index]);\n if (line.trim().length === 0) continue;\n const lineIndent = indentOf(line);\n if (lineIndent < currentIndent) {\n headers.push(line.trim());\n currentIndent = lineIndent;\n }\n }\n return headers;\n}\n"],"mappings":"iDAKA,SAAgB,eAAe,EAAsB,CACjD,IAAIA,EAAW,GACXC,EAAa,GACjB,IAAK,IAAIC,EAAQ,EAAGA,EAAQC,EAAK,OAAQ,IAAS,CAC9C,IAAMC,EAAYD,EAAKD,GACvB,GAAIE,IAAc,MAAQJ,GAAYE,EAAQ,EAAIC,EAAK,OACnD,SACG,GAAIC,IAAc,KAAO,CAACH,EAC7B,EAAW,CAACD,OACT,GAAII,IAAc,KAAO,CAACJ,EAC7B,EAAa,CAACC,OACX,GAAI,CAACD,GAAY,CAACC,GAAcG,IAAc,KAAOD,EAAKD,EAAQ,KAAO,IAC5E,OAAOC,EAAK,MAAM,EAAGD,CAAK,CAElC,CACA,OAAOC,CACX,CAEA,SAAgB,SAAS,EAAsB,CAC3C,OAAOA,EAAK,OAASA,EAAK,UAAU,CAAC,CAAC,MAC1C,CAEA,SAAgB,UAAU,EAAsB,CAC5C,OAAOA,EAAK,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,IAAM,EAC1C,CAIA,SAAgB,SAAS,EAA4B,CACjD,IAAME,EAAqB,MAAMC,EAAM,MAAM,CAAC,CAAC,KAAK,EAAK,EACrDC,EAAO,GACX,IAAK,IAAIL,EAAQ,EAAGA,EAAQI,EAAM,OAAQ,IACl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C,CACX"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e={label:`documentation`,insertText:"documentation\n ```markdown\n ${1:Reasoning, assumptions or rejected alternatives}\n ```",documentation:`One nonempty authoring-only Markdown block; report-only (PLAY0270), with no executable effect.`};export{e as documentationItem};
|
|
2
|
+
//# sourceMappingURL=documentation-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentation-item.js","names":["documentationItem"],"sources":["../../documentation-item.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { CompletionEntry } from './completion-items';\n\nexport const documentationItem: CompletionEntry = {\n label: 'documentation',\n insertText: 'documentation\\n ```markdown\\n ${1:Reasoning, assumptions or rejected alternatives}\\n ```',\n documentation: 'One nonempty authoring-only Markdown block; report-only (PLAY0270), with no executable effect.',\n};\n"],"mappings":"AAKA,MAAaA,EAAqC,CAC9C,MAAO,gBACP,WAAY,oGACZ,cAAe,gGACnB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{withoutComment as e}from"./document-context.js";function eventAnalysisSource(t){let n=!1;return t.map(t=>{if(n)return t.trim()==="```"&&(n=!1),t;let r=e(t);return/^\s*```(?:[a-z]+)?\s*$/.test(r)&&(n=!0),r.trimEnd()})}export{eventAnalysisSource};
|
|
2
|
+
//# sourceMappingURL=event-analysis-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-analysis-source.js","names":["fenced","lines","line","text","withoutComment"],"sources":["../../event-analysis-source.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { withoutComment } from './document-context';\n\n// Match SourceLineSplitter: comments begin outside strings/templates; fenced bodies remain opaque.\nexport function eventAnalysisSource(lines: string[]): string[] {\n let fenced = false;\n return lines.map(line => {\n if (fenced) {\n if (line.trim() === '```') fenced = false;\n return line;\n }\n const text = withoutComment(line);\n if (/^\\s*```(?:[a-z]+)?\\s*$/.test(text)) fenced = true;\n return text.trimEnd();\n });\n}\n"],"mappings":"wGAMA,SAAgB,oBAAoB,EAA2B,CAC3D,IAAIA,EAAS,GACb,OAAOC,EAAM,IAAI,GAAQ,CACrB,GAAID,EAEA,OADIE,EAAK,KAAK,IAAM,QAAO,EAAS,IAC7BA,EAEX,IAAMC,EAAOC,EAAeF,CAAI,EAEhC,MADI,yBAAyB,KAAKC,CAAI,IAAG,EAAS,IAC3CA,EAAK,QAAQ,CACxB,CAAC,CACL"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=`EventContext`,t={EventContext:[{name:`eventType`,type:`EventType`,kind:`composite`,description:`The type of the event - its identifier, generation and whether it is a tombstone.`},{name:`eventSourceType`,type:`EventSourceType`,kind:`value`,description:`The type of the event source the event was appended to.`},{name:`eventSourceId`,type:`EventSourceId`,kind:`value`,description:`The identifier of the event source the event was appended to - the value $eventSourceId resolves.`},{name:`eventStreamType`,type:`EventStreamType`,kind:`value`,description:`The type of the event stream the event belongs to.`},{name:`eventStreamId`,type:`EventStreamId`,kind:`value`,description:`The identifier of the event stream the event belongs to.`},{name:`sequenceNumber`,type:`EventSequenceNumber`,kind:`value`,description:`The position of the event in its event sequence.`},{name:`occurred`,type:`DateTimeOffset`,kind:`value`,description:`When the event occurred - the time it was appended unless one was given.`},{name:`eventStore`,type:`EventStoreName`,kind:`value`,description:`The name of the event store the event belongs to.`},{name:`namespace`,type:`EventStoreNamespaceName`,kind:`value`,description:`The namespace within the event store the event belongs to.`},{name:`correlationId`,type:`CorrelationId`,kind:`value`,description:`The correlation identifier the event was appended with.`},{name:`causation`,type:`IEnumerable<Causation>`,kind:`collection`,description:`The chain of causes that led to the event - a collection, not addressable below.`},{name:`causedBy`,type:`Identity`,kind:`composite`,description:`The identity that caused the event.`},{name:`tags`,type:`IEnumerable<Tag>`,kind:`collection`,description:`The tags the event was appended with - a collection, not addressable below.`},{name:`hash`,type:`EventHash`,kind:`value`,description:`The hash of the event content.`},{name:`observationState`,type:`EventObservationState`,kind:`value`,description:`Whether the observer sees the event for the first time or again on replay - differs between live processing and replay.`},{name:`subject`,type:`Subject`,kind:`value`,description:`The compliance subject the event is about - the event source identifier unless one was given.`},{name:`subjectIsEventSourceId`,type:`bool`,kind:`value`,description:`Whether the subject is the event source identifier.`}],EventType:[{name:`id`,type:`EventTypeId`,kind:`value`,description:`The identifier of the event type.`},{name:`generation`,type:`EventTypeGeneration`,kind:`value`,description:`The generation of the event type.`},{name:`tombstone`,type:`bool`,kind:`value`,description:`Whether the event is a tombstone event.`}],EventSourceType:[{name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`}],EventSourceId:[{name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`}],EventStreamType:[{name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`}],EventStreamId:[{name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`}],EventSequenceNumber:[{name:`value`,type:`ulong`,kind:`value`,description:`The underlying ulong value.`}],DateTimeOffset:[{name:`Week`,type:`int`,kind:`function`,description:`The ISO 8601 week of the year the value falls in.`}],EventStoreName:[{name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`}],EventStoreNamespaceName:[{name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`}],CorrelationId:[{name:`value`,type:`Guid`,kind:`value`,description:`The underlying Guid value.`}],Identity:[{name:`subject`,type:`string`,kind:`value`,description:`The subject identifier of the identity.`},{name:`name`,type:`string`,kind:`value`,description:`The display name of the identity.`},{name:`userName`,type:`string`,kind:`value`,description:`The user name of the identity.`},{name:`onBehalfOf`,type:`Identity`,kind:`composite`,description:`The identity this identity acted on behalf of, if any - an identity with the same members.`}],EventHash:[{name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`}],Subject:[{name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`}],EventTypeId:[{name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`}],EventTypeGeneration:[{name:`value`,type:`uint`,kind:`value`,description:`The underlying uint value.`}]},n=[{path:`eventType`,name:`eventType`,type:`EventType`,kind:`composite`,description:`The type of the event - its identifier, generation and whether it is a tombstone.`},{path:`eventType.id`,name:`id`,type:`EventTypeId`,kind:`value`,description:`The identifier of the event type.`},{path:`eventType.id.value`,name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`},{path:`eventType.generation`,name:`generation`,type:`EventTypeGeneration`,kind:`value`,description:`The generation of the event type.`},{path:`eventType.generation.value`,name:`value`,type:`uint`,kind:`value`,description:`The underlying uint value.`},{path:`eventType.tombstone`,name:`tombstone`,type:`bool`,kind:`value`,description:`Whether the event is a tombstone event.`},{path:`eventSourceType`,name:`eventSourceType`,type:`EventSourceType`,kind:`value`,description:`The type of the event source the event was appended to.`},{path:`eventSourceType.value`,name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`},{path:`eventSourceId`,name:`eventSourceId`,type:`EventSourceId`,kind:`value`,description:`The identifier of the event source the event was appended to - the value $eventSourceId resolves.`},{path:`eventSourceId.value`,name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`},{path:`eventStreamType`,name:`eventStreamType`,type:`EventStreamType`,kind:`value`,description:`The type of the event stream the event belongs to.`},{path:`eventStreamType.value`,name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`},{path:`eventStreamId`,name:`eventStreamId`,type:`EventStreamId`,kind:`value`,description:`The identifier of the event stream the event belongs to.`},{path:`eventStreamId.value`,name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`},{path:`sequenceNumber`,name:`sequenceNumber`,type:`EventSequenceNumber`,kind:`value`,description:`The position of the event in its event sequence.`},{path:`sequenceNumber.value`,name:`value`,type:`ulong`,kind:`value`,description:`The underlying ulong value.`},{path:`occurred`,name:`occurred`,type:`DateTimeOffset`,kind:`value`,description:`When the event occurred - the time it was appended unless one was given.`},{path:`occurred.Week`,name:`Week`,type:`int`,kind:`function`,description:`The ISO 8601 week of the year the value falls in.`},{path:`eventStore`,name:`eventStore`,type:`EventStoreName`,kind:`value`,description:`The name of the event store the event belongs to.`},{path:`eventStore.value`,name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`},{path:`namespace`,name:`namespace`,type:`EventStoreNamespaceName`,kind:`value`,description:`The namespace within the event store the event belongs to.`},{path:`namespace.value`,name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`},{path:`correlationId`,name:`correlationId`,type:`CorrelationId`,kind:`value`,description:`The correlation identifier the event was appended with.`},{path:`correlationId.value`,name:`value`,type:`Guid`,kind:`value`,description:`The underlying Guid value.`},{path:`causation`,name:`causation`,type:`IEnumerable<Causation>`,kind:`collection`,description:`The chain of causes that led to the event - a collection, not addressable below.`},{path:`causedBy`,name:`causedBy`,type:`Identity`,kind:`composite`,description:`The identity that caused the event.`},{path:`causedBy.subject`,name:`subject`,type:`string`,kind:`value`,description:`The subject identifier of the identity.`},{path:`causedBy.name`,name:`name`,type:`string`,kind:`value`,description:`The display name of the identity.`},{path:`causedBy.userName`,name:`userName`,type:`string`,kind:`value`,description:`The user name of the identity.`},{path:`causedBy.onBehalfOf`,name:`onBehalfOf`,type:`Identity`,kind:`composite`,description:`The identity this identity acted on behalf of, if any - an identity with the same members.`},{path:`tags`,name:`tags`,type:`IEnumerable<Tag>`,kind:`collection`,description:`The tags the event was appended with - a collection, not addressable below.`},{path:`hash`,name:`hash`,type:`EventHash`,kind:`value`,description:`The hash of the event content.`},{path:`hash.value`,name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`},{path:`observationState`,name:`observationState`,type:`EventObservationState`,kind:`value`,description:`Whether the observer sees the event for the first time or again on replay - differs between live processing and replay.`},{path:`subject`,name:`subject`,type:`Subject`,kind:`value`,description:`The compliance subject the event is about - the event source identifier unless one was given.`},{path:`subject.value`,name:`value`,type:`string`,kind:`value`,description:`The underlying string value.`},{path:`subjectIsEventSourceId`,name:`subjectIsEventSourceId`,type:`bool`,kind:`value`,description:`Whether the subject is the event source identifier.`}];export{n as eventContextPaths,e as eventContextRootType,t as eventContextTypes};
|
|
2
|
+
//# sourceMappingURL=event-context-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-context-catalog.js","names":["eventContextRootType","eventContextTypes","\"EventContext\"","\"EventType\"","\"EventSourceType\"","\"EventSourceId\"","\"EventStreamType\"","\"EventStreamId\"","\"EventSequenceNumber\"","\"DateTimeOffset\"","\"EventStoreName\"","\"EventStoreNamespaceName\"","\"CorrelationId\"","\"Identity\"","\"EventHash\"","\"Subject\"","\"EventTypeId\"","\"EventTypeGeneration\"","eventContextPaths"],"sources":["../../event-context-catalog.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// Generated from Cratis.Screenplay.Syntax.EventContextCatalog - do not edit by hand. The spec\n// Syntax/for_EventContextCatalog/when_holding_the_editor_catalog_to_it fails when this file drifts; rerun\n// it with SCREENPLAY_REGENERATE_EVENT_CONTEXT=1 to rewrite it.\n\nexport type EventContextMemberKind = 'value' | 'composite' | 'collection' | 'function';\n\nexport interface EventContextMember {\n readonly name: string;\n readonly type: string;\n readonly kind: EventContextMemberKind;\n readonly description: string;\n}\n\nexport interface EventContextPath extends EventContextMember {\n readonly path: string;\n}\n\nexport const eventContextRootType = 'EventContext';\n\n// The members of each type a path passes through, keyed by type name.\nexport const eventContextTypes: Readonly<Record<string, readonly EventContextMember[]>> = {\n 'EventContext': [\n { name: 'eventType', type: 'EventType', kind: 'composite', description: 'The type of the event - its identifier, generation and whether it is a tombstone.' },\n { name: 'eventSourceType', type: 'EventSourceType', kind: 'value', description: 'The type of the event source the event was appended to.' },\n { name: 'eventSourceId', type: 'EventSourceId', kind: 'value', description: 'The identifier of the event source the event was appended to - the value $eventSourceId resolves.' },\n { name: 'eventStreamType', type: 'EventStreamType', kind: 'value', description: 'The type of the event stream the event belongs to.' },\n { name: 'eventStreamId', type: 'EventStreamId', kind: 'value', description: 'The identifier of the event stream the event belongs to.' },\n { name: 'sequenceNumber', type: 'EventSequenceNumber', kind: 'value', description: 'The position of the event in its event sequence.' },\n { name: 'occurred', type: 'DateTimeOffset', kind: 'value', description: 'When the event occurred - the time it was appended unless one was given.' },\n { name: 'eventStore', type: 'EventStoreName', kind: 'value', description: 'The name of the event store the event belongs to.' },\n { name: 'namespace', type: 'EventStoreNamespaceName', kind: 'value', description: 'The namespace within the event store the event belongs to.' },\n { name: 'correlationId', type: 'CorrelationId', kind: 'value', description: 'The correlation identifier the event was appended with.' },\n { name: 'causation', type: 'IEnumerable<Causation>', kind: 'collection', description: 'The chain of causes that led to the event - a collection, not addressable below.' },\n { name: 'causedBy', type: 'Identity', kind: 'composite', description: 'The identity that caused the event.' },\n { name: 'tags', type: 'IEnumerable<Tag>', kind: 'collection', description: 'The tags the event was appended with - a collection, not addressable below.' },\n { name: 'hash', type: 'EventHash', kind: 'value', description: 'The hash of the event content.' },\n { name: 'observationState', type: 'EventObservationState', kind: 'value', description: 'Whether the observer sees the event for the first time or again on replay - differs between live processing and replay.' },\n { name: 'subject', type: 'Subject', kind: 'value', description: 'The compliance subject the event is about - the event source identifier unless one was given.' },\n { name: 'subjectIsEventSourceId', type: 'bool', kind: 'value', description: 'Whether the subject is the event source identifier.' },\n ],\n 'EventType': [\n { name: 'id', type: 'EventTypeId', kind: 'value', description: 'The identifier of the event type.' },\n { name: 'generation', type: 'EventTypeGeneration', kind: 'value', description: 'The generation of the event type.' },\n { name: 'tombstone', type: 'bool', kind: 'value', description: 'Whether the event is a tombstone event.' },\n ],\n 'EventSourceType': [\n { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n ],\n 'EventSourceId': [\n { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n ],\n 'EventStreamType': [\n { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n ],\n 'EventStreamId': [\n { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n ],\n 'EventSequenceNumber': [\n { name: 'value', type: 'ulong', kind: 'value', description: 'The underlying ulong value.' },\n ],\n 'DateTimeOffset': [\n { name: 'Week', type: 'int', kind: 'function', description: 'The ISO 8601 week of the year the value falls in.' },\n ],\n 'EventStoreName': [\n { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n ],\n 'EventStoreNamespaceName': [\n { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n ],\n 'CorrelationId': [\n { name: 'value', type: 'Guid', kind: 'value', description: 'The underlying Guid value.' },\n ],\n 'Identity': [\n { name: 'subject', type: 'string', kind: 'value', description: 'The subject identifier of the identity.' },\n { name: 'name', type: 'string', kind: 'value', description: 'The display name of the identity.' },\n { name: 'userName', type: 'string', kind: 'value', description: 'The user name of the identity.' },\n { name: 'onBehalfOf', type: 'Identity', kind: 'composite', description: 'The identity this identity acted on behalf of, if any - an identity with the same members.' },\n ],\n 'EventHash': [\n { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n ],\n 'Subject': [\n { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n ],\n 'EventTypeId': [\n { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n ],\n 'EventTypeGeneration': [\n { name: 'value', type: 'uint', kind: 'value', description: 'The underlying uint value.' },\n ],\n};\n\n// Every path the catalog lists, depth first in declaration order.\nexport const eventContextPaths: readonly EventContextPath[] = [\n { path: 'eventType', name: 'eventType', type: 'EventType', kind: 'composite', description: 'The type of the event - its identifier, generation and whether it is a tombstone.' },\n { path: 'eventType.id', name: 'id', type: 'EventTypeId', kind: 'value', description: 'The identifier of the event type.' },\n { path: 'eventType.id.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n { path: 'eventType.generation', name: 'generation', type: 'EventTypeGeneration', kind: 'value', description: 'The generation of the event type.' },\n { path: 'eventType.generation.value', name: 'value', type: 'uint', kind: 'value', description: 'The underlying uint value.' },\n { path: 'eventType.tombstone', name: 'tombstone', type: 'bool', kind: 'value', description: 'Whether the event is a tombstone event.' },\n { path: 'eventSourceType', name: 'eventSourceType', type: 'EventSourceType', kind: 'value', description: 'The type of the event source the event was appended to.' },\n { path: 'eventSourceType.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n { path: 'eventSourceId', name: 'eventSourceId', type: 'EventSourceId', kind: 'value', description: 'The identifier of the event source the event was appended to - the value $eventSourceId resolves.' },\n { path: 'eventSourceId.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n { path: 'eventStreamType', name: 'eventStreamType', type: 'EventStreamType', kind: 'value', description: 'The type of the event stream the event belongs to.' },\n { path: 'eventStreamType.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n { path: 'eventStreamId', name: 'eventStreamId', type: 'EventStreamId', kind: 'value', description: 'The identifier of the event stream the event belongs to.' },\n { path: 'eventStreamId.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n { path: 'sequenceNumber', name: 'sequenceNumber', type: 'EventSequenceNumber', kind: 'value', description: 'The position of the event in its event sequence.' },\n { path: 'sequenceNumber.value', name: 'value', type: 'ulong', kind: 'value', description: 'The underlying ulong value.' },\n { path: 'occurred', name: 'occurred', type: 'DateTimeOffset', kind: 'value', description: 'When the event occurred - the time it was appended unless one was given.' },\n { path: 'occurred.Week', name: 'Week', type: 'int', kind: 'function', description: 'The ISO 8601 week of the year the value falls in.' },\n { path: 'eventStore', name: 'eventStore', type: 'EventStoreName', kind: 'value', description: 'The name of the event store the event belongs to.' },\n { path: 'eventStore.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n { path: 'namespace', name: 'namespace', type: 'EventStoreNamespaceName', kind: 'value', description: 'The namespace within the event store the event belongs to.' },\n { path: 'namespace.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n { path: 'correlationId', name: 'correlationId', type: 'CorrelationId', kind: 'value', description: 'The correlation identifier the event was appended with.' },\n { path: 'correlationId.value', name: 'value', type: 'Guid', kind: 'value', description: 'The underlying Guid value.' },\n { path: 'causation', name: 'causation', type: 'IEnumerable<Causation>', kind: 'collection', description: 'The chain of causes that led to the event - a collection, not addressable below.' },\n { path: 'causedBy', name: 'causedBy', type: 'Identity', kind: 'composite', description: 'The identity that caused the event.' },\n { path: 'causedBy.subject', name: 'subject', type: 'string', kind: 'value', description: 'The subject identifier of the identity.' },\n { path: 'causedBy.name', name: 'name', type: 'string', kind: 'value', description: 'The display name of the identity.' },\n { path: 'causedBy.userName', name: 'userName', type: 'string', kind: 'value', description: 'The user name of the identity.' },\n { path: 'causedBy.onBehalfOf', name: 'onBehalfOf', type: 'Identity', kind: 'composite', description: 'The identity this identity acted on behalf of, if any - an identity with the same members.' },\n { path: 'tags', name: 'tags', type: 'IEnumerable<Tag>', kind: 'collection', description: 'The tags the event was appended with - a collection, not addressable below.' },\n { path: 'hash', name: 'hash', type: 'EventHash', kind: 'value', description: 'The hash of the event content.' },\n { path: 'hash.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n { path: 'observationState', name: 'observationState', type: 'EventObservationState', kind: 'value', description: 'Whether the observer sees the event for the first time or again on replay - differs between live processing and replay.' },\n { path: 'subject', name: 'subject', type: 'Subject', kind: 'value', description: 'The compliance subject the event is about - the event source identifier unless one was given.' },\n { path: 'subject.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },\n { path: 'subjectIsEventSourceId', name: 'subjectIsEventSourceId', type: 'bool', kind: 'value', description: 'Whether the subject is the event source identifier.' },\n];\n"],"mappings":"AAoBA,MAAaA,EAAuB,eAGvBC,EAA6E,CACtFC,aAAgB,CACZ,CAAE,KAAM,YAAa,KAAM,YAAa,KAAM,YAAa,YAAa,mFAAoF,EAC5J,CAAE,KAAM,kBAAmB,KAAM,kBAAmB,KAAM,QAAS,YAAa,yDAA0D,EAC1I,CAAE,KAAM,gBAAiB,KAAM,gBAAiB,KAAM,QAAS,YAAa,mGAAoG,EAChL,CAAE,KAAM,kBAAmB,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AM,OAAQ,KAAM,YAAa,KAAM,QAAS,YAAa,gCAAiC,EAC9G,CAAE,KAAM,aAAc,KAAM,QAAS,KAAM,SAAU,KAAM,QAAS,YAAa,8BAA+B,EAChH,CAAE,KAAM,mBAAoB,KAAM,mBAAoB,KAAM,wBAAyB,KAAM,QAAS,YAAa,yHAA0H,EAC3O,CAAE,KAAM,UAAW,KAAM,UAAW,KAAM,UAAW,KAAM,QAAS,YAAa,+FAAgG,EACjL,CAAE,KAAM,gBAAiB,KAAM,QAAS,KAAM,SAAU,KAAM,QAAS,YAAa,8BAA+B,EACnH,CAAE,KAAM,yBAA0B,KAAM,yBAA0B,KAAM,OAAQ,KAAM,QAAS,YAAa,qDAAsD,CACtK"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{eventContextPaths as e,eventContextRootType as t,eventContextTypes as n}from"./event-context-catalog.js";function namesEventContextMember(e,t){if(e.kind===`function`)return t===e.name||t===`${e.name}()`;let n=e.name[0].toUpperCase()+e.name.slice(1);return t===n||t.length>0&&t[0].toUpperCase()+t.slice(1)===n}const r=n[t];function eventContextMembersAfter(e){let t=r;for(let r of e){let e=t.find(e=>namesEventContextMember(e,r));if(!e||e.kind===`collection`||e.kind===`function`)return;t=n[e.type]??[]}return t}function eventContextMemberAt(e){if(e.length!==0)return eventContextMembersAfter(e.slice(0,-1))?.find(t=>namesEventContextMember(t,e[e.length-1]))}function resolveEventContextPath(e){let t,i=r;for(let r of e.split(`.`)){if(r.length===0)return{status:`missing`,member:t,expected:i};if(t?.kind===`collection`)return{status:`belowCollection`,member:t,segment:r,expected:[]};let e=i.find(e=>namesEventContextMember(e,r));if(!e)return{status:t?`unknownSubPath`:`unknownMember`,member:t,segment:r,expected:i};t=e,i=e.kind===`function`?[]:n[e.type]??[]}return{status:`known`,member:t,expected:[]}}function describeEventContext(){return[`**$eventContext**`,``,"Metadata about the event being projected. Paths are checked against the event-context catalog; `causation` and `tags` are collections and cannot be addressed below.",``,`**Members:**`,...r.map(e=>`- \`${e.name}\` (${e.type}) - ${e.description}`)].join(`
|
|
2
|
+
`)}function describeEventContextMember(e,t){let r=t.kind===`collection`||t.kind===`function`?[]:n[t.type]??[],i=[`**$eventContext.${e}**: \`${t.type}\``,``,t.description];return r.length>0&&i.push(``,`**Members:** ${r.map(e=>`\`${e.name}\``).join(`, `)}`),i.join(`
|
|
3
|
+
`)}export{describeEventContext,describeEventContextMember,eventContextMemberAt,r as eventContextMembers,eventContextMembersAfter,e as eventContextPaths,namesEventContextMember,resolveEventContextPath};
|
|
4
|
+
//# sourceMappingURL=event-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-context.js","names":["member","segment","declared","eventContextMembers","eventContextTypes","eventContextRootType","members","segments","candidate","current","expected","path","next","below","lines","child","eventContextPaths"],"sources":["../../event-context.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// Reads the generated event-context catalog. Every editor surface that describes $eventContext - projection\n// completion and hover, and the host editor's context-variable docs and completions - goes through here, so\n// none of them carries a list of its own.\n\nimport { eventContextPaths, eventContextRootType, eventContextTypes } from './event-context-catalog';\nimport type { EventContextMember, EventContextPath } from './event-context-catalog';\n\nexport { eventContextPaths };\nexport type { EventContextMember, EventContextPath };\n\n/**\n * Whether a written path segment names a member. Mirrors EventContextMember.IsNamedBy in the compiler: a property\n * resolves camelCase or with only its first character uppercased; a function resolves by its exact name, with or\n * without parentheses.\n */\nexport function namesEventContextMember(member: EventContextMember, segment: string): boolean {\n if (member.kind === 'function') {\n return segment === member.name || segment === `${member.name}()`;\n }\n\n const declared = member.name[0].toUpperCase() + member.name.slice(1);\n return segment === declared || (segment.length > 0 && segment[0].toUpperCase() + segment.slice(1) === declared);\n}\n\n/** The members of the event context itself - the first segment of every path. */\nexport const eventContextMembers: readonly EventContextMember[] = eventContextTypes[eventContextRootType];\n\n/**\n * The members that may follow the given segments after `$eventContext.`, or undefined when the segments do not\n * resolve or stop at a collection or function, below which nothing is addressable.\n */\nexport function eventContextMembersAfter(segments: readonly string[]): readonly EventContextMember[] | undefined {\n let members = eventContextMembers;\n for (const segment of segments) {\n const member = members.find((candidate) => namesEventContextMember(candidate, segment));\n if (!member || member.kind === 'collection' || member.kind === 'function') {\n return undefined;\n }\n\n members = eventContextTypes[member.type] ?? [];\n }\n\n return members;\n}\n\n/** The member the given segments name, or undefined when they do not resolve. */\nexport function eventContextMemberAt(segments: readonly string[]): EventContextMember | undefined {\n if (segments.length === 0) {\n return undefined;\n }\n\n const members = eventContextMembersAfter(segments.slice(0, -1));\n return members?.find((member) => namesEventContextMember(member, segments[segments.length - 1]));\n}\n\n/** The outcome of resolving a path against the catalog. Mirrors EventContextPathStatus in the compiler. */\nexport type EventContextPathStatus = 'known' | 'missing' | 'unknownMember' | 'unknownSubPath' | 'belowCollection';\n\n/** A path resolved against the catalog. Mirrors EventContextPathResolution in the compiler. */\nexport interface EventContextPathResolution {\n readonly status: EventContextPathStatus;\n readonly member?: EventContextMember;\n readonly segment?: string;\n readonly expected: readonly EventContextMember[];\n}\n\n/**\n * Resolves a path, as written after `$eventContext.`, the way EventContextCatalog.Resolve in the compiler does, so the\n * editor reports what the compiler reports.\n */\nexport function resolveEventContextPath(path: string): EventContextPathResolution {\n let current: EventContextMember | undefined;\n let expected = eventContextMembers;\n for (const segment of path.split('.')) {\n if (segment.length === 0) {\n return { status: 'missing', member: current, expected };\n }\n\n if (current?.kind === 'collection') {\n return { status: 'belowCollection', member: current, segment, expected: [] };\n }\n\n const next = expected.find((member) => namesEventContextMember(member, segment));\n if (!next) {\n return { status: current ? 'unknownSubPath' : 'unknownMember', member: current, segment, expected };\n }\n\n current = next;\n expected = next.kind === 'function' ? [] : eventContextTypes[next.type] ?? [];\n }\n\n return { status: 'known', member: current, expected: [] };\n}\n\n/** Markdown describing $eventContext and its members, for hovers. */\nexport function describeEventContext(): string {\n return [\n '**$eventContext**',\n '',\n 'Metadata about the event being projected. Paths are checked against the event-context catalog; `causation` and `tags` are collections and cannot be addressed below.',\n '',\n '**Members:**',\n ...eventContextMembers.map((member) => `- \\`${member.name}\\` (${member.type}) - ${member.description}`),\n ].join('\\n');\n}\n\n/** Markdown describing one member of the event context, for hovers. */\nexport function describeEventContextMember(path: string, member: EventContextMember): string {\n const below = member.kind === 'collection' || member.kind === 'function' ? [] : eventContextTypes[member.type] ?? [];\n const lines = [`**$eventContext.${path}**: \\`${member.type}\\``, '', member.description];\n if (below.length > 0) {\n lines.push('', `**Members:** ${below.map((child) => `\\`${child.name}\\``).join(', ')}`);\n }\n\n return lines.join('\\n');\n}\n"],"mappings":"iKAkBA,SAAgB,wBAAwB,EAA4B,EAA0B,CAC1F,GAAIA,EAAO,OAAS,WAChB,OAAOC,IAAYD,EAAO,MAAQC,IAAY,GAAGD,EAAO,KAAK,IAGjE,IAAME,EAAWF,EAAO,KAAK,EAAE,CAAC,YAAY,EAAIA,EAAO,KAAK,MAAM,CAAC,EACnE,OAAOC,IAAYC,GAAaD,EAAQ,OAAS,GAAKA,EAAQ,EAAE,CAAC,YAAY,EAAIA,EAAQ,MAAM,CAAC,IAAMC,CAC1G,CAGA,MAAaC,EAAqDC,EAAkBC,GAMpF,SAAgB,yBAAyB,EAAwE,CAC7G,IAAIC,EAAUH,EACd,IAAK,IAAMF,KAAWM,EAAU,CAC5B,IAAMP,EAASM,EAAQ,KAAM,GAAc,wBAAwBE,EAAWP,CAAO,CAAC,EACtF,GAAI,CAACD,GAAUA,EAAO,OAAS,cAAgBA,EAAO,OAAS,WAC3D,OAGJ,EAAUI,EAAkBJ,EAAO,OAAS,CAAC,CACjD,CAEA,OAAOM,CACX,CAGA,SAAgB,qBAAqB,EAA6D,CAC9F,GAAIC,EAAS,SAAW,EAKxB,OADgB,yBAAyBA,EAAS,MAAM,EAAG,EAAE,CAChD,CAAC,EAAE,KAAM,GAAW,wBAAwBP,EAAQO,EAASA,EAAS,OAAS,E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import"./_virtual/_virtual/_rolldown/runtime.js";import{typeReferenceText as e}from"./TypeReferenceSymbol.js";import{isSourceStreamName as t,isSourceStreamTypeName as n,sourceStreamPattern as r}from"./compiler/Text/SourceStreamNames.js";import"./compiler/index.js";import{fenceMap as i,indentOf as a,withoutComment as o}from"./document-context.js";import{responseAnalysis as s}from"./response-analysis.js";import{symbolsForBuffer as c}from"./symbols.js";const l=`Event sources, streams and declarative command routes are admitted in executable semantic model (ESM) v8. A route classifies events; it does not supply an identity destination. Property-path mappings and handler routes remain unadmitted (PLAY0268).`,u=`Specification event routes, including example routes, are admitted in executable semantic model (ESM) v8. Redelivery remains unadmitted (PLAY0268) (#433), independently of its locator route.`,d=r(`^\\s*stream\\s+(?:[A-Za-z_]\\w*(?:\\.[A-Za-z_]\\w*)?\\.?)?$`),f=r(`^\\s*streamId\\s*=\\s*([\\w.]*)$`),p=r(`^\\s*identifier\\s+[\\w.]*$`),m=r(`^\\s*streamId\\s+[\\w.]*$`);function analyzeEventSources(e,t){return t=c(e,t),s(e,t?.authoringDocuments??t?.authoringSources?.filter(t=>t!==e.join(`
|
|
2
|
+
`))??[],t?.authoringPlacement,t?.authoringPath,t?.authoringPlacementResolved).eventSources}function eventSourceDetails(t,n){return[`**${n?`stream ${t.name}.${n.name}`:`eventsource ${t.name}`}**`,n?.description??t.description??``,t.identifier?`Identifier type: ${e(t.identifier)}`:`No identifier type declared.`,n?n.streamIdParts.length>0?`Stream id parts: ${n.streamIdParts.map(t=>`${t.name} ${e(t.type)}`).join(`, `)}`:n.streamId?`Stream id type: ${e(n.streamId)}`:`Unkeyed stream.`:t.streams.map(t=>`${t.name}${t.streamIdParts.length>0?` — ${t.streamIdParts.map(t=>`${t.name} ${e(t.type)}`).join(`, `)}`:t.streamId?` — ${e(t.streamId)}`:` — unkeyed`}`).join(`
|
|
3
|
+
`),n?.id??(n?null:t.id)?`Stored-name pin (rename-only metadata; not a semantic ID).`:``,l].filter(Boolean).join(`
|
|
4
|
+
|
|
5
|
+
`)}function eventSourceReferenceAt(e,t,n,r,i){let a=analyzeEventSources(e,i),at=i=>{let a=i.referenceLocation,s=`${i.eventSource}.${i.stream}`;return a?.line===t+1&&n>=a.column&&r<=a.column+s.length&&o(e[t]??``).slice(a.column-1,a.column-1+s.length)===s},s=a.ambiguousCandidates.find(at);if(s)return{route:s,resolution:{state:`ambiguous`,source:void 0,stream:void 0},target:void 0};let c=a.routes.find(at);if(!c)return null;let l=a.resolve(c.eventSource,c.stream),u=r<=c.referenceLocation.column+c.eventSource.length;return{route:c,resolution:l,target:l.state===`unique`?u?l.source:l.stream:void 0}}function eventSourceIdentifier(e,t,n){let r=o(n.split(/\r?\n/)[e.line-1]??``),i=r.slice(e.column-1).match(/^(?:eventsource|stream)\s+/)?.[0];return i&&r.slice(e.column-1+i.length,e.column-1+i.length+t.length)===t?{...e,column:e.column+i.length}:void 0}function eventSourceHover(t,n,r,i,d){d=c(t,d);let f=analyzeEventSources(t,d),p=eventSourceReferenceAt(t,n,r,i,d);if(p)return p.resolution.source&&p.resolution.stream?eventSourceDetails(p.resolution.source,p.resolution.stream)+(f.contexts.get(n)?.event?`\n\n${u}`:``):`Physical stream owner: ${p.resolution.state}; no route selected. ${`reasons`in p.resolution?p.resolution.reasons.join(` `):``} ${l}`;let m=f.contexts.get(n);if(m?.event?.noStream?.location.line===n+1&&r>=m.event.noStream.location.column&&i<=m.event.noStream.location.column+9)return`Assert an unrouted event; omitting a route on then leaves it unasserted. ${u}`;if(m?.event&&m.route?.streamId?.location.line===n+1&&r===m.route.streamId.location.column&&i===r+8)return`Concrete literal stream id, not a command property mapping. ${u}`;let h=m?.route?.directiveLocations?.streamId??m?.stream?.directiveLocations?.streamId;if(h?.line===n+1&&r===h.column&&i===r+8)return`Composite stream id: named parts, not a pre-joined value. ${m?.event?u:l}`;for(let e of m?.route?.streamIdParts??[])if(e.location.line===n+1&&r===e.location.column&&i===r+e.property.length)return`Authored stream id part **${e.property}**. ${m?.event?`Concrete literal. ${u}`:l}`;let g=m?.stream??m?.source;if(g){let e=eventSourceIdentifier(g.location,g.name,t.join(`
|
|
6
|
+
`));if(e?.line===n+1&&r===e.column&&i===r+g.name.length&&m?.source){let e=f.resolve(m.source.name,m.stream?.name);return eventSourceDetails(m.source,m.stream)+(e.state===`unique`?``:`\n\nPhysical ownership: ${e.state}. ${e.reasons.join(` `)}`)}}let _=m?.route?[m.route.streamId,...m.route.streamIdParts].find(e=>e?.location.line===n+1):void 0;if(_&&m?.command){if(_.location.line===n+1&&r===_.location.column&&i===r+8)return`Authored stream id mapping. ${l}`;let a=_.source;if(a.kind===`PathExpressionSyntax`&&a.path&&a.location?.line===n+1&&r>=a.location.column&&i<=a.location.column+a.path.length){let n=s(t,d?.authoringDocuments??d?.authoringSources?.filter(e=>e!==t.join(`
|
|
7
|
+
`))??[],d?.authoringPlacement,d?.authoringPath,d?.authoringPlacementResolved),r=a.path.slice(0,i-a.location.column).split(`.`),o=m.command.properties,c=!1,u=!1;for(let[t,i]of r.entries()){let a=o.filter(e=>e.name===i);if(a.length!==1)break;let s=a[0];if(c||=s.type.isOptional,u||=s.type.isCollection,t===r.length-1)return`**${i}** — ${e({...s.type,isOptional:c,isCollection:u})}. Command source for authored stream id. ${l}`;let d=n.operations.types.filter(e=>e.name===s.type.name);if(d.length!==1||u)break;o=d[0].properties.map(e=>({...e,isIdentifier:!1}))}}}if(m?.source&&/^\s*id\s+"/.test(o(t[n]??``))&&r===a(t[n])+1&&i===r+2)return`Stored-name pin: rename-only metadata, not a semantic identity or an automatic refactor. ${l}`;let v=m?.stream?.streamIdParts.find(e=>e.type.location?.line===n+1)?.type??m?.stream?.streamId??m?.source?.identifier;return v&&v.location?.line===n+1&&r>=v.location.column&&i<=v.location.column+v.name.length?`${e(v)} — authored ${m?.stream?`stream id`:`identifier`} type. ${l}`:null}function streamIdHeader(e,t,n){let r=a(e[t]??``);for(let i=t-1;i>n;i--){let t=o(e[i]);if(!(!t.trim()||a(t)>=r))return t.trim()===`streamId`?i:null}return null}function eventSourceCompletions(c,h,g,_){if(i(c)[h]||o(g).length<g.length||/[\uD800-\uDFFF]/.test(g))return null;let v=analyzeEventSources(c,_),y=v.contexts.get(h),b=g.trim()?a(c[h]):g.length;if(y?.route&&b>a(c[y.route.location.line-1])){let n=v.resolve(y.route.eventSource,y.route.stream).stream;if(n?.streamIdParts.length){let i=s(c,_.authoringDocuments??_.authoringSources?.filter(e=>e!==c.join(`
|
|
8
|
+
`))??[],_.authoringPlacement,_.authoringPath,_.authoringPlacementResolved),literal=e=>{let t=i.operations.concepts.find(t=>t.name===e)?.type??e;return t===`Int`?`0`:t===`Uuid`?`"00000000-0000-0000-0000-000000000000"`:'"${1:value}"'};if(streamIdHeader(c,h,y.route.location.line-1)!==null){let a=r(`^\\s*([A-Za-z_]\\w*)\\s*=(?!=|>)\\s*([\\w.]*)$`).exec(g);if(a){let r=n.streamIdParts.find(e=>e.name===a[1]);if(!r)return[];if(y.event)return[{label:r.name,insertText:literal(r.type.name),documentation:u}];if(!y.command)return[];let o=i.operations.concepts.filter(e=>e.name===r.type.name);if(r.type.isOptional||r.type.isCollection||!([`String`,`Uuid`].includes(r.type.name)||o.length===1&&[`String`,`Uuid`,`Int`].includes(o[0].type)&&o[0].values.length===0))return[];let s=a[2].split(`.`),c=y.command.properties;for(let e of s.slice(0,-1)){let t=c.filter(t=>t.name===e&&!t.type.isOptional&&!t.type.isCollection);if(t.length!==1)return[];let n=i.operations.types.filter(e=>e.name===t[0].type.name);if(n.length!==1)return[];c=n[0].properties.map(e=>({...e,isIdentifier:!1}))}return c.filter(e=>t(e.name)&&e.type.name===r.type.name&&!e.type.isOptional&&!e.type.isCollection).map(t=>({label:t.name,insertText:t.name,documentation:`${e(t.type)} — command source for authored stream id. ${l}`}))}let o=new Set(y.route.streamIdParts.filter(e=>e.location.line!==h+1).map(e=>e.property));return n.streamIdParts.filter(e=>!o.has(e.name)&&e.name.startsWith(g.trim())).map(e=>({label:e.name,insertText:`${e.name} = ${y.event?literal(e.type.name):``}`,documentation:y.event?u:l}))}return/^\s*(?:streamId)?$/.test(g)?[{label:`streamId parts`,insertText:`streamId\n${n.streamIdParts.map((e,t)=>` ${e.name} = ${y.event?literal(e.type.name):`\${${t+1}:source}`}`).join(`
|
|
9
|
+
`)}`,documentation:y.event?u:l}]:[]}}if(y?.event&&b>a(c[y.event.location.line-1])){if(y.route&&b>a(c[y.route.location.line-1])){let t=v.resolve(y.route.eventSource,y.route.stream).stream?.streamId;if(!t||y.route.streamId&&y.route.streamId.location.line!==h+1)return[];let n=s(c,_.authoringDocuments??_.authoringSources?.filter(e=>e!==c.join(`
|
|
10
|
+
`))??[],_.authoringPlacement,_.authoringPath,_.authoringPlacementResolved).operations.concepts.find(e=>e.name===t.name)?.type??t.name,r=n===`Int`?`0`:n===`Uuid`?`"00000000-0000-0000-0000-000000000000"`:'"${1:value}"';return/^\s*(?:streamId\s*=\s*)?$/.test(g)||`streamId`.startsWith(g.trim())?[{label:`streamId`,insertText:g.includes(`=`)?r:`streamId = ${r}`,documentation:`Concrete ${e(t)} literal. ${u}`}]:[]}if(d.test(g)&&(!y.event.stream||y.event.stream.location.line===h+1)&&!y.event.noStream){let e=g.trim().split(/\s+/)[1]??``;return v.declarations.flatMap(e=>e.streams.filter(t=>v.resolve(e.name,t.name).state===`unique`).map(t=>({name:`${e.name}.${t.name}`,source:e,stream:t}))).filter(n=>t(n.source.name)&&t(n.stream.name)&&(!e.includes(`.`)||n.name.startsWith(e.slice(0,e.lastIndexOf(`.`)+1)))).map(t=>({label:t.name,insertText:e.includes(`.`)?t.stream.name:t.name,documentation:`${eventSourceDetails(t.source,t.stream)}\n\n${u}`}))}if(y.event.stream||y.event.noStream)return!g.trim()||`stream`.startsWith(g.trim())||`no stream`.startsWith(g.trim())?[]:null;let n=[{label:`stream`,insertText:"stream ${1:Source.Stream}",documentation:u},...y.expectation?[{label:`no stream`,insertText:/^\s*no\s+/.test(g)?`stream`:`no stream`,documentation:`Assert an unrouted fact. ${u}`}]:[]].filter(e=>e.label.startsWith(g.trim()));return n.length>0?n:null}if(y?.command&&b>a(c[y.command.location.line-1])&&(!y.route||b<=a(c[y.route.location.line-1]))&&d.test(g)){let e=s(c,_.authoringDocuments??_.authoringSources?.filter(e=>e!==c.join(`
|
|
11
|
+
`))??[],_.authoringPlacement,_.authoringPath),n=new Set([...e.operations.concepts,...e.operations.types].map(e=>e.name)),r=g.trim().split(/\s+/)[1]??``;return v.targets.filter(e=>t(e.source.name)&&t(e.stream.name)&&!n.has(e.name)&&(!r.includes(`.`)||e.name.startsWith(r.slice(0,r.lastIndexOf(`.`)+1)))).map(e=>({label:e.name,insertText:r.includes(`.`)?e.stream.name:e.name,documentation:eventSourceDetails(e.source,e.stream)}))}if(y?.route&&y.command&&b>a(c[y.route.location.line-1])&&f.test(g)){let n=v.resolve(y.route.eventSource,y.route.stream).stream?.streamId;if(!n)return[];let r=s(c,_.authoringDocuments??_.authoringSources?.filter(e=>e!==c.join(`
|
|
12
|
+
`))??[],_.authoringPlacement,_.authoringPath),i=r.operations.concepts.filter(e=>e.name===n.name);if(!([`String`,`Uuid`].includes(n.name)||i.length===1&&[`String`,`Uuid`,`Int`].includes(i[0].type)&&i[0].values.length===0)||n.isOptional||n.isCollection)return[];let a=f.exec(g)[1].split(`.`),o=y.command.properties;for(let e of a.slice(0,-1)){let t=o.filter(t=>t.name===e);if(t.length!==1||t[0].type.isOptional||t[0].type.isCollection)return[];let n=r.operations.types.filter(e=>e.name===t[0].type.name);if(n.length!==1)return[];o=n[0].properties.map(e=>({...e,isIdentifier:!1}))}return o.filter(e=>t(e.name)&&e.type.name===n.name&&!e.type.isOptional&&!e.type.isCollection).map(t=>({label:t.name,insertText:t.name,documentation:`${e(t.type)} — command source for authored stream id. ${l}`}))}if(y?.source&&b>a(c[y.source.location.line-1])){let e=y.stream&&b>a(c[y.stream.location.line-1]),t=e&&streamIdHeader(c,h,y.stream.location.line-1)!==null&&r(`^\\s*[A-Za-z_]\\w*\\s+[\\w.]*$`).test(g);if(t||(e?m:p).test(g)){let e=s(c,_.authoringDocuments??[],_.authoringPlacement,_.authoringPath),r=t||/^\s*streamId\b/.test(g);return[...r?[`String`,`Uuid`]:[`String`,`Uuid`,`Int`,`Decimal`,`Bool`,`Date`,`DateTime`],...e.operations.concepts.filter(e=>!r||[`String`,`Uuid`,`Int`].includes(e.type)&&e.values.length===0).map(e=>e.name)].filter(n).map(e=>({label:e,insertText:e,documentation:l}))}if(/^\s*$/.test(g))return e?[{label:`streamId`,insertText:"streamId ${1:Type}",documentation:l},{label:`streamId parts`,insertText:"streamId\n ${1:first} ${2:Type}\n ${3:second} ${4:Type}",documentation:l},{label:`description`,insertText:'description "${1:Description}"',documentation:`Authored description.`}]:[{label:`identifier`,insertText:"identifier ${1:Type}",documentation:l},{label:`stream`,insertText:"stream ${1:Name}",documentation:l},{label:`description`,insertText:'description "${1:Description}"',documentation:`Authored description.`}]}return null}export{analyzeEventSources,l as eventSourceAvailability,eventSourceCompletions,eventSourceDetails,eventSourceHover,eventSourceIdentifier,eventSourceReferenceAt,u as specificationRouteAvailability};
|
|
13
|
+
//# sourceMappingURL=event-source-authoring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-source-authoring.js","names":["eventSourceAvailability","specificationRouteAvailability","routePrefix","sourceStreamPattern","keyPrefix","identifierTypePrefix","streamTypePrefix","symbolsForBuffer","lines","symbols","responseAnalysis","source","stream","typeReferenceText","part","analysis","location","route","name","line","start","end","withoutComment","candidate","resolution","sourcePart","prefix","reference","context","blockLocation","declaration","confidence","mapping","expression","typed","parts","properties","optional","collection","index","matches","property","types","type","indentOf","indent","owner","text","fenceMap","before","primitive","concept","concepts","path","segment","fields","isSourceStreamName","mapped","target","literal","qualified","matching","entry","names","ownsStream","partType","streamId","isSourceStreamTypeName"],"sources":["../../event-source-authoring.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { CompletionEntry } from './completion-items';\nimport { fenceMap, indentOf, withoutComment } from './document-context';\nimport { AuthoredEventSource } from './AuthoredEventSource';\nimport { AuthoredStream } from './AuthoredStream';\nimport { isSourceStreamName, isSourceStreamTypeName, sourceStreamPattern } from '@cratis/screenplay-compiler';\nimport { DocumentSymbols, symbolsForBuffer } from './symbols';\nimport { responseAnalysis } from './response-analysis';\nimport { typeReferenceText } from './TypeReferenceSymbol';\n\nexport const eventSourceAvailability = 'Event sources, streams and declarative command routes are admitted in executable semantic model (ESM) v8. A route classifies events; it does not supply an identity destination. Property-path mappings and handler routes remain unadmitted (PLAY0268).';\n\nexport const specificationRouteAvailability = 'Specification event routes, including example routes, are admitted in executable semantic model (ESM) v8. Redelivery remains unadmitted (PLAY0268) (#433), independently of its locator route.';\n\nconst routePrefix = sourceStreamPattern('^\\\\s*stream\\\\s+(?:[A-Za-z_]\\\\w*(?:\\\\.[A-Za-z_]\\\\w*)?\\\\.?)?$');\nconst keyPrefix = sourceStreamPattern('^\\\\s*streamId\\\\s*=\\\\s*([\\\\w.]*)$');\nconst identifierTypePrefix = sourceStreamPattern('^\\\\s*identifier\\\\s+[\\\\w.]*$');\nconst streamTypePrefix = sourceStreamPattern('^\\\\s*streamId\\\\s+[\\\\w.]*$');\n\nexport function analyzeEventSources(lines: string[], symbols?: DocumentSymbols) {\n symbols = symbolsForBuffer(lines, symbols);\n return responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, symbols?.authoringPath, symbols?.authoringPlacementResolved).eventSources;\n}\n\nexport function eventSourceDetails(source: AuthoredEventSource, stream?: AuthoredStream): string {\n return [`**${stream ? `stream ${source.name}.${stream.name}` : `eventsource ${source.name}`}**`,\n stream?.description ?? source.description ?? '',\n source.identifier ? `Identifier type: ${typeReferenceText(source.identifier)}` : 'No identifier type declared.',\n stream ? stream.streamIdParts.length > 0 ? `Stream id parts: ${stream.streamIdParts.map(part => `${part.name} ${typeReferenceText(part.type)}`).join(', ')}` : stream.streamId ? `Stream id type: ${typeReferenceText(stream.streamId)}` : 'Unkeyed stream.' : source.streams.map(stream => `${stream.name}${stream.streamIdParts.length > 0 ? ` — ${stream.streamIdParts.map(part => `${part.name} ${typeReferenceText(part.type)}`).join(', ')}` : stream.streamId ? ` — ${typeReferenceText(stream.streamId)}` : ' — unkeyed'}`).join('\\n'),\n (stream?.id ?? (!stream ? source.id : null)) ? 'Stored-name pin (rename-only metadata; not a semantic ID).' : '', eventSourceAvailability].filter(Boolean).join('\\n\\n');\n}\n\nexport function eventSourceReferenceAt(lines: string[], line: number, start: number, end: number, symbols?: DocumentSymbols) {\n const analysis = analyzeEventSources(lines, symbols);\n const at = (route: typeof analysis.routes[number]) => {\n const location = route.referenceLocation;\n const name = `${route.eventSource}.${route.stream}`;\n return location?.line === line + 1 && start >= location.column && end <= location.column + name.length &&\n withoutComment(lines[line] ?? '').slice(location.column - 1, location.column - 1 + name.length) === name;\n };\n const candidate = analysis.ambiguousCandidates.find(at);\n if (candidate) return { route: candidate, resolution: { state: 'ambiguous', source: undefined, stream: undefined }, target: undefined };\n const route = analysis.routes.find(at);\n if (!route) return null;\n const resolution = analysis.resolve(route.eventSource, route.stream);\n const sourcePart = end <= route.referenceLocation!.column + route.eventSource.length;\n return { route, resolution, target: resolution.state === 'unique' ? sourcePart ? resolution.source : resolution.stream : undefined };\n}\n\n// The location is a typed header start. Match its exact prefix, never search comments or another\n// occurrence of the same name. Both hosts use this to navigate to the authored identifier.\nexport function eventSourceIdentifier(location: { line: number; column: number; path?: string }, name: string, source: string) {\n const line = withoutComment(source.split(/\\r?\\n/)[location.line - 1] ?? '');\n const prefix = line.slice(location.column - 1).match(/^(?:eventsource|stream)\\s+/)?.[0];\n return prefix && line.slice(location.column - 1 + prefix.length, location.column - 1 + prefix.length + name.length) === name\n ? { ...location, column: location.column + prefix.length } : undefined;\n}\n\nexport function eventSourceHover(lines: string[], line: number, start: number, end: number, symbols?: DocumentSymbols): string | null {\n symbols = symbolsForBuffer(lines, symbols);\n const analysis = analyzeEventSources(lines, symbols);\n const reference = eventSourceReferenceAt(lines, line, start, end, symbols);\n if (reference) return reference.resolution.source && reference.resolution.stream ? eventSourceDetails(reference.resolution.source, reference.resolution.stream) + (analysis.contexts.get(line)?.event ? `\\n\\n${specificationRouteAvailability}` : '')\n : `Physical stream owner: ${reference.resolution.state}; no route selected. ${'reasons' in reference.resolution ? reference.resolution.reasons.join(' ') : ''} ${eventSourceAvailability}`;\n const context = analysis.contexts.get(line);\n if (context?.event?.noStream?.location.line === line + 1 && start >= context.event.noStream.location.column && end <= context.event.noStream.location.column + 9)\n return `Assert an unrouted event; omitting a route on then leaves it unasserted. ${specificationRouteAvailability}`;\n if (context?.event && context.route?.streamId?.location.line === line + 1 && start === context.route.streamId.location.column && end === start + 8)\n return `Concrete literal stream id, not a command property mapping. ${specificationRouteAvailability}`;\n const blockLocation = context?.route?.directiveLocations?.streamId ?? context?.stream?.directiveLocations?.streamId;\n if (blockLocation?.line === line + 1 && start === blockLocation.column && end === start + 8)\n return `Composite stream id: named parts, not a pre-joined value. ${context?.event ? specificationRouteAvailability : eventSourceAvailability}`;\n for (const part of context?.route?.streamIdParts ?? []) {\n if (part.location.line === line + 1 && start === part.location.column && end === start + part.property.length)\n return `Authored stream id part **${part.property}**. ${context?.event ? `Concrete literal. ${specificationRouteAvailability}` : eventSourceAvailability}`;\n }\n const declaration = context?.stream ?? context?.source;\n if (declaration) {\n const name = eventSourceIdentifier(declaration.location, declaration.name, lines.join('\\n'));\n if (name?.line === line + 1 && start === name.column && end === start + declaration.name.length && context?.source) {\n const confidence = analysis.resolve(context.source.name, context.stream?.name);\n return eventSourceDetails(context.source, context.stream) + (confidence.state === 'unique' ? '' : `\\n\\nPhysical ownership: ${confidence.state}. ${confidence.reasons.join(' ')}`);\n }\n }\n const mapping = context?.route ? [context.route.streamId, ...context.route.streamIdParts].find(mapping => mapping?.location.line === line + 1) : undefined;\n if (mapping && context?.command) {\n if (mapping.location.line === line + 1 && start === mapping.location.column && end === start + 8)\n return `Authored stream id mapping. ${eventSourceAvailability}`;\n const expression = mapping.source as { kind?: string; path?: string; location?: { line: number; column: number } };\n if (expression.kind === 'PathExpressionSyntax' && expression.path && expression.location?.line === line + 1 &&\n start >= expression.location.column && end <= expression.location.column + expression.path.length) {\n const typed = responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, symbols?.authoringPath, symbols?.authoringPlacementResolved);\n const prefix = expression.path.slice(0, end - expression.location.column);\n const parts = prefix.split('.');\n let properties = context.command.properties;\n let optional = false;\n let collection = false;\n for (const [index, part] of parts.entries()) {\n const matches = properties.filter(property => property.name === part);\n if (matches.length !== 1) break;\n const property = matches[0];\n optional ||= property.type.isOptional;\n collection ||= property.type.isCollection;\n if (index === parts.length - 1)\n return `**${part}** — ${typeReferenceText({ ...property.type, isOptional: optional, isCollection: collection })}. Command source for authored stream id. ${eventSourceAvailability}`;\n const types = typed.operations.types.filter(type => type.name === property.type.name);\n if (types.length !== 1 || collection) break;\n properties = types[0].properties.map(property => ({ ...property, isIdentifier: false }));\n }\n }\n }\n if (context?.source && /^\\s*id\\s+\"/.test(withoutComment(lines[line] ?? '')) && start === indentOf(lines[line]) + 1 && end === start + 2)\n return `Stored-name pin: rename-only metadata, not a semantic identity or an automatic refactor. ${eventSourceAvailability}`;\n const type = context?.stream?.streamIdParts.find(part => part.type.location?.line === line + 1)?.type ?? context?.stream?.streamId ?? context?.source?.identifier;\n if (type && type.location?.line === line + 1 && start >= type.location.column && end <= type.location.column + type.name.length)\n return `${typeReferenceText(type)} — authored ${context?.stream ? 'stream id' : 'identifier'} type. ${eventSourceAvailability}`;\n return null;\n}\n\nfunction streamIdHeader(lines: string[], line: number, owner: number): number | null {\n const indent = indentOf(lines[line] ?? '');\n for (let index = line - 1; index > owner; index--) {\n const text = withoutComment(lines[index]);\n if (!text.trim() || indentOf(text) >= indent) continue;\n return text.trim() === 'streamId' ? index : null;\n }\n return null;\n}\n\nexport function eventSourceCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n // .NET word characters are UTF-16 code units; supplementary letters are not identifiers.\n if (fenceMap(lines)[line] || withoutComment(before).length < before.length || /[\\uD800-\\uDFFF]/.test(before)) return null;\n const analysis = analyzeEventSources(lines, symbols);\n const context = analysis.contexts.get(line);\n const indent = before.trim() ? indentOf(lines[line]) : before.length;\n if (context?.route && indent > indentOf(lines[context.route.location.line - 1])) {\n const stream = analysis.resolve(context.route.eventSource, context.route.stream).stream;\n if (stream?.streamIdParts.length) {\n const typed = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols.authoringPlacement, symbols.authoringPath, symbols.authoringPlacementResolved);\n const literal = (name: string) => {\n const primitive = typed.operations.concepts.find(concept => concept.name === name)?.type ?? name;\n return primitive === 'Int' ? '0' : primitive === 'Uuid' ? '\"00000000-0000-0000-0000-000000000000\"' : '\"${1:value}\"';\n };\n if (streamIdHeader(lines, line, context.route.location.line - 1) !== null) {\n const mapping = sourceStreamPattern('^\\\\s*([A-Za-z_]\\\\w*)\\\\s*=(?!=|>)\\\\s*([\\\\w.]*)$').exec(before);\n if (mapping) {\n const part = stream.streamIdParts.find(part => part.name === mapping[1]);\n if (!part) return [];\n if (context.event) return [{ label: part.name, insertText: literal(part.type.name), documentation: specificationRouteAvailability }];\n if (!context.command) return [];\n const concepts = typed.operations.concepts.filter(concept => concept.name === part.type.name);\n if (part.type.isOptional || part.type.isCollection || !(['String', 'Uuid'].includes(part.type.name) || concepts.length === 1 && ['String', 'Uuid', 'Int'].includes(concepts[0].type) && concepts[0].values.length === 0)) return [];\n const path = mapping[2].split('.');\n let properties = context.command.properties;\n for (const segment of path.slice(0, -1)) {\n const fields = properties.filter(property => property.name === segment && !property.type.isOptional && !property.type.isCollection);\n if (fields.length !== 1) return [];\n const types = typed.operations.types.filter(type => type.name === fields[0].type.name);\n if (types.length !== 1) return [];\n properties = types[0].properties.map(property => ({ ...property, isIdentifier: false }));\n }\n return properties.filter(property => isSourceStreamName(property.name) && property.type.name === part.type.name && !property.type.isOptional && !property.type.isCollection)\n .map(property => ({ label: property.name, insertText: property.name, documentation: `${typeReferenceText(property.type)} — command source for authored stream id. ${eventSourceAvailability}` }));\n }\n const mapped = new Set(context.route.streamIdParts.filter(part => part.location.line !== line + 1).map(part => part.property));\n return stream.streamIdParts.filter(part => !mapped.has(part.name) && part.name.startsWith(before.trim()))\n .map(part => ({ label: part.name, insertText: `${part.name} = ${context.event ? literal(part.type.name) : ''}`, documentation: context.event ? specificationRouteAvailability : eventSourceAvailability }));\n }\n if (/^\\s*(?:streamId)?$/.test(before)) return [{ label: 'streamId parts', insertText: `streamId\\n${stream.streamIdParts.map((part, index) => ` ${part.name} = ${context.event ? literal(part.type.name) : `\\${${index + 1}:source}`}`).join('\\n')}`, documentation: context.event ? specificationRouteAvailability : eventSourceAvailability }];\n return [];\n }\n }\n if (context?.event && indent > indentOf(lines[context.event.location.line - 1])) {\n if (context.route && indent > indentOf(lines[context.route.location.line - 1])) {\n const target = analysis.resolve(context.route.eventSource, context.route.stream).stream?.streamId;\n if (!target || context.route.streamId && context.route.streamId.location.line !== line + 1) return [];\n const typed = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols.authoringPlacement, symbols.authoringPath, symbols.authoringPlacementResolved);\n const primitive = typed.operations.concepts.find(concept => concept.name === target.name)?.type ?? target.name;\n const literal = primitive === 'Int' ? '0' : primitive === 'Uuid' ? '\"00000000-0000-0000-0000-000000000000\"' : '\"${1:value}\"';\n if (/^\\s*(?:streamId\\s*=\\s*)?$/.test(before) || 'streamId'.startsWith(before.trim()))\n return [{ label: 'streamId', insertText: before.includes('=') ? literal : `streamId = ${literal}`, documentation: `Concrete ${typeReferenceText(target)} literal. ${specificationRouteAvailability}` }];\n return [];\n }\n if (routePrefix.test(before) && (!context.event.stream || context.event.stream.location.line === line + 1) && !context.event.noStream) {\n const qualified = before.trim().split(/\\s+/)[1] ?? '';\n // Specification payload lines require '=', so imported value types cannot compete\n // with a route here as they do under a command. Physical ownership still must be unique.\n const targets = analysis.declarations.flatMap(source => source.streams.filter(stream => analysis.resolve(source.name, stream.name).state === 'unique')\n .map(stream => ({ name: `${source.name}.${stream.name}`, source, stream })));\n return targets.filter(target => isSourceStreamName(target.source.name) && isSourceStreamName(target.stream.name) && (!qualified.includes('.') || target.name.startsWith(qualified.slice(0, qualified.lastIndexOf('.') + 1))))\n .map(target => ({ label: target.name, insertText: qualified.includes('.') ? target.stream.name : target.name, documentation: `${eventSourceDetails(target.source, target.stream)}\\n\\n${specificationRouteAvailability}` }));\n }\n if (context.event.stream || context.event.noStream)\n return !before.trim() || 'stream'.startsWith(before.trim()) || 'no stream'.startsWith(before.trim()) ? [] : null;\n const entries = [{ label: 'stream', insertText: 'stream ${1:Source.Stream}', documentation: specificationRouteAvailability },\n ...(context.expectation ? [{ label: 'no stream', insertText: /^\\s*no\\s+/.test(before) ? 'stream' : 'no stream', documentation: `Assert an unrouted fact. ${specificationRouteAvailability}` }] : [])];\n const matching = entries.filter(entry => entry.label.startsWith(before.trim()));\n return matching.length > 0 ? matching : null;\n }\n if (context?.command && indent > indentOf(lines[context.command.location.line - 1]) &&\n (!context.route || indent <= indentOf(lines[context.route.location.line - 1])) && routePrefix.test(before)) {\n // A property named stream remains legal. Only offer routes whose complete-input\n // candidates have no known value-type competitor; never silently rewrite ambiguity.\n const typed = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols.authoringPlacement, symbols.authoringPath);\n const names = new Set([...typed.operations.concepts, ...typed.operations.types].map(type => type.name));\n // targets already exclude competing imports from the authoritative parsed documents.\n // Scanned symbols can retain an import removed from the current unsaved buffer.\n const qualified = before.trim().split(/\\s+/)[1] ?? '';\n return analysis.targets.filter(target => isSourceStreamName(target.source.name) && isSourceStreamName(target.stream.name) && !names.has(target.name) && (!qualified.includes('.') || target.name.startsWith(qualified.slice(0, qualified.lastIndexOf('.') + 1))))\n .map(target => ({ label: target.name, insertText: qualified.includes('.') ? target.stream.name : target.name, documentation: eventSourceDetails(target.source, target.stream) }));\n }\n if (context?.route && context.command && indent > indentOf(lines[context.route.location.line - 1]) && keyPrefix.test(before)) {\n const target = analysis.resolve(context.route.eventSource, context.route.stream).stream?.streamId;\n if (!target) return [];\n const typed = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols.authoringPlacement, symbols.authoringPath);\n const concepts = typed.operations.concepts.filter(concept => concept.name === target.name);\n const supported = ['String', 'Uuid'].includes(target.name) || concepts.length === 1 && ['String', 'Uuid', 'Int'].includes(concepts[0].type) && concepts[0].values.length === 0;\n if (!supported || target.isOptional || target.isCollection) return [];\n const parts = keyPrefix.exec(before)![1].split('.');\n let properties = context.command.properties;\n for (const part of parts.slice(0, -1)) {\n const matches = properties.filter(property => property.name === part);\n if (matches.length !== 1 || matches[0].type.isOptional || matches[0].type.isCollection) return [];\n const types = typed.operations.types.filter(type => type.name === matches[0].type.name);\n if (types.length !== 1) return [];\n properties = types[0].properties.map(property => ({ ...property, isIdentifier: false }));\n }\n return properties.filter(property => isSourceStreamName(property.name) && property.type.name === target.name && !property.type.isOptional && !property.type.isCollection)\n .map(property => ({ label: property.name, insertText: property.name, documentation: `${typeReferenceText(property.type)} — command source for authored stream id. ${eventSourceAvailability}` }));\n }\n if (context?.source && indent > indentOf(lines[context.source.location.line - 1])) {\n const ownsStream = context.stream && indent > indentOf(lines[context.stream.location.line - 1]);\n const partType = ownsStream && streamIdHeader(lines, line, context.stream!.location.line - 1) !== null && sourceStreamPattern('^\\\\s*[A-Za-z_]\\\\w*\\\\s+[\\\\w.]*$').test(before);\n if (partType || (ownsStream ? streamTypePrefix : identifierTypePrefix).test(before)) {\n const typed = responseAnalysis(lines, symbols.authoringDocuments ?? [], symbols.authoringPlacement, symbols.authoringPath);\n const streamId = partType || /^\\s*streamId\\b/.test(before);\n return [...(streamId ? ['String', 'Uuid'] : ['String', 'Uuid', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime']), ...typed.operations.concepts.filter(concept => !streamId || ['String', 'Uuid', 'Int'].includes(concept.type) && concept.values.length === 0).map(concept => concept.name)]\n .filter(isSourceStreamTypeName).map(name => ({ label: name, insertText: name, documentation: eventSourceAvailability }));\n }\n if (/^\\s*$/.test(before)) return ownsStream ? [\n { label: 'streamId', insertText: 'streamId ${1:Type}', documentation: eventSourceAvailability },\n { label: 'streamId parts', insertText: 'streamId\\n ${1:first} ${2:Type}\\n ${3:second} ${4:Type}', documentation: eventSourceAvailability },\n { label: 'description', insertText: 'description \"${1:Description}\"', documentation: 'Authored description.' }\n ] : [\n { label: 'identifier', insertText: 'identifier ${1:Type}', documentation: eventSourceAvailability },\n { label: 'stream', insertText: 'stream ${1:Name}', documentation: eventSourceAvailability },\n { label: 'description', insertText: 'description \"${1:Description}\"', documentation: 'Authored description.' }\n ];\n }\n return null;\n}\n"],"mappings":"scAYA,MAAaA,EAA0B,2PAE1BC,EAAiC,iMAExCC,EAAcC,EAAoB,6DAA6D,EAC/FC,EAAYD,EAAoB,kCAAkC,EAClEE,EAAuBF,EAAoB,6BAA6B,EACxEG,EAAmBH,EAAoB,2BAA2B,EAExE,SAAgB,oBAAoB,EAAiB,EAA2B,CAE5E,MADA,GAAUI,EAAiBC,EAAOC,CAAO,EAClCC,EAAiBF,EAAOC,GAAS,oBAAsBA,GAAS,kBAAkB,OAAO,GAAUE,IAAWH,EAAM,KAAK;CAAI,CAAC,GAAK,CAAC,EAAGC,GAAS,mBAAoBA,GAAS,cAAeA,GAAS,0BAA0B,CAAC,CAAC,YAC5O,CAEA,SAAgB,mBAAmB,EAA6B,EAAiC,CAC7F,MAAO,CAAC,KAAKG,EAAS,UAAUD,EAAO,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AAW,SAAS,OAAO,GAAW,CAACgC,GAAY,CAAC,SAAU,OAAQ,KAAK,CAAC,CAAC,SAASf,EAAQ,IAAI,GAAKA,EAAQ,OAAO,SAAW,CAAC,CAAC,CAAC,IAAI,GAAWA,EAAQ,IAAI,CAAC,CAAC,CACpR,OAAOgB,CAAsB,CAAC,CAAC,IAAI,IAAS,CAAE,MAAOjD,EAAM,WAAYA,EAAM,cAAelB,CAAwB,EAAE,CAC/H,CACA,GAAI,QAAQ,KAAKiD,CAAM,EAAG,OAAOe,EAAa,CAC1C,CAAE,MAAO,WAAY,WAAY,qBAAsB,cAAehE,CAAwB,EAC9F,CAAE,MAAO,iBAAkB,WAAY,4DAA6D,cAAeA,CAAwB,EAC3I,CAAE,MAAO,cAAe,WAAY,iCAAkC,cAAe,uBAAwB,CACjH,EAAI,CACA,CAAE,MAAO,aAAc,WAAY,uBAAwB,cAAeA,CAAwB,EAClG,CAAE,MAAO,SAAU,WAAY,mBAAoB,cAAeA,CAAwB,EAC1F,CAAE,MAAO,cAAe,WAAY,iCAAkC,cAAe,uBAAwB,CACjH,CACJ,CACA,OAAO,IACX"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{bmpWordCharacters as e}from"./bmp-word-characters.js";import{eventDeclarations as t}from"./compiler/Syntax/EventDeclarations.js";import"./compiler/index.js";import{withoutComment as n}from"./document-context.js";import{specificationStepItems as r}from"./completion-items.js";const i=RegExp(`^\\s*example\\s+[A-Z][${e}]*\\s*:\\s*([${e}.]*)$`),a=RegExp(`^\\s*(given|when|then)\\s+(?:(readmodel|append)\\s+)?([${e}.]*)$`);function exampleAnalysis(e,o,s,c,l,u){let d=e,f=[],p=u.some(e=>e.severity===`error`)?u.some(e=>e.code===`PLAY0519`)?`**Invalid duplicate assignments; no effective values selected.**`:`**Invalid source; no effective values selected.**`:null,m=/* @__PURE__ */ new Map,h=[],own=(e,t)=>{if(e.location.path===o&&e.location.line>0)for(let n of c(e.location.line-1))m.set(n,t)},examples=(e,t)=>{for(let n of e??[])f.push({name:n.name,scope:t,example:n}),own(n,t)};examples(d.examples,[]),f.push(...[...d.concepts,...d.types].map(e=>({name:e.name,scope:[]})));let features=(e,n)=>{for(let r of e){let e=[...n,r.name];own(r,e),examples(r.examples,e);for(let e of r.slices){let i=[...n,r.name,e.name];own(e,i),examples(e.examples,i);let a=/* @__PURE__ */ new Map;for(let n of t(e))a.set(n.name,[...a.get(n.name)??[],n]);for(let e of a.values()){let t=Math.max(...e.map(e=>e.generation));f.push(...e.filter(e=>e.generation===t).map(e=>({name:e.name,scope:i,fixtureKind:`event`})))}f.push(...e.commands.map(e=>({name:e.name,scope:i,fixtureKind:`command`})),...e.readModels.map(e=>({name:e.name,scope:i,fixtureKind:`readmodel`})));for(let t of e.specifications)h.push({node:t,scope:i}),own(t,i),examples(t.examples,i)}features(r.features,e)}};for(let e of d.modules)own(e,[e.name]),examples(e.examples,[e.name]),features(e.features,[e.name]);let candidates=(e,t)=>{let n=e.split(`.`),r=f.filter(e=>e.name===n.at(-1)),i=n.slice(0,-1);if(i.length)return r.filter(e=>i.length<=e.scope.length&&i.every((t,n)=>e.scope[e.scope.length-i.length+n]===t));for(let e=t.length;e>=0;e--){let n=r.filter(n=>e<=n.scope.length&&t.slice(0,e).every((e,t)=>n.scope[t]===e));if(n.length)return n}return[]},unique=(e,t)=>{let n=candidates(e,t);return n.length===1?n[0]:void 0},kind=e=>e.example?unique(e.example.type,e.scope)?.fixtureKind:e.fixtureKind,display=e=>[...e.scope.filter(e=>!l.has(e)),e.name].join(`.`),targets=(e,t,n=!1,r=``)=>f.flatMap(i=>{let a=kind(i);if(!a||t&&a!==t||n&&i.example)return[];let o=[...i.scope,i.name].join(`.`),s=unique(i.name,e)===i?i.name:o;if(unique(s,e)!==i)return[];let c=r.split(`.`).slice(0,-1).join(`.`);return c&&!o.endsWith(`${c}.${i.name}`)||s===o&&i.scope.some(e=>l.has(e))&&unique(i.name,e)!==i?[]:[{label:unique(i.name,e)===i?i.name:display(i),insertText:c?i.name:s,documentation:i.example?`Example of ${i.example.type}. Step assignments override example values; no implicit defaults.`:`Declared ${a}.`}]}),effective=(e,t,n,r,i)=>{if(p)return p;let merge=(t,n,r=``)=>{if(new Set(t.map(e=>e.property)).size!==t.length||new Set(n.map(e=>e.property)).size!==n.length)return null;let i=new Map(t.map(e=>[e.property,{value:e,origin:`example`,replaced:void 0}]));for(let e of n){let t=i.get(e.property)?.value;i.delete(e.property),i.set(e.property,{value:e,origin:t?`override`:`authored`,replaced:t})}return[...i.values()].map(({value:t,origin:n,replaced:i})=>`${r}${t.property} = ${expressionText(t.source)} — ${n}${n===`example`?` ${e.name}`:``}${i?` (replaces ${expressionText(i.source)} from ${e.name})`:``}`)},a=merge(e?.values??[],t),o=merge(e?.generatedValues??[],n,`generated `);if(!a||!o)return`**Invalid duplicate assignments; no effective values selected.**`;let s=r??e?.for,c=e?.stream??e?.noStream,l=i?.stream??i?.noStream,u=l??c,routeText=e=>e.kind===`SpecificationNoStreamSyntax`?`no stream`:`stream ${e.eventSource}.${e.stream}${e.streamId?` streamId = ${expressionText(e.streamId.source)}`:e.streamIdParts.length?` streamId ${e.streamIdParts.map(e=>`${e.property} = ${expressionText(e.source)}`).join(`, `)}`:``}`,d=u?[`${routeText(u)} — ${l?c?`override (replaces ${routeText(c)} from ${e.name})`:`authored`:`example ${e.name}`}`]:[];return[...a,...o,...d,...s?[`for ${expressionText(s)} — ${r?e?.for?`override (replaces ${expressionText(e.for)} from ${e.name})`:`authored`:`example ${e.name}`}`]:[]].join(`
|
|
2
|
+
`)},g=/* @__PURE__ */ new Map;for(let e of f.filter(e=>e.example?.location.path===o)){let t=e.example,r=t.location.line-1,i=n(s[r]??``).match(/^\s*example\s+/)?.[0];i&&g.set(r,{start:i.length+1,length:t.name.length,content:`**example ${display(e)} : ${t.type}**\n\n${kind(e)?effective(t,[],[],null):`Unresolved or ambiguous type; no effective values selected.`}`})}for(let{node:e,scope:t}of h){let r=[...e.given.map(e=>({step:e,name:e.eventType,expected:`event`,values:e.values,generated:[],destination:e.for,prefix:/^\s*given\s+/})),...e.givenReadModels.map(e=>({step:e,name:e.name,expected:`readmodel`,values:e.properties,generated:[],destination:null,prefix:/^\s*given\s+readmodel\s+/})),...e.when?[{step:e.when,name:e.when.commandType,expected:`command`,values:e.when.values,generated:e.when.generatedValues??[],destination:e.when.for,prefix:/^\s*when\s+/}]:[],...e.whenAppended?[{step:e.whenAppended,name:e.whenAppended.eventType,expected:`event`,values:e.whenAppended.values,generated:[],destination:e.whenAppended.for,prefix:/^\s*when\s+append\s+/}]:[],...e.thenEvents.map(e=>({step:e,name:e.eventType,expected:`event`,values:e.values,generated:[],destination:e.for,prefix:/^\s*then\s+/})),...e.thenReadModels.map(e=>({step:e,name:e.name,expected:`readmodel`,values:e.properties,generated:[],destination:null,prefix:/^\s*then\s+readmodel\s+/}))];for(let{step:e,name:i,expected:a,values:c,generated:l,destination:u,prefix:d}of r.filter(e=>e.step.location.path===o)){let r=unique(i,t),o=candidates(i,t).some(e=>e.example);if(!r?.example&&(r||!o))continue;let f=e.location.line-1,p=n(s[f]??``).match(d)?.[0].length;if(p===void 0)continue;let m=r?kind(r)===a?`**${a} ${r.example?.type??i}${r.example?` — example ${display(r)}`:``}**\n\n${effective(r.example,c,l,u,`eventType`in e?e:void 0)}\n\nAuthored fixture values, not execution results. Matching is unchanged.`:`**Example kind mismatch; no effective values selected.**`:`**Ambiguous example; no effective values selected.**`;g.set(f,{start:p+1,length:i.length,content:m})}}return{eventExamples:f.filter(e=>e.example?.location.path===o&&kind(e)===`event`).map(e=>e.example),completions(e,t){let n=m.get(e)??[],s=t.match(i);if(s)return targets(n,void 0,!0,s[1]);if(!h.some(({node:t})=>t.location.path===o&&c(t.location.line-1).includes(e)))return null;let l=t.match(a);if(!l||[`clock`,`caller`,`capture`,`trigger`,`query`,`result`,`error`,`denied`,`returns`,`no`,`operation`,`compensated`].includes(l[3]))return null;let u=l[2]===`readmodel`?`readmodel`:l[2]===`append`||l[1]!==`when`?`event`:`command`,d=targets(n,u,!1,l[3]);return d.length?l[2]?d:[...r[l[1]],...d]:null},hover(e,t,n){let r=g.get(e);return r&&t>=r.start&&n<=r.start+r.length?r.content:null}}}function expressionText(e){switch(e.kind){case`LiteralExpressionSyntax`:return typeof e.value==`object`&&e.value!==null?e.value.value:JSON.stringify(e.value);case`ListExpressionSyntax`:return`[${e.items.map(expressionText).join(`, `)}]`;case`ObjectExpressionSyntax`:return`{ ${e.members.map(e=>`${JSON.stringify(e.name)}: ${expressionText(e.value)}`).join(`, `)} }`;case`RawExpressionSyntax`:return e.text;case`CaseValueExpressionSyntax`:return`case.${e.parameter}`;case`PathExpressionSyntax`:return e.path;case`ContextExpressionSyntax`:return`$context.${e.path}`;case`IdentityExpressionSyntax`:return`$identity.${e.path}`;case`EventContextExpressionSyntax`:return`$eventContext.${e.path}`;case`RefusalExpressionSyntax`:return`$refusal.${e.member}`;case`EventSourceIdExpressionSyntax`:return`$eventSourceId`;case`CausedByExpressionSyntax`:return`$causedBy${e.property?`.${e.property}`:``}`;case`EnvironmentExpressionSyntax`:return`$env.${e.name}`;case`StringsExpressionSyntax`:return`$strings.${e.key}`;case`SourceItemExpressionSyntax`:return`$.${e.path}`;case`TemplateExpressionSyntax`:return"`"+e.parts.map(e=>e.kind===`TemplateTextSyntax`?e.text:"${"+expressionText(e.expression)+`}`).join(``)+"`"}}export{exampleAnalysis};
|
|
3
|
+
//# sourceMappingURL=example-analysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example-analysis.js","names":["exampleTypePrefix","bmpWordCharacters","fixtureStepPrefix","application","syntax","declarations","rejected","diagnostics","diagnostic","contexts","specifications","node","path","line","range","scope","example","nodes","feature","parent","slice","events","event","eventDeclarations","generations","latest","module","parts","reference","named","qualifiers","index","part","depth","visible","matches","hiddenScopes","fixtureKind","expected","typesOnly","full","name","prefix","base","value","overrides","result","replaced","origin","properties","values","fixtures","generated","selected","destination","priorRoute","replacementRoute","authoredRoute","route","routing","hovers","declaration","withoutComment","lines","steps","step","entry","resolved","competing","start","content","header","before","entries","specificationStepItems","hover","end","expression","member"],"sources":["../../example-analysis.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ApplicationSyntax, eventDeclarations, ExpressionSyntax, FeatureSyntax, PropertyMappingSyntax, SpecificationExampleSyntax, SpecificationSyntax } from '@cratis/screenplay-compiler';\nimport { CompletionEntry, specificationStepItems } from './completion-items';\nimport { ExampleAnalysis } from './ExampleAnalysis';\nimport { FixtureKind } from './FixtureKind';\nimport { withoutComment } from './document-context';\nimport { bmpWordCharacters } from './bmp-word-characters';\n\nconst exampleTypePrefix = new RegExp(`^\\\\s*example\\\\s+[A-Z][${bmpWordCharacters}]*\\\\s*:\\\\s*([${bmpWordCharacters}.]*)$`);\nconst fixtureStepPrefix = new RegExp(`^\\\\s*(given|when|then)\\\\s+(?:(readmodel|append)\\\\s+)?([${bmpWordCharacters}.]*)$`);\n\n// Editor-only projection of parser-owned fixtures. It does not bind, execute, supply defaults,\n// or publish ESM. Scoped candidates use the same nearest-shared-prefix rule as the compiler.\nexport function exampleAnalysis(syntax: unknown, path: string, lines: string[], range: (line: number) => number[], hiddenScopes: ReadonlySet<string>, diagnostics: readonly { severity: string; code: string }[]): ExampleAnalysis {\n const application = syntax as ApplicationSyntax;\n const declarations: { name: string; scope: readonly string[]; fixtureKind?: FixtureKind; example?: SpecificationExampleSyntax }[] = [];\n const rejected = diagnostics.some(diagnostic => diagnostic.severity === 'error')\n ? diagnostics.some(diagnostic => diagnostic.code === 'PLAY0519') ? '**Invalid duplicate assignments; no effective values selected.**' : '**Invalid source; no effective values selected.**'\n : null;\n const contexts = new Map<number, readonly string[]>();\n const specifications: { node: SpecificationSyntax; scope: readonly string[] }[] = [];\n const own = (node: { location: { path?: string; line: number } }, scope: readonly string[]) => {\n if (node.location.path === path && node.location.line > 0) for (const line of range(node.location.line - 1)) contexts.set(line, scope);\n };\n const examples = (nodes: readonly SpecificationExampleSyntax[] | undefined, scope: readonly string[]) => {\n for (const example of nodes ?? []) { declarations.push({ name: example.name, scope, example }); own(example, scope); }\n };\n examples(application.examples, []);\n declarations.push(...[...application.concepts, ...application.types].map(node => ({ name: node.name, scope: [] })));\n const features = (nodes: readonly FeatureSyntax[], parent: readonly string[]) => {\n for (const feature of nodes) {\n const scope = [...parent, feature.name];\n own(feature, scope);\n examples(feature.examples, scope);\n for (const slice of feature.slices) {\n const scope = [...parent, feature.name, slice.name];\n own(slice, scope);\n examples(slice.examples, scope);\n const events = new Map<string, ReturnType<typeof eventDeclarations>[number][]>();\n for (const event of eventDeclarations(slice)) events.set(event.name, [...events.get(event.name) ?? [], event]);\n for (const generations of events.values()) {\n const latest = Math.max(...generations.map(event => event.generation));\n declarations.push(...generations.filter(event => event.generation === latest).map(event => ({ name: event.name, scope, fixtureKind: FixtureKind.Event })));\n }\n declarations.push(...slice.commands.map(node => ({ name: node.name, scope, fixtureKind: FixtureKind.Command })),\n ...slice.readModels.map(node => ({ name: node.name, scope, fixtureKind: FixtureKind.ReadModel })));\n for (const node of slice.specifications) { specifications.push({ node, scope }); own(node, scope); examples(node.examples, scope); }\n }\n features(feature.features, scope);\n }\n };\n for (const module of application.modules) {\n own(module, [module.name]);\n examples(module.examples, [module.name]);\n features(module.features, [module.name]);\n }\n const candidates = (reference: string, scope: readonly string[]) => {\n const parts = reference.split('.');\n const named = declarations.filter(node => node.name === parts.at(-1));\n const qualifiers = parts.slice(0, -1);\n if (qualifiers.length) return named.filter(node => qualifiers.length <= node.scope.length && qualifiers.every((part, index) => node.scope[node.scope.length - qualifiers.length + index] === part));\n for (let depth = scope.length; depth >= 0; depth--) {\n const visible = named.filter(node => depth <= node.scope.length && scope.slice(0, depth).every((part, index) => node.scope[index] === part));\n if (visible.length) return visible;\n }\n return [];\n };\n const unique = (reference: string, scope: readonly string[]) => {\n const matches = candidates(reference, scope);\n return matches.length === 1 ? matches[0] : undefined;\n };\n const kind = (node: typeof declarations[number]): FixtureKind | undefined => node.example ? unique(node.example.type, node.scope)?.fixtureKind : node.fixtureKind;\n const display = (node: typeof declarations[number]) => [...node.scope.filter(part => !hiddenScopes.has(part)), node.name].join('.');\n const targets = (scope: readonly string[], expected?: FixtureKind, typesOnly = false, prefix = ''): CompletionEntry[] => declarations.flatMap(node => {\n const fixtureKind = kind(node);\n if (!fixtureKind || (expected && fixtureKind !== expected) || (typesOnly && node.example)) return [];\n // A full scope-qualified spelling is the fallback for a shadowed declaration. Never\n // suggest a name that resolves to a competitor or an ambiguous declaration.\n const full = [...node.scope, node.name].join('.');\n const name = unique(node.name, scope) === node ? node.name : full;\n if (unique(name, scope) !== node) return [];\n const qualifiers = prefix.split('.').slice(0, -1).join('.');\n if (qualifiers && !full.endsWith(`${qualifiers}.${node.name}`)) return [];\n if (name === full && node.scope.some(part => hiddenScopes.has(part)) && unique(node.name, scope) !== node) return [];\n return [{ label: unique(node.name, scope) === node ? node.name : display(node), insertText: qualifiers ? node.name : name,\n documentation: node.example ? `Example of ${node.example.type}. Step assignments override example values; no implicit defaults.` : `Declared ${fixtureKind}.` }];\n });\n const effective = (example: SpecificationExampleSyntax | undefined, values: readonly PropertyMappingSyntax[], generated: readonly PropertyMappingSyntax[], destination: ExpressionSyntax | null, authoredRoute?: Pick<SpecificationExampleSyntax, 'stream' | 'noStream'>) => {\n if (rejected) return rejected;\n const merge = (base: readonly PropertyMappingSyntax[], overrides: readonly PropertyMappingSyntax[], prefix = '') => {\n if (new Set(base.map(value => value.property)).size !== base.length || new Set(overrides.map(value => value.property)).size !== overrides.length) return null;\n const result = new Map(base.map(value => [value.property, { value, origin: 'example', replaced: undefined as PropertyMappingSyntax | undefined }]));\n for (const value of overrides) {\n const replaced = result.get(value.property)?.value;\n result.delete(value.property);\n result.set(value.property, { value, origin: replaced ? 'override' : 'authored', replaced });\n }\n return [...result.values()].map(({ value, origin, replaced }) => `${prefix}${value.property} = ${expressionText(value.source)} — ${origin}${origin === 'example' ? ` ${example!.name}` : ''}${replaced ? ` (replaces ${expressionText(replaced.source)} from ${example!.name})` : ''}`);\n };\n const properties = merge(example?.values ?? [], values);\n const fixtures = merge(example?.generatedValues ?? [], generated, 'generated ');\n if (!properties || !fixtures) return '**Invalid duplicate assignments; no effective values selected.**';\n const selected = destination ?? example?.for;\n const priorRoute = example?.stream ?? example?.noStream;\n const replacementRoute = authoredRoute?.stream ?? authoredRoute?.noStream;\n const route = replacementRoute ?? priorRoute;\n const routeText = (value: NonNullable<typeof route>): string => value.kind === 'SpecificationNoStreamSyntax' ? 'no stream' :\n `stream ${value.eventSource}.${value.stream}${value.streamId ? ` streamId = ${expressionText(value.streamId.source)}` : value.streamIdParts.length ? ` streamId ${value.streamIdParts.map(part => `${part.property} = ${expressionText(part.source)}`).join(', ')}` : ''}`;\n const routing = route ? [`${routeText(route)} — ${replacementRoute ? priorRoute ? `override (replaces ${routeText(priorRoute)} from ${example!.name})` : 'authored' : `example ${example!.name}`}`] : [];\n return [...properties, ...fixtures, ...routing, ...(selected ? [`for ${expressionText(selected)} — ${destination ? example?.for ? `override (replaces ${expressionText(example.for)} from ${example.name})` : 'authored' : `example ${example!.name}`}`] : [])].join('\\n');\n };\n const hovers = new Map<number, { start: number; length: number; content: string }>();\n for (const declaration of declarations.filter(node => node.example?.location.path === path)) {\n const example = declaration.example!;\n const line = example.location.line - 1;\n const prefix = withoutComment(lines[line] ?? '').match(/^\\s*example\\s+/)?.[0];\n if (prefix) hovers.set(line, { start: prefix.length + 1, length: example.name.length, content: `**example ${display(declaration)} : ${example.type}**\\n\\n${kind(declaration) ? effective(example, [], [], null) : 'Unresolved or ambiguous type; no effective values selected.'}` });\n }\n for (const { node, scope } of specifications) {\n const steps = [\n ...node.given.map(step => ({ step, name: step.eventType, expected: FixtureKind.Event, values: step.values, generated: [], destination: step.for, prefix: /^\\s*given\\s+/ })),\n ...node.givenReadModels.map(step => ({ step, name: step.name, expected: FixtureKind.ReadModel, values: step.properties, generated: [], destination: null, prefix: /^\\s*given\\s+readmodel\\s+/ })),\n ...(node.when ? [{ step: node.when, name: node.when.commandType, expected: FixtureKind.Command, values: node.when.values, generated: node.when.generatedValues ?? [], destination: node.when.for, prefix: /^\\s*when\\s+/ }] : []),\n ...(node.whenAppended ? [{ step: node.whenAppended, name: node.whenAppended.eventType, expected: FixtureKind.Event, values: node.whenAppended.values, generated: [], destination: node.whenAppended.for, prefix: /^\\s*when\\s+append\\s+/ }] : []),\n ...node.thenEvents.map(step => ({ step, name: step.eventType, expected: FixtureKind.Event, values: step.values, generated: [], destination: step.for, prefix: /^\\s*then\\s+/ })),\n ...node.thenReadModels.map(step => ({ step, name: step.name, expected: FixtureKind.ReadModel, values: step.properties, generated: [], destination: null, prefix: /^\\s*then\\s+readmodel\\s+/ })),\n ];\n for (const { step, name, expected, values, generated, destination, prefix } of steps.filter(entry => entry.step.location.path === path)) {\n const resolved = unique(name, scope);\n const competing = candidates(name, scope).some(node => node.example);\n if (!resolved?.example && (resolved || !competing)) continue;\n const line = step.location.line - 1;\n const start = withoutComment(lines[line] ?? '').match(prefix)?.[0].length;\n if (start === undefined) continue;\n const content = !resolved ? '**Ambiguous example; no effective values selected.**' : kind(resolved) !== expected ? '**Example kind mismatch; no effective values selected.**'\n : `**${expected} ${resolved.example?.type ?? name}${resolved.example ? ` — example ${display(resolved)}` : ''}**\\n\\n${effective(resolved.example, values, generated, destination, 'eventType' in step ? step : undefined)}\\n\\nAuthored fixture values, not execution results. Matching is unchanged.`;\n hovers.set(line, { start: start + 1, length: name.length, content });\n }\n }\n return {\n eventExamples: declarations.filter(declaration => declaration.example?.location.path === path && kind(declaration) === FixtureKind.Event).map(declaration => declaration.example!),\n completions(line, before) {\n const scope = contexts.get(line) ?? [];\n const header = before.match(exampleTypePrefix);\n if (header) return targets(scope, undefined, true, header[1]);\n // A parser-rejected incomplete step still belongs to its specification's range.\n const inSpecification = specifications.some(({ node }) => node.location.path === path && range(node.location.line - 1).includes(line));\n if (!inSpecification) return null;\n const step = before.match(fixtureStepPrefix);\n if (!step) return null;\n if (['clock', 'caller', 'capture', 'trigger', 'query', 'result', 'error', 'denied', 'returns', 'no', 'operation', 'compensated'].includes(step[3])) return null;\n const expected = step[2] === 'readmodel' ? FixtureKind.ReadModel : step[2] === 'append' || step[1] !== 'when' ? FixtureKind.Event : FixtureKind.Command;\n const entries = targets(scope, expected, false, step[3]);\n // Keep the existing planner's keyword behavior when there are no fixture targets.\n if (!entries.length) return null;\n return step[2] ? entries : [...specificationStepItems[step[1] as 'given' | 'when' | 'then'], ...entries];\n },\n hover(line, start, end) {\n const hover = hovers.get(line);\n return hover && start >= hover.start && end <= hover.start + hover.length ? hover.content : null;\n },\n };\n}\n\nfunction expressionText(expression: ExpressionSyntax): string {\n switch (expression.kind) {\n case 'LiteralExpressionSyntax': return typeof expression.value === 'object' && expression.value !== null ? expression.value.value : JSON.stringify(expression.value);\n case 'ListExpressionSyntax': return `[${expression.items.map(expressionText).join(', ')}]`;\n case 'ObjectExpressionSyntax': return `{ ${expression.members.map(member => `${JSON.stringify(member.name)}: ${expressionText(member.value)}`).join(', ')} }`;\n case 'RawExpressionSyntax': return expression.text;\n case 'CaseValueExpressionSyntax': return `case.${expression.parameter}`;\n case 'PathExpressionSyntax': return expression.path;\n case 'ContextExpressionSyntax': return `$context.${expression.path}`;\n case 'IdentityExpressionSyntax': return `$identity.${expression.path}`;\n case 'EventContextExpressionSyntax': return `$eventContext.${expression.path}`;\n case 'RefusalExpressionSyntax': return `$refusal.${expression.member}`;\n case 'EventSourceIdExpressionSyntax': return '$eventSourceId';\n case 'CausedByExpressionSyntax': return `$causedBy${expression.property ? `.${expression.property}` : ''}`;\n case 'EnvironmentExpressionSyntax': return `$env.${expression.name}`;\n case 'StringsExpressionSyntax': return `$strings.${expression.key}`;\n case 'SourceItemExpressionSyntax': return `$.${expression.path}`;\n case 'TemplateExpressionSyntax': return '`' + expression.parts.map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AYA,EAAW,QAAU,KAAOA,EAAW,MAAM,MAAQ,KAAK,UAAUA,EAAW,KAAK,EACnK,IAAK,uBAAwB,MAAO,IAAIA,EAAW,MAAM,IAAI,cAAc,CAAC,CAAC,KAAK,IAAI,EAAE,GACxF,IAAK,yBAA0B,MAAO,KAAKA,EAAW,QAAQ,IAAI,GAAU,GAAG,KAAK,UAAUC,EAAO,IAAI,EAAE,IAAI,eAAeA,EAAO,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,IAC1J,IAAK,sBAAuB,OAAOD,EAAW,KAC9C,IAAK,4BAA6B,MAAO,QAAQA,EAAW,YAC5D,IAAK,uBAAwB,OAAOA,EAAW,KAC/C,IAAK,0BAA2B,MAAO,YAAYA,EAAW,OAC9D,IAAK,2BAA4B,MAAO,aAAaA,EAAW,OAChE,IAAK,+BAAgC,MAAO,iBAAiBA,EAAW,OACxE,IAAK,0BAA2B,MAAO,YAAYA,EAAW,SAC9D,IAAK,gCAAiC,MAAO,iBAC7C,IAAK,2BAA4B,MAAO,YAAYA,EAAW,SAAW,IAAIA,EAAW,WAAa,KACtG,IAAK,8BAA+B,MAAO,QAAQA,EAAW,OAC9D,IAAK,0BAA2B,MAAO,YAAYA,EAAW,MAC9D,IAAK,6BAA8B,MAAO,KAAKA,EAAW,OAC1D,IAAK,2BAA4B,MAAO,IAAMA,EAAW,MAAM,IAAI,GAAQ7C,EAAK,OAAS,qBAAuBA,EAAK,KAAO,KAAO,eAAeA,EAAK,UAAU,EAAI,GAAG,CAAC,CAAC,KAAK,EAAE,EAAI,GACzL,CACJ"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{fenceMap as e,withoutComment as t}from"./document-context.js";import{responseAnalysis as n}from"./response-analysis.js";import{symbolsForBuffer as r}from"./symbols.js";import{caseCompletions as i,caseHover as a}from"./case-authoring.js";function analyze(e,t){let i=r(e,t);return n(e,i.authoringDocuments??i.authoringSources?.filter(t=>t!==e.join(`
|
|
2
|
+
`))??[],i.authoringPlacement,i.authoringPath,i.authoringPlacementResolved)}function exampleCompletions(n,r,a,o){if(e(n)[r]||t(a).length<a.length)return null;let s=analyze(n,o);return i(n,r,a)??s.personas.completions(r,a)??s.examples.completions(r,a)}function exampleHover(e,t,n,r,i){let o=analyze(e,i);return a(e,t,n,r)??o.personas.hover(t,n,r)??o.examples.hover(t,n,r)}export{exampleCompletions,exampleHover};
|
|
3
|
+
//# sourceMappingURL=example-authoring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example-authoring.js","names":["symbols","symbolsForBuffer","lines","application","responseAnalysis","source","fenceMap","line","withoutComment","before","analysis","caseCompletions","caseHover","start","end"],"sources":["../../example-authoring.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { fenceMap, withoutComment } from './document-context';\nimport { caseCompletions, caseHover } from './case-authoring';\nimport { responseAnalysis } from './response-analysis';\nimport { DocumentSymbols, symbolsForBuffer } from './symbols';\n\nfunction analyze(lines: string[], application?: DocumentSymbols) {\n const symbols = symbolsForBuffer(lines, application);\n return responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [],\n symbols.authoringPlacement, symbols.authoringPath, symbols.authoringPlacementResolved);\n}\n\nexport function exampleCompletions(lines: string[], line: number, before: string, application?: DocumentSymbols) {\n if (fenceMap(lines)[line] || withoutComment(before).length < before.length) return null;\n const analysis = analyze(lines, application);\n return caseCompletions(lines, line, before) ?? analysis.personas.completions(line, before) ?? analysis.examples.completions(line, before);\n}\n\nexport function exampleHover(lines: string[], line: number, start: number, end: number, application?: DocumentSymbols) {\n const analysis = analyze(lines, application);\n return caseHover(lines, line, start, end) ?? analysis.personas.hover(line, start, end) ?? analysis.examples.hover(line, start, end);\n}\n"],"mappings":"qSAQA,SAAS,QAAQ,EAAiB,EAA+B,CAC7D,IAAMA,EAAUC,EAAiBC,EAAOC,CAAW,EACnD,OAAOC,EAAiBF,EAAOF,EAAQ,oBAAsBA,EAAQ,kBAAkB,OAAO,GAAUK,IAAWH,EAAM,KAAK;CAAI,CAAC,GAAK,CAAC,EACrIF,EAAQ,mBAAoBA,EAAQ,cAAeA,EAAQ,0BAA0B,CAC7F,CAEA,SAAgB,mBAAmB,EAAiB,EAAc,EAAgB,EAA+B,CAC7G,GAAIM,EAASJ,CAAK,CAAC,CAACK,IAASC,EAAeC,CAAM,CAAC,CAAC,OAASA,EAAO,OAAQ,OAAO,KACnF,IAAMC,EAAW,QAAQR,EAAOC,CAAW,EAC3C,OAAOQ,EAAgBT,EAAOK,EAAME,CAAM,GAAKC,EAAS,SAAS,YAAYH,EAAME,CAAM,GAAKC,EAAS,SAAS,YAAYH,EAAME,CAAM,CAC5I,CAEA,SAAgB,aAAa,EAAiB,EAAc,EAAe,EAAa,EAA+B,CACnH,IAAMC,EAAW,QAAQR,EAAOC,CAAW,EAC3C,OAAOS,EAAUV,EAAOK,EAAMM,EAAOC,CAAG,GAAKJ,EAAS,SAAS,MAAMH,EAAMM,EAAOC,CAAG,GAAKJ,EAAS,SAAS,MAAMH,EAAMM,EAAOC,CAAG,CACtI"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=[{label:`example`,insertText:"example ${1:Name} : ${2:Type}\n ${3:property} = ${4:value}",documentation:`One possibly partial event, command or read-model fixture. Step assignments override its values; no implicit defaults.`}];export{e as exampleDeclarationItems};
|
|
2
|
+
//# sourceMappingURL=example-declaration-items.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example-declaration-items.js","names":["exampleDeclarationItems"],"sources":["../../example-declaration-items.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { CompletionEntry } from './completion-items';\n\nexport const exampleDeclarationItems: CompletionEntry[] = [\n { label: 'example', insertText: 'example ${1:Name} : ${2:Type}\\n ${3:property} = ${4:value}', documentation: 'One possibly partial event, command or read-model fixture. Step assignments override its values; no implicit defaults.' },\n];\n"],"mappings":"AAKA,MAAaA,EAA6C,CACtD,CAAE,MAAO,UAAW,WAAY,gEAAiE,cAAe,wHAAyH,CAC7O"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";const e={Uuid:`"0f8fad5b-d9cb-469f-a165-70867728950e"`,String:`"Example"`,Int:`1`,Decimal:`1.5`,Bool:`true`,Date:`"2026-01-15"`,DateTime:`"2026-01-15T10:00:00Z"`};function exampleValueFor(t,n){let r=t.replace(/\s+optional$/,``).replace(/\?$/,``);if(r.endsWith(`[]`))return`"Example"`;let i=n.concepts.find(e=>e.name===r)?.primitive??r;return e[i]??`"Example"`}export{exampleValueFor};
|
|
2
|
+
//# sourceMappingURL=example-values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example-values.js","names":["primitiveExamples","bare","type","primitive","symbols","concept"],"sources":["../../example-values.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DocumentSymbols } from './symbols';\n\nconst exampleUuid = '\"0f8fad5b-d9cb-469f-a165-70867728950e\"';\n\nconst primitiveExamples: Record<string, string> = {\n Uuid: exampleUuid,\n String: '\"Example\"',\n Int: '1',\n Decimal: '1.5',\n Bool: 'true',\n Date: '\"2026-01-15\"',\n DateTime: '\"2026-01-15T10:00:00Z\"',\n};\n\n// An example value to write in a specification for a property of the given type, resolving concepts\n// down to the primitive they wrap. Collections and unknown types fall back to a quoted string.\nexport function exampleValueFor(type: string, symbols: DocumentSymbols): string {\n const bare = type.replace(/\\s+optional$/, '').replace(/\\?$/, '');\n if (bare.endsWith('[]')) return '\"Example\"';\n const primitive = symbols.concepts.find(concept => concept.name === bare)?.primitive ?? bare;\n return primitiveExamples[primitive] ?? '\"Example\"';\n}\n"],"mappings":"iDAOA,MAAMA,EAA4C,CAC9C,KAAM,yCACN,OAAQ,YACR,IAAK,IACL,QAAS,MACT,KAAM,OACN,KAAM,eACN,SAAU,wBACd,EAIA,SAAgB,gBAAgB,EAAc,EAAkC,CAC5E,IAAMC,EAAOC,EAAK,QAAQ,eAAgB,EAAE,CAAC,CAAC,QAAQ,MAAO,EAAE,EAC/D,GAAID,EAAK,SAAS,IAAI,EAAG,MAAO,YAChC,IAAME,EAAYC,EAAQ,SAAS,KAAK,GAAWC,EAAQ,OAASJ,CAAI,CAAC,EAAE,WAAaA,EACxF,OAAOD,EAAkBG,IAAc,WAC3C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{fenceMap as e,indentOf as t}from"./document-context.js";const n=/^import(\s+)"([^"\\]+)"\s*(?:\/\/.*)?$/,r=/^import\s+"/;function isFileImportLine(e){return r.test(e.trim())}function fileImportOn(e,r){let i=t(e),a=e.slice(i).match(n);if(!a)return;let o=i+6+a[1].length+2;return{pattern:a[2],line:r,startColumn:o,endColumn:o+a[2].length}}function fileImports(t){let n=e(t),r=[];for(let e=0;e<t.length;e++){if(n[e])continue;let i=fileImportOn(t[e],e);i&&r.push(i)}return r}const folderOf=e=>e.split(`/`).slice(0,-1);function relativeTo(e,t){let n=t.split(`/`),r=0;for(;r<e.length&&r<n.length-1&&e[r]===n[r];)r++;return[...e.slice(r).map(()=>`..`),...n.slice(r)].join(`/`)}function importablePaths(e,t){let n=folderOf(e),r=/* @__PURE__ */ new Set;for(let i of t.filter(t=>t!==e&&t.toLowerCase().endsWith(`.play`))){let e=relativeTo(n,i),t=folderOf(e);r.add(e),r.add([...t,`*.play`].join(`/`));for(let e=0;e<=t.length;e++)r.add([...t.slice(0,e),`**`,`*.play`].join(`/`))}return[...r].sort()}export{fileImportOn,fileImports,importablePaths,isFileImportLine};
|
|
2
|
+
//# sourceMappingURL=file-imports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-imports.js","names":["fileImportPattern","quotedImportPattern","line","indent","indentOf","match","startColumn","lineIndex","fences","fenceMap","lines","found","index","fileImport","path","segments","common","from","documentPath","paths","file","files","candidate","relative","folders","depth"],"sources":["../../file-imports.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { fenceMap, indentOf } from './document-context';\n\n// An `import \"<path or glob>\"` of other .play files, with the pattern exactly as written and the span it\n// occupies between the quotes. Columns are one-based like every other position this package reports.\nexport interface FileImport {\n pattern: string;\n line: number;\n startColumn: number;\n endColumn: number;\n}\n\n// The compiler's own shape for a file import (FileImportParser): a quoted operand without quotes or escapes.\nconst fileImportPattern = /^import(\\s+)\"([^\"\\\\]+)\"\\s*(?:\\/\\/.*)?$/;\nconst quotedImportPattern = /^import\\s+\"/;\n\n// Whether a line imports files rather than a qualified name - its operand is quoted.\nexport function isFileImportLine(line: string): boolean {\n return quotedImportPattern.test(line.trim());\n}\n\n// The file import on a single line, or undefined when the line is not a well-formed one.\nexport function fileImportOn(line: string, lineIndex: number): FileImport | undefined {\n const indent = indentOf(line);\n const match = line.slice(indent).match(fileImportPattern);\n if (!match) return undefined;\n const startColumn = indent + 'import'.length + match[1].length + 2;\n return { pattern: match[2], line: lineIndex, startColumn, endColumn: startColumn + match[2].length };\n}\n\n// Every well-formed file import in a document, in document order, skipping code fences.\nexport function fileImports(lines: string[]): FileImport[] {\n const fences = fenceMap(lines);\n const found: FileImport[] = [];\n for (let index = 0; index < lines.length; index++) {\n if (fences[index]) continue;\n const fileImport = fileImportOn(lines[index], index);\n if (fileImport) found.push(fileImport);\n }\n return found;\n}\n\nconst folderOf = (path: string): string[] => path.split('/').slice(0, -1);\n\nfunction relativeTo(from: readonly string[], path: string): string {\n const segments = path.split('/');\n let common = 0;\n while (common < from.length && common < segments.length - 1 && from[common] === segments[common]) common++;\n return [...from.slice(common).map(() => '..'), ...segments.slice(common)].join('/');\n}\n\n// What an import written in a document can name: every other .play file, relative to the document's folder;\n// a glob for the files directly in each folder holding one; and a glob for everything beneath each folder on\n// the way to them. Paths are portable ('/' separated) and relative to one root, the way the compiler resolves them.\nexport function importablePaths(documentPath: string, files: readonly string[]): string[] {\n const from = folderOf(documentPath);\n const paths = new Set<string>();\n for (const file of files.filter((candidate) => candidate !== documentPath && candidate.toLowerCase().endsWith('.play'))) {\n const relative = relativeTo(from, file);\n const folders = folderOf(relative);\n paths.add(relative);\n paths.add([...folders, '*.play'].join('/'));\n for (let depth = 0; depth <= folders.length; depth++) {\n paths.add([...folders.slice(0, depth), '**', '*.play'].join('/'));\n }\n }\n return [...paths].sort();\n}\n"],"mappings":"gHAeA,MAAMA,EAAoB,yCACpBC,EAAsB,cAG5B,SAAgB,iBAAiB,EAAuB,CACpD,OAAOA,EAAoB,KAAKC,EAAK,KAAK,CAAC,CAC/C,CAGA,SAAgB,aAAa,EAAc,EAA2C,CAClF,IAAMC,EAASC,EAASF,CAAI,EACtBG,EAAQH,EAAK,MAAMC,CAAM,CAAC,CAAC,MAAMH,CAAiB,EACxD,GAAI,CAACK,EAAO,OACZ,IAAMC,EAAcH,EAAS,EAAkBE,EAAM,EAAE,CAAC,OAAS,EACjE,MAAO,CAAE,QAASA,EAAM,GAAI,KAAME,EAAW,cAAa,UAAWD,EAAcD,EAAM,EAAE,CAAC,MAAO,CACvG,CAGA,SAAgB,YAAY,EAA+B,CACvD,IAAMG,EAASC,EAASC,CAAK,EACvBC,EAAsB,CAAC,EAC7B,IAAK,IAAIC,EAAQ,EAAGA,EAAQF,EAAM,OAAQ,IAAS,CAC/C,GAAIF,EAAOI,GAAQ,SACnB,IAAMC,EAAa,aAAaH,EAAME,GAAQA,CAAK,EAC/CC,GAAYF,EAAM,KAAKE,CAAU,CACzC,CACA,OAAOF,CACX,CAEA,MAAM,SAAY,GAA2BG,EAAK,MAAM,GAAG,CAAC,CAAC,MAAM,EAAG,EAAE,EAExE,SAAS,WAAW,EAAyB,EAAsB,CAC/D,IAAMC,EAAWD,EAAK,MAAM,GAAG,EAC3BE,EAAS,EACb,KAAOA,EAASC,EAAK,QAAUD,EAASD,EAAS,OAAS,GAAKE,EAAKD,KAAYD,EAASC,IAAS,IAClG,MAAO,CAAC,GAAGC,EAAK,MAAMD,CAAM,CAAC,CAAC,QAAU,IAAI,EAAG,GAAGD,EAAS,MAAMC,CAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CACtF,CAKA,SAAgB,gBAAgB,EAAsB,EAAoC,CACtF,IAAMC,EAAO,SAASC,CAAY,EAC5BC,kBAAQ,IAAI,IAClB,IAAK,IAAMC,KAAQC,EAAM,OAAQ,GAAcC,IAAcJ,GAAgBI,EAAU,YAAY,CAAC,CAAC,SAAS,OAAO,CAAC,EAAG,CACrH,IAAMC,EAAW,WAAWN,EAAMG,CAAI,EAChCI,EAAU,SAASD,CAAQ,EACjCJ,EAAM,IAAII,CAAQ,EAClBJ,EAAM,IAAI,CAAC,GAAGK,EAAS,QAAQ,CAAC,CAAC,KAAK,GAAG,CAAC,EAC1C,IAAK,IAAIC,EAAQ,EAAGA,GAASD,EAAQ,OAAQ,IACzCL,EAAM,IAAI,CAAC,GAAGK,EAAQ,MAAM,EAAGC,CAAK,EAAG,KAAM,QAAQ,CAAC,CAAC,KAAK,GAAG,CAAC,CAExE,CACA,MAAO,CAAC,GAAGN,CAAK,CAAC,CAAC,KAAK,CAC3B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{fenceMap as e,firstWord as t,indentOf as n}from"./document-context.js";const r=`file`,i=/^[A-Za-z_]\w*(?:\[\])?(?:\?|\s+optional)?$/,a=/^(?:[/\\]|[A-Za-z]:[/\\]|~[/\\])/;function isAbsoluteFileReferencePath(e){return a.test(e)}function withoutComment(e){let t=!1,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`&&t&&r+1<e.length)r++;else if(i===`"`&&!n)t=!t;else if(i==="`"&&!t)n=!n;else if(!t&&!n&&i===`/`&&e[r+1]===`/`)return e.slice(0,r)}return e}function fileReferenceOn(e,r){let a=n(e),o=withoutComment(e.slice(a)).trimEnd();if(t(o)!==`file`)return;let s=o.slice(4),c=s.trim();if(c.length===0||i.test(c))return;let l=s.length-s.trimStart().length,u=a+4+l+1;return{path:c,line:r,startColumn:u,endColumn:u+c.length}}function fileReferences(t){let n=e(t),r=[];for(let e=0;e<t.length;e++){if(n[e])continue;let i=fileReferenceOn(t[e],e);i&&r.push(i)}return r}export{r as fileReferenceKeyword,fileReferenceOn,fileReferences,isAbsoluteFileReferencePath};
|
|
2
|
+
//# sourceMappingURL=file-references.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-references.js","names":["fileReferenceKeyword","typeReferencePattern","absolutePathPattern","path","inString","inTemplate","index","text","current","indent","indentOf","line","content","firstWord","afterKeyword","separatorLength","startColumn","lineIndex","fences","fenceMap","lines","references","reference"],"sources":["../../file-references.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { fenceMap, firstWord, indentOf } from './document-context';\n\n// The keyword the directive opens with — the single word the language points at a file with.\nexport const fileReferenceKeyword = 'file';\n\n// A `file <path>` directive, with the path exactly as written and the span it occupies on its line.\n// The span is measured against the raw line, and its columns are one-based like every other position\n// this package reports, so an editor places a range on it the same way it does a validation issue.\nexport interface FileReference {\n path: string;\n line: number;\n startColumn: number;\n endColumn: number;\n}\n\n// `file String` is a property named `file`; `file Invoices/Register.cs` is the directive. The two are\n// told apart by shape, the way the compiler tells them apart: a type reference is a bare identifier,\n// so anything carrying a separator or an extension is a path and nothing else. The property wins the\n// tie, because a document that used the name before the directive existed keeps meaning what it meant.\nconst typeReferencePattern = /^[A-Za-z_]\\w*(?:\\[\\])?(?:\\?|\\s+optional)?$/;\n\n// A path naming a place on one machine rather than a place in the repository. The compiler warns about\n// these; nothing here rejects one, so a resolver can still probe it and come up empty on other machines.\nconst absolutePathPattern = /^(?:[/\\\\]|[A-Za-z]:[/\\\\]|~[/\\\\])/;\n\nexport function isAbsoluteFileReferencePath(path: string): boolean {\n return absolutePathPattern.test(path);\n}\n\n// Drops a trailing `//` comment without cutting into a string or a template, mirroring how the\n// compiler strips one before it reads the line.\nfunction withoutComment(text: string): string {\n let inString = false;\n let inTemplate = false;\n\n for (let index = 0; index < text.length; index++) {\n const current = text[index];\n if (current === '\\\\' && inString && index + 1 < text.length) {\n index++;\n } else if (current === '\"' && !inTemplate) {\n inString = !inString;\n } else if (current === '`' && !inString) {\n inTemplate = !inTemplate;\n } else if (!inString && !inTemplate && current === '/' && text[index + 1] === '/') {\n return text.slice(0, index);\n }\n }\n\n return text;\n}\n\n// The `file` directive on a single line, or undefined when the line is not one. Callers that scan a\n// whole document go through fileReferences instead, so code fences are accounted for.\nexport function fileReferenceOn(line: string, lineIndex: number): FileReference | undefined {\n const indent = indentOf(line);\n const content = withoutComment(line.slice(indent)).trimEnd();\n if (firstWord(content) !== fileReferenceKeyword) return undefined;\n\n const afterKeyword = content.slice(fileReferenceKeyword.length);\n const path = afterKeyword.trim();\n\n // A bare `file` leaves the word available as a name to whatever the enclosing block reads a bare\n // word as, and a bare identifier after it is a property type rather than a path.\n if (path.length === 0 || typeReferencePattern.test(path)) return undefined;\n\n const separatorLength = afterKeyword.length - afterKeyword.trimStart().length;\n const startColumn = indent + fileReferenceKeyword.length + separatorLength + 1;\n return { path, line: lineIndex, startColumn, endColumn: startColumn + path.length };\n}\n\n// Every `file` directive in a document, in document order. Lines inside a code fence are skipped, so\n// a `file` line in an inline C# or TypeScript block is never mistaken for one of ours.\nexport function fileReferences(lines: string[]): FileReference[] {\n const fences = fenceMap(lines);\n const references: FileReference[] = [];\n\n for (let index = 0; index < lines.length; index++) {\n if (fences[index]) continue;\n const reference = fileReferenceOn(lines[index], index);\n if (reference) references.push(reference);\n }\n\n return references;\n}\n"],"mappings":"+H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F,EAAMd,GAAQA,CAAK,EACjDgB,GAAWD,EAAW,KAAKC,CAAS,CAC5C,CAEA,OAAOD,CACX"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{typeReferenceText as e}from"./TypeReferenceSymbol.js";import{enclosingChain as t,enclosingHeaders as n,fenceMap as r,indentOf as i,withoutComment as a}from"./document-context.js";import{eventAnalysisSource as o}from"./event-analysis-source.js";import{responseAnalysis as s,responseAvailability as c}from"./response-analysis.js";import{directBody as ee,propertyTypeReference as l,scanDocument as u,symbolsForBuffer as d}from"./symbols.js";import{exampleHover as f}from"./example-authoring.js";import{operationHover as p}from"./operation-authoring.js";import{eventSourceHover as m}from"./event-source-authoring.js";import{refusalContext as h}from"./refusal-context.js";import{namedRuleContext as g}from"./named-rule-context.js";import{getSubLanguage as te}from"./sub-language-registry.js";import{reactionReferenceAt as ne}from"./reaction-authoring.js";import{attributeDocs as re,contextVariableDocs as _,handlerIntentDocs as v,keywordDocs as y,specialCategoryDocs as b,specificationKeywordDocs as x}from"./keyword-docs.js";function hoverContent(S,C,w,T,E,D){let O=r(S);if(O[C])return null;let k=S[C]??``;if(E-1>a(k).length)return null;let A=!1,j=!1;for(let e=0;e<T-1;e++)k[e]===`\\`&&A?e++:k[e]===`"`&&!j?A=!A:k[e]==="`"&&!A&&(j=!j);if(A||j)return null;let M=ne(S,C,T,E,D);if(M)return M.content;let N=f(S,C,T,E,D);if(N)return N;let P=m(S,C,T,E,D);if(P)return P;let F=p(S,C,T,E,D);if(F)return F;let tokenAt=(e,t)=>{let n=e+ +(k[e-1]===`@`);return w===t&&T===n&&E===n+t.length&&k.slice(n-1,E-1)===t},I=k.charAt(T-2);if(w===`authorization`&&t(S,O,C,i(k))[0]===`purpose`)return`A quoted authorization in law for criminal-offence data (Art. 10).`;let L=/^\s*concept\s+[^\s:]+\s*:\s*\w+\s+/.exec(k),R=t(S,O,C,i(k))[0]===`concept`&&/^\s*(?:@?pii|personal|@?sensitive|secret)\s+(?:reason|scope|special|criminal)\b/.test(k);if(L!==null&&T-1>=L[0].length-1||R){let e=re[w];if(e)return e;if(Object.hasOwn(b,w)&&/^\s*(?:@?pii|personal)\s+special\s+/.test(k))return`**${w}** — ${b[w]}`;if(w===`special`)return`GDPR Art. 9(1) special category; requires pii. At most one category per concept.`;if(w===`criminal`)return`Personal data relating to criminal convictions and offenses (GDPR Art. 10); requires pii.`;if(/^\s*(?:secret|sensitive|@sensitive)\s+scope\s+/.test(k)&&[`subject`,`namespace`,`global`].includes(w))return`**${w}** — Secret encryption scope${w===`subject`?` per data subject`:w===`namespace`?` per tenant namespace`:` shared globally`}. Not an event-property subject role.`;if(w===`scope`)return`Secret encryption scope: subject, namespace or global. Omitted scope keeps Chronicle’s Subject default; pii secret renders only [PII].`}if(I===`$`||I===`.`){let e=k.substring(0,E-1).match(/\$[\w.]*$/)?.[0];if(e){if(e.startsWith(`$refusal`)){let t=h(S,C,i(k)),n=e.substring(9),r={reason:`Refusal kind as a String: validation, constraint or authorization.`,message:`Rejection details verbatim, including unresolved $strings keys.`,constraint:`Violated constraint name as a String, only in a by constraint branch.`};return t!==void 0&&r[n]!==void 0?`**${e}** — ${r[n]} Syntax-only, not yet executable (PLAY0268).`:null}if(e.startsWith(`$identity.`)){let t=e.substring(10).split(`.`)[0],n=d(S,D).identityDetails?.find(e=>e.name===t);if(n)return`**$identity.${n.name}** — ${n.type}. Declared caller detail; authoring metadata only, not executable until admitted (#600).`}let t=_[e]??(e.startsWith(`$env`)?_.$env:void 0);if(t)return t}}let z=k.slice(0,T-1),B=/^\s*(?:by|filter)\s+/.test(z)?/^\s*(?:by|filter)\s+[a-z_]\w*\s+[\w.]+(?:\[\])?\s+$/.test(z):/^\s*@?[a-z_]\w*\s+[\w.]+(?:\[\])?\s+$/.test(z),V=/^\s*query\s+\w+\s*=>\s*(?:observable\s+)?[\w.]+(?:\[\])?\s+$/.test(z)&&!/^\s*query\s+\w+\s*=>\s*observable\s+$/.test(z);if(w===`subject`){let e=o(S),r=/^\s*@?[a-z_]\w*\s+[\w.]+(?:\[\])?(?:\?|\s+optional)?(?:\s+generated)?(?:\s+identifier)?\s+$/.test(z),a=t(e,O,C,i(k));return r&&(a[0]===`event`||/^produces\s+event\s+/.test(n(e,O,C,i(k))[0]??``))?`**subject** — This event property identifies its one data subject instead of the event source (decision 0008). Required scalar String, Uuid or their concepts, or an Int-backed concept; never pii or secret. Report-only lineage metadata (PLAY0270); no ESM bytes or provider output yet.`:/\bclaim\s+"(?:[^"\\]|\\.)*"\s+matches\s+$/.test(z)&&a.includes(`policy`)?`**subject** — ${y.subject}`:null}if(w===`optional`&&(B||V))return`**optional** — ${y.optional}`;if(w===`implementation`||w===`hint`){let e=t(S,O,C,i(k)),n=g(S,C,i(k));if(w===`implementation`&&n===`rule`&&/^\s*implementation\s*$/.test(a(k))||w===`hint`&&n===`implementation`&&/^\s*hint\s+"/.test(k))return`**${w}** — Command named-rule guidance with at most one file or tagged fence. No payload means pending and fails binding (PLAY0268). Attached predicates keep their existing pure RuleContext contract; reference execution is unsupported, never confirmation.`;if(w===`implementation`&&e[0]===`handler`&&/^\s*implementation\s*$/.test(a(k)))return`**implementation** — ${v.implementation}`;if(w===`hint`&&e[0]===`implementation`&&e[1]===`handler`&&/^\s*hint\s+"/.test(k))return`**hint** — ${v.hint}`}let H=u(S),U=H.commands.filter(e=>e.line<C).at(-1),W=U?.properties.find(e=>e.name===w&&e.line===C);if(W?.isGenerated||w===`generated`&&U?.properties.some(e=>e.isGenerated&&e.line===C)&&B)return`**${W?.name??`generated`}** — ${W?e(l(W))+`. `:``}Generated value, not a request or form input. ${c}`;let G=U?.response;if(G?.location.line===C+1&&(tokenAt(G.location.column,`returns`)||G.kind===`ScalarCommandResponseSyntax`&&tokenAt(G.source.location.column,G.source.property))){let t=G.kind===`ScalarCommandResponseSyntax`?U?.properties.find(e=>e.name===G.source.property):void 0;return`**returns**${t?` — ${e(l(t))}`:` — unnamed record response`}. ${c}`}if(G?.kind===`RecordCommandResponseSyntax`){let t=G.fields.find(e=>e.location.line===C+1&&(tokenAt(e.location.column,e.name)||tokenAt(e.source.location.column,e.source.property)));if(t){let n=U?.properties.find(e=>e.name===t.source.property),r=t.type?e(t.type):n?e(l(n)):`Unresolved type`;return`**${t.name}** — ${r}${t.type?` (explicit)`:` (inferred)`} = ${t.source.property}. ${n?.isGenerated?`Generated source, not request input. `:``}${c}`}}for(let e of s(S).specifications.values())if(w===`returns`&&e.thenReturns?.location.line===C+1||w===`generated`&&e.when?.generatedValues?.some(e=>e.location.line===C+1))return c;let K=H.concepts.find(e=>e.name===w);if(K){let e=K.attributes.length?` ${K.attributes.join(` `)}`:``,t=K.enumValues.length?`\n\nValues: ${K.enumValues.join(`, `)}`:``,n=Object.entries(K.attributeReasons).map(([e,t])=>`\n\n**@${e}** — ${t}`).join(``);return`\`\`\`screenplay\nconcept ${K.name} : ${K.primitive}${e}\n\`\`\`${n}${t}`}let q=H.types.find(e=>e.name===w);if(q){let t=q.properties.map(t=>`${t.name} ${e(l(t))}`).join(`
|
|
2
|
+
`);return`\`\`\`screenplay\ntype ${q.name}\n${t}\n\`\`\``}let J=H.policies.find(e=>e.name===w);if(J){let e=J.requires.length?J.requires.join(`
|
|
3
|
+
`):`(custom C#)`;return`\`\`\`screenplay\npolicy ${J.name}\n${e}\n\`\`\``}let Y=H.events.find(e=>e.name===w&&e.line===C)??H.events.filter(e=>e.name===w).sort((e,t)=>(t.generation??1)-(e.generation??1))[0];if(Y){let t=Y.properties.map(t=>`${t.name} ${e(l(t))}${t.isSubject?` subject`:``}`).join(`
|
|
4
|
+
`);return`\`\`\`screenplay\n${Y.visibility===`Public`?`public `:``}event ${Y.name}${Y.generation===void 0?``:` generation ${Y.generation}`}${Y.origin===void 0?``:` from ${JSON.stringify(Y.origin)}`}\n${t}\n\`\`\``}let X=H.commands.find(e=>e.name===w);if(X&&X.properties.length>0){let t=X.properties.map(t=>`${t.name} ${e(l(t))}${t.isGenerated?` generated`:``}${t.isIdentifier?` identifier`:``}`).join(`
|
|
5
|
+
`);return`\`\`\`screenplay\ncommand ${X.name}\n${t}\n\`\`\`${X.response||X.properties.some(e=>e.isGenerated)?`\n\n${c}`:``}`}let Z=t(S,O,C,i(k));for(let e of[k.trim().split(/\s+/)[0],...Z]){let t=te(e??``)?.hovers?.[w];if(t)return t}if(w===`reads`&&(Z[0]===`every`||Z[0]===`at`)&&Z.includes(`reaction`))return"**reads** — Declares a whole view this clock trigger consults: `reads <View>`. Clock triggers take no values, so `by` is unavailable.";let Q=k.trim().match(/^(given|when|then)\s+(?:no\s+)?(\w+)/);if(Q&&Q[2]===w&&Z[0]===`specification`&&x[w])return`**${w}** — ${x[w]}`;if(w===`id`||w===`documentation`){let e=o(S),t=H.events.some(t=>ee(e,O,t.line,i(e[t.line])).includes(C)),n=w===`id`?/^\s*id\s+"/.test(e[C]):/^\s*documentation\s*$/.test(e[C]);if(!(t||w===`documentation`&&[`module`,`feature`,`slice`,`command`,`readmodel`,`reaction`].includes(Z[0]))||!n||T!==i(k)+1)return null}if(w===`optional`||w===`generated`||w===`returns`)return null;let $=y[w];return $?`**${w}** — ${$}`:null}export{hoverContent};
|
|
6
|
+
//# sourceMappingURL=hover-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover-content.js","names":["fences","fenceMap","lines","lineIndex","line","endColumn","withoutComment","inString","inTemplate","index","startColumn","reaction","reactionReferenceAt","application","fixtureHover","exampleHover","sourceHover","eventSourceHover","operation","operationHover","start","column","word","name","before","enclosingChain","indentOf","complianceHeader","complianceBody","doc","attributeDocs","specialCategoryDocs","variable","branch","refusalContext","member","descriptions","detail","symbolsForBuffer","contextVariableDocs","\"$env\"","prefix","followsPropertyType","followsQueryType","source","eventAnalysisSource","subjectPrefix","ownerChain","enclosingHeaders","keywordDocs","chain","ruleContext","namedRuleContext","handlerIntentDocs","symbols","scanDocument","owner","command","property","typeReferenceText","propertyTypeReference","responseAvailability","response","field","type","specification","responseAnalysis","value","concept","candidate","attributes","values","reasons","attribute","reason","properties","policy","body","event","right","left","construct","getSubLanguage","step","specificationKeywordDocs","inEvent","directBody","directive","keywordDoc"],"sources":["../../hover-content.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { reactionReferenceAt } from './reaction-authoring';\nimport { refusalContext } from './refusal-context';\nimport { namedRuleContext } from './named-rule-context';\nimport { eventSourceHover } from './event-source-authoring';\nimport { exampleHover } from './example-authoring';\nimport { operationHover } from './operation-authoring';\nimport { DocumentSymbols, symbolsForBuffer } from './symbols';\nimport { responseAnalysis, responseAvailability } from './response-analysis';\nimport { enclosingChain, enclosingHeaders, fenceMap, indentOf, withoutComment } from './document-context';\nimport { directBody, propertyTypeReference, scanDocument } from './symbols';\nimport { typeReferenceText } from './TypeReferenceSymbol';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { getSubLanguage } from './sub-language-registry';\nimport { attributeDocs, contextVariableDocs, handlerIntentDocs, keywordDocs, specialCategoryDocs, specificationKeywordDocs } from './keyword-docs';\n\n// Produces the hover markdown for a word at a position, without any editor\n// dependency — the Monaco service and the VSCode extension share this content.\n// Columns are 1-based, matching both editors' word-at-position APIs.\nexport function hoverContent(\n lines: string[],\n lineIndex: number,\n word: string,\n startColumn: number,\n endColumn: number,\n application?: DocumentSymbols,\n): string | null {\n const fences = fenceMap(lines);\n if (fences[lineIndex]) return null;\n\n const line = lines[lineIndex] ?? '';\n if (endColumn - 1 > withoutComment(line).length) return null;\n let inString = false;\n let inTemplate = false;\n for (let index = 0; index < startColumn - 1; index++) {\n if (line[index] === '\\\\' && inString) index++;\n else if (line[index] === '\"' && !inTemplate) inString = !inString;\n else if (line[index] === '`' && !inString) inTemplate = !inTemplate;\n }\n if (inString || inTemplate) return null;\n const reaction = reactionReferenceAt(lines, lineIndex, startColumn, endColumn, application);\n if (reaction) return reaction.content;\n const fixtureHover = exampleHover(lines, lineIndex, startColumn, endColumn, application);\n if (fixtureHover) return fixtureHover;\n const sourceHover = eventSourceHover(lines, lineIndex, startColumn, endColumn, application);\n if (sourceHover) return sourceHover;\n const operation = operationHover(lines, lineIndex, startColumn, endColumn, application);\n if (operation) return operation;\n const tokenAt = (column: number, name: string): boolean => {\n const start = column + (line[column - 1] === '@' ? 1 : 0);\n return word === name && startColumn === start && endColumn === start + name.length && line.slice(start - 1, endColumn - 1) === name;\n };\n const before = line.charAt(startColumn - 2);\n if (word === 'authorization' && enclosingChain(lines, fences, lineIndex, indentOf(line))[0] === 'purpose') return 'A quoted authorization in law for criminal-offence data (Art. 10).';\n\n const complianceHeader = /^\\s*concept\\s+[^\\s:]+\\s*:\\s*\\w+\\s+/.exec(line);\n const complianceBody = enclosingChain(lines, fences, lineIndex, indentOf(line))[0] === 'concept' && /^\\s*(?:@?pii|personal|@?sensitive|secret)\\s+(?:reason|scope|special|criminal)\\b/.test(line);\n if ((complianceHeader !== null && startColumn - 1 >= complianceHeader[0].length - 1) || complianceBody) {\n const doc = attributeDocs[word];\n if (doc) return doc;\n if (Object.hasOwn(specialCategoryDocs, word) && /^\\s*(?:@?pii|personal)\\s+special\\s+/.test(line)) return `**${word}** — ${specialCategoryDocs[word]}`;\n if (word === 'special') return 'GDPR Art. 9(1) special category; requires pii. At most one category per concept.';\n if (word === 'criminal') return 'Personal data relating to criminal convictions and offenses (GDPR Art. 10); requires pii.';\n if (/^\\s*(?:secret|sensitive|@sensitive)\\s+scope\\s+/.test(line) && ['subject', 'namespace', 'global'].includes(word)) return `**${word}** — Secret encryption scope${word === 'subject' ? ' per data subject' : word === 'namespace' ? ' per tenant namespace' : ' shared globally'}. Not an event-property subject role.`;\n if (word === 'scope') return 'Secret encryption scope: subject, namespace or global. Omitted scope keeps Chronicle’s Subject default; pii secret renders only [PII].';\n }\n if (before === '$' || before === '.') {\n const variable = line.substring(0, endColumn - 1).match(/\\$[\\w.]*$/)?.[0];\n if (variable) {\n if (variable.startsWith('$refusal')) {\n const branch = refusalContext(lines, lineIndex, indentOf(line));\n const member = variable.substring('$refusal.'.length);\n const descriptions: Record<string, string> = { reason: 'Refusal kind as a String: validation, constraint or authorization.', message: 'Rejection details verbatim, including unresolved $strings keys.', constraint: 'Violated constraint name as a String, only in a by constraint branch.' };\n return branch !== undefined && descriptions[member] !== undefined ? `**${variable}** — ${descriptions[member]} Syntax-only, not yet executable (PLAY0268).` : null;\n }\n if (variable.startsWith('$identity.')) {\n const name = variable.substring('$identity.'.length).split('.')[0];\n const detail = symbolsForBuffer(lines, application).identityDetails?.find(detail => detail.name === name);\n if (detail) return `**$identity.${detail.name}** — ${detail.type}. Declared caller detail; authoring metadata only, not executable until admitted (#600).`;\n }\n const doc =\n contextVariableDocs[variable] ??\n (variable.startsWith('$env') ? contextVariableDocs['$env'] : undefined);\n if (doc) return doc;\n }\n }\n\n // Do not mistake a property/type named optional for the contextual modifier.\n const prefix = line.slice(0, startColumn - 1);\n // Commit to query-parameter context before matching the name and type.\n const followsPropertyType = /^\\s*(?:by|filter)\\s+/.test(prefix)\n ? /^\\s*(?:by|filter)\\s+[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+$/.test(prefix)\n : /^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+$/.test(prefix);\n const followsQueryType = /^\\s*query\\s+\\w+\\s*=>\\s*(?:observable\\s+)?[\\w.]+(?:\\[\\])?\\s+$/.test(prefix) &&\n !/^\\s*query\\s+\\w+\\s*=>\\s*observable\\s+$/.test(prefix);\n if (word === 'subject') {\n const source = eventAnalysisSource(lines);\n const subjectPrefix = /^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?(?:\\s+generated)?(?:\\s+identifier)?\\s+$/.test(prefix);\n const ownerChain = enclosingChain(source, fences, lineIndex, indentOf(line));\n if (subjectPrefix && (ownerChain[0] === 'event' || /^produces\\s+event\\s+/.test(enclosingHeaders(source, fences, lineIndex, indentOf(line))[0] ?? ''))) {\n return '**subject** — This event property identifies its one data subject instead of the event source (decision 0008). Required scalar String, Uuid or their concepts, or an Int-backed concept; never pii or secret. Report-only lineage metadata (PLAY0270); no ESM bytes or provider output yet.';\n }\n if (/\\bclaim\\s+\"(?:[^\"\\\\]|\\\\.)*\"\\s+matches\\s+$/.test(prefix) && ownerChain.includes('policy')) return `**subject** — ${keywordDocs.subject}`;\n return null;\n }\n if (word === 'optional' && (followsPropertyType || followsQueryType)) {\n return `**optional** — ${keywordDocs.optional}`;\n }\n\n if (word === 'implementation' || word === 'hint') {\n const chain = enclosingChain(lines, fences, lineIndex, indentOf(line));\n const ruleContext = namedRuleContext(lines, lineIndex, indentOf(line));\n if ((word === 'implementation' && ruleContext === 'rule' && /^\\s*implementation\\s*$/.test(withoutComment(line))) ||\n (word === 'hint' && ruleContext === 'implementation' && /^\\s*hint\\s+\"/.test(line))) {\n return `**${word}** — Command named-rule guidance with at most one file or tagged fence. No payload means pending and fails binding (PLAY0268). Attached predicates keep their existing pure RuleContext contract; reference execution is unsupported, never confirmation.`;\n }\n if (word === 'implementation' && chain[0] === 'handler' && /^\\s*implementation\\s*$/.test(withoutComment(line))) {\n return `**implementation** — ${handlerIntentDocs.implementation}`;\n }\n if (word === 'hint' && chain[0] === 'implementation' && chain[1] === 'handler' && /^\\s*hint\\s+\"/.test(line)) {\n return `**hint** — ${handlerIntentDocs.hint}`;\n }\n }\n\n const symbols = scanDocument(lines);\n const owner = symbols.commands.filter(command => command.line < lineIndex).at(-1);\n const property = owner?.properties.find(property => property.name === word && property.line === lineIndex);\n if (property?.isGenerated || (word === 'generated' && owner?.properties.some(property => property.isGenerated && property.line === lineIndex) && followsPropertyType)) {\n return `**${property?.name ?? 'generated'}** — ${property ? typeReferenceText(propertyTypeReference(property)) + '. ' : ''}Generated value, not a request or form input. ${responseAvailability}`;\n }\n const response = owner?.response;\n if (response?.location.line === lineIndex + 1 && (tokenAt(response.location.column, 'returns') || (response.kind === 'ScalarCommandResponseSyntax' && tokenAt(response.source.location.column, response.source.property)))) {\n const source = response.kind === 'ScalarCommandResponseSyntax' ? owner?.properties.find(property => property.name === response.source.property) : undefined;\n return `**returns**${source ? ` — ${typeReferenceText(propertyTypeReference(source))}` : ' — unnamed record response'}. ${responseAvailability}`;\n }\n if (response?.kind === 'RecordCommandResponseSyntax') {\n const field = response.fields.find(field => field.location.line === lineIndex + 1 && (tokenAt(field.location.column, field.name) || tokenAt(field.source.location.column, field.source.property)));\n if (field) {\n const source = owner?.properties.find(property => property.name === field.source.property);\n const type = field.type ? typeReferenceText(field.type) : source ? typeReferenceText(propertyTypeReference(source)) : 'Unresolved type';\n return `**${field.name}** — ${type}${field.type ? ' (explicit)' : ' (inferred)'} = ${field.source.property}. ${source?.isGenerated ? 'Generated source, not request input. ' : ''}${responseAvailability}`;\n }\n }\n for (const specification of responseAnalysis(lines).specifications.values()) {\n if ((word === 'returns' && specification.thenReturns?.location.line === lineIndex + 1) || (word === 'generated' && specification.when?.generatedValues?.some(value => value.location.line === lineIndex + 1))) return responseAvailability;\n }\n\n const concept = symbols.concepts.find((candidate) => candidate.name === word);\n if (concept) {\n const attributes = concept.attributes.length ? ` ${concept.attributes.join(' ')}` : '';\n const values = concept.enumValues.length\n ? `\\n\\nValues: ${concept.enumValues.join(', ')}`\n : '';\n const reasons = Object.entries(concept.attributeReasons)\n .map(([attribute, reason]) => `\\n\\n**@${attribute}** — ${reason}`)\n .join('');\n return `\\`\\`\\`screenplay\\nconcept ${concept.name} : ${concept.primitive}${attributes}\\n\\`\\`\\`${reasons}${values}`;\n }\n\n const type = symbols.types.find((candidate) => candidate.name === word);\n if (type) {\n const properties = type.properties\n .map((property) => `${property.name} ${typeReferenceText(propertyTypeReference(property))}`)\n .join('\\n');\n return `\\`\\`\\`screenplay\\ntype ${type.name}\\n${properties}\\n\\`\\`\\``;\n }\n\n const policy = symbols.policies.find((candidate) => candidate.name === word);\n if (policy) {\n const body = policy.requires.length ? policy.requires.join('\\n') : '(custom C#)';\n return `\\`\\`\\`screenplay\\npolicy ${policy.name}\\n${body}\\n\\`\\`\\``;\n }\n\n const event = symbols.events.find((candidate) => candidate.name === word && candidate.line === lineIndex) ??\n symbols.events.filter((candidate) => candidate.name === word)\n .sort((left, right) => (right.generation ?? 1) - (left.generation ?? 1))[0];\n if (event) {\n const properties = event.properties\n .map((property) => `${property.name} ${typeReferenceText(propertyTypeReference(property))}${property.isSubject ? ' subject' : ''}`)\n .join('\\n');\n return `\\`\\`\\`screenplay\\n${event.visibility === 'Public' ? 'public ' : ''}event ${event.name}${event.generation !== undefined ? ` generation ${event.generation}` : ''}${event.origin !== undefined ? ` from ${JSON.stringify(event.origin)}` : ''}\\n${properties}\\n\\`\\`\\``;\n }\n\n const command = symbols.commands.find((candidate) => candidate.name === word);\n if (command && command.properties.length > 0) {\n const properties = command.properties\n .map(\n (property) =>\n `${property.name} ${typeReferenceText(propertyTypeReference(property))}${property.isGenerated ? ' generated' : ''}${property.isIdentifier ? ' identifier' : ''}`,\n )\n .join('\\n');\n return `\\`\\`\\`screenplay\\ncommand ${command.name}\\n${properties}\\n\\`\\`\\`${command.response || command.properties.some(property => property.isGenerated) ? `\\n\\n${responseAvailability}` : ''}`;\n }\n\n // Sub-language keywords take precedence inside their construct.\n const chain = enclosingChain(lines, fences, lineIndex, indentOf(line));\n for (const construct of [line.trim().split(/\\s+/)[0], ...chain]) {\n const subLanguage = getSubLanguage(construct ?? '');\n const doc = subLanguage?.hovers?.[word];\n if (doc) return doc;\n }\n\n if (word === 'reads' && (chain[0] === 'every' || chain[0] === 'at') && chain.includes('reaction')) {\n return '**reads** — Declares a whole view this clock trigger consults: `reads <View>`. Clock triggers take no values, so `by` is unavailable.';\n }\n\n const step = line.trim().match(/^(given|when|then)\\s+(?:no\\s+)?(\\w+)/);\n if (step && step[2] === word && chain[0] === 'specification' && specificationKeywordDocs[word]) {\n return `**${word}** — ${specificationKeywordDocs[word]}`;\n }\n\n if (word === 'id' || word === 'documentation') {\n const source = eventAnalysisSource(lines);\n const inEvent = symbols.events.some(event => directBody(source, fences, event.line, indentOf(source[event.line])).includes(lineIndex));\n const directive = word === 'id' ? /^\\s*id\\s+\"/.test(source[lineIndex]) : /^\\s*documentation\\s*$/.test(source[lineIndex]);\n const supportedOwner = inEvent || (word === 'documentation' && ['module', 'feature', 'slice', 'command', 'readmodel', 'reaction'].includes(chain[0]));\n if (!supportedOwner || !directive || startColumn !== indentOf(line) + 1) return null;\n }\n\n if (word === 'optional' || word === 'generated' || word === 'returns') return null;\n const keywordDoc = keywordDocs[word];\n if (keywordDoc) return `**${word}** — ${keywordDoc}`;\n\n return null;\n}\n"],"mappings":"qjCAqBA,SAAgB,aACZ,EACA,EACA,EACA,EACA,EACA,EACa,CACb,IAAMA,EAASC,EAASC,CAAK,EAC7B,GAAIF,EAAOG,GAAY,OAAO,KAE9B,IAAMC,EAAOF,EAAMC,IAAc,GACjC,GAAIE,EAAY,EAAIC,EAAeF,CAAI,CAAC,CAAC,OAAQ,OAAO,KACxD,IAAIG,EAAW,GACXC,EAAa,GACjB,IAAK,IAAIC,EAAQ,EAAGA,EAAQC,EAAc,EAAG,IACrCN,EAAKK,KAAW,MAAQF,EAAU,IAC7BH,EAAKK,KAAW,KAAO,CAACD,EAAY,EAAW,CAACD,EAChDH,EAAKK,KAAW,KAAO,CAACF,IAAU,EAAa,CAACC,GAE7D,GAAID,GAAYC,EAAY,OAAO,KACnC,IAAMG,EAAWC,GAAoBV,EAAOC,EAAWO,EAAaL,EAAWQ,CAAW,EAC1F,GAAIF,EAAU,OAAOA,EAAS,QAC9B,IAAMG,EAAeC,EAAab,EAAOC,EAAWO,EAAaL,EAAWQ,CAAW,EACvF,GAAIC,EAAc,OAAOA,EACzB,IAAME,EAAcC,EAAiBf,EAAOC,EAAWO,EAAaL,EAAWQ,CAAW,EAC1F,GAAIG,EAAa,OAAOA,EACxB,IAAME,EAAYC,EAAejB,EAAOC,EAAWO,EAAaL,EAAWQ,CAAW,EACtF,GAAIK,E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3C,CAAK,EAClCmF,EAAU/B,EAAQ,OAAO,KAAK,GAASgC,GAAW1C,EAAQ5C,EAAQ8E,EAAM,KAAMpD,EAASkB,EAAOkC,EAAM,KAAK,CAAC,CAAC,CAAC,SAAS3E,CAAS,CAAC,EAC/HoF,EAAYjE,IAAS,KAAO,aAAa,KAAKsB,EAAOzC,EAAU,EAAI,wBAAwB,KAAKyC,EAAOzC,EAAU,EAEvH,GAAI,EADmBkF,GAAY/D,IAAS,iBAAmB,CAAC,SAAU,UAAW,QAAS,UAAW,YAAa,UAAU,CAAC,CAAC,SAAS4B,EAAM,EAAE,IAC5H,CAACqC,GAAa7E,IAAgBgB,EAAStB,CAAI,EAAI,EAAG,OAAO,IACpF,CAEA,GAAIkB,IAAS,YAAcA,IAAS,aAAeA,IAAS,UAAW,OAAO,KAC9E,IAAMkE,EAAavC,EAAY3B,GAG/B,OAFIkE,EAAmB,KAAKlE,EAAK,OAAOkE,IAEjC,IACX"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{hoverContent as e}from"./hover-content.js";function createHoverProvider(t={}){return{provideHover(n,r){let i=n.getWordAtPosition(r);if(!i)return null;let a=e(n.getLinesContent(),r.lineNumber-1,i.word,i.startColumn,i.endColumn,t.application?.(n));return a?{contents:[{value:a}]}:null}}}export{createHoverProvider};
|
|
2
|
+
//# sourceMappingURL=hover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover.js","names":["word","model","position","content","hoverContent","options"],"sources":["../../hover.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { languages } from 'monaco-editor';\nimport { hoverContent } from './hover-content';\nimport { CompletionOptions } from './completions';\n\nexport function createHoverProvider(options: CompletionOptions = {}): languages.HoverProvider {\n return {\n provideHover(model, position) {\n const word = model.getWordAtPosition(position);\n if (!word) return null;\n\n const content = hoverContent(\n model.getLinesContent(),\n position.lineNumber - 1,\n word.word,\n word.startColumn,\n word.endColumn,\n options.application?.(model),\n );\n return content ? { contents: [{ value: content }] } : null;\n },\n };\n}\n"],"mappings":"mGAOA,SAAgB,oBAAoB,EAA6B,CAAC,EAA4B,CAC1F,MAAO,CACH,aAAa,EAAO,EAAU,CAC1B,IAAMA,EAAOC,EAAM,kBAAkBC,CAAQ,EAC7C,GAAI,CAACF,EAAM,OAAO,KAElB,IAAMG,EAAUC,EACZH,EAAM,gBAAgB,EACtBC,EAAS,WAAa,EACtBF,EAAK,KACLA,EAAK,YACLA,EAAK,UACLK,EAAQ,cAAcJ,CAAK,CAC/B,EACA,OAAOE,EAAU,CAAE,SAAU,CAAC,CAAE,MAAOA,CAAQ,CAAC,CAAE,EAAI,IAC1D,CACJ,CACJ"}
|