@cratis/screenplay-language 4.123.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/dist/completion-items.d.ts.map +1 -1
- package/dist/diagnostic-codes.d.ts +6 -0
- package/dist/diagnostic-codes.d.ts.map +1 -1
- package/dist/keyword-docs.d.ts.map +1 -1
- package/dist/language.d.ts.map +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/package.json +4 -3
- package/dist/bundles/chunk-4CLLEMBX.js +0 -42
- package/dist/bundles/chunk-4CLLEMBX.js.map +0 -7
- package/dist/bundles/chunk-AYDF3IFZ.js +0 -2
- package/dist/bundles/chunk-AYDF3IFZ.js.map +0 -7
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{destinationHints as e}from"./production-destinations.js";function createInlayHintsProvider(t={}){return{provideInlayHints(n,r){return{hints:e(n.getLinesContent(),t.application?.(n)).filter(e=>e.line+1>=r.startLineNumber&&e.line+1<=r.endLineNumber).map(e=>({position:{lineNumber:e.line+1,column:e.column},label:e.label,paddingLeft:!0})),dispose(){}}}}}export{createInlayHintsProvider};
|
|
2
|
+
//# sourceMappingURL=inlay-hints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inlay-hints.js","names":["destinationHints","model","options","hint","range"],"sources":["../../inlay-hints.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 { destinationHints } from './production-destinations';\nimport { CompletionOptions } from './completions';\n\nexport function createInlayHintsProvider(options: CompletionOptions = {}): languages.InlayHintsProvider {\n return {\n provideInlayHints(model, range) {\n const hints = destinationHints(model.getLinesContent(), options.application?.(model)).filter(hint => hint.line + 1 >= range.startLineNumber && hint.line + 1 <= range.endLineNumber);\n return {\n hints: hints.map(hint => ({ position: { lineNumber: hint.line + 1, column: hint.column }, label: hint.label, paddingLeft: true })),\n dispose() {},\n };\n },\n };\n}\n"],"mappings":"iHAOA,SAAgB,yBAAyB,EAA6B,CAAC,EAAiC,CACpG,MAAO,CACH,kBAAkB,EAAO,EAAO,CAE5B,MAAO,CACH,MAFUA,EAAiBC,EAAM,gBAAgB,EAAGC,EAAQ,cAAcD,CAAK,CAAC,CAAC,CAAC,OAAO,GAAQE,EAAK,KAAO,GAAKC,EAAM,iBAAmBD,EAAK,KAAO,GAAKC,EAAM,aAEvJ,CAAC,CAAC,IAAI,IAAS,CAAE,SAAU,CAAE,WAAYD,EAAK,KAAO,EAAG,OAAQA,EAAK,MAAO,EAAG,MAAOA,EAAK,MAAO,YAAa,EAAK,EAAE,EACjI,SAAU,CAAC,CACf,CACJ,CACJ,CACJ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{symbolsForBuffer as e}from"./symbols.js";import{structureCompletion as t}from"./structure-completions.js";function createInlineCompletionProvider(n){return{provideInlineCompletions(r,i){let a=r.getLinesContent(),o=i.lineNumber-1,s=a[o]??``,c=e(a,n.application?.(r)),l=t(a,o,s.substring(0,i.column-1),s.substring(i.column-1),c);return l?{items:[{insertText:`${s.substring(0,i.column-1)}${l.text}`,range:{startLineNumber:i.lineNumber,startColumn:1,endLineNumber:i.lineNumber,endColumn:i.column}}]}:{items:[]}},disposeInlineCompletions(){}}}export{createInlineCompletionProvider};
|
|
2
|
+
//# sourceMappingURL=inline-completions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-completions.js","names":["lines","model","lineIndex","position","line","symbols","symbolsForBuffer","options","suggestion","structureCompletion"],"sources":["../../inline-completions.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 type { CompletionOptions } from './completions';\nimport { structureCompletion } from './structure-completions';\nimport { symbolsForBuffer } from './symbols';\n\n// Ghost text for the structure a block obviously needs next, from the compiler's own model.\nexport function createInlineCompletionProvider(options: CompletionOptions): languages.InlineCompletionsProvider {\n return {\n provideInlineCompletions(model, position) {\n const lines = model.getLinesContent();\n const lineIndex = position.lineNumber - 1;\n const line = lines[lineIndex] ?? '';\n const symbols = symbolsForBuffer(lines, options.application?.(model));\n const suggestion = structureCompletion(lines, lineIndex, line.substring(0, position.column - 1), line.substring(position.column - 1), symbols);\n if (!suggestion) return { items: [] };\n // The suggestion replaces the indentation before the cursor, so it starts with indentation of its own -\n // the editors take Tab as 'indent' rather than 'accept' for a suggestion that does not.\n return { items: [{ insertText: `${line.substring(0, position.column - 1)}${suggestion.text}`, range: { startLineNumber: position.lineNumber, startColumn: 1, endLineNumber: position.lineNumber, endColumn: position.column } }] };\n },\n disposeInlineCompletions() {},\n };\n}\n"],"mappings":"kKASA,SAAgB,+BAA+B,EAAiE,CAC5G,MAAO,CACH,yBAAyB,EAAO,EAAU,CACtC,IAAMA,EAAQC,EAAM,gBAAgB,EAC9BC,EAAYC,EAAS,WAAa,EAClCC,EAAOJ,EAAME,IAAc,GAC3BG,EAAUC,EAAiBN,EAAOO,EAAQ,cAAcN,CAAK,CAAC,EAC9DO,EAAaC,EAAoBT,EAAOE,EAAWE,EAAK,UAAU,EAAGD,EAAS,OAAS,CAAC,EAAGC,EAAK,UAAUD,EAAS,OAAS,CAAC,EAAGE,CAAO,EAI7I,OAHKG,EAGE,CAAE,MAAO,CAAC,CAAE,WAAY,GAAGJ,EAAK,UAAU,EAAGD,EAAS,OAAS,CAAC,IAAIK,EAAW,OAAQ,MAAO,CAAE,gBAAiBL,EAAS,WAAY,YAAa,EAAG,cAAeA,EAAS,WAAY,UAAWA,EAAS,MAAO,CAAE,CAAC,CAAE,EAHzM,CAAE,MAAO,CAAC,CAAE,CAIxC,EACA,0BAA2B,CAAC,CAChC,CACJ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{fenceMap as e,indentOf as t}from"./document-context.js";import{eventAnalysisSource as n}from"./event-analysis-source.js";import{directBody as r}from"./symbols.js";import{productionDestinations as i}from"./production-destinations.js";import{diagnosticCodes as a}from"./diagnostic-codes.js";const o=/* @__PURE__ */ new Set([`namespace`,`sequence`,`correlation`,`causation`,`causedBy`,`occurred`]),s=/^id\s+"((?:[^"\\]|\\.)*)"$/;function validateInlineEvents(c,l,u,d=/* @__PURE__ */ new Set){c=n(c);let f=[],p=e(c),m=nonemptyMarkdownBlocks(c,p),h=new Set(l.commands.flatMap(e=>e.productionHeaders??[])),g=/* @__PURE__ */ new Map,_=/* @__PURE__ */ new Set;for(let e of[l,u]){for(let t of e.events)g.set(t.name,(g.get(t.name)??0)+1);for(let t of e.imports)_.add(t.shortName)}let report=(e,n,r,i=`error`)=>{f.push({line:e,startColumn:t(c[e])+1,endColumn:c[e].length+1,code:n,message:r,severity:i})};for(let e of l.events){let n=r(c,p,e.line,t(c[e.line]));if(e.inline){let t=/* @__PURE__ */ new Set;for(let n of e.properties)t.has(n.name)&&report(n.line,a.duplicateDeclaration,`Event '${e.name}' already declares property '${n.name}'.`),t.add(n.name);h.has(e.line)||report(e.line,a.inlineEventOutsideCommand,`Inline events can only be declared inside commands.`),e.generation!==void 0&&report(e.line,a.inlineEventGeneration,`Inline events are generation 1; extract the event before declaring generations.`),((g.get(e.name)??0)>1||_.has(e.name))&&report(e.line,a.inlineEventCollision,`Inline event '${e.name}' collides with another declaration or import.`)}let i=!1,o=!1;for(let r of n){let n=c[r].trim(),l=n.split(/\s+/)[0];if(e.inline&&l===`generation`&&report(r,a.inlineEventGeneration,`Inline events are generation 1; extract the event before declaring generations.`),e.inline&&l===`origin`&&report(r,a.reservedProductionMetadata,`An inline event is local to its command and cannot declare origin.`),!/^(?:id|description|documentation)\s+[\w.]+(?:\[\])?(?:\?|\s+optional)?(?:\s*=.*)?$/.test(n)){if(l===`id`){let t=n.match(s);i||t===null||t[1].trim().length===0?report(r,a.invalidEventId,`Expected one nonempty id "<old-name>".`):t[1]===e.name&&report(r,a.redundantEventId,`This id repeats the event name; remove it.`,`information`),i=!0}if(l===`documentation`){let e=r+1;for(;e<c.length&&c[e].trim().length===0;)e++;(o||n!==`documentation`||c[e]?.trim()!=="```markdown"||t(c[e])<=t(c[r])||!m.has(e))&&report(r,a.invalidEventDocumentation,`Expected one nonempty fenced markdown documentation block.`),o=!0}}}}let v=[];for(let e=0;e<c.length;e++){if(p[e]||c[e].trim().length===0)continue;let n=t(c[e]);for(;v.length>0&&v[v.length-1].indent>=n;)v.pop();let r=c[e].trim().split(/\s+/)[0];o.has(r)&&v.at(-1)?.event&&report(e,a.reservedProductionMetadata,`'${r}' is system-assigned production metadata.`),r===`produces`&&v.push({indent:n,event:!d.has(e)&&!/^\s*produces\s+operation\b/.test(c[e])})}for(let e of l.commands){let{identifier:t,mixed:n}=i(e);for(let r of e.produces??[]){n&&r.target===void 0&&report(r.line,a.explicitProducesTargetsRequired,`Production '${r.name}' must state for explicitly when destinations differ.`);let e=r.target??(r.inline?t:void 0);if(t!==void 0&&e===t)for(let e of r.mappings.filter(e=>e.source===t))report(e.line,a.eventSourceIdInPayload,`The payload copies '${t}', which already identifies the event source.`,r.inline?`warning`:`information`)}}return f}function nonemptyMarkdownBlocks(e,t){let n=/* @__PURE__ */ new Set,r,i=!1;for(let a=0;a<e.length;a++){if(!t[a])continue;let o=e[a].trim();r===void 0?(r=a,i=!1):o==="```"?(i&&e[r].trim()==="```markdown"&&n.add(r),r=void 0):o.length>0&&(i=!0)}return n}export{validateInlineEvents};
|
|
2
|
+
//# sourceMappingURL=inline-event-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-event-validation.js","names":["reserved","quotedId","eventAnalysisSource","lines","issues","fences","fenceMap","documentationBlocks","commandProductions","symbols","command","eventCounts","importedNames","document","application","event","imported","indentOf","line","body","directBody","properties","property","diagnosticCodes","hasId","hasDocumentation","index","text","keyword","match","next","productionIndents","indent","operationProductionLines","productionDestinations","production","mixed","destination","identifier","mapping","blocks","opening","content"],"sources":["../../inline-event-validation.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 { DiagnosticCode, diagnosticCodes } from './diagnostic-codes';\nimport { fenceMap, indentOf } from './document-context';\nimport { productionDestinations } from './production-destinations';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { directBody, DocumentSymbols } from './symbols';\nimport type { ValidationIssue, ValidationSeverity } from './validation';\n\nconst reserved = new Set(['namespace', 'sequence', 'correlation', 'causation', 'causedBy', 'occurred']);\nconst quotedId = /^id\\s+\"((?:[^\"\\\\]|\\\\.)*)\"$/;\n\nexport function validateInlineEvents(lines: string[], symbols: DocumentSymbols, application: DocumentSymbols, operationProductionLines: ReadonlySet<number> = new Set()): ValidationIssue[] {\n lines = eventAnalysisSource(lines);\n const issues: ValidationIssue[] = [];\n const fences = fenceMap(lines);\n const documentationBlocks = nonemptyMarkdownBlocks(lines, fences);\n const commandProductions = new Set(symbols.commands.flatMap(command => command.productionHeaders ?? []));\n const eventCounts = new Map<string, number>();\n const importedNames = new Set<string>();\n for (const document of [symbols, application]) {\n for (const event of document.events) eventCounts.set(event.name, (eventCounts.get(event.name) ?? 0) + 1);\n for (const imported of document.imports) importedNames.add(imported.shortName);\n }\n const report = (line: number, code: DiagnosticCode, message: string, severity: ValidationSeverity = 'error') => {\n issues.push({ line, startColumn: indentOf(lines[line]) + 1, endColumn: lines[line].length + 1, code, message, severity });\n };\n for (const event of symbols.events) {\n const body = directBody(lines, fences, event.line, indentOf(lines[event.line]));\n if (event.inline) {\n const properties = new Set<string>();\n for (const property of event.properties) {\n if (properties.has(property.name)) report(property.line, diagnosticCodes.duplicateDeclaration, `Event '${event.name}' already declares property '${property.name}'.`);\n properties.add(property.name);\n }\n if (!commandProductions.has(event.line)) report(event.line, diagnosticCodes.inlineEventOutsideCommand, 'Inline events can only be declared inside commands.');\n if (event.generation !== undefined) report(event.line, diagnosticCodes.inlineEventGeneration, 'Inline events are generation 1; extract the event before declaring generations.');\n if ((eventCounts.get(event.name) ?? 0) > 1 || importedNames.has(event.name)) {\n report(event.line, diagnosticCodes.inlineEventCollision, `Inline event '${event.name}' collides with another declaration or import.`);\n }\n }\n let hasId = false;\n let hasDocumentation = false;\n for (const index of body) {\n const text = lines[index].trim();\n const keyword = text.split(/\\s+/)[0];\n if (event.inline && keyword === 'generation') report(index, diagnosticCodes.inlineEventGeneration, 'Inline events are generation 1; extract the event before declaring generations.');\n if (event.inline && keyword === 'origin') report(index, diagnosticCodes.reservedProductionMetadata, 'An inline event is local to its command and cannot declare origin.');\n // Property-shaped metadata names stay properties, whether standalone or typed mappings.\n if (/^(?:id|description|documentation)\\s+[\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?(?:\\s*=.*)?$/.test(text)) continue;\n if (keyword === 'id') {\n const match = text.match(quotedId);\n if (hasId || match === null || match[1].trim().length === 0) report(index, diagnosticCodes.invalidEventId, 'Expected one nonempty id \"<old-name>\".');\n else if (match[1] === event.name) report(index, diagnosticCodes.redundantEventId, 'This id repeats the event name; remove it.', 'information');\n hasId = true;\n }\n if (keyword === 'documentation') {\n let next = index + 1;\n while (next < lines.length && lines[next].trim().length === 0) next++;\n if (hasDocumentation || text !== 'documentation' || lines[next]?.trim() !== '```markdown' || indentOf(lines[next]) <= indentOf(lines[index]) ||\n !documentationBlocks.has(next)) {\n report(index, diagnosticCodes.invalidEventDocumentation, 'Expected one nonempty fenced markdown documentation block.');\n }\n hasDocumentation = true;\n }\n }\n }\n // Also cover reaction productions without a backward ancestry walk per metadata line.\n const productionIndents: { indent: number; event: boolean }[] = [];\n for (let index = 0; index < lines.length; index++) {\n if (fences[index] || lines[index].trim().length === 0) continue;\n const indent = indentOf(lines[index]);\n while (productionIndents.length > 0 && productionIndents[productionIndents.length - 1].indent >= indent) productionIndents.pop();\n const keyword = lines[index].trim().split(/\\s+/)[0];\n if (reserved.has(keyword) && productionIndents.at(-1)?.event) {\n report(index, diagnosticCodes.reservedProductionMetadata, `'${keyword}' is system-assigned production metadata.`);\n }\n if (keyword === 'produces') productionIndents.push({ indent, event: !operationProductionLines.has(index) && !/^\\s*produces\\s+operation\\b/.test(lines[index]) });\n }\n for (const command of symbols.commands) {\n const { identifier, mixed } = productionDestinations(command);\n for (const production of command.produces ?? []) {\n if (mixed && production.target === undefined) report(production.line, diagnosticCodes.explicitProducesTargetsRequired, `Production '${production.name}' must state for explicitly when destinations differ.`);\n const destination = production.target ?? (production.inline ? identifier : undefined);\n if (identifier === undefined || destination !== identifier) continue;\n for (const mapping of production.mappings.filter(mapping => mapping.source === identifier)) {\n report(mapping.line, diagnosticCodes.eventSourceIdInPayload, `The payload copies '${identifier}', which already identifies the event source.`, production.inline ? 'warning' : 'information');\n }\n }\n }\n return issues;\n}\n\n// Record complete, nonempty Markdown fences once. Validation must not scan a suffix\n// for every documentation directive, especially while its opener is still being typed.\nfunction nonemptyMarkdownBlocks(lines: string[], fences: boolean[]): Set<number> {\n const blocks = new Set<number>();\n let opening: number | undefined;\n let content = false;\n for (let index = 0; index < lines.length; index++) {\n if (!fences[index]) continue;\n const text = lines[index].trim();\n if (opening === undefined) {\n opening = index;\n content = false;\n } else if (text === '```') {\n if (content && lines[opening].trim() === '```markdown') blocks.add(opening);\n opening = undefined;\n } else if (text.length > 0) {\n content = true;\n }\n }\n return blocks;\n}\n"],"mappings":"yVAUA,MAAMA,kBAAW,IAAI,IAAI,CAAC,YAAa,WAAY,cAAe,YAAa,WAAY,UAAU,CAAC,EAChGC,EAAW,6BAEjB,SAAgB,qBAAqB,EAAiB,EAA0B,EAA8B,kBAAgD,IAAI,IAA0B,CACxL,EAAQC,EAAoBC,CAAK,EACjC,IAAMC,EAA4B,CAAC,EAC7BC,EAASC,EAASH,CAAK,EACvBI,EAAsB,uBAAuBJ,EAAOE,CAAM,EAC1DG,EAAqB,IAAI,IAAIC,EAAQ,SAAS,QAAQ,GAAWC,EAAQ,mBAAqB,CAAC,CAAC,CAAC,EACjGC,kBAAc,IAAI,IAClBC,kBAAgB,IAAI,IAC1B,IAAK,IAAMC,IAAY,CAACJ,EAASK,CAAW,EAAG,CAC3C,IAAK,IAAMC,KAASF,EAAS,OAAQF,EAAY,IAAII,EAAM,MAAOJ,EAAY,IAAII,EAAM,IAAI,GAAK,GAAK,CAAC,EACvG,IAAK,IAAMC,KAAYH,EAAS,QAASD,EAAc,IAAII,EAAS,SAAS,CACjF,CACA,IAAM,QAAU,EAAc,EAAsB,EAAiB,EAA+B,UAAY,CAC5GZ,EAAO,KAAK,CAAE,OAAM,YAAaa,EAASd,EAAMe,EAAK,EAAI,EAAG,UAAWf,EAAMe,EAAK,CAAC,OAAS,EAAG,OAAM,UAAS,UAAS,CAAC,CAC5H,EACA,IAAK,IAAMH,KAASN,EAAQ,OAAQ,CAChC,IAAMU,EAAOC,EAAWjB,EAAOE,EAAQU,EAAM,KAAME,EAASd,EAAMY,EAAM,KAAK,CAAC,EAC9E,GAAIA,EAAM,OAAQ,CACd,IAAMM,kBAAa,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OAASG,EAAa,IAAA,IAC3E,GAAIA,IAAe,IAAA,IAAaD,IAAgBC,EAChD,IAAK,IAAMC,KAAWJ,EAAW,SAAS,OAAO,GAAWI,EAAQ,SAAWD,CAAU,EACrF,OAAOC,EAAQ,KAAMhB,EAAgB,uBAAwB,uBAAuBe,EAAW,+CAAgDH,EAAW,OAAS,UAAY,aAAa,CAEpM,CACJ,CACA,OAAO/B,CACX,CAIA,SAAS,uBAAuB,EAAiB,EAAgC,CAC7E,IAAMoC,kBAAS,IAAI,IACfC,EACAC,EAAU,GACd,IAAK,IAAIhB,EAAQ,EAAGA,EAAQvB,EAAM,OAAQ,IAAS,CAC/C,GAAI,CAACE,EAAOqB,GAAQ,SACpB,IAAMC,EAAOxB,EAAMuB,EAAM,CAAC,KAAK,EAC3Be,IAAY,IAAA,IACZ,EAAUf,EACV,EAAU,IACHC,IAAS,OACZe,GAAWvC,EAAMsC,EAAQ,CAAC,KAAK,IAAM,eAAeD,EAAO,IAAIC,CAAO,EAC1E,EAAU,IAAA,IACHd,EAAK,OAAS,IACrB,EAAU,GAElB,CACA,OAAOa,CACX"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{eventContextPaths as e}from"./event-context-catalog.js";import"./event-context.js";const t={implementation:`Handler-only intent with ordered hints and at most one file or tagged fence. No payload means pending. Handler execution is unsupported; this is not confirmation.`,hint:`One nonblank quoted implementation hint. Order and decoded text are retained; hints do not execute or confirm code.`},n={parameter:`A typed value declared by a specification table, or an argument of a named behavior. Table types are required; every case supplies each parameter exactly once.`,case:`One named concrete row of a specification table, expanded as <Specification>_<Case>. Use case.<parameter> for a whole step value.`,example:"One typed, possibly partial fixture: `example <Name> : <EventOrCommandOrReadModel>`. Use its name in a matching specification step; assignments override example values without changing matching or supplying defaults. Event examples may carry stream or no stream; a step replaces that route as a whole.",domain:`The domain the file belongs to — optional, at most one per file, before everything else.`,import:'Imports a type from another module by its qualified name — `import Module.Type` — making it available by its short name; or, quoted, other `.play` files by path or glob — `import "Orders/**/*.play"`, relative to this file\'s folder. Written inside a module or feature, a file import places the imported files there: their top level is that module\'s or feature\'s body. `import Module.Event from "origin"` is instead public contract metadata with an opaque origin; executable binding refuses it with PLAY0268.',concept:`A formalized value type wrapping a primitive. Bare pii and secret markers travel with every usage, with optional concept notes and qualifiers.`,type:`A composite value type — a named shape built from several properties, referenced by events, commands and other types the same way a concept is.`,reason:`A free-text concept note, not a lawful basis. Written as pii reason "..." or secret reason "..."; migration preserves it verbatim.`,optional:"Allows a value to be absent. Write it after the type: `note String optional` or `lines InvoiceLine[] optional`. The collection itself may be absent; its items keep their declared type.",identifier:`Marks the command property a runtime resolves the event source id from. At most one per command; without it a new Uuid is generated.`,policy:`A named authorization rule referenced by commands and queries. Multiple policies AND together.`,purpose:`A report-only processing declaration (GDPR Art. 30), referenced on modules, features and slices. Coverage is their union, not an authorization gate. Generated declarations are not legal advice.`,basis:`One declared Art. 6(1) basis: consent, contract, legalObligation, vitalInterests, publicTask or legitimateInterests; an optional quoted reference may follow.`,interest:`The legitimate-interest statement for basis legitimateInterests (Art. 13(1)(d)).`,condition:`One Art. 9(2) processing condition, optionally followed by a quoted reference.`,subjects:`Comma-separated categories of data subjects, as open identifiers.`,retention:`Declared retention period or criteria, not enforced by the model or Chronicle.`,recipient:`A quoted recipient category; repeatable on a purpose.`,transfer:`A declared destination followed by safeguard and quoted safeguards; repeatable.`,safeguard:`The declared safeguard accompanying a third-country transfer.`,erasure:`An erasure exception under Art. 17(3); Chronicle crypto-shredding remains per subject, not per purpose.`,exception:`One declared Art. 17(3) exception: expression, legalObligation, publicTask, publicHealth, archiving or legalClaims.`,persona:`A named role interacting with the application, with an optional description and its associated policies.`,identity:"Declares typed additional caller details from a claim, a keyed single-result query, inline code or a file. Authoring metadata only; executable use of `$identity.<detail>` reports PLAY0268 until admitted (#600).",authentication:`Declares the identity providers of the application — at most one block per file.`,provider:"A named identity provider within `authentication`, with free-form `name value` settings.",description:"A human-readable description, including the rule or case a specification witnesses, as a quoted single line or a fenced ```text block for multiple lines.",depends:"Declares `depends on <Name>` on a module or feature. This opts only that container into checking counted explicit references against its own declarations; it does not change executable bytes.",module:`The top-level namespace — maps to a bounded context.`,layout:`A reusable screen template with named slots.`,template:`Declares the named slots of a layout.`,feature:`A vertical slice grouping. Features nest arbitrarily deep.`,slice:`The atomic unit of behavior, aligned with Event Modeling. Has a type and a name.`,public:`Marks an event as a public contract. An event with from "origin" is also public. Origin is opaque, not a path or declaration reference. Public events and origins are admitted by executable semantic model (ESM) v9.`,direction:`Declare direction inbound or direction outbound once inside a Translate slice. Admitted by executable semantic model (ESM) v9; a Translate slice that uses public events must declare it (PLAY0614).`,inbound:`Inbound Translate direction metadata. No transport or delivery guarantee is implied.`,outbound:`Outbound Translate direction metadata. No transport or delivery guarantee is implied.`,event:"An immutable, past-tense fact. Declare it in a slice or inline with `produces event <Name>` in a command. Inline properties are typed mappings; inline tags belong to the event type.",documentation:"Authoring-only reasoning on a module, feature, slice, command, event, read model or reaction in one nonempty fenced ```markdown block. It does not change executable model bytes.",id:`Preserves the previous persisted event name after a rename. Leave absent on new events; repeating the current name is redundant.`,command:`An imperative intent. Declares authorization, validation, and what events it produces — declaratively, or via a full handler.`,query:`A read-side entry point mapping to a return type, with an optional description, parameters and performer.`,observable:"Qualifies a query return type as a live read — `query <Name> => observable <ReadModel>` keeps pushing as the read model changes, instead of answering once.",performer:"The code that performs a query — a `file <Path>` reference or an inline `csharp`/`sql` block. The query's counterpart to a command handler.",from:"Fills a query parameter from the query context instead of the caller, as in `filter tenantId TenantId from $context.tenant`.",projection:`Declares how events project into a read model, using the embedded Projection Declaration Language (PDL).`,capture:`Converts external data into events, using the embedded Change Data Capture Language (CDL).`,reaction:"Behavior that runs when something happens. Lives inside Automation slices. A trigger with no body states intent on its own — `file`/code is optional realization metadata.",runs:'`runs as system [role "Role" and role "Role"]` declares the identity for every returned or invoked command of a reaction, not imperative pipeline calls. Syntax-only (PLAY0268, #383); clock and application triggers have no Stage realization yet.',trigger:`Declares a kind of occurrence a reaction can respond to, and the values it hands the reaction. What makes one occur belongs to whoever provides it, never to the compiler.`,where:`Narrows which occurrences actually run the reaction.`,contains:`Text comparison — true when the left string holds the right one anywhere.`,every:"Runs a reaction on an interval — `every 15 minutes`, `every 1 day`.",refused:"Ordered invocation refusal branch: first match wins. Bare `on refused` covers validation and constraints, not authorization. Syntax-only, not yet executable (PLAY0268).",acknowledge:`A refusal branch acknowledges alone, or produces events instead. Syntax-only, not yet executable (PLAY0268).`,validation:"In `on refused by validation`, selects property, concept and require refusals. Syntax-only, not yet executable (PLAY0268).",authorization:"In `on refused by authorization`, explicitly selects unauthorized results, never Unsupported. Syntax-only, not yet executable (PLAY0268).",redelivered:"`when redelivered <Event> to <Reaction>` selects exactly one effective given occurrence by optional for, stated values and stream or no stream, without appending it again. Syntax-only, not yet executable (PLAY0268).",invokes:`A command a reaction hands on. A command is asked for, not produced — it may still be rejected.`,screen:`A UI declaration. Supports intent, structure, and layout-with-code levels, or a full file reference.`,constraint:`A server-side rule enforced in the Chronicle kernel before events are committed.`,authorize:`References the policies that must all pass for the construct to execute.`,validate:"Declarative validation rules, or `validate` followed by ```csharp for imperative rules — on commands and concepts.",produces:"References a declared event with `produces <Name>`, or declares one inline with `produces event <Name>`. An inline omitted `for` uses the command identifier only when all destinations are the same source; legacy plain omission allocates an identity.",reads:"Declares a view consulted by a command or reaction trigger: `reads <View> [as <alias>] [by <value>]`. A reaction `by` names a value taken by its trigger; clock triggers cannot use `by`. Repeated views require unique aliases. Runtime binding is not yet supported for command or reaction reads.",as:"Names an instance of a view in a command or reaction trigger reads declaration, for example `reads Account as source by sourceId`.",handler:"A fully imperative command implementation — a `file <Path>` reference or an inline `csharp` block, instead of `produces`.",when:"Guards a produced event or a capture append with a condition. In a labeled screen action, `when item.<field> == <literal> execute <Command>` selects the first matching command. Inside on click, double click or select, block-form `when <condition>` selects one whole action list at gesture time.",rule:"Names a predicate. Bare, it states that a constraint exists without expressing what it computes — nothing resolves the name. Optionally followed by an indented `file <Path>` reference or inline `csharp` block giving it a body.",require:'A policy condition: `authenticated`, `role "..."`, or `claim "..." matches ...`. Unary `not` negates a condition or group; precedence is not, and, or.',authenticated:`Requires an authenticated caller.`,role:`Requires the caller to have the given role.`,claim:`Requires a claim on the caller to match a subject or value.`,subject:"In policy `matches subject`, the identifier of the thing acted on, not the caller. The caller is `$context.causedBy.subject`.",data:`Binds a read model to a screen through a query.`,action:'Makes a command available on a screen. `action "Label"` declares one button with ordered `when … execute` alternatives over the nearest data item or selected row. No subject hides it; commands still enforce authorization and validation.',otherwise:"The final fallback of a guarded action: `otherwise hidden` or `otherwise execute <Command>`. In an item interaction, bare `otherwise` opens a fallback action list. No subject runs nothing, including fallback; authorization never falls through.",hidden:`Hides a guarded action when no condition matches. Without a subject the action is always hidden, even with an execute fallback.`,execute:"Executes a command. A guarded screen action selects it by the first matching condition; explicit `with … from` bindings precede same-name item fields, its declared form and renderer input.",navigate:"Navigates to a screen, optionally passing a parameter with `by`.",section:`A named structural section of a screen.`,table:`A table widget over a read model or child collection.`,summary:`A summary widget showing labeled fields.`,column:`A table column bound to a property.`,field:`A summary field bound to a property.`,title:`The display title of a screen or section.`,label:`The display label of an action, column, or field.`,unique:"A uniqueness constraint — `unique <property> on <EventType>` or `unique event <EventType>`.",concurrency:"The concurrency scope enforced when the command appends events — dimensions: `eventSource`, `sourceType`, `streamType`, `streamId`, `events`.",eventSource:`Concurrency dimension — scope the check to the event source id of the command.`,sourceType:`Concurrency dimension — scope the check to an event source type.`,streamType:`Concurrency dimension — scope the check to an event stream type.`,streamId:`Concurrency dimension — scope the check to an event stream id.`,tag:"Attaches a tag to appended events — a static identifier or string, or a `$context.` expression resolved at append time.",seed:`Declares events to seed into the event store per event source id — multiple blocks accumulate.`,for:"Names the event source of a production or seed group. Inside `produces event`, omission uses the command identifier unless another production targets a different source.",readmodel:"Declares a read model — its name and properties — in a slice, or, in a specification, read model state: `given readmodel` establishes it, `then readmodel` asserts it, `then no readmodel <View> for <key>` asserts keyed absence.",reducer:"Builds a read model from events with imperative code — `reducer <Name> => <ReadModel>` with an `on <EventType>` rule per event. Use it when a projection cannot express the transition.",specification:`Given/when/then acceptance criteria for a slice: prior events and state, the command, query or appended event under test, and the events, state, results, errors or denials that follow.`,dialog:"A dialog opened over the shell, or with `dialog template` a reusable dialog shape.",form:"A form bound to a command — `form <Name> for <Command>` with a `field` per input.",contribute:"Contributes entries to a slot of the shell — `contribute to Navigation` with `navigate to`, `label` and `order`.",theme:`A named theme and the component packages it is compatible with.`,ui:"A UI profile — `ui profile <Name>` binds a target platform and size to a layout, theme and packages.",behavior:"A named interaction wiring of `on <interaction>` handlers, attached to a screen, form or dialog with `uses`.",system:`An application-scoped external system that operations use.`,eventsource:`An application-owned event source with nested streams.`,operation:`A reusable operation intent that uses one external system.`,no:"A keyed absence assertion: `then no readmodel <View> for <key>`.",arguments:"The values supplied to a query asserted by `then query`.",result:"One expected result - `then result [exactly]` after `when query`, or a `result` block inside `then query`. Repeat it to assert several results in authored order.",clock:'The instant a specification happens at - `given clock "2026-10-05T08:00:00Z"` fixes when everything occurs; `when clock "<instant>"` is the clock reaching it, as the action.',exactly:"Requires every property to match, rather than only the ones asserted - on `then readmodel`, `then query` and `then result`.",file:`Delegates the implementation to an external file; the Screenplay contract stays visible.`,by:`Introduces the identifying parameter.`,via:`Connects screen data to the query that supplies it.`,filter:`An optional query filter parameter.`,on:"The event a constraint applies to, the day a schedule narrows to, or a widget interaction such as `on row-click`.",message:`The validation message reported when the rule fails.`,matches:"Matches a value against a regular expression or a named pattern such as `email`.",all:`Applies a comparison to every element of a collection.`,max:`Maximum length or value.`,min:`Minimum length or value.`,length:`Constrains the exact length of a value.`,today:`The current date.`,empty:"Used with `not empty` — the value must be present.",not:"Negates a validation condition, as in `not empty`.",and:`Both conditions must hold.`,or:`Either condition may hold.`,csharp:"An inline C# block whose opening fence is ```csharp.",sql:`An inline SQL block between triple backticks — a query performer written against a relational store.`,typescript:`An inline TypeScript block between triple backticks.`,react:"An inline React/TSX block; receives the surrounding data contract as `Props`.",html:`An inline static HTML block.`,StateChange:`Slice type — a command → events flow; something that changes the system.`,StateView:`Slice type — a query + projection + screen; something that reads the system.`,Automation:`Slice type — a reaction or reducer; something that runs when something happens.`,Translate:`Slice type — a capture; converts external data into events.`,Uuid:`Primitive type — a universally unique identifier.`,String:`Primitive type — a string of characters.`,Int:`Primitive type — an integer number.`,Decimal:`Primitive type — a decimal number.`,Bool:`Primitive type — true or false.`,Date:`Primitive type — a date without time.`,DateTime:`Primitive type — a date and time.`,Enum:`An enumeration concept with a fixed set of values.`},r={parameter:"Declares a required typed case value: `parameter <name> <Type>`. Every case assigns it once. `optional` permits literal null but supplies no default.",case:"One named complete row of a specification table. `case.<parameter>` substitutes a whole value after example overrides; each row runs as `<Specification>_<Case>`.",caller:"`given caller` states an explicit identity; `given caller as <Persona>` synthesizes an authenticated deterministic witness of the persona, with no body. Leftmost buildable policy alternatives are significant.",clock:n.clock,redelivered:n.redelivered,trigger:"`when trigger <Trigger>` - an application trigger fires, as the action, with the values on the lines beneath it.",capture:"`given capture <Capture>` - a record the capture's source held before; `when capture <Capture>` - the record it sees now, as the action. The fields go on the lines beneath.",query:"`when query <Query>` - the query is performed, as the action, with its arguments on the lines beneath; assert what it returns with `then result` or `then no result`. `then query` instead asserts a query after another action.",events:"`then no events` - asserts no new events after a non-append action. Syntax-only, not yet executable (PLAY0268). Cannot accompany event, event-order, error or denial expectations.",result:"`then result [exactly]` - one result the query performed by `when query` returns, in order; `then no result` - it returns nothing."},i={pii:`personal data (GDPR Art. 4(1)); renders Chronicle [PII]. Bare suffix marker; @pii is deprecated (PLAY0565). Not admitted by the executable model (PLAY0268).`,personal:`Alias of pii: personal data (GDPR Art. 4(1)); renders Chronicle [PII]. No diagnostic; canonical printing writes pii.`,secret:`Operational secret, not personal data: encrypted at rest without erasure and withheld from causation. Provider mapping: [Encrypted] + [NotAudited], or [PII] only with pii. Cannot be identity (PLAY0515). Not admitted by the executable model (PLAY0268).`,sensitive:`Deprecated spelling of secret (PLAY0565); repair to bare secret. Operational secret, not GDPR Art. 9 special-category data.`},a={"$context.occurred":`When the command or query was received.`,"$context.tenant":`The tenant the command or query is executing for.`,"$context.command":"The command being handled, shaped by its `command` declaration.","$context.arguments":`The arguments of the query being performed.`,"$context.causedBy":"The identity that caused the command or query — `subject`, `name`, `userName`.","$context.causedBy.subject":`The subject of the identity that caused the command or query.`,"$context.causedBy.name":`The display name of the identity that caused the command or query.`,"$context.causedBy.userName":`The user name of the identity that caused the command or query.`,"$context.causation":"What caused the command or query — `type`, `occurred`, `properties`.","$context.causation.type":`What caused the command or query — a command, a reactor, a schedule.`,$identity:"The caller — token built-ins `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`, plus declared identity details. Built-ins are equivalent to `$context.identity`; details are authoring-only until admitted (#600).","$identity.id":"The identifier of the caller from the auth token; equivalent to `$context.identity.id`.","$identity.name":"The display name of the caller; equivalent to `$context.identity.name`.","$identity.userName":"The user name of the caller; equivalent to `$context.identity.userName`.","$identity.isAuthenticated":`Whether the caller is authenticated.`,"$identity.roles":`The roles the caller holds.`,"$identity.claims":"The claims the caller carries — `$identity.claims.<name>` reads one.","$context.identity":"The caller a decision is made about — `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`.","$context.identity.id":`The identifier of the caller from the auth token.`,"$context.identity.name":`The display name of the caller.`,"$context.identity.userName":`The user name of the caller.`,"$context.identity.isAuthenticated":`Whether the caller is authenticated.`,"$context.identity.roles":`The roles the caller holds.`,"$context.identity.claims":"The claims the caller carries — `$context.identity.claims.<name>` reads one.",$env:"An environment variable, e.g. `$env.SERVICE_NAME`.",$secrets:"An encrypted secret resolved at runtime, e.g. `$secrets.azureAdClientId` — stays symbolic in the compiled tree.",$strings:"A localized string resolved from the `.strings` file of the active locale, e.g. `$strings.invoices.title`.",...Object.fromEntries(e.map(e=>[`$eventContext.${e.path}`,e.description]))},o={racialOrEthnicOrigin:`Data revealing a person's racial or ethnic origin (GDPR Art. 9(1)).`,politicalOpinions:`Data revealing a person's political opinions (GDPR Art. 9(1)).`,religiousOrPhilosophicalBeliefs:`Data revealing a person's religious or philosophical beliefs (GDPR Art. 9(1)).`,tradeUnionMembership:`Data revealing whether a person belongs to a trade union (GDPR Art. 9(1)).`,genetic:`Data about inherited or acquired genetic characteristics that gives unique information about a person's physiology or health (GDPR Art. 9(1), Art. 4(13)).`,biometric:`Data from technical processing of physical, physiological or behavioral characteristics, special only when processed to uniquely identify a person (GDPR Art. 9(1), Art. 4(14)).`,health:`Data about a person's physical or mental health, including health care services, that reveals their health status (GDPR Art. 9(1), Art. 4(15)).`,sexLifeOrSexualOrientation:`Data concerning a person's sex life or sexual orientation (GDPR Art. 9(1)).`};export{i as attributeDocs,a as contextVariableDocs,t as handlerIntentDocs,n as keywordDocs,o as specialCategoryDocs,r as specificationKeywordDocs};
|
|
2
|
+
//# sourceMappingURL=keyword-docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyword-docs.js","names":["handlerIntentDocs","keywordDocs","specificationKeywordDocs","attributeDocs","contextVariableDocs","\"$identity\"","\"$env\"","\"$secrets\"","\"$strings\"","eventContextPaths","path","specialCategoryDocs"],"sources":["../../keyword-docs.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 { eventContextPaths } from './event-context';\n\n// These words are contextual beneath a handler, never global property keywords.\nexport const handlerIntentDocs = {\n implementation: 'Handler-only intent with ordered hints and at most one file or tagged fence. No payload means pending. Handler execution is unsupported; this is not confirmation.',\n hint: 'One nonblank quoted implementation hint. Order and decoded text are retained; hints do not execute or confirm code.',\n};\n\nexport const keywordDocs: Record<string, string> = {\n parameter: 'A typed value declared by a specification table, or an argument of a named behavior. Table types are required; every case supplies each parameter exactly once.',\n case: 'One named concrete row of a specification table, expanded as <Specification>_<Case>. Use case.<parameter> for a whole step value.',\n example: 'One typed, possibly partial fixture: `example <Name> : <EventOrCommandOrReadModel>`. Use its name in a matching specification step; assignments override example values without changing matching or supplying defaults. Event examples may carry stream or no stream; a step replaces that route as a whole.',\n domain: 'The domain the file belongs to — optional, at most one per file, before everything else.',\n import: 'Imports a type from another module by its qualified name — `import Module.Type` — making it available by its short name; or, quoted, other `.play` files by path or glob — `import \"Orders/**/*.play\"`, relative to this file\\'s folder. Written inside a module or feature, a file import places the imported files there: their top level is that module\\'s or feature\\'s body. `import Module.Event from \"origin\"` is instead public contract metadata with an opaque origin; executable binding refuses it with PLAY0268.',\n concept: 'A formalized value type wrapping a primitive. Bare pii and secret markers travel with every usage, with optional concept notes and qualifiers.',\n type: 'A composite value type — a named shape built from several properties, referenced by events, commands and other types the same way a concept is.',\n reason: 'A free-text concept note, not a lawful basis. Written as pii reason \"...\" or secret reason \"...\"; migration preserves it verbatim.',\n optional: 'Allows a value to be absent. Write it after the type: `note String optional` or `lines InvoiceLine[] optional`. The collection itself may be absent; its items keep their declared type.',\n identifier: 'Marks the command property a runtime resolves the event source id from. At most one per command; without it a new Uuid is generated.',\n policy: 'A named authorization rule referenced by commands and queries. Multiple policies AND together.',\n purpose: 'A report-only processing declaration (GDPR Art. 30), referenced on modules, features and slices. Coverage is their union, not an authorization gate. Generated declarations are not legal advice.',\n basis: 'One declared Art. 6(1) basis: consent, contract, legalObligation, vitalInterests, publicTask or legitimateInterests; an optional quoted reference may follow.',\n interest: 'The legitimate-interest statement for basis legitimateInterests (Art. 13(1)(d)).',\n condition: 'One Art. 9(2) processing condition, optionally followed by a quoted reference.',\n subjects: 'Comma-separated categories of data subjects, as open identifiers.',\n retention: 'Declared retention period or criteria, not enforced by the model or Chronicle.',\n recipient: 'A quoted recipient category; repeatable on a purpose.',\n transfer: 'A declared destination followed by safeguard and quoted safeguards; repeatable.',\n safeguard: 'The declared safeguard accompanying a third-country transfer.',\n erasure: 'An erasure exception under Art. 17(3); Chronicle crypto-shredding remains per subject, not per purpose.',\n exception: 'One declared Art. 17(3) exception: expression, legalObligation, publicTask, publicHealth, archiving or legalClaims.',\n persona: 'A named role interacting with the application, with an optional description and its associated policies.',\n identity: 'Declares typed additional caller details from a claim, a keyed single-result query, inline code or a file. Authoring metadata only; executable use of `$identity.<detail>` reports PLAY0268 until admitted (#600).',\n authentication: 'Declares the identity providers of the application — at most one block per file.',\n provider: 'A named identity provider within `authentication`, with free-form `name value` settings.',\n description: 'A human-readable description, including the rule or case a specification witnesses, as a quoted single line or a fenced ```text block for multiple lines.',\n depends: 'Declares `depends on <Name>` on a module or feature. This opts only that container into checking counted explicit references against its own declarations; it does not change executable bytes.',\n module: 'The top-level namespace — maps to a bounded context.',\n layout: 'A reusable screen template with named slots.',\n template: 'Declares the named slots of a layout.',\n feature: 'A vertical slice grouping. Features nest arbitrarily deep.',\n slice: 'The atomic unit of behavior, aligned with Event Modeling. Has a type and a name.',\n public: 'Marks an event as a public contract. An event with from \"origin\" is also public. Origin is opaque, not a path or declaration reference. Public events and origins are admitted by executable semantic model (ESM) v9.',\n direction: 'Declare direction inbound or direction outbound once inside a Translate slice. Admitted by executable semantic model (ESM) v9; a Translate slice that uses public events must declare it (PLAY0614).',\n inbound: 'Inbound Translate direction metadata. No transport or delivery guarantee is implied.',\n outbound: 'Outbound Translate direction metadata. No transport or delivery guarantee is implied.',\n event: 'An immutable, past-tense fact. Declare it in a slice or inline with `produces event <Name>` in a command. Inline properties are typed mappings; inline tags belong to the event type.',\n documentation: 'Authoring-only reasoning on a module, feature, slice, command, event, read model or reaction in one nonempty fenced ```markdown block. It does not change executable model bytes.',\n id: 'Preserves the previous persisted event name after a rename. Leave absent on new events; repeating the current name is redundant.',\n command: 'An imperative intent. Declares authorization, validation, and what events it produces — declaratively, or via a full handler.',\n query: 'A read-side entry point mapping to a return type, with an optional description, parameters and performer.',\n observable: 'Qualifies a query return type as a live read — `query <Name> => observable <ReadModel>` keeps pushing as the read model changes, instead of answering once.',\n performer: 'The code that performs a query — a `file <Path>` reference or an inline `csharp`/`sql` block. The query\\'s counterpart to a command handler.',\n from: 'Fills a query parameter from the query context instead of the caller, as in `filter tenantId TenantId from $context.tenant`.',\n projection: 'Declares how events project into a read model, using the embedded Projection Declaration Language (PDL).',\n capture: 'Converts external data into events, using the embedded Change Data Capture Language (CDL).',\n reaction: 'Behavior that runs when something happens. Lives inside Automation slices. A trigger with no body states intent on its own — `file`/code is optional realization metadata.',\n runs: '`runs as system [role \"Role\" and role \"Role\"]` declares the identity for every returned or invoked command of a reaction, not imperative pipeline calls. Syntax-only (PLAY0268, #383); clock and application triggers have no Stage realization yet.',\n trigger: 'Declares a kind of occurrence a reaction can respond to, and the values it hands the reaction. What makes one occur belongs to whoever provides it, never to the compiler.',\n where: 'Narrows which occurrences actually run the reaction.',\n contains: 'Text comparison — true when the left string holds the right one anywhere.',\n every: 'Runs a reaction on an interval — `every 15 minutes`, `every 1 day`.',\n refused: 'Ordered invocation refusal branch: first match wins. Bare `on refused` covers validation and constraints, not authorization. Syntax-only, not yet executable (PLAY0268).',\n acknowledge: 'A refusal branch acknowledges alone, or produces events instead. Syntax-only, not yet executable (PLAY0268).',\n validation: 'In `on refused by validation`, selects property, concept and require refusals. Syntax-only, not yet executable (PLAY0268).',\n authorization: 'In `on refused by authorization`, explicitly selects unauthorized results, never Unsupported. Syntax-only, not yet executable (PLAY0268).',\n redelivered: '`when redelivered <Event> to <Reaction>` selects exactly one effective given occurrence by optional for, stated values and stream or no stream, without appending it again. Syntax-only, not yet executable (PLAY0268).',\n invokes: 'A command a reaction hands on. A command is asked for, not produced — it may still be rejected.',\n screen: 'A UI declaration. Supports intent, structure, and layout-with-code levels, or a full file reference.',\n constraint: 'A server-side rule enforced in the Chronicle kernel before events are committed.',\n authorize: 'References the policies that must all pass for the construct to execute.',\n validate: 'Declarative validation rules, or `validate` followed by ```csharp for imperative rules — on commands and concepts.',\n produces: 'References a declared event with `produces <Name>`, or declares one inline with `produces event <Name>`. An inline omitted `for` uses the command identifier only when all destinations are the same source; legacy plain omission allocates an identity.',\n reads: 'Declares a view consulted by a command or reaction trigger: `reads <View> [as <alias>] [by <value>]`. A reaction `by` names a value taken by its trigger; clock triggers cannot use `by`. Repeated views require unique aliases. Runtime binding is not yet supported for command or reaction reads.',\n as: 'Names an instance of a view in a command or reaction trigger reads declaration, for example `reads Account as source by sourceId`.',\n handler: 'A fully imperative command implementation — a `file <Path>` reference or an inline `csharp` block, instead of `produces`.',\n when: 'Guards a produced event or a capture append with a condition. In a labeled screen action, `when item.<field> == <literal> execute <Command>` selects the first matching command. Inside on click, double click or select, block-form `when <condition>` selects one whole action list at gesture time.',\n rule: 'Names a predicate. Bare, it states that a constraint exists without expressing what it computes — nothing resolves the name. Optionally followed by an indented `file <Path>` reference or inline `csharp` block giving it a body.',\n require: 'A policy condition: `authenticated`, `role \"...\"`, or `claim \"...\" matches ...`. Unary `not` negates a condition or group; precedence is not, and, or.',\n authenticated: 'Requires an authenticated caller.',\n role: 'Requires the caller to have the given role.',\n claim: 'Requires a claim on the caller to match a subject or value.',\n subject: 'In policy `matches subject`, the identifier of the thing acted on, not the caller. The caller is `$context.causedBy.subject`.',\n data: 'Binds a read model to a screen through a query.',\n action: 'Makes a command available on a screen. `action \"Label\"` declares one button with ordered `when … execute` alternatives over the nearest data item or selected row. No subject hides it; commands still enforce authorization and validation.',\n otherwise: 'The final fallback of a guarded action: `otherwise hidden` or `otherwise execute <Command>`. In an item interaction, bare `otherwise` opens a fallback action list. No subject runs nothing, including fallback; authorization never falls through.',\n hidden: 'Hides a guarded action when no condition matches. Without a subject the action is always hidden, even with an execute fallback.',\n execute: 'Executes a command. A guarded screen action selects it by the first matching condition; explicit `with … from` bindings precede same-name item fields, its declared form and renderer input.',\n navigate: 'Navigates to a screen, optionally passing a parameter with `by`.',\n section: 'A named structural section of a screen.',\n table: 'A table widget over a read model or child collection.',\n summary: 'A summary widget showing labeled fields.',\n column: 'A table column bound to a property.',\n field: 'A summary field bound to a property.',\n title: 'The display title of a screen or section.',\n label: 'The display label of an action, column, or field.',\n unique: 'A uniqueness constraint — `unique <property> on <EventType>` or `unique event <EventType>`.',\n concurrency: 'The concurrency scope enforced when the command appends events — dimensions: `eventSource`, `sourceType`, `streamType`, `streamId`, `events`.',\n eventSource: 'Concurrency dimension — scope the check to the event source id of the command.',\n sourceType: 'Concurrency dimension — scope the check to an event source type.',\n streamType: 'Concurrency dimension — scope the check to an event stream type.',\n streamId: 'Concurrency dimension — scope the check to an event stream id.',\n tag: 'Attaches a tag to appended events — a static identifier or string, or a `$context.` expression resolved at append time.',\n seed: 'Declares events to seed into the event store per event source id — multiple blocks accumulate.',\n for: 'Names the event source of a production or seed group. Inside `produces event`, omission uses the command identifier unless another production targets a different source.',\n readmodel: 'Declares a read model — its name and properties — in a slice, or, in a specification, read model state: `given readmodel` establishes it, `then readmodel` asserts it, `then no readmodel <View> for <key>` asserts keyed absence.',\n reducer: 'Builds a read model from events with imperative code — `reducer <Name> => <ReadModel>` with an `on <EventType>` rule per event. Use it when a projection cannot express the transition.',\n specification: 'Given/when/then acceptance criteria for a slice: prior events and state, the command, query or appended event under test, and the events, state, results, errors or denials that follow.',\n dialog: 'A dialog opened over the shell, or with `dialog template` a reusable dialog shape.',\n form: 'A form bound to a command — `form <Name> for <Command>` with a `field` per input.',\n contribute: 'Contributes entries to a slot of the shell — `contribute to Navigation` with `navigate to`, `label` and `order`.',\n theme: 'A named theme and the component packages it is compatible with.',\n ui: 'A UI profile — `ui profile <Name>` binds a target platform and size to a layout, theme and packages.',\n behavior: 'A named interaction wiring of `on <interaction>` handlers, attached to a screen, form or dialog with `uses`.',\n system: 'An application-scoped external system that operations use.',\n eventsource: 'An application-owned event source with nested streams.',\n operation: 'A reusable operation intent that uses one external system.',\n no: 'A keyed absence assertion: `then no readmodel <View> for <key>`.',\n arguments: 'The values supplied to a query asserted by `then query`.',\n result: 'One expected result - `then result [exactly]` after `when query`, or a `result` block inside `then query`. Repeat it to assert several results in authored order.',\n clock: 'The instant a specification happens at - `given clock \"2026-10-05T08:00:00Z\"` fixes when everything occurs; `when clock \"<instant>\"` is the clock reaching it, as the action.',\n exactly: 'Requires every property to match, rather than only the ones asserted - on `then readmodel`, `then query` and `then result`.',\n file: 'Delegates the implementation to an external file; the Screenplay contract stays visible.',\n by: 'Introduces the identifying parameter.',\n via: 'Connects screen data to the query that supplies it.',\n filter: 'An optional query filter parameter.',\n on: 'The event a constraint applies to, the day a schedule narrows to, or a widget interaction such as `on row-click`.',\n message: 'The validation message reported when the rule fails.',\n matches: 'Matches a value against a regular expression or a named pattern such as `email`.',\n all: 'Applies a comparison to every element of a collection.',\n max: 'Maximum length or value.',\n min: 'Minimum length or value.',\n length: 'Constrains the exact length of a value.',\n today: 'The current date.',\n empty: 'Used with `not empty` — the value must be present.',\n not: 'Negates a validation condition, as in `not empty`.',\n and: 'Both conditions must hold.',\n or: 'Either condition may hold.',\n csharp: 'An inline C# block whose opening fence is ```csharp.',\n sql: 'An inline SQL block between triple backticks — a query performer written against a relational store.',\n typescript: 'An inline TypeScript block between triple backticks.',\n react: 'An inline React/TSX block; receives the surrounding data contract as `Props`.',\n html: 'An inline static HTML block.',\n StateChange: 'Slice type — a command → events flow; something that changes the system.',\n StateView: 'Slice type — a query + projection + screen; something that reads the system.',\n Automation: 'Slice type — a reaction or reducer; something that runs when something happens.',\n Translate: 'Slice type — a capture; converts external data into events.',\n Uuid: 'Primitive type — a universally unique identifier.',\n String: 'Primitive type — a string of characters.',\n Int: 'Primitive type — an integer number.',\n Decimal: 'Primitive type — a decimal number.',\n Bool: 'Primitive type — true or false.',\n Date: 'Primitive type — a date without time.',\n DateTime: 'Primitive type — a date and time.',\n Enum: 'An enumeration concept with a fixed set of values.',\n};\n\n// What the words of a specification's steps mean there - where 'trigger', 'capture' and 'query' name what the\n// scenario exercises rather than declare one.\nexport const specificationKeywordDocs: Record<string, string> = {\n parameter: 'Declares a required typed case value: `parameter <name> <Type>`. Every case assigns it once. `optional` permits literal null but supplies no default.',\n case: 'One named complete row of a specification table. `case.<parameter>` substitutes a whole value after example overrides; each row runs as `<Specification>_<Case>`.',\n caller: '`given caller` states an explicit identity; `given caller as <Persona>` synthesizes an authenticated deterministic witness of the persona, with no body. Leftmost buildable policy alternatives are significant.',\n clock: keywordDocs.clock,\n redelivered: keywordDocs.redelivered,\n trigger: '`when trigger <Trigger>` - an application trigger fires, as the action, with the values on the lines beneath it.',\n capture: '`given capture <Capture>` - a record the capture\\'s source held before; `when capture <Capture>` - the record it sees now, as the action. The fields go on the lines beneath.',\n query: '`when query <Query>` - the query is performed, as the action, with its arguments on the lines beneath; assert what it returns with `then result` or `then no result`. `then query` instead asserts a query after another action.',\n events: '`then no events` - asserts no new events after a non-append action. Syntax-only, not yet executable (PLAY0268). Cannot accompany event, event-order, error or denial expectations.',\n result: '`then result [exactly]` - one result the query performed by `when query` returns, in order; `then no result` - it returns nothing.',\n};\n\nexport const attributeDocs: Record<string, string> = {\n pii: 'personal data (GDPR Art. 4(1)); renders Chronicle [PII]. Bare suffix marker; @pii is deprecated (PLAY0565). Not admitted by the executable model (PLAY0268).',\n personal: 'Alias of pii: personal data (GDPR Art. 4(1)); renders Chronicle [PII]. No diagnostic; canonical printing writes pii.',\n secret: 'Operational secret, not personal data: encrypted at rest without erasure and withheld from causation. Provider mapping: [Encrypted] + [NotAudited], or [PII] only with pii. Cannot be identity (PLAY0515). Not admitted by the executable model (PLAY0268).',\n sensitive: 'Deprecated spelling of secret (PLAY0565); repair to bare secret. Operational secret, not GDPR Art. 9 special-category data.',\n};\n\nexport const contextVariableDocs: Record<string, string> = {\n '$context.occurred': 'When the command or query was received.',\n '$context.tenant': 'The tenant the command or query is executing for.',\n '$context.command': 'The command being handled, shaped by its `command` declaration.',\n '$context.arguments': 'The arguments of the query being performed.',\n '$context.causedBy': 'The identity that caused the command or query — `subject`, `name`, `userName`.',\n '$context.causedBy.subject': 'The subject of the identity that caused the command or query.',\n '$context.causedBy.name': 'The display name of the identity that caused the command or query.',\n '$context.causedBy.userName': 'The user name of the identity that caused the command or query.',\n '$context.causation': 'What caused the command or query — `type`, `occurred`, `properties`.',\n '$context.causation.type': 'What caused the command or query — a command, a reactor, a schedule.',\n '$identity': 'The caller — token built-ins `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`, plus declared identity details. Built-ins are equivalent to `$context.identity`; details are authoring-only until admitted (#600).',\n '$identity.id': 'The identifier of the caller from the auth token; equivalent to `$context.identity.id`.',\n '$identity.name': 'The display name of the caller; equivalent to `$context.identity.name`.',\n '$identity.userName': 'The user name of the caller; equivalent to `$context.identity.userName`.',\n '$identity.isAuthenticated': 'Whether the caller is authenticated.',\n '$identity.roles': 'The roles the caller holds.',\n '$identity.claims': 'The claims the caller carries — `$identity.claims.<name>` reads one.',\n '$context.identity': 'The caller a decision is made about — `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`.',\n '$context.identity.id': 'The identifier of the caller from the auth token.',\n '$context.identity.name': 'The display name of the caller.',\n '$context.identity.userName': 'The user name of the caller.',\n '$context.identity.isAuthenticated': 'Whether the caller is authenticated.',\n '$context.identity.roles': 'The roles the caller holds.',\n '$context.identity.claims': 'The claims the caller carries — `$context.identity.claims.<name>` reads one.',\n '$env': 'An environment variable, e.g. `$env.SERVICE_NAME`.',\n '$secrets': 'An encrypted secret resolved at runtime, e.g. `$secrets.azureAdClientId` — stays symbolic in the compiled tree.',\n '$strings': 'A localized string resolved from the `.strings` file of the active locale, e.g. `$strings.invoices.title`.',\n // Every $eventContext path the event-context catalog lists, for projections.\n ...Object.fromEntries(eventContextPaths.map((path) => [`$eventContext.${path.path}`, path.description])),\n};\n\n// One-sentence descriptions of the `pii special` categories (GDPR Art. 9(1)) and `pii criminal` (Art. 10).\n// The same sentences appear in Documentation/screenplay/concepts.md.\nexport const specialCategoryDocs: Record<string, string> = {\n racialOrEthnicOrigin: 'Data revealing a person\\'s racial or ethnic origin (GDPR Art. 9(1)).',\n politicalOpinions: 'Data revealing a person\\'s political opinions (GDPR Art. 9(1)).',\n religiousOrPhilosophicalBeliefs: 'Data revealing a person\\'s religious or philosophical beliefs (GDPR Art. 9(1)).',\n tradeUnionMembership: 'Data revealing whether a person belongs to a trade union (GDPR Art. 9(1)).',\n genetic: 'Data about inherited or acquired genetic characteristics that gives unique information about a person\\'s physiology or health (GDPR Art. 9(1), Art. 4(13)).',\n biometric: 'Data from technical processing of physical, physiological or behavioral characteristics, special only when processed to uniquely identify a person (GDPR Art. 9(1), Art. 4(14)).',\n health: 'Data about a person\\'s physical or mental health, including health care services, that reveals their health status (GDPR Art. 9(1), Art. 4(15)).',\n sexLifeOrSexualOrientation: 'Data concerning a person\\'s sex life or sexual orientation (GDPR Art. 9(1)).'\n};\n"],"mappings":"2IAMA,MAAaA,EAAoB,CAC7B,eAAgB,qKAChB,KAAM,qHACV,EAEaC,EAAsC,CAC/C,UAAW,kKACX,KAAM,oIACN,QAAS,gTACT,OAAQ,2FACR,OAAQ,ggBACR,QAAS,iJACT,KAAM,kJACN,OAAQ,qIACR,SAAU,2LACV,WAAY,uIACZ,OAAQ,iGACR,QAAS,oMACT,MAAO,gKACP,SAAU,mFACV,UAAW,iFACX,SAAU,oEACV,UAAW,iFACX,UAAW,wDACX,SAAU,kFACV,UAAW,gEACX,QAAS,0GACT,UAAW,sHACX,QAAS,2GACT,SAAU,qNACV,eAAgB,mFAChB,SAAU,2FACV,YAAa,4JACb,QAAS,kMACT,OAAQ,uDACR,OAAQ,+CACR,SAAU,wCACV,QAAS,6DACT,MAAO,mFACP,OAAQ,wNACR,UAAW,uMACX,QAAS,uFACT,SAAU,wFACV,MAAO,wLACP,cAAe,oLACf,GAAI,mIACJ,QAAS,gIACT,MAAO,4GACP,WAAY,8JACZ,UAAW,8IACX,KAAM,+HACN,WAAY,2GACZ,QAAS,6FACT,SAAU,6KACV,KAAM,uPACN,QAAS,6KACT,MAAO,uDACP,SAAU,4EACV,MAAO,sEACP,QAAS,2KACT,YAAa,+GACb,WAAY,6HACZ,cAAe,4IACf,YAAa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Q,qLACR,OAAQ,oIACZ,EAEaE,EAAwC,CACjD,IAAK,+JACL,SAAU,uHACV,OAAQ,8PACR,UAAW,6HACf,EAEaC,EAA8C,CACvD,oBAAqB,0CACrB,kBAAmB,oDACnB,mBAAoB,kEACpB,qBAAsB,8CACtB,oBAAqB,iFACrB,4BAA6B,gEAC7B,yBAA0B,qEAC1B,6BAA8B,kEAC9B,qBAAsB,uEACtB,0BAA2B,uEAC3BC,UAAa,kOACb,eAAgB,0FAChB,iBAAkB,0EAClB,qBAAsB,2EACtB,4BAA6B,uCAC7B,kBAAmB,8BACnB,mBAAoB,uEACpB,oBAAqB,wGACrB,uBAAwB,oDACxB,yBAA0B,kCAC1B,6BAA8B,+BAC9B,oCAAqC,uCACrC,0BAA2B,8BAC3B,2BAA4B,+EAC5BC,KAAQ,qDACRC,SAAY,kHACZC,SAAY,6GAEZ,GAAG,OAAO,YAAYC,EAAkB,IAAK,GAAS,CAAC,iBAAiBC,EAAK,OAAQA,EAAK,WAAW,CAAC,CAAC,CAC3G,EAIaC,EAA8C,CACvD,qBAAsB,sEACtB,kBAAmB,iEACnB,gCAAiC,iFACjC,qBAAsB,6EACtB,QAAS,6JACT,UAAW,mLACX,OAAQ,kJACR,2BAA4B,6EAChC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=`screenplay`,t={id:e,extensions:[`.play`],aliases:[`Screenplay`,`screenplay`,`play`],mimetypes:[`text/x-screenplay`]},n=/* @__PURE__ */ `domain.import.concept.type.policy.purpose.persona.authentication.identity.module.layout.theme.ui.feature.slice.event.public.system.eventsource.operation.command.query.projection.capture.reaction.runs.reducer.readmodel.trigger.screen.dialog.form.contribute.constraint.specification.case.parameter.example.seed.behavior.exposure.instance`.split(`.`),r=/* @__PURE__ */ `depends.direction.inbound.outbound.description.documentation.template.profile.require.authenticated.role.claim.subject.authorize.validate.produces.reads.as.handler.performer.observable.identifier.reason.from.when.given.then.arguments.result.clock.exactly.error.message.not.empty.rule.matches.all.max.min.length.today.true.false.and.or.by.filter.data.via.component.context.property.literal.icons.packages.outlet.display.scopes.reexposes.operations.items.toolbar.item.presentation.exposes.mode.oneWay.twoWay.null.propagate.clear.preserve.expected.action.navigate.to.label.section.table.summary.title.column.field.on.unique.file.concurrency.eventSource.sourceType.streamType.streamId.tag.for.readmodel.no.when.every.at.where.invokes.contains.starts.with.provider.uses.parameter.order.open.close.refresh.set.notify.confirm.raise.interval.success.failure.click.double.select.submit.change.load.unload.enter.leave.info.warning`.split(`.`),i=[`csharp`,`typescript`,`react`,`html`,`sql`],a=[`command`,`arguments`,`tenant`,`causedBy`,`causation`,`occurred`,`identity`],o=[`subject`,`name`,`userName`],s=[`id`,`name`,`userName`,`isAuthenticated`,`roles`,`claims`],c=[`StateChange`,`StateView`,`Automation`,`Translate`],l=[`Uuid`,`String`,`Int`,`Decimal`,`Bool`,`Date`,`DateTime`],u=[`pii`,`personal`,`secret`],d=/^\s*(?:module|feature|slice\s+\w+|type|command|event|readmodel|reducer|projection|capture|reaction|screen|dialog|form|contribute|specification|case|constraint|persona|policy|behavior|layout|theme|ui\s+profile|trigger|authentication|identity|seed|system|eventsource|operation|screen\s+template|dialog\s+template|produces\s+event|validate|handler|on)\b[^=]*$/,f={comments:{lineComment:`//`},brackets:[[`(`,`)`],[`[`,`]`]],autoClosingPairs:[{open:`(`,close:`)`},{open:`[`,close:`]`},{open:`"`,close:`"`}],surroundingPairs:[{open:`(`,close:`)`},{open:`[`,close:`]`},{open:`"`,close:`"`}],folding:{offSide:!0},onEnterRules:[{beforeText:d,action:{indentAction:1}}],indentationRules:{increaseIndentPattern:/^\s*(module|feature|slice|policy|persona|authentication|identity|provider|event|command|query|type|screen|projection|capture|reaction|trigger|constraint|specification|layout|template|validate|produces|handler|implementation(?=\s*$)|performer|rule|section|action|otherwise(?=\s*$|\s+execute\b)|concurrency|seed|for|when|then|arguments|result|every|at|invokes|on)\b.*$/,decreaseIndentPattern:/(?!)/}};export{d as blockHeaderPattern,o as causedByProperties,r as clauseKeywords,i as codeBlockTags,u as conceptAttributes,n as constructKeywords,a as contextRoots,s as identityProperties,f as languageConfiguration,t as languageExtensionPoint,e as languageId,l as primitiveTypes,c as sliceTypes};
|
|
2
|
+
//# sourceMappingURL=language.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language.js","names":["languageId","languageExtensionPoint","constructKeywords","clauseKeywords","codeBlockTags","contextRoots","causedByProperties","identityProperties","sliceTypes","primitiveTypes","conceptAttributes","blockHeaderPattern","languageConfiguration"],"sources":["../../language.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';\n\nexport type Monaco = typeof import('monaco-editor');\n\nexport const languageId = 'screenplay';\n\nexport const languageExtensionPoint: languages.ILanguageExtensionPoint = {\n id: languageId,\n extensions: ['.play'],\n aliases: ['Screenplay', 'screenplay', 'play'],\n mimetypes: ['text/x-screenplay'],\n};\n\n// Every word the parser dispatches on at the top level, inside a module, or inside a slice.\n// `for_LanguageService.when_comparing_keywords_against_the_parsers` derives that set from\n// ScreenplayParser and SliceParser and fails when this list has drifted from it, so a construct\n// added to the compiler cannot silently lose its highlighting and completion.\nexport const constructKeywords = [\n 'domain',\n 'import',\n 'concept',\n 'type',\n 'policy',\n 'purpose',\n 'persona',\n 'authentication',\n 'identity',\n 'module',\n 'layout',\n 'theme',\n 'ui',\n 'feature',\n 'slice',\n 'event',\n 'public',\n 'system',\n 'eventsource',\n 'operation',\n 'command',\n 'query',\n 'projection',\n 'capture',\n 'reaction',\n 'runs',\n 'reducer',\n 'readmodel',\n 'trigger',\n 'screen',\n 'dialog',\n 'form',\n 'contribute',\n 'constraint',\n 'specification',\n 'case',\n 'parameter',\n 'example',\n 'seed',\n 'behavior',\n 'exposure',\n 'instance',\n];\n\n// Type modifiers are contextual, never excluded from property or declaration names.\nexport const typeModifierKeywords = ['optional'];\n\nexport const clauseKeywords = [\n 'depends',\n 'direction',\n 'inbound',\n 'outbound',\n 'description',\n 'documentation',\n 'template',\n 'profile',\n 'require',\n 'authenticated',\n 'role',\n 'claim',\n 'subject',\n 'authorize',\n 'validate',\n 'produces',\n 'reads', // A clause in command bodies and reaction trigger bodies; @reads remains a value.\n 'as',\n 'handler',\n 'performer',\n 'observable',\n 'identifier',\n 'reason',\n 'from',\n 'when',\n 'given',\n 'then',\n 'arguments',\n 'result',\n 'clock', // A specification step - 'given clock' and 'when clock' state an instant.\n 'exactly',\n 'error',\n 'message',\n 'not', // Unary policy negation, as well as 'not empty' validation.\n 'empty',\n 'rule',\n 'matches',\n 'all',\n 'max',\n 'min',\n 'length',\n 'today',\n 'true',\n 'false',\n 'and',\n 'or',\n 'by',\n 'filter',\n 'data',\n 'via',\n 'component',\n 'context',\n 'property',\n 'literal',\n 'icons',\n 'packages',\n 'outlet',\n 'display',\n 'scopes',\n 'reexposes',\n 'operations',\n 'items',\n 'toolbar',\n 'item',\n 'presentation',\n 'exposes',\n 'mode',\n 'oneWay',\n 'twoWay',\n 'null',\n 'propagate',\n 'clear',\n 'preserve',\n 'expected',\n 'action',\n 'navigate',\n 'to',\n 'label',\n 'section',\n 'table',\n 'summary',\n 'title',\n 'column',\n 'field',\n 'on',\n 'unique',\n 'file',\n 'concurrency',\n 'eventSource',\n 'sourceType',\n 'streamType',\n 'streamId',\n 'tag',\n 'for',\n 'readmodel',\n 'no',\n 'when',\n 'every',\n 'at',\n 'where',\n 'invokes',\n 'contains',\n 'starts',\n 'with',\n 'provider',\n // Interaction: the words a behavior body uses. The built-in interaction kinds ('click', 'submit', and\n // friends) are only reserved inside an `on` clause, so they are clause words rather than constructs -\n // an identifier of the same name elsewhere in a document remains an identifier.\n 'uses',\n 'parameter',\n 'order',\n 'open',\n 'close',\n 'refresh',\n 'set',\n 'notify',\n 'confirm',\n 'raise',\n 'interval',\n 'success',\n 'failure',\n 'click',\n 'double',\n 'select',\n 'submit',\n 'change',\n 'load',\n 'unload',\n 'enter',\n 'leave',\n 'info',\n 'warning',\n];\n\nexport const codeBlockTags = ['csharp', 'typescript', 'react', 'html', 'sql'];\n\n// The roots a `$context.` path can start with — the members of CommandContext and QueryContext.\nexport const contextRoots = [\n 'command',\n 'arguments',\n 'tenant',\n 'causedBy',\n 'causation',\n 'occurred',\n 'identity',\n];\n\nexport const causedByProperties = ['subject', 'name', 'userName'];\n\n// The properties a `$identity.` or `$context.identity.` path can name — the members of Identity. Everything after\n// `claims.` is the name of a claim rather than a member, so it is never checked.\nexport const identityProperties = ['id', 'name', 'userName', 'isAuthenticated', 'roles', 'claims'];\n\nexport const sliceTypes = ['StateChange', 'StateView', 'Automation', 'Translate'];\n\nexport const primitiveTypes = ['Uuid', 'String', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime'];\n\nexport const conceptAttributes = ['pii', 'personal', 'secret'];\n\n// The lines that open a block with a body of their own. A line that is complete as written - a `domain`, a\n// `concept` or `query` with nothing under it, a `produces` of an existing event - is not one.\nexport const blockHeaderPattern = /^\\s*(?:module|feature|slice\\s+\\w+|type|command|event|readmodel|reducer|projection|capture|reaction|screen|dialog|form|contribute|specification|case|constraint|persona|policy|behavior|layout|theme|ui\\s+profile|trigger|authentication|identity|seed|system|eventsource|operation|screen\\s+template|dialog\\s+template|produces\\s+event|validate|handler|on)\\b[^=]*$/;\n\nexport const languageConfiguration: languages.LanguageConfiguration = {\n comments: {\n lineComment: '//',\n },\n brackets: [\n ['(', ')'],\n ['[', ']'],\n ],\n autoClosingPairs: [\n { open: '(', close: ')' },\n { open: '[', close: ']' },\n { open: '\"', close: '\"' },\n ],\n surroundingPairs: [\n { open: '(', close: ')' },\n { open: '[', close: ']' },\n { open: '\"', close: '\"' },\n ],\n folding: {\n offSide: true,\n },\n // A header that opens a block puts the cursor one level in on Enter, so what is typed - or suggested - starts at\n // the block's own indentation. IndentAction.Indent is 1.\n onEnterRules: [\n { beforeText: blockHeaderPattern, action: { indentAction: 1 as languages.IndentAction } },\n ],\n indentationRules: {\n increaseIndentPattern:\n /^\\s*(module|feature|slice|policy|persona|authentication|identity|provider|event|command|query|type|screen|projection|capture|reaction|trigger|constraint|specification|layout|template|validate|produces|handler|implementation(?=\\s*$)|performer|rule|section|action|otherwise(?=\\s*$|\\s+execute\\b)|concurrency|seed|for|when|then|arguments|result|every|at|invokes|on)\\b.*$/,\n // Dedents are always explicit in an offside language — never auto-dedent.\n decreaseIndentPattern: /(?!)/,\n },\n};\n"],"mappings":"AAOA,MAAaA,EAAa,aAEbC,EAA4D,CACrE,GAAID,EACJ,WAAY,CAAC,OAAO,EACpB,QAAS,CAAC,aAAc,aAAc,MAAM,EAC5C,UAAW,CAAC,mBAAmB,CACnC,EAMaE,EAAoB,2WA2CjC,EAKaC,EAAiB,o7BAqI9B,EAEaC,EAAgB,CAAC,SAAU,aAAc,QAAS,OAAQ,KAAK,EAG/DC,EAAe,CACxB,UACA,YACA,SACA,WACA,YACA,WACA,UACJ,EAEaC,EAAqB,CAAC,UAAW,OAAQ,UAAU,EAInDC,EAAqB,CAAC,KAAM,OAAQ,WAAY,kBAAmB,QAAS,QAAQ,EAEpFC,EAAa,CAAC,cAAe,YAAa,aAAc,WAAW,EAEnEC,EAAiB,CAAC,OAAQ,SAAU,MAAO,UAAW,OAAQ,OAAQ,UAAU,EAEhFC,EAAoB,CAAC,MAAO,WAAY,QAAQ,EAIhDC,EAAqB,uWAErBC,EAAyD,CAClE,SAAU,CACN,YAAa,IACjB,EACA,SAAU,CACN,CAAC,IAAK,GAAG,EACT,CAAC,IAAK,GAAG,CACb,EACA,iBAAkB,CACd,CAAE,KAAM,IAAK,MAAO,GAAI,EACxB,CAAE,KAAM,IAAK,MAAO,GAAI,EACxB,CAAE,KAAM,IAAK,MAAO,GAAI,CAC5B,EACA,iBAAkB,CACd,CAAE,KAAM,IAAK,MAAO,GAAI,EACxB,CAAE,KAAM,IAAK,MAAO,GAAI,EACxB,CAAE,KAAM,IAAK,MAAO,GAAI,CAC5B,EACA,QAAS,CACL,QAAS,EACb,EAGA,aAAc,CACV,CAAE,WAAYD,EAAoB,OAAQ,CAAE,aAAc,CAA4B,CAAE,CAC5F,EACA,iBAAkB,CACd,sBACI,iXAEJ,sBAAuB,MAC3B,CACJ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{bmpWordCharacters as e}from"./bmp-word-characters.js";import{fenceMap as t,indentOf as n,withoutComment as r}from"./document-context.js";const i=RegExp(`^[${e}.]+\\s+rule\\s+[A-Za-z_][${e}]*(?:\\s+severity\\s+(?:information|warning|error))?(?:\\s+message\\s+.*)?$`);function namedRuleContext(e,a,o){let s=t(e),c=[],l=o;for(let t=a-1;t>=0&&l>0;t--){if(s[t])continue;let i=r(e[t]).trimEnd();i.trim().length===0||n(i)>=l||(c.push(i.trim()),l=n(i))}let u=c[0]===`implementation`,d=+!!u;return i.test(c[d]??``)&&c[d+1]===`validate`&&/^command\s/.test(c[d+2]??``)?u?`implementation`:`rule`:null}export{i as commandNamedRulePattern,namedRuleContext};
|
|
2
|
+
//# sourceMappingURL=named-rule-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"named-rule-context.js","names":["commandNamedRulePattern","bmpWordCharacters","fences","fenceMap","lines","owners","boundary","indent","index","lineIndex","line","withoutComment","indentOf","wrapped","offset"],"sources":["../../named-rule-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\nimport { bmpWordCharacters } from './bmp-word-characters';\nimport { fenceMap, indentOf, withoutComment } from './document-context';\n\n// The command property form, with the compiler/tokenizer BMP identifier boundary, including its existing optional severity/message suffixes.\nexport const commandNamedRulePattern = new RegExp(`^[${bmpWordCharacters}.]+\\\\s+rule\\\\s+[A-Za-z_][${bmpWordCharacters}]*(?:\\\\s+severity\\\\s+(?:information|warning|error))?(?:\\\\s+message\\\\s+.*)?$`);\n\nexport function namedRuleContext(lines: string[], lineIndex: number, indent: number): 'rule' | 'implementation' | null {\n const fences = fenceMap(lines);\n const owners: string[] = [];\n let boundary = indent;\n for (let index = lineIndex - 1; index >= 0 && boundary > 0; index--) {\n if (fences[index]) continue;\n const line = withoutComment(lines[index]).trimEnd();\n if (line.trim().length === 0 || indentOf(line) >= boundary) continue;\n owners.push(line.trim());\n boundary = indentOf(line);\n }\n const wrapped = owners[0] === 'implementation';\n const offset = wrapped ? 1 : 0;\n return commandNamedRulePattern.test(owners[offset] ?? '') && owners[offset + 1] === 'validate' && /^command\\s/.test(owners[offset + 2] ?? '')\n ? wrapped ? 'implementation' : 'rule' : null;\n}\n"],"mappings":"iMAOA,MAAaA,EAA8B,OAAO,KAAKC,EAAkB,2BAA2BA,EAAkB,4EAA4E,EAElM,SAAgB,iBAAiB,EAAiB,EAAmB,EAAkD,CACnH,IAAMC,EAASC,EAASC,CAAK,EACvBC,EAAmB,CAAC,EACtBC,EAAWC,EACf,IAAK,IAAIC,EAAQC,EAAY,EAAGD,GAAS,GAAKF,EAAW,EAAG,IAAS,CACjE,GAAIJ,EAAOM,GAAQ,SACnB,IAAME,EAAOC,EAAeP,EAAMI,EAAM,CAAC,CAAC,QAAQ,EAC9CE,EAAK,KAAK,CAAC,CAAC,SAAW,GAAKE,EAASF,CAAI,GAAKJ,IAClDD,EAAO,KAAKK,EAAK,KAAK,CAAC,EACvB,EAAWE,EAASF,CAAI,EAC5B,CACA,IAAMG,EAAUR,EAAO,KAAO,iBACxBS,EAAS,KACf,OAAOd,EAAwB,KAAKK,EAAOS,IAAW,EAAE,GAAKT,EAAOS,EAAS,KAAO,YAAc,aAAa,KAAKT,EAAOS,EAAS,IAAM,EAAE,EACtID,EAAU,iBAAmB,OAAS,IAChD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{typeReferenceText as e}from"./TypeReferenceSymbol.js";import{enclosingChain as t,fenceMap as n,indentOf as r,nearestEnclosingLine as i,withoutComment as a}from"./document-context.js";import{operationImplementationItems as o,operationItems as s,operationPhaseItems as c}from"./completion-items.js";import{responseAnalysis as l}from"./response-analysis.js";const u=`Syntax-only; not admitted by any supported executable model (ESM) version yet (PLAY0268) (#301). No semantic or requirement identity is assigned.`;function analyzeOperations(e,t){return l(e,t?.authoringDocuments??t?.authoringSources?.filter(t=>t!==e.join(`
|
|
2
|
+
`))??[],t?.authoringPlacement,t?.authoringPath).operations}function phaseState(e){return e?e.file?`file ${e.file.path}`:e.code?`inline ${e.code.language}`:`pending`:`not declared`}function operationDetails(t){let n=t.inputs.map(t=>`${t.name} ${e(t.type)}`).join(`
|
|
3
|
+
`),phase=(e,t)=>`${e}: ${e===`compensate`&&!t?`not declared`:phaseState(t)}${t?.description?` — ${t.description}`:``}${t?.implementation?.hints.map(e=>`\n hint: ${e.text}`).join(``)??``}`;return`**operation ${[...t.scope,t.name].join(`.`)}**\n\n${t.description??``}\n\nUses ${t.uses}\n\n\`\`\`screenplay\n${n}\n\`\`\`\n\n${phase(`execute`,t.execute)}\n\n${phase(`compensate`,t.compensate)}\n\n${u}`}function operationCompletions(d,f,p,m){let h=n(d);if(h[f]||a(p).length<p.length)return null;let g=p.trim()===``?p.length:r(d[f]),_=t(d,h,f,g),v=i(d,h,f,g)??``,y=l(d,m.authoringDocuments??m.authoringSources?.filter(e=>e!==d.join(`
|
|
4
|
+
`))??[],m.authoringPlacement,m.authoringPath),b=y.operations,x=b.contexts.get(f),targets=()=>{if(!x)return[];let e=(p.match(/(?:produces|given\s+operation|then\s+(?:operation|compensated))\s+([\w.]*)$/)?.[1]??p.trim()).split(`.`).slice(0,-1);return b.targets(x.scope).filter(t=>e.length===0||e.length<=t.declaration.scope.length&&e.every((n,r)=>t.declaration.scope[t.declaration.scope.length-e.length+r]===n)).map(t=>({label:t.name,insertText:e.length>0?t.declaration.name:t.name,documentation:operationDetails(t.declaration)}))};if(_.includes(`specification`)&&/^\s*(?:given\s+operation|then\s+(?:operation|compensated))\s+[\w.]*$/.test(p))return targets();if(_[0]===`command`&&/^\s*produces\s+[\w.]*$/.test(p))return targets().length?[{label:`event`,insertText:"event ${1:Name}",documentation:`Declares an inline event.`},{label:`operation`,insertText:"operation ${1:Name}\n uses ${2:System}\n ${3:input} ${4:Type} = ${5:source}",documentation:u},...m.events.map(e=>({label:e.name,insertText:e.name,documentation:`Declared event.`})),...targets()]:null;if(x?.commandLine!==void 0&&_[0]===`produces`&&/^produces\s+when\b/.test(v)&&/^\s*[\w.]*$/.test(p))return targets();let S=x?.operation,C=S&&(f===S.location.line-1||g>r(d[S.location.line-1]))?S:void 0;if(C&&/^\s*uses\s+\w*$/.test(p)&&!C.inputs.some(e=>e.location.line===f+1))return b.systems.map(e=>({label:e.name,insertText:e.name,documentation:`${e.description??`External system`}. ${u}`}));if(_[0]===`implementation`&&[`execute`,`compensate`].includes(_[1]))return o;if([`execute`,`compensate`].includes(_[0])&&C)return c;let w=x?.production,T=(w?.targetLocation??w?.location)?.line,E=T!==void 0&&f>T-1&&g>r(d[T-1]),D=C??(E?w?.declaration:void 0);if(D){let t=p.match(/=\s*([\w.]*)$/);if(t&&x?.commandLine!==void 0){let n=y.commands.get(x.commandLine)?.properties??[],r=t[1].split(`.`);for(let e of r.slice(0,-1)){let t=n.find(t=>t.name===e);if(!t||t.type.isCollection)return[];let r=b.types.filter(e=>e.name===t.type.name);if(r.length!==1)return[];n=r[0].properties}return n.map(t=>({label:t.name,insertText:t.name,documentation:`${e(t.type)}${t.isGenerated?` — generated source, not request input`:``}. ${u}`}))}return C&&/^\s*@?[a-z_]\w*\s+[\w.]+(?:\[\])?\s+\w*$/.test(p)?[{label:`optional`,insertText:`optional`,documentation:`Allows absence of the complete operation input value.`}]:/^\s*@?[a-z_]\w*\s+[\w.[\]?]*$/.test(p)&&C?[...b.concepts.map(e=>e.name),...b.types.map(e=>e.name),`String`,`Uuid`,`Int`,`Decimal`,`Bool`,`Date`,`DateTime`].map(e=>({label:e,insertText:e,documentation:`Operation input type.`})):C?s:D.inputs.map(t=>({label:t.name,insertText:`${t.name} = \${1:source}`,documentation:`${e(t.type)}. ${u}`}))}if(_[0]===`then`&&/^then\s+operation\s+/.test(v)){let t=v.match(/^then\s+operation\s+([\w.]+)/)?.[1],n=b.references.filter(e=>e.name===t&&e.location.line-1<f&&e.kind===`operation`).at(-1)?.declaration;if(n){let t=p.match(/^\s*(\w+)\s*=\s*[^=]*$/);if(t){let e=n.inputs.find(e=>e.name===t[1])?.type,r=b.concepts.filter(t=>t.name===e?.name);if(r.length===1&&r[0].type===`Enum`)return r[0].values.map(t=>({label:t,insertText:JSON.stringify(t),documentation:`${e?.name} value.`}))}return n.inputs.map(t=>({label:t.name,insertText:`${t.name} = \${1:value}`,documentation:`${e(t.type)}. Partial assertion; ${u}`}))}}return null}function operationReferenceAt(e,t,n,r,i){let o=a(t[n]??``);return e.references.find(e=>{let t=e.targetLocation??e.location;return t.line===n+1&&r>=t.column&&i<=t.column+e.name.length&&o.slice(t.column-1,t.column-1+e.name.length)===e.name})}function operationHover(t,n,r,i,o){let s=analyzeOperations(t,o),c=t[n]??``,at=(e,t)=>{let a=e.column+ +(c[e.column-1]===`@`);return e.line===n+1&&r===a&&i===a+t.length&&c.slice(r-1,i-1)===t},d=s.contexts.get(n),f=d?.operation?.inputs.find(e=>at(e.location,e.name));if(f)return`**${f.name}** — ${e(f.type)}. Operation input, not a command request field. ${u}`;let p=c.indexOf(`=`);if(p>=0&&r-1>p&&d?.commandLine!==void 0&&(d.operation||d.production?.declaration)){let n=l(t,o?.authoringDocuments??o?.authoringSources?.filter(e=>e!==t.join(`
|
|
5
|
+
`))??[],o?.authoringPlacement,o?.authoringPath).commands.get(d.commandLine),r=c.slice(p+1,i-1).trim().split(`.`),a=n?.properties??[];for(let[t,n]of r.entries()){let i=a.find(e=>e.name===n);if(!i)break;if(t===r.length-1)return`**${n}** — ${e(i.type)}. Command source for an operation input. ${u}`;let o=s.types.filter(e=>e.name===i.type.name);if(o.length!==1||i.type.isCollection)break;a=o[0].properties}}let m=operationReferenceAt(s,t,n,r,i);if(m?.declaration)return operationDetails(m.declaration);if(m?.kind===`ambiguous`)return`Ambiguous production: no declaration kind was selected. ${u}`;let h=d?.operation;if(h&&h.location.line===n+1){let e=a(c).match(/^\s*(?:produces\s+)?operation\s+/)?.[0];if(e&&r===e.length+1&&i===r+h.name.length)return operationDetails(h)}if(h?.usesLocation?.line===n+1&&r>=h.usesLocation.column&&i<=h.usesLocation.column+h.uses.length&&a(c).slice(r-1,i-1)===h.uses.slice(r-h.usesLocation.column,i-h.usesLocation.column)){let e=s.systems.filter(e=>e.name===h.uses);return e.length===1?`**system ${e[0].name}**\n\n${e[0].description??``}\n\n${u}`:`Unresolved or ambiguous external system. ${u}`}for(let e of[h?.execute,h?.compensate])if(e&&(e.location.line===n+1||e.implementation?.location.line===n+1||e.implementation?.hints.some(e=>e.location.line===n+1)))return`${phaseState(e)}\n\n${e.description??``}\n\n${e.implementation?.hints.map(e=>e.text).join(`
|
|
6
|
+
`)??``}\n\n${u}`;let g=s.systems.find(e=>e.location.path===(o?.authoringPath??`current.play`)&&e.location.line===n+1);return g?`**system ${g.name}**\n\n${g.description??``}\n\n${u}`:null}export{analyzeOperations,u as operationAvailability,operationCompletions,operationDetails,operationHover,operationReferenceAt,phaseState};
|
|
7
|
+
//# sourceMappingURL=operation-authoring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-authoring.js","names":["operationAvailability","responseAnalysis","lines","symbols","source","phase","inputs","operation","input","typeReferenceText","name","value","hint","fences","fenceMap","line","withoutComment","before","indent","indentOf","chain","enclosingChain","enclosing","nearestEnclosingLine","analysis","operations","context","qualifiers","target","index","part","event","ownedOperation","system","operationImplementationItems","operationPhaseItems","production","targetLine","inProductionBody","mappedOperation","rhs","properties","parts","property","types","type","concept","operationItems","declaration","reference","start","end","column","location","equals","command","text","header","systems"],"sources":["../../operation-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, operationItems, operationPhaseItems, operationImplementationItems } from './completion-items';\nimport { enclosingChain, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { DocumentSymbols } from './symbols';\nimport { responseAnalysis } from './response-analysis';\nimport { OperationAnalysis, OperationDeclaration, OperationPhase } from './OperationAnalysis';\nimport { TypeReferenceSymbol, typeReferenceText } from './TypeReferenceSymbol';\n\nexport const operationAvailability = 'Syntax-only; not admitted by any supported executable model (ESM) version yet (PLAY0268) (#301). No semantic or requirement identity is assigned.';\n\nexport function analyzeOperations(lines: string[], symbols?: DocumentSymbols) {\n return responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [],\n symbols?.authoringPlacement, symbols?.authoringPath).operations;\n}\n\nexport function phaseState(phase: OperationPhase | null): string {\n return !phase ? 'not declared' : phase.file ? `file ${phase.file.path}` : phase.code ? `inline ${phase.code.language}` : 'pending';\n}\n\nexport function operationDetails(operation: OperationDeclaration): string {\n const inputs = operation.inputs.map(input => `${input.name} ${typeReferenceText(input.type)}`).join('\\n');\n const phase = (name: string, value: OperationPhase | null) => `${name}: ${name === 'compensate' && !value ? 'not declared' : phaseState(value)}${value?.description ? ` — ${value.description}` : ''}${value?.implementation?.hints.map(hint => `\\n hint: ${hint.text}`).join('') ?? ''}`;\n return `**operation ${[...operation.scope, operation.name].join('.')}**\\n\\n${operation.description ?? ''}\\n\\nUses ${operation.uses}\\n\\n\\`\\`\\`screenplay\\n${inputs}\\n\\`\\`\\`\\n\\n${phase('execute', operation.execute)}\\n\\n${phase('compensate', operation.compensate)}\\n\\n${operationAvailability}`;\n}\n\nexport function operationCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n const fences = fenceMap(lines);\n if (fences[line] || withoutComment(before).length < before.length) return null;\n const indent = before.trim() === '' ? before.length : indentOf(lines[line]);\n const chain = enclosingChain(lines, fences, line, indent);\n const enclosing = nearestEnclosingLine(lines, fences, line, indent) ?? '';\n const analysis = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols.authoringPlacement, symbols.authoringPath);\n const operations = analysis.operations;\n const context = operations.contexts.get(line);\n const targets = () => {\n if (!context) return [];\n const reference = before.match(/(?:produces|given\\s+operation|then\\s+(?:operation|compensated))\\s+([\\w.]*)$/)?.[1] ?? before.trim();\n const qualifiers = reference.split('.').slice(0, -1);\n return operations.targets(context.scope).filter(target => qualifiers.length === 0 ||\n qualifiers.length <= target.declaration.scope.length && qualifiers.every((part, index) => target.declaration.scope[target.declaration.scope.length - qualifiers.length + index] === part))\n .map(target => ({ label: target.name, insertText: qualifiers.length > 0 ? target.declaration.name : target.name, documentation: operationDetails(target.declaration) }));\n };\n if (chain.includes('specification') && /^\\s*(?:given\\s+operation|then\\s+(?:operation|compensated))\\s+[\\w.]*$/.test(before)) return targets();\n if (chain[0] === 'command' && /^\\s*produces\\s+[\\w.]*$/.test(before)) return targets().length ? [\n { label: 'event', insertText: 'event ${1:Name}', documentation: 'Declares an inline event.' },\n { label: 'operation', insertText: 'operation ${1:Name}\\n uses ${2:System}\\n ${3:input} ${4:Type} = ${5:source}', documentation: operationAvailability },\n ...symbols.events.map(event => ({ label: event.name, insertText: event.name, documentation: 'Declared event.' })), ...targets()\n ] : null;\n if (context?.commandLine !== undefined && chain[0] === 'produces' && /^produces\\s+when\\b/.test(enclosing) && /^\\s*[\\w.]*$/.test(before)) return targets();\n const ownedOperation = context?.operation;\n const operation = ownedOperation && (line === ownedOperation.location.line - 1 || indent > indentOf(lines[ownedOperation.location.line - 1])) ? ownedOperation : undefined;\n if (operation && /^\\s*uses\\s+\\w*$/.test(before) && !operation.inputs.some(input => input.location.line === line + 1)) return operations.systems.map(system => ({ label: system.name, insertText: system.name, documentation: `${system.description ?? 'External system'}. ${operationAvailability}` }));\n if (chain[0] === 'implementation' && ['execute', 'compensate'].includes(chain[1])) return operationImplementationItems;\n if (['execute', 'compensate'].includes(chain[0]) && operation) return operationPhaseItems;\n const production = context?.production;\n const targetLine = (production?.targetLocation ?? production?.location)?.line;\n const inProductionBody = targetLine !== undefined && line > targetLine - 1 && indent > indentOf(lines[targetLine - 1]);\n const mappedOperation = operation ?? (inProductionBody ? production?.declaration : undefined);\n // Typed ranges include blank lines and comments. The caret must still be inside\n // the target's body, not dedented to a command member or conditional target line.\n // Ancestor keywords cannot own mappings, including deeper composite paths.\n if (mappedOperation) {\n const rhs = before.match(/=\\s*([\\w.]*)$/);\n if (rhs && context?.commandLine !== undefined) {\n const command = analysis.commands.get(context.commandLine);\n let properties: readonly { name: string; type: TypeReferenceSymbol; isGenerated?: boolean }[] = command?.properties ?? [];\n const parts = rhs[1].split('.');\n for (const part of parts.slice(0, -1)) {\n const property = properties.find(property => property.name === part);\n if (!property || property.type.isCollection) return [];\n const types = operations.types.filter(type => type.name === property.type.name);\n if (types.length !== 1) return [];\n properties = types[0].properties;\n }\n return properties.map(property => ({ label: property.name, insertText: property.name, documentation: `${typeReferenceText(property.type)}${property.isGenerated ? ' — generated source, not request input' : ''}. ${operationAvailability}` }));\n }\n if (operation && /^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+\\w*$/.test(before)) return [{ label: 'optional', insertText: 'optional', documentation: 'Allows absence of the complete operation input value.' }];\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.[\\]?]*$/.test(before) && operation) return [...operations.concepts.map(concept => concept.name), ...operations.types.map(type => type.name), 'String', 'Uuid', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime'].map(name => ({ label: name, insertText: name, documentation: 'Operation input type.' }));\n if (operation) return operationItems;\n return mappedOperation.inputs.map(input => ({ label: input.name, insertText: `${input.name} = \\${1:source}`, documentation: `${typeReferenceText(input.type)}. ${operationAvailability}` }));\n }\n if (chain[0] === 'then' && /^then\\s+operation\\s+/.test(enclosing)) {\n const name = enclosing.match(/^then\\s+operation\\s+([\\w.]+)/)?.[1];\n const declaration = operations.references.filter(reference => reference.name === name && reference.location.line - 1 < line && reference.kind === 'operation').at(-1)?.declaration;\n if (declaration) {\n const value = before.match(/^\\s*(\\w+)\\s*=\\s*[^=]*$/);\n if (value) {\n const type = declaration.inputs.find(input => input.name === value[1])?.type;\n const concept = operations.concepts.filter(concept => concept.name === type?.name);\n if (concept.length === 1 && concept[0].type === 'Enum') return concept[0].values.map(value => ({ label: value, insertText: JSON.stringify(value), documentation: `${type?.name} value.` }));\n }\n return declaration.inputs.map(input => ({ label: input.name, insertText: `${input.name} = \\${1:value}`, documentation: `${typeReferenceText(input.type)}. Partial assertion; ${operationAvailability}` }));\n }\n }\n return null;\n}\n\n// Shared by both editor hosts. Only the parser-owned target span can bind a reference;\n// a repeated identifier in a trailing comment or a condition is not that reference.\nexport function operationReferenceAt(analysis: OperationAnalysis, lines: string[], line: number, start: number, end: number) {\n const source = withoutComment(lines[line] ?? '');\n return analysis.references.find(reference => {\n const target = reference.targetLocation ?? reference.location;\n return target.line === line + 1 && start >= target.column && end <= target.column + reference.name.length &&\n source.slice(target.column - 1, target.column - 1 + reference.name.length) === reference.name;\n });\n}\n\nexport function operationHover(lines: string[], line: number, start: number, end: number, symbols?: DocumentSymbols): string | null {\n const analysis = analyzeOperations(lines, symbols);\n const source = lines[line] ?? '';\n const at = (location: { line: number; column: number }, name: string) => {\n const column = location.column + (source[location.column - 1] === '@' ? 1 : 0);\n return location.line === line + 1 && start === column && end === column + name.length && source.slice(start - 1, end - 1) === name;\n };\n const context = analysis.contexts.get(line);\n const property = context?.operation?.inputs.find(input => at(input.location, input.name));\n if (property) return `**${property.name}** — ${typeReferenceText(property.type)}. Operation input, not a command request field. ${operationAvailability}`;\n const equals = source.indexOf('=');\n if (equals >= 0 && start - 1 > equals && context?.commandLine !== undefined && (context.operation || context.production?.declaration)) {\n const command = responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(text => text !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, symbols?.authoringPath).commands.get(context.commandLine);\n const expression = source.slice(equals + 1, end - 1).trim();\n const parts = expression.split('.');\n let properties: readonly { name: string; type: TypeReferenceSymbol }[] = command?.properties ?? [];\n for (const [index, part] of parts.entries()) {\n const property = properties.find(property => property.name === part);\n if (!property) break;\n if (index === parts.length - 1) return `**${part}** — ${typeReferenceText(property.type)}. Command source for an operation input. ${operationAvailability}`;\n const types = analysis.types.filter(type => type.name === property.type.name);\n if (types.length !== 1 || property.type.isCollection) break;\n properties = types[0].properties;\n }\n }\n const reference = operationReferenceAt(analysis, lines, line, start, end);\n if (reference?.declaration) return operationDetails(reference.declaration);\n if (reference?.kind === 'ambiguous') return `Ambiguous production: no declaration kind was selected. ${operationAvailability}`;\n const operation = context?.operation;\n if (operation && operation.location.line === line + 1) {\n const header = withoutComment(source).match(/^\\s*(?:produces\\s+)?operation\\s+/)?.[0];\n if (header && start === header.length + 1 && end === start + operation.name.length) return operationDetails(operation);\n }\n if (operation?.usesLocation?.line === line + 1 && start >= operation.usesLocation.column && end <= operation.usesLocation.column + operation.uses.length && withoutComment(source).slice(start - 1, end - 1) === operation.uses.slice(start - operation.usesLocation.column, end - operation.usesLocation.column)) {\n const systems = analysis.systems.filter(system => system.name === operation.uses);\n return systems.length === 1 ? `**system ${systems[0].name}**\\n\\n${systems[0].description ?? ''}\\n\\n${operationAvailability}` : `Unresolved or ambiguous external system. ${operationAvailability}`;\n }\n for (const phase of [operation?.execute, operation?.compensate]) {\n if (!phase) continue;\n if (phase.location.line === line + 1 || phase.implementation?.location.line === line + 1 || phase.implementation?.hints.some(hint => hint.location.line === line + 1)) return `${phaseState(phase)}\\n\\n${phase.description ?? ''}\\n\\n${phase.implementation?.hints.map(hint => hint.text).join('\\n') ?? ''}\\n\\n${operationAvailability}`;\n }\n const system = analysis.systems.find(system => system.location.path === (symbols?.authoringPath ?? 'current.play') && system.location.line === line + 1);\n return system ? `**system ${system.name}**\\n\\n${system.description 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EAAK,SAAS,OAASG,EAAO,CAAC,GAAG,MAAO,GAAG,WAAWV,CAAK,EAAE,MAAMA,EAAM,aAAe,GAAG,MAAMA,EAAM,gBAAgB,MAAM,IAAI,GAAQO,EAAK,IAAI,CAAC,CAAC,KAAK;CAAI,GAAK,GAAG,MAAMZ,IAErT,IAAMiC,EAAST,EAAS,QAAQ,KAAK,GAAUS,EAAO,SAAS,QAAU9B,GAAS,eAAiB,iBAAmB8B,EAAO,SAAS,OAASlB,EAAO,CAAC,EACvJ,OAAOkB,EAAS,YAAYA,EAAO,KAAK,QAAQA,EAAO,aAAe,GAAG,MAAMjC,IAA0B,IAC7G"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{bmpWordCharacters as e}from"./bmp-word-characters.js";import{synthesizePersonaCaller as t}from"./compiler/Syntax/PersonaCallers.js";import"./compiler/index.js";import{withoutComment as n}from"./document-context.js";const r=RegExp(`^\\s*given caller as\\s+[${e}]*$`),i=RegExp(`^\\s*(?:given caller as|persona)\\s+([A-Za-z_][${e}]*)\\s*$`);function personaAnalysis(e,a){let o=e,s=new Map(o.personas.map(e=>[e.name,t(e,o)]));return{completions(e,t){return n(t).length<t.length||!r.test(t)?null:o.personas.map(e=>({label:e.name,insertText:e.name,documentation:`Authenticated deterministic witness of this persona. Negation, needed nonliteral claims, role-URI claims, implementations and policyless personas require an explicit caller.`}))},hover(e,t,r){let o=n(a[e]??``),c=i.exec(o);if(!c||o.slice(t-1,r-1)!==c[1])return null;let l=s.get(c[1]);return l?l.refusal?`**${c[1]} caller** — ${l.refusal.reason}${l.refusal.policy?` in policy ${l.refusal.policy}`:``}. Use an explicit \`given caller\`.`:`**${c[1]} caller** — authenticated.\n\nRoles: ${l.caller.roles.map(e=>JSON.stringify(e)).join(`, `)||`(none)`}.\n\nClaims: ${l.caller.claims.map(e=>`${JSON.stringify(e.type)} = ${JSON.stringify(e.value)}`).join(`, `)||`(none)`}.\n\nContributions: ${l.contributions.map(e=>`${e.policy}: ${e.kind}${e.type?` ${JSON.stringify(e.type)}`:``} ${JSON.stringify(e.value)}`).join(`; `)}. This witnesses one deterministic minimal caller, not every caller fitting the persona.`:null}}}export{personaAnalysis};
|
|
2
|
+
//# sourceMappingURL=persona-analysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona-analysis.js","names":["callerPrefix","bmpWordCharacters","personaLine","application","syntax","results","persona","synthesizePersonaCaller","withoutComment","before","text","lines","line","match","start","end","result","role","claim","atom"],"sources":["../../persona-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, synthesizePersonaCaller } from '@cratis/screenplay-compiler';\nimport { CompletionEntry } from './completion-items';\nimport { withoutComment } from './document-context';\nimport { bmpWordCharacters } from './bmp-word-characters';\n\nconst callerPrefix = new RegExp(`^\\\\s*given caller as\\\\s+[${bmpWordCharacters}]*$`);\nconst personaLine = new RegExp(`^\\\\s*(?:given caller as|persona)\\\\s+([A-Za-z_][${bmpWordCharacters}]*)\\\\s*$`);\n\nexport function personaAnalysis(syntax: unknown, lines: string[]) {\n const application = syntax as ApplicationSyntax;\n const results = new Map(application.personas.map(persona => [persona.name, synthesizePersonaCaller(persona, application)]));\n return {\n completions(_line: number, before: string): CompletionEntry[] | null {\n if (withoutComment(before).length < before.length || !callerPrefix.test(before)) return null;\n return application.personas.map(persona => ({ label: persona.name, insertText: persona.name, documentation: 'Authenticated deterministic witness of this persona. Negation, needed nonliteral claims, role-URI claims, implementations and policyless personas require an explicit caller.' }));\n },\n hover(line: number, start: number, end: number): string | null {\n const text = withoutComment(lines[line] ?? '');\n const match = personaLine.exec(text);\n if (!match || text.slice(start - 1, end - 1) !== match[1]) return null;\n const result = results.get(match[1]);\n if (!result) return null;\n if (result.refusal) return `**${match[1]} caller** — ${result.refusal.reason}${result.refusal.policy ? ` in policy ${result.refusal.policy}` : ''}. Use an explicit \\`given caller\\`.`;\n return `**${match[1]} caller** — authenticated.\\n\\nRoles: ${result.caller!.roles.map(role => JSON.stringify(role)).join(', ') || '(none)'}.\\n\\nClaims: ${result.caller!.claims.map(claim => `${JSON.stringify(claim.type)} = ${JSON.stringify(claim.value)}`).join(', ') || '(none)'}.\\n\\nContributions: ${result.contributions.map(atom => `${atom.policy}: ${atom.kind}${atom.type ? ` ${JSON.stringify(atom.type)}` : ''} ${JSON.stringify(atom.value)}`).join('; ')}. This witnesses one deterministic minimal caller, not every caller fitting the persona.`;\n },\n };\n}\n"],"mappings":"+QAQA,MAAMA,EAAmB,OAAO,4BAA4BC,EAAkB,IAAI,EAC5EC,EAAkB,OAAO,kDAAkDD,EAAkB,SAAS,EAE5G,SAAgB,gBAAgB,EAAiB,EAAiB,CAC9D,IAAME,EAAcC,EACdC,EAAU,IAAI,IAAIF,EAAY,SAAS,IAAI,GAAW,CAACG,EAAQ,KAAMC,EAAwBD,EAASH,CAAW,CAAC,CAAC,CAAC,EAC1H,MAAO,CACH,YAAY,EAAe,EAA0C,CAEjE,OADIK,EAAeC,CAAM,CAAC,CAAC,OAASA,EAAO,QAAU,CAACT,EAAa,KAAKS,CAAM,EAAU,KACjFN,EAAY,SAAS,IAAI,IAAY,CAAE,MAAOG,EAAQ,KAAM,WAAYA,EAAQ,KAAM,cAAe,+KAAgL,EAAE,CAClS,EACA,MAAM,EAAc,EAAe,EAA4B,CAC3D,IAAMI,EAAOF,EAAeG,EAAMC,IAAS,EAAE,EACvCC,EAAQX,EAAY,KAAKQ,CAAI,EACnC,GAAI,CAACG,GAASH,EAAK,MAAMI,EAAQ,EAAGC,EAAM,CAAC,IAAMF,EAAM,GAAI,OAAO,KAClE,IAAMG,EAASX,EAAQ,IAAIQ,EAAM,EAAE,EAGnC,OAFKG,EACDA,EAAO,QAAgB,KAAKH,EAAM,GAAG,cAAcG,EAAO,QAAQ,SAASA,EAAO,QAAQ,OAAS,cAAcA,EAAO,QAAQ,SAAW,GAAG,qCAC3I,KAAKH,EAAM,GAAG,uCAAuCG,EAAO,OAAQ,MAAM,IAAI,GAAQ,KAAK,UAAUC,CAAI,CAAC,CAAC,CAAC,KAAK,IAAI,GAAK,SAAS,eAAeD,EAAO,OAAQ,OAAO,IAAI,GAAS,GAAG,KAAK,UAAUE,EAAM,IAAI,EAAE,KAAK,KAAK,UAAUA,EAAM,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,GAAK,SAAS,sBAAsBF,EAAO,cAAc,IAAI,GAAQ,GAAGG,EAAK,OAAO,IAAIA,EAAK,OAAOA,EAAK,KAAO,IAAI,KAAK,UAAUA,EAAK,IAAI,IAAM,GAAG,GAAG,KAAK,UAAUA,EAAK,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,0FAFpb,IAGxB,CACJ,CACJ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{eventAnalysisSource as e}from"./event-analysis-source.js";import{responseAnalysis as t}from"./response-analysis.js";import{propertyTypeReference as n,scanDocument as r}from"./symbols.js";function productionDestinations(e){let t=e.properties.filter(e=>e.isIdentifier&&!n(e).isOptional&&!n(e).isCollection),r=t.length===1?t[0].name:void 0,i=e.produces??[];return{identifier:r,mixed:i.some(e=>e.target!==void 0&&e.target!==r)||i.some(e=>e.inline&&e.target===void 0)&&i.some(e=>!e.inline&&e.target===void 0)}}function destinationHints(n,i){let a=t(n,i?.authoringDocuments??i?.authoringSources,i?.authoringPlacement,i?.authoringPath),o=e(n);return r(o).commands.map(e=>({...e,produces:e.produces?.filter(e=>!a.operationProductionLines?.has(e.line)&&a.operations.references.some(t=>t.location.line-1===e.line&&t.kind===`event`)),productionHeaders:e.productionHeaders?.filter(e=>!a.operationProductionLines?.has(e))})).flatMap(e=>{let{identifier:t,mixed:n}=productionDestinations(e);if(n||e.productionHeaders?.length!==e.produces?.length)return[];let r=e.produces?.some(e=>e.target!==void 0||e.inline);return(e.produces??[]).flatMap(e=>e.target!==void 0||e.inline&&(t===void 0||/\bgeneration\b/.test(o[e.line]))||!e.inline&&r?[]:[{line:e.line,column:o[e.line].length+1,label:e.inline?`for ${t}`:`for <new event source>`}])})}export{destinationHints,productionDestinations};
|
|
2
|
+
//# sourceMappingURL=production-destinations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"production-destinations.js","names":["identifiers","command","property","propertyTypeReference","identifier","productions","production","analysis","responseAnalysis","lines","application","source","eventAnalysisSource","scanDocument","reference","line","mixed","hasPromotedDestination","sibling"],"sources":["../../production-destinations.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 { DestinationHint } from './DestinationHint';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { CommandSymbol, DocumentSymbols, propertyTypeReference, scanDocument } from './symbols';\nimport { responseAnalysis } from './response-analysis';\n\nexport function productionDestinations(command: CommandSymbol): { identifier?: string; mixed: boolean } {\n const identifiers = command.properties.filter(property => property.isIdentifier && !propertyTypeReference(property).isOptional && !propertyTypeReference(property).isCollection);\n const identifier = identifiers.length === 1 ? identifiers[0].name : undefined;\n const productions = command.produces ?? [];\n const mixed = productions.some(production => production.target !== undefined && production.target !== identifier) ||\n (productions.some(production => production.inline && production.target === undefined) &&\n productions.some(production => !production.inline && production.target === undefined));\n return { identifier, mixed };\n}\n\n// Shared by both editor adapters. Never suggest that a legacy allocated source is the command identifier.\nexport function destinationHints(lines: string[], application?: DocumentSymbols): DestinationHint[] {\n const analysis = responseAnalysis(lines, application?.authoringDocuments ?? application?.authoringSources, application?.authoringPlacement, application?.authoringPath);\n const source = eventAnalysisSource(lines);\n return scanDocument(source).commands.map(command => ({ ...command,\n produces: command.produces?.filter(production => !analysis.operationProductionLines?.has(production.line) && analysis.operations.references.some(reference => reference.location.line - 1 === production.line && reference.kind === 'event')),\n productionHeaders: command.productionHeaders?.filter(line => !analysis.operationProductionLines?.has(line)),\n })).flatMap(command => {\n const { identifier, mixed } = productionDestinations(command);\n if (mixed || command.productionHeaders?.length !== command.produces?.length) return [];\n const hasPromotedDestination = command.produces?.some(sibling => sibling.target !== undefined || sibling.inline);\n return (command.produces ?? []).flatMap(production => {\n if (production.target !== undefined || (production.inline && (identifier === undefined || /\\bgeneration\\b/.test(source[production.line])))) return [];\n // A sibling destination can promote the command default in the legacy binder.\n if (!production.inline && hasPromotedDestination) return [];\n return [{ line: production.line, column: source[production.line].length + 1, label: production.inline ? `for ${identifier}` : 'for <new event source>' }];\n });\n });\n}\n"],"mappings":"mPAQA,SAAgB,uBAAuB,EAAiE,CACpG,IAAMA,EAAcC,EAAQ,WAAW,OAAO,GAAYC,EAAS,cAAgB,CAACC,EAAsBD,CAAQ,CAAC,CAAC,YAAc,CAACC,EAAsBD,CAAQ,CAAC,CAAC,YAAY,EACzKE,EAAaJ,EAAY,SAAW,EAAIA,EAAY,EAAE,CAAC,KAAO,IAAA,GAC9DK,EAAcJ,EAAQ,UAAY,CAAC,EAIzC,MAAO,CAAE,aAAY,MAHPI,EAAY,KAAK,GAAcC,EAAW,SAAW,IAAA,IAAaA,EAAW,SAAWF,CAAU,GAC3GC,EAAY,KAAK,GAAcC,EAAW,QAAUA,EAAW,SAAW,IAAA,EAAS,GACnFD,EAAY,KAAK,GAAc,CAACC,EAAW,QAAUA,EAAW,SAAW,IAAA,EAAS,CAC9D,CAC/B,CAGA,SAAgB,iBAAiB,EAAiB,EAAkD,CAChG,IAAMC,EAAWC,EAAiBC,EAAOC,GAAa,oBAAsBA,GAAa,iBAAkBA,GAAa,mBAAoBA,GAAa,aAAa,EAChKC,EAASC,EAAoBH,CAAK,EACxC,OAAOI,EAAaF,CAAM,CAAC,CAAC,SAAS,IAAI,IAAY,CAAE,GAAGV,EACtD,SAAUA,EAAQ,UAAU,OAAO,GAAc,CAACM,EAAS,0BAA0B,IAAID,EAAW,IAAI,GAAKC,EAAS,WAAW,WAAW,KAAK,GAAaO,EAAU,SAAS,KAAO,IAAMR,EAAW,MAAQQ,EAAU,OAAS,OAAO,CAAC,EAC5O,kBAAmBb,EAAQ,mBAAmB,OAAO,GAAQ,CAACM,EAAS,0BAA0B,IAAIQ,CAAI,CAAC,CAC9G,EAAE,CAAC,CAAC,QAAQ,GAAW,CACnB,GAAM,CAAE,aAAY,SAAU,uBAAuBd,CAAO,EAC5D,GAAIe,GAASf,EAAQ,mBAAmB,SAAWA,EAAQ,UAAU,OAAQ,MAAO,CAAC,EACrF,IAAMgB,EAAyBhB,EAAQ,UAAU,KAAK,GAAWiB,EAAQ,SAAW,IAAA,IAAaA,EAAQ,MAAM,EAC/G,OAAQjB,EAAQ,UAAY,CAAC,EAAA,CAAG,QAAQ,GAChCK,EAAW,SAAW,IAAA,IAAcA,EAAW,SAAWF,IAAe,IAAA,IAAa,iBAAiB,KAAKO,EAAOL,EAAW,KAAK,IAEnI,CAACA,EAAW,QAAUW,EAA+B,CAAC,EACnD,CAAC,CAAE,KAAMX,EAAW,KAAM,OAAQK,EAAOL,EAAW,KAAK,CAAC,OAAS,EAAG,MAAOA,EAAW,OAAS,OAAOF,IAAe,wBAAyB,CAAC,CAC3J,CACL,CAAC,CACL"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e={label:`purpose`,insertText:"purpose ${1:Name}",documentation:`Adds a declared processing purpose to the union covering this slice and its enclosing containers.`},t=[{label:`description`,insertText:'description "${1:processing intent}"',documentation:`Describes the processing, not a legal verdict.`},{label:`basis`,insertText:"basis ${1|consent,contract,legalObligation,vitalInterests,publicTask,legitimateInterests|}",documentation:`One Art. 6(1) lawful basis, with an optional quoted reference.`},{label:`interest`,insertText:'interest "${1:legitimate interests pursued}"',documentation:`Statement accompanying basis legitimateInterests.`},{label:`condition`,insertText:"condition ${1|explicitConsent,employmentLaw,vitalInterests,notForProfit,madePublic,legalClaims,substantialPublicInterest,healthCare,publicHealth,research|}",documentation:`Art. 9(2) condition for special-category data.`},{label:`authorization`,insertText:'authorization "${1:authorization in law}"',documentation:`Art. 10 authorization for criminal-offence data.`},{label:`subjects`,insertText:"subjects ${1:customer}",documentation:`Comma-separated open identifiers for categories of data subjects.`},{label:`retention`,insertText:'retention "${1:period or criteria}"',documentation:`Declared retention, not enforced.`},{label:`recipient`,insertText:'recipient "${1:recipient category}"',documentation:`Repeatable recipient category.`},{label:`transfer`,insertText:'transfer "${1:destination}" safeguard "${2:safeguard}"',documentation:`Repeatable destination and safeguards.`},{label:`erasure exception`,insertText:"erasure exception ${1|expression,legalObligation,publicTask,publicHealth,archiving,legalClaims|}",documentation:`Declared Art. 17(3) exception; does not change Chronicle per-subject erasure.`}];export{t as purposeItems,e as purposeReferenceItem};
|
|
2
|
+
//# sourceMappingURL=purpose-items.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purpose-items.js","names":["purposeReferenceItem","purposeItems"],"sources":["../../purpose-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 purposeReferenceItem: CompletionEntry = { label: 'purpose', insertText: 'purpose ${1:Name}', documentation: 'Adds a declared processing purpose to the union covering this slice and its enclosing containers.' };\n\nexport const purposeItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:processing intent}\"', documentation: 'Describes the processing, not a legal verdict.' },\n { label: 'basis', insertText: 'basis ${1|consent,contract,legalObligation,vitalInterests,publicTask,legitimateInterests|}', documentation: 'One Art. 6(1) lawful basis, with an optional quoted reference.' },\n { label: 'interest', insertText: 'interest \"${1:legitimate interests pursued}\"', documentation: 'Statement accompanying basis legitimateInterests.' },\n { label: 'condition', insertText: 'condition ${1|explicitConsent,employmentLaw,vitalInterests,notForProfit,madePublic,legalClaims,substantialPublicInterest,healthCare,publicHealth,research|}', documentation: 'Art. 9(2) condition for special-category data.' },\n { label: 'authorization', insertText: 'authorization \"${1:authorization in law}\"', documentation: 'Art. 10 authorization for criminal-offence data.' },\n { label: 'subjects', insertText: 'subjects ${1:customer}', documentation: 'Comma-separated open identifiers for categories of data subjects.' },\n { label: 'retention', insertText: 'retention \"${1:period or criteria}\"', documentation: 'Declared retention, not enforced.' },\n { label: 'recipient', insertText: 'recipient \"${1:recipient category}\"', documentation: 'Repeatable recipient category.' },\n { label: 'transfer', insertText: 'transfer \"${1:destination}\" safeguard \"${2:safeguard}\"', documentation: 'Repeatable destination and safeguards.' },\n { label: 'erasure exception', insertText: 'erasure exception ${1|expression,legalObligation,publicTask,publicHealth,archiving,legalClaims|}', documentation: 'Declared Art. 17(3) exception; does not change Chronicle per-subject erasure.' },\n];\n"],"mappings":"AAKA,MAAaA,EAAwC,CAAE,MAAO,UAAW,WAAY,oBAAqB,cAAe,mGAAoG,EAEhNC,EAAkC,CAC3C,CAAE,MAAO,cAAe,WAAY,uCAAwC,cAAe,gDAAiD,EAC5I,CAAE,MAAO,QAAS,WAAY,6FAA8F,cAAe,gEAAiE,EAC5M,CAAE,MAAO,WAAY,WAAY,+CAAgD,cAAe,mDAAoD,EACpJ,CAAE,MAAO,YAAa,WAAY,8JAA+J,cAAe,gDAAiD,EACjQ,CAAE,MAAO,gBAAiB,WAAY,4CAA6C,cAAe,kDAAmD,EACrJ,CAAE,MAAO,WAAY,WAAY,yBAA0B,cAAe,mEAAoE,EAC9I,CAAE,MAAO,YAAa,WAAY,sCAAuC,cAAe,mCAAoC,EAC5H,CAAE,MAAO,YAAa,WAAY,sCAAuC,cAAe,gCAAiC,EACzH,CAAE,MAAO,WAAY,WAAY,yDAA0D,cAAe,wCAAyC,EACnJ,CAAE,MAAO,oBAAqB,WAAY,mGAAoG,cAAe,+EAAgF,CACjP"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{typeReferenceText as e}from"./TypeReferenceSymbol.js";import{enclosingChain as t,fenceMap as n,indentOf as r,withoutComment as i}from"./document-context.js";import{directBody as a,propertyTypeReference as o,scanDocument as s}from"./symbols.js";function reactionReferenceAt(c,l,u,d,f){let p=n(c);if(p[l])return null;let m=i(c[l]??``),h=m.match(/^\s*when\s+([A-Za-z_][\p{L}\p{Mn}\p{Nd}\p{Pc}]*)\s*$/u);if(!h||t(c,p,l,r(m))[0]!==`reaction`)return null;let g=h[1],_=m.indexOf(g,m.indexOf(`when`)+4)+1;if(u!==_||d!==_+g.length)return null;let v=f?.authoringPath??`current.play`,y=[...(f?.authoringDocuments??[]).filter(e=>e.path!==v),{path:v,source:c.join(`
|
|
2
|
+
`)}].map(e=>({...e,lines:e.source.split(/\r?\n/),symbols:s(e.source.split(/\r?\n/))})),b=y.flatMap(e=>{let t=e.symbols.events.filter(e=>e.name===g),n=Math.max(...t.map(e=>e.generation??1));return t.filter(e=>(e.generation??1)===n).map(t=>({document:e,declaration:t}))}),selected=e=>{if(e.length!==1)return{name:g,content:null,target:null};let{document:t,declaration:i}=e[0],o=a(t.lines,n(t.lines),i.line,r(t.lines[i.line])),s=[t.lines[i.line].trim(),...o.map(e=>t.lines[e].trim())].join(`
|
|
3
|
+
`),c=t.lines[i.line].match(/\b(?:event|trigger)\s+/);return{name:g,content:`\`\`\`screenplay\n${s}\n\`\`\``,target:{name:g,location:{path:t.path,line:i.line+1,column:c.index+c[0].length+1},source:t.source}}};if(b.length>0)return selected(b);if(f?.authoringDocuments===void 0){let t=f?.events.filter(e=>e.name===g)??[];if(t.length>0){let n=Math.max(...t.map(e=>e.generation??1)),r=t.filter(e=>(e.generation??1)===n);return{name:g,content:r.length===1?`\`\`\`screenplay\nevent ${g}\n${r[0].properties.map(t=>`${t.name} ${e(o(t))}`).join(`
|
|
4
|
+
`)}\n\`\`\``:null,target:null}}}let x=[...y.flatMap(e=>e.symbols.imports),...f?.authoringDocuments===void 0?f?.imports??[]:[]].filter(e=>e.shortName===g);return x.length>0?{name:g,content:x.length===1?`\`\`\`screenplay\nimport ${x[0].qualifiedName}\n\`\`\``:null,target:null}:selected(y.flatMap(e=>e.symbols.triggers.filter(e=>e.name===g).map(t=>({document:e,declaration:t}))))}export{reactionReferenceAt};
|
|
5
|
+
//# sourceMappingURL=reaction-authoring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reaction-authoring.js","names":["fences","fenceMap","lines","lineIndex","line","withoutComment","match","enclosingChain","indentOf","name","column","startColumn","endColumn","current","application","scanned","document","scanDocument","events","named","event","generation","matches","body","directBody","declaration","content","prefix","known","property","typeReferenceText","propertyTypeReference","imports","imported","trigger"],"sources":["../../reaction-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 { enclosingChain, fenceMap, indentOf, withoutComment } from './document-context';\nimport { ReactionReference } from './ReactionReference';\nimport { directBody, DocumentSymbols, NamedSymbol, propertyTypeReference, scanDocument } from './symbols';\nimport { typeReferenceText } from './TypeReferenceSymbol';\n\n// Resolve only a reaction's named occurrence, never a specification step, comment or native fence.\n// Both editors use the same event/import/declared-trigger precedence, including unsaved buffers.\nexport function reactionReferenceAt(lines: string[], lineIndex: number, startColumn: number, endColumn: number, application?: DocumentSymbols): ReactionReference | null {\n const fences = fenceMap(lines);\n if (fences[lineIndex]) return null;\n const line = withoutComment(lines[lineIndex] ?? '');\n const match = line.match(/^\\s*when\\s+([A-Za-z_][\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}]*)\\s*$/u);\n if (!match || enclosingChain(lines, fences, lineIndex, indentOf(line))[0] !== 'reaction') return null;\n const name = match[1];\n const column = line.indexOf(name, line.indexOf('when') + 4) + 1;\n if (startColumn !== column || endColumn !== column + name.length) return null;\n const current = application?.authoringPath ?? 'current.play';\n const documents = [...(application?.authoringDocuments ?? []).filter(document => document.path !== current), { path: current, source: lines.join('\\n') }];\n const scanned = documents.map(document => ({ ...document, lines: document.source.split(/\\r?\\n/), symbols: scanDocument(document.source.split(/\\r?\\n/)) }));\n const events = scanned.flatMap(document => {\n const named = document.symbols.events.filter(event => event.name === name);\n const generation = Math.max(...named.map(event => event.generation ?? 1));\n return named.filter(event => (event.generation ?? 1) === generation).map(event => ({ document, declaration: event }));\n });\n const selected = (matches: { document: typeof scanned[number]; declaration: NamedSymbol }[]): ReactionReference => {\n if (matches.length !== 1) return { name, content: null, target: null };\n const { document, declaration } = matches[0];\n const body = directBody(document.lines, fenceMap(document.lines), declaration.line, indentOf(document.lines[declaration.line]));\n const content = [document.lines[declaration.line].trim(), ...body.map(line => document.lines[line].trim())].join('\\n');\n const prefix = document.lines[declaration.line].match(/\\b(?:event|trigger)\\s+/)!;\n return { name, content: `\\`\\`\\`screenplay\\n${content}\\n\\`\\`\\``, target: { name, location: { path: document.path, line: declaration.line + 1, column: prefix.index! + prefix[0].length + 1 }, source: document.source } };\n };\n if (events.length > 0) return selected(events);\n // A host may supply symbols without physical documents. Hover their event shape, but\n // never invent a definition location or fall through to a shadowed local trigger.\n if (application?.authoringDocuments === undefined) {\n const known = application?.events.filter(event => event.name === name) ?? [];\n if (known.length > 0) {\n const generation = Math.max(...known.map(event => event.generation ?? 1));\n const current = known.filter(event => (event.generation ?? 1) === generation);\n const content = current.length === 1 ? `\\`\\`\\`screenplay\\nevent ${name}\\n${current[0].properties.map(property => `${property.name} ${typeReferenceText(propertyTypeReference(property))}`).join('\\n')}\\n\\`\\`\\`` : null;\n return { name, content, target: null };\n }\n }\n const imports = [...scanned.flatMap(document => document.symbols.imports), ...(application?.authoringDocuments === undefined ? application?.imports ?? [] : [])].filter(imported => imported.shortName === name);\n if (imports.length > 0) return { name, content: imports.length === 1 ? `\\`\\`\\`screenplay\\nimport ${imports[0].qualifiedName}\\n\\`\\`\\`` : null, target: null };\n const triggers = scanned.flatMap(document => document.symbols.triggers.filter(trigger => trigger.name === name).map(trigger => ({ document, declaration: trigger })));\n return selected(triggers);\n}\n"],"mappings":"4SAUA,SAAgB,oBAAoB,EAAiB,EAAmB,EAAqB,EAAmB,EAAyD,CACrK,IAAMA,EAASC,EAASC,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,CAAI,EAG/M,OAFIuB,EAAQ,OAAS,EAAU,CAAE,OAAM,QAASA,EAAQ,SAAW,EAAI,4BAA4BA,EAAQ,EAAE,CAAC,cAAc,UAAY,KAAM,OAAQ,IAAK,EAEpJ,SADUjB,EAAQ,QAAQ,GAAYC,EAAS,QAAQ,SAAS,OAAO,GAAWkB,EAAQ,OAASzB,CAAI,CAAC,CAAC,IAAI,IAAY,CAAE,WAAU,YAAayB,CAAQ,EAAE,CAC5I,CAAC,CAC5B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{fenceMap as e,indentOf as t,withoutComment as n}from"./document-context.js";function refusalContext(r,i,a){let o=e(r),s=[];for(let e=i-1;e>=0&&a>0;e--){if(o[e])continue;let i=n(r[e]);i.trim().length===0||t(i)>=a||(s.push(i.trim()),a=t(i))}let c=s.findIndex(e=>/^on\s+refused(?:\s|$)/.test(e));return c>=0&&/^invokes\s+/.test(s[c+1]??``)&&s.some(e=>/^reaction\s+/.test(e))?s[c]:void 0}export{refusalContext};
|
|
2
|
+
//# sourceMappingURL=refusal-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refusal-context.js","names":["fences","fenceMap","lines","headers","index","lineIndex","indent","line","withoutComment","indentOf","branch","header"],"sources":["../../refusal-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\nimport { fenceMap, indentOf, withoutComment } from './document-context';\n\n// Return only an enclosing invocation branch, never a sibling branch or quoted/code content.\nexport function refusalContext(lines: string[], lineIndex: number, indent: number): string | undefined {\n const fences = fenceMap(lines);\n const headers: string[] = [];\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 || indentOf(line) >= indent) continue;\n headers.push(line.trim());\n indent = indentOf(line);\n }\n const branch = headers.findIndex(header => /^on\\s+refused(?:\\s|$)/.test(header));\n return branch >= 0 && /^invokes\\s+/.test(headers[branch + 1] ?? '') && headers.some(header => /^reaction\\s+/.test(header)) ? headers[branch] : undefined;\n}\n"],"mappings":"oIAMA,SAAgB,eAAe,EAAiB,EAAmB,EAAoC,CACnG,IAAMA,EAASC,EAASC,CAAK,EACvBC,EAAoB,CAAC,EAC3B,IAAK,IAAIC,EAAQC,EAAY,EAAGD,GAAS,GAAKE,EAAS,EAAG,IAAS,CAC/D,GAAIN,EAAOI,GAAQ,SACnB,IAAMG,EAAOC,EAAeN,EAAME,EAAM,EACpCG,EAAK,KAAK,CAAC,CAAC,SAAW,GAAKE,EAASF,CAAI,GAAKD,IAClDH,EAAQ,KAAKI,EAAK,KAAK,CAAC,EACxB,EAASE,EAASF,CAAI,EAC1B,CACA,IAAMG,EAASP,EAAQ,UAAU,GAAU,wBAAwB,KAAKQ,CAAM,CAAC,EAC/E,OAAOD,GAAU,GAAK,cAAc,KAAKP,EAAQO,EAAS,IAAM,EAAE,GAAKP,EAAQ,KAAK,GAAU,eAAe,KAAKQ,CAAM,CAAC,EAAIR,EAAQO,GAAU,IAAA,EACnJ"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{AuthoringProductionResolver as e}from"./compiler/Syntax/AuthoringProductionResolver.js";import{parseForAuthoring as t}from"./compiler/ScreenplayCompiler.js";import{EventSourceReadConfidence as n}from"./compiler/Syntax/EventSourceReadConfidence.js";import{parsePlacedDocuments as r}from"./compiler/Files/PlayApplicationAssembly.js";import"./compiler/index.js";import{fenceMap as i,indentOf as a,withoutComment as o}from"./document-context.js";import{exampleAnalysis as s}from"./example-analysis.js";import{personaAnalysis as c}from"./persona-analysis.js";import{dependencyTargetAnalysis as l}from"./dependency-target-analysis.js";const u=`Executable as ESM v7. Generated values require fixtures in reference execution; other unadmitted constructs still prevent binding.`,d=/* @__PURE__ */ new Map;function authoringSource(e,t){let n=i(e),r=e.flatMap((e,t)=>!n[t]&&a(e)===0&&/^\w/.test(e)?[e.split(/\s+/)[0]]:[]);if(r.includes(`module`)||!r.some(e=>[`feature`,`slice`,`command`,`event`,`operation`,`reaction`,`specification`].includes(e)))return{source:e.join(`
|
|
2
|
+
`),locations:e.map((e,t)=>({line:t+1,column:0}))};let o=[],s=[],c=!1;e.forEach((e,t)=>{!n[t]&&a(e)===0&&/^\w/.test(e)&&(c=/^(?:concept|type|import|domain|system|eventsource|policy|persona|identity)\b/.test(e)),(c?o:s).push(t)});let l=r.includes(`feature`)?1:r.includes(`slice`)?2:3,u=t.slice(0,l);return{source:[...o.map(t=>e[t]),...u,...s.map(t=>` `.repeat(l*2)+e[t])].join(`
|
|
3
|
+
`),locations:[...o.map(e=>({line:e+1,column:0})),...u.map(()=>({line:0,column:0})),...s.map(e=>({line:e+1,column:l*2}))]}}function analyze(u,d,f,p=`current.play`,m=!0){let h=d.map((e,t)=>typeof e==`string`?{path:`other-${t}.play`,source:e}:e).filter(e=>e.path!==p),g=[{path:p,source:u.join(`
|
|
4
|
+
`),placement:f,isPlacementResolved:m},...h],_=new Set(g.flatMap(e=>[...e.source.matchAll(/\w+/g)].map(e=>e[0]).concat(e.placement??[]))),fresh=e=>{let t=e;for(let n=1;_.has(t);n++)t=`${e}${n}`;return _.add(t),t},v=fresh(`EditorAuthoring`),y=fresh(`FragmentFeature`),b=/* @__PURE__ */ new Set([v,y]),x=g.map((e,t)=>{let n=t===0?u:e.source.split(`
|
|
5
|
+
`),r=fresh(`Fragment${t}`);b.add(r);let i=e.placement?.length?{source:e.source,locations:n.map((e,t)=>({line:t+1,column:0}))}:authoringSource(n,[`module ${v}`,` feature ${y}`,` slice StateChange ${r}`]);return{...e,...i,placement:e.placement??[]}}),S=x[0],C=new Map(x.map(e=>[e.path,e.locations])),w=r([...x.slice(1),S]),T=/* @__PURE__ */ new Map,E=/* @__PURE__ */ new Map,D=/* @__PURE__ */ new WeakSet,walk=e=>{if(typeof e!=`object`||!e||D.has(e))return;if(D.add(e),Array.isArray(e)){e.forEach(walk);return}let t=e;if(typeof t.path==`string`&&typeof t.line==`number`&&typeof t.column==`number`){let e=C.get(t.path)?.[t.line-1];e&&(t.line=e.line,t.column=Math.max(1,t.column-e.column))}else{for(let e of Object.values(t))walk(e);t.location?.path===p&&(t.kind===`CommandSyntax`&&T.set(t.location.line-1,e),t.kind===`SpecificationSyntax`&&E.set(t.location.line-1,e))}};walk(w.value),walk(w.physicalEventSources);for(let e of w.diagnostics)walk(e.location);let O=w.diagnostics.some(e=>{if(![`PLAY0022`,`PLAY0024`,`PLAY0029`].includes(e.code))return!1;let t=x.find(t=>t.path===e.location.path),n=g.find(t=>t.path===e.location.path)?.source.split(`
|
|
6
|
+
`)[e.location.line-1];return t?.locations.some(e=>e.line===0)&&n!==void 0&&a(n)===0}),k=w.diagnostics.filter(e=>e.location.path===p).flatMap(e=>(walk(e.location),e.location.line>0?[e]:[])),A=new e(w.value),j=new Set(A.slices.flatMap(({slice:e})=>[...e.commands.flatMap(e=>e.produces),...e.reactions.flatMap(e=>e.triggers).flatMap(e=>e.produces)].filter(t=>t.location.path===p&&!A.isEventProduction(t,e)).map(e=>e.location.line-1)));for(let e of k)e.code===`PLAY0499`&&j.add(e.location.line-1);let M=A.declarations.filter(e=>e.kind===`operation`).map(e=>({...e.node,scope:e.scope.filter(e=>!b.has(e))})),N=/* @__PURE__ */ new Map,P=i(u),range=e=>{let t=[],n=a(u[e]);for(let r=e;r<u.length&&!(r>e&&!P[r]&&o(u[r]).trim()&&a(u[r])<=n);r++)t.push(r);return t};for(let{slice:e,scope:t}of A.slices){if(e.location.path===p&&e.location.line>0)for(let n of range(e.location.line-1))N.set(n,{scope:t});for(let n of e.specifications.filter(e=>e.location.path===p&&e.location.line>0))for(let e of range(n.location.line-1))N.set(e,{scope:t});for(let n of e.commands.filter(e=>e.location.path===p&&e.location.line>0))for(let e of range(n.location.line-1))N.set(e,{scope:t,commandLine:n.location.line-1})}let F=new Map(A.declarations.map(e=>[e.node.location,e.scope]));for(let e of M.filter(e=>e.location.path===p)){let t=F.get(e.location);for(let n of range(e.location.line-1))N.set(n,{...N.get(n),scope:t,operation:e})}let I=new Map(M.map(e=>[e.location,e])),referenceLocation=(e,t)=>{let n=o(u[e.line-1]??``),r=n.slice(e.column-1).match(/^(?:given\s+operation|then\s+(?:operation|compensated))\s+/)?.[0];return r&&n.slice(e.column-1+r.length,e.column-1+r.length+t.length)===t?{...e,column:e.column+r.length}:e},L=[];for(let{slice:e}of A.slices){for(let t of e.commands)for(let n of t.produces){if(n.location.path!==p)continue;let t=A.resolve(n.event,e),r=t.declaration?I.get(t.declaration.node.location)??null:null,i={name:n.event,location:n.location,targetLocation:n.targetLocation??n.location,kind:t.kind,declaration:r,mappings:n.mappings};if(L.push(i),t.kind===`operation`)for(let e of range(n.location.line-1)){let t=N.get(e);t&&N.set(e,{...t,production:i})}}for(let t of e.specifications)for(let n of[...t.givenOperationFailures??[],...t.thenOperations??[],...t.thenCompensated??[]]){if(n.location.path!==p)continue;let t=A.resolve(n.operation,e);L.push({name:n.operation,location:n.location,targetLocation:referenceLocation(n.location,n.operation),kind:t.kind,declaration:t.declaration?I.get(t.declaration.node.location)??null:null,mappings:[]})}}let R={declarations:M,systems:w.value.systems??[],references:L,contexts:N,types:w.value.types,concepts:w.value.concepts,targets:e=>{let t=A.slices.find(t=>t.scope.length===e.length&&t.scope.every((t,n)=>t===e[n]))?.slice;return t?M.flatMap(e=>{let n=A.resolve(e.name,t).declaration?.node.location===e.location?e.name:[...e.scope,e.name].join(`.`);return A.resolve(n,t).kind===`operation`&&A.resolve(n,t).declaration?.node.location===e.location?[{name:n,declaration:e}]:[]}):[]}},z=w.physicalEventSources.map(e=>e.source),B=new n(w.physicalEventSources,w.sourceInventoryComplete&&!O),V=/* @__PURE__ */ new Map,resolve=(e,t)=>{let n=JSON.stringify([e,t]),r=V.get(n);return r||(r=B.resolve(e,t),V.set(n,r)),{...r,source:r.state===`unique`?r.sources[0]:void 0,stream:r.state===`unique`?r.streams[0]:void 0}},H=new Set(w.value.imports.map(e=>e.qualifiedName)),U=z.flatMap(e=>e.streams.filter(t=>resolve(e.name,t.name).state===`unique`&&!H.has(`${e.name}.${t.name}`)).map(t=>({name:`${e.name}.${t.name}`,source:e,stream:t}))),W=/* @__PURE__ */ new Map,G=[];for(let e of T.values()){for(let t of range(e.location.line-1))W.set(t,{command:e});for(let t of[...e.produces,...e.validations,...e.handler?[e.handler]:[]])for(let e of range(t.location.line-1))W.delete(e);if(e.stream){G.push(e.stream);for(let t of range(e.stream.location.line-1))W.set(t,{command:e,route:e.stream})}}let K=s(w.value,p,u,range,b,w.diagnostics),q=[...[...E.values()].flatMap(e=>[...e.given.map(e=>({event:e,expectation:!1})),...e.whenAppended?[{event:e.whenAppended,expectation:!1}]:[],...e.thenEvents.map(e=>({event:e,expectation:!0})),...e.whenRedelivered?[{event:e.whenRedelivered,expectation:!0}]:[]]),...(K.eventExamples??[]).map(e=>({event:e,expectation:!0}))];for(let e of q){let t=e.event;for(let n of range(t.location.line-1))W.set(n,e);if(t.stream){G.push(t.stream);for(let n of range(t.stream.location.line-1))W.set(n,{...e,route:t.stream})}}for(let e of z.filter(e=>e.location.path===p)){for(let t of range(e.location.line-1))W.set(t,{source:e});for(let t of e.streams)for(let n of range(t.location.line-1))W.set(n,{source:e,stream:t})}let J={declarations:z,routes:G,ambiguousCandidates:[...T.values()].flatMap(e=>e.streamCandidates??[]).filter(e=>e.propertyCandidate!==null),contexts:W,targets:U,resolve},Y;return{identityDetails:(w.value.identity?.details??[]).map(e=>({name:e.name,type:`${e.type.name}${e.type.isCollection?`[]`:``}${e.type.isOptional?` optional`:``}`,line:e.location.line-1})),commands:T,specifications:E,diagnostics:k,operationProductionLines:j,operations:R,eventSources:J,examples:K,personas:c(w.value,u),dependencies:{completions(e,n,r){if(Y===void 0){let e=t(S.source,p,S.placement,!1).value,remapDependencyHeaders=e=>{walk(e.location),e.features.forEach(remapDependencyHeaders)};e.modules.forEach(remapDependencyHeaders),Y=l(w.value,e,p,range,b)}return Y.completions(e,n,r)}}}}function responseAnalysis(e,t=[],n,r=`current.play`,i=!0){let a=JSON.stringify([e,t,n,r,i]),o=d.get(a);return o===void 0&&(o=analyze(e,t,n,r,i),d.size>=16&&d.delete(d.keys().next().value),d.set(a,o)),o}export{responseAnalysis,u as responseAvailability};
|
|
7
|
+
//# sourceMappingURL=response-analysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-analysis.js","names":["responseAvailability","revisions","fences","fenceMap","lines","roots","index","indentOf","line","root","globals","body","global","depth","wrappers","headers","others","otherSources","document","path","documents","names","match","name","prefix","suffix","module","feature","syntheticScopes","preparedDocuments","sourceLines","fragment","prepared","locations","parsed","parsePlacedDocuments","commands","specifications","visited","value","node","original","child","diagnostic","unknownFragmentExtent","location","diagnostics","productions","AuthoringProductionResolver","operationProductionLines","slice","command","reaction","trigger","production","declarations","declaration","segment","contexts","result","indent","start","withoutComment","specification","declarationScopes","operation","scope","declarationsByLocation","source","references","resolved","reference","context","step","operations","entry","part","sourceDeclarations","sourceCatalog","EventSourceReadConfidence","resolutions","key","stream","importedTypeReferences","imported","targets","sourceContexts","routes","member","examples","exampleAnalysis","routeOwners","event","eventSources","candidate","dependencyAnalysis","detail","personaAnalysis","localDependencies","parseForAuthoring","dependencyTargetAnalysis","qualifier","placement","isPlacementResolved","analysis"],"sources":["../../response-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 { AuthoringProductionKind, AuthoringProductionResolver, CommandSyntax, Diagnostic, EventSourceReadConfidence, FeatureSyntax, OperationSyntax, parseForAuthoring, parsePlacedDocuments, SpecificationSyntax } from '@cratis/screenplay-compiler';\nimport { fenceMap, indentOf, withoutComment } from './document-context';\nimport { AuthoredSpecificationEvent } from './AuthoredSpecificationEvent';\nimport { ResponseAnalysis } from './ResponseAnalysis';\nimport { ExampleAnalysis } from './ExampleAnalysis';\nimport { exampleAnalysis } from './example-analysis';\nimport { personaAnalysis } from './persona-analysis';\nimport { dependencyTargetAnalysis } from './dependency-target-analysis';\nimport { EventSourceAnalysis } from './EventSourceAnalysis';\nimport { AuthoredCommandRoute } from './AuthoredCommandRoute';\nimport { AuthoringDocument } from './AuthoringDocument';\nimport { OperationAnalysis, OperationDeclaration, OperationReference } from './OperationAnalysis';\n\n// Public editor shapes are structural: packed declarations never expose the private compiler.\nexport type { AuthoringDocument } from './AuthoringDocument';\nexport type { AnalysisLocation } from './AnalysisLocation';\nexport type { AnalysisDiagnostic } from './AnalysisDiagnostic';\nexport type { AnalysisType } from './AnalysisType';\nexport type { AnalysisCommand } from './AnalysisCommand';\nexport type { AnalysisSpecification } from './AnalysisSpecification';\nexport type { CommandResponseSymbol } from './CommandResponseSymbol';\nexport type { ResponseFieldSymbol } from './ResponseFieldSymbol';\nexport type { ResponseSourceSymbol } from './ResponseSourceSymbol';\nexport type { ResponseAnalysis } from './ResponseAnalysis';\n\nexport const responseAvailability = 'Executable as ESM v7. Generated values require fixtures in reference execution; other unadmitted constructs still prevent binding.';\n\n// A bounded revision cache shared by symbols, validation, completion and hover. Index typed nodes\n// once, not by reparsing the document for each command or response field.\nconst revisions = new Map<string, ReturnType<typeof analyze>>();\n\nfunction authoringSource(lines: string[], headers: readonly string[]) {\n const fences = fenceMap(lines);\n const roots = lines.flatMap((line, index) => !fences[index] && indentOf(line) === 0 && /^\\w/.test(line) ? [line.split(/\\s+/)[0]] : []);\n if (roots.includes('module') || !roots.some(root => ['feature', 'slice', 'command', 'event', 'operation', 'reaction', 'specification'].includes(root))) {\n return { source: lines.join('\\n'), locations: lines.map((_, index) => ({ line: index + 1, column: 0 })) };\n }\n // Isolated slice/command fragments are a supported editor input. Global declarations stay global.\n const globals: number[] = [];\n const body: number[] = [];\n let global = false;\n lines.forEach((line, index) => {\n if (!fences[index] && indentOf(line) === 0 && /^\\w/.test(line)) global = /^(?:concept|type|import|domain|system|eventsource|policy|persona|identity)\\b/.test(line);\n (global ? globals : body).push(index);\n });\n const depth = roots.includes('feature') ? 1 : roots.includes('slice') ? 2 : 3;\n const wrappers = headers.slice(0, depth);\n const source = [...globals.map(index => lines[index]), ...wrappers, ...body.map(index => ' '.repeat(depth * 2) + lines[index])].join('\\n');\n const locations = [...globals.map(index => ({ line: index + 1, column: 0 })), ...wrappers.map(() => ({ line: 0, column: 0 })), ...body.map(index => ({ line: index + 1, column: depth * 2 }))];\n return { source, locations };\n}\n\nfunction analyze(lines: string[], otherSources: readonly (string | AuthoringDocument)[], placement?: readonly string[], path = 'current.play', isPlacementResolved = true): ResponseAnalysis & { readonly operations: OperationAnalysis; readonly eventSources: EventSourceAnalysis; readonly examples: ExampleAnalysis; readonly personas: ReturnType<typeof personaAnalysis>; readonly dependencies: ReturnType<typeof dependencyTargetAnalysis> } {\n const others = otherSources.map((document, index) => typeof document === 'string' ? { path: `other-${index}.play`, source: document } : document).filter(document => document.path !== path);\n const documents: AuthoringDocument[] = [{ path, source: lines.join('\\n'), placement, isPlacementResolved }, ...others];\n // Modules/features merge, but slices are real declarations: equal slice names discard later\n // documents. Share only fresh synthetic module/feature names, with a distinct synthetic slice\n // per fragment. This retains all commands for normal (including ambiguous) scope resolution,\n // without combining source texts or renaming real declarations/explicit placements. Reserve\n // source/placement names once so even a real Editor.Authoring.Fragment cannot collide.\n const names = new Set(documents.flatMap(document => [...document.source.matchAll(/\\w+/g)].map(match => match[0]).concat(document.placement ?? [])));\n const fresh = (prefix: string): string => {\n let name = prefix;\n for (let suffix = 1; names.has(name); suffix++) name = `${prefix}${suffix}`;\n names.add(name);\n return name;\n };\n const module = fresh('EditorAuthoring');\n const feature = fresh('FragmentFeature');\n const syntheticScopes = new Set([module, feature]);\n const preparedDocuments = documents.map((document, index) => {\n const sourceLines = index === 0 ? lines : document.source.split('\\n');\n const fragment = fresh(`Fragment${index}`);\n syntheticScopes.add(fragment);\n const prepared = document.placement?.length ? { source: document.source, locations: sourceLines.map((_, line) => ({ line: line + 1, column: 0 })) }\n : authoringSource(sourceLines, [`module ${module}`, ` feature ${feature}`, ` slice StateChange ${fragment}`]);\n return { ...document, ...prepared, placement: document.placement ?? [] };\n });\n const prepared = preparedDocuments[0];\n const locations = new Map(preparedDocuments.map(document => [document.path, document.locations]));\n // Put the buffer after its supplied context so duplicate real declarations are reported at\n // the current source, not silently dropped from its source-local diagnostic view.\n const parsed = parsePlacedDocuments([...preparedDocuments.slice(1), prepared]);\n const commands = new Map<number, CommandSyntax>();\n const specifications = new Map<number, SpecificationSyntax>();\n const visited = new WeakSet<object>();\n const walk = (value: unknown): void => {\n if (value === null || typeof value !== 'object' || visited.has(value)) return;\n visited.add(value);\n if (Array.isArray(value)) { value.forEach(walk); return; }\n const node = value as Record<string, unknown>;\n // Source locations also occur as standalone members (usesLocation, targetLocation).\n // Mutate each original identity once: shared locations must not be shifted twice.\n if (typeof node.path === 'string' && typeof node.line === 'number' && typeof node.column === 'number') {\n const original = locations.get(node.path)?.[node.line - 1];\n if (original) { node.line = original.line; node.column = Math.max(1, node.column - original.column); }\n return;\n }\n for (const child of Object.values(node)) walk(child);\n if ((node.location as { path?: string; line: number } | undefined)?.path === path) {\n if (node.kind === 'CommandSyntax') commands.set((node.location as { line: number }).line - 1, value as CommandSyntax);\n if (node.kind === 'SpecificationSyntax') specifications.set((node.location as { line: number }).line - 1, value as SpecificationSyntax);\n }\n };\n walk(parsed.value);\n walk(parsed.physicalEventSources);\n // Fragment wrappers must not turn an unread original root into confidence evidence.\n // Retain the parser's unknown-owner diagnostic at its original physical root location.\n for (const diagnostic of parsed.diagnostics) walk(diagnostic.location);\n const unknownFragmentExtent = parsed.diagnostics.some(diagnostic => {\n if (!['PLAY0022', 'PLAY0024', 'PLAY0029'].includes(diagnostic.code)) return false;\n const document = preparedDocuments.find(document => document.path === diagnostic.location.path);\n const original = documents.find(document => document.path === diagnostic.location.path)?.source.split('\\n')[diagnostic.location.line - 1];\n return document?.locations.some(location => location.line === 0) && original !== undefined && indentOf(original) === 0;\n });\n const diagnostics: Diagnostic[] = parsed.diagnostics.filter(diagnostic => diagnostic.location.path === path).flatMap(diagnostic => {\n walk(diagnostic.location);\n return diagnostic.location.line > 0 ? [diagnostic] : [];\n });\n const productions = new AuthoringProductionResolver(parsed.value);\n const operationProductionLines = new Set(productions.slices.flatMap(({ slice }) => [...slice.commands.flatMap(command => command.produces), ...slice.reactions.flatMap(reaction => reaction.triggers).flatMap(trigger => trigger.produces)]\n .filter(production => production.location.path === path && !productions.isEventProduction(production, slice))\n .map(production => production.location.line - 1)));\n // Rejected inline operation declarations have no syntax node, but the core parser still owns\n // the command-only kind fact. Retain it rather than suggesting an event declaration repair.\n for (const diagnostic of diagnostics) if (diagnostic.code === 'PLAY0499') operationProductionLines.add(diagnostic.location.line - 1);\n const declarations: OperationDeclaration[] = productions.declarations.filter(declaration => declaration.kind === AuthoringProductionKind.Operation)\n .map(declaration => ({ ...declaration.node as OperationSyntax, scope: declaration.scope.filter(segment => !syntheticScopes.has(segment)) }));\n const contexts = new Map<number, { scope: readonly string[]; commandLine?: number; operation?: OperationDeclaration; production?: OperationReference }>();\n // Index source ownership once per revision. Typed headers, not keyword-shaped properties,\n // define the ranges; greater-indented legacy properties remain leaves.\n const fences = fenceMap(lines);\n const range = (start: number): number[] => {\n const result: number[] = [];\n const indent = indentOf(lines[start]);\n for (let line = start; line < lines.length; line++) {\n if (line > start && !fences[line] && withoutComment(lines[line]).trim() && indentOf(lines[line]) <= indent) break;\n result.push(line);\n }\n return result;\n };\n for (const { slice, scope } of productions.slices) {\n if (slice.location.path === path && slice.location.line > 0) for (const line of range(slice.location.line - 1)) contexts.set(line, { scope });\n for (const specification of slice.specifications.filter(specification => specification.location.path === path && specification.location.line > 0)) {\n for (const line of range(specification.location.line - 1)) contexts.set(line, { scope });\n }\n for (const command of slice.commands.filter(command => command.location.path === path && command.location.line > 0)) {\n for (const line of range(command.location.line - 1)) contexts.set(line, { scope, commandLine: command.location.line - 1 });\n }\n }\n const declarationScopes = new Map(productions.declarations.map(declaration => [declaration.node.location, declaration.scope]));\n for (const operation of declarations.filter(operation => operation.location.path === path)) {\n const scope = declarationScopes.get(operation.location)!;\n for (const line of range(operation.location.line - 1)) contexts.set(line, { ...contexts.get(line), scope, operation });\n }\n const declarationsByLocation = new Map(declarations.map(declaration => [declaration.location, declaration]));\n const referenceLocation = (location: { path?: string; line: number; column: number }, name: string) => {\n const source = withoutComment(lines[location.line - 1] ?? '');\n const prefix = source.slice(location.column - 1).match(/^(?:given\\s+operation|then\\s+(?:operation|compensated))\\s+/)?.[0];\n return prefix && source.slice(location.column - 1 + prefix.length, location.column - 1 + prefix.length + name.length) === name\n ? { ...location, column: location.column + prefix.length } : location;\n };\n const references: OperationReference[] = [];\n for (const { slice } of productions.slices) {\n for (const command of slice.commands) for (const production of command.produces) {\n if (production.location.path !== path) continue;\n const resolved = productions.resolve(production.event, slice);\n const declaration = resolved.declaration ? declarationsByLocation.get(resolved.declaration.node.location) ?? null : null;\n const reference = { name: production.event, location: production.location, targetLocation: production.targetLocation ?? production.location, kind: resolved.kind, declaration, mappings: production.mappings };\n references.push(reference);\n if (resolved.kind === AuthoringProductionKind.Operation) {\n for (const line of range(production.location.line - 1)) {\n const context = contexts.get(line);\n if (context) contexts.set(line, { ...context, production: reference });\n }\n }\n }\n for (const specification of slice.specifications) {\n for (const step of [...specification.givenOperationFailures ?? [], ...specification.thenOperations ?? [], ...specification.thenCompensated ?? []]) {\n if (step.location.path !== path) continue;\n const resolved = productions.resolve(step.operation, slice);\n references.push({ name: step.operation, location: step.location, targetLocation: referenceLocation(step.location, step.operation), kind: resolved.kind,\n declaration: resolved.declaration ? declarationsByLocation.get(resolved.declaration.node.location) ?? null : null,\n mappings: [] });\n }\n }\n }\n const operations: OperationAnalysis = { declarations, systems: parsed.value.systems ?? [], references, contexts, types: parsed.value.types, concepts: parsed.value.concepts,\n targets: scope => {\n const slice = productions.slices.find(entry => entry.scope.length === scope.length && entry.scope.every((part, index) => part === scope[index]))?.slice;\n if (!slice) return [];\n return declarations.flatMap(declaration => {\n const name = productions.resolve(declaration.name, slice).declaration?.node.location === declaration.location\n ? declaration.name : [...declaration.scope, declaration.name].join('.');\n return productions.resolve(name, slice).kind === AuthoringProductionKind.Operation &&\n productions.resolve(name, slice).declaration?.node.location === declaration.location ? [{ name, declaration }] : [];\n });\n }\n };\n const sourceDeclarations = parsed.physicalEventSources.map(entry => entry.source);\n const sourceCatalog = new EventSourceReadConfidence(parsed.physicalEventSources, parsed.sourceInventoryComplete && !unknownFragmentExtent);\n const resolutions = new Map<string, ReturnType<EventSourceReadConfidence['resolve']>>();\n const resolve = (source: string, stream?: string) => {\n const key = JSON.stringify([source, stream]);\n let result = resolutions.get(key);\n if (!result) { result = sourceCatalog.resolve(source, stream); resolutions.set(key, result); }\n return { ...result, source: result.state === 'unique' ? result.sources[0] : undefined, stream: result.state === 'unique' ? result.streams[0] : undefined };\n };\n const importedTypeReferences = new Set(parsed.value.imports.map(imported => imported.qualifiedName));\n const targets = sourceDeclarations.flatMap(source => {\n return source.streams.filter(stream => resolve(source.name, stream.name).state === 'unique' && !importedTypeReferences.has(`${source.name}.${stream.name}`)).map(stream => ({ name: `${source.name}.${stream.name}`, source, stream }));\n });\n const sourceContexts = new Map<number, { command?: CommandSyntax; event?: AuthoredSpecificationEvent; expectation?: boolean; route?: AuthoredCommandRoute; source?: typeof sourceDeclarations[number]; stream?: typeof sourceDeclarations[number]['streams'][number] }>();\n const routes: AuthoredCommandRoute[] = [];\n for (const command of commands.values()) {\n for (const line of range(command.location.line - 1)) sourceContexts.set(line, { command });\n for (const member of [...command.produces, ...command.validations, ...(command.handler ? [command.handler] : [])])\n for (const line of range(member.location.line - 1)) sourceContexts.delete(line);\n // Retained ambiguity candidates are not selected authored routes.\n if (command.stream) {\n routes.push(command.stream);\n for (const line of range(command.stream.location.line - 1)) sourceContexts.set(line, { command, route: command.stream });\n }\n }\n const examples = exampleAnalysis(parsed.value, path, lines, range, syntheticScopes, parsed.diagnostics);\n const routeOwners = [\n ...[...specifications.values()].flatMap(specification => [\n ...specification.given.map(event => ({ event, expectation: false })),\n ...(specification.whenAppended ? [{ event: specification.whenAppended, expectation: false }] : []),\n ...specification.thenEvents.map(event => ({ event, expectation: true })),\n ...(specification.whenRedelivered ? [{ event: specification.whenRedelivered, expectation: true }] : [])\n ]),\n ...(examples.eventExamples ?? []).map(event => ({ event, expectation: true }))\n ];\n for (const context of routeOwners) {\n const event = context.event;\n for (const line of range(event.location.line - 1)) sourceContexts.set(line, context);\n if (event.stream) {\n routes.push(event.stream);\n for (const line of range(event.stream.location.line - 1)) sourceContexts.set(line, { ...context, route: event.stream });\n }\n }\n for (const source of sourceDeclarations.filter(source => source.location.path === path)) {\n for (const line of range(source.location.line - 1)) sourceContexts.set(line, { source });\n for (const stream of source.streams) for (const line of range(stream.location.line - 1)) sourceContexts.set(line, { source, stream });\n }\n const ambiguousCandidates = [...commands.values()].flatMap(command => command.streamCandidates ?? []).filter(candidate => candidate.propertyCandidate !== null);\n const eventSources: EventSourceAnalysis = { declarations: sourceDeclarations, routes, ambiguousCandidates, contexts: sourceContexts, targets, resolve };\n let dependencyAnalysis: ReturnType<typeof dependencyTargetAnalysis> | undefined;\n const dependencies: ReturnType<typeof dependencyTargetAnalysis> = {\n completions(line, qualifier, placement) {\n if (dependencyAnalysis === undefined) {\n // Merging restated headers retains the first header's location. Index physical typed\n // headers only when needed, so later fragments still own their incomplete lines.\n const localDependencies = parseForAuthoring(prepared.source, path, prepared.placement, false).value;\n const remapDependencyHeaders = (node: typeof localDependencies.modules[number] | FeatureSyntax): void => {\n walk(node.location);\n node.features.forEach(remapDependencyHeaders);\n };\n localDependencies.modules.forEach(remapDependencyHeaders);\n dependencyAnalysis = dependencyTargetAnalysis(parsed.value, localDependencies, path, range, syntheticScopes);\n }\n return dependencyAnalysis.completions(line, qualifier, placement);\n },\n };\n const identityDetails = (parsed.value.identity?.details ?? []).map(detail => ({ name: detail.name, type: `${detail.type.name}${detail.type.isCollection ? '[]' : ''}${detail.type.isOptional ? ' optional' : ''}`, line: detail.location.line - 1 }));\n return { identityDetails, commands, specifications, diagnostics, operationProductionLines, operations, eventSources, examples, personas: personaAnalysis(parsed.value, lines), dependencies };\n}\n\nexport function responseAnalysis(lines: string[], otherSources: readonly (string | AuthoringDocument)[] = [], placement?: readonly string[], path = 'current.play', isPlacementResolved = true): ResponseAnalysis & { readonly operations: OperationAnalysis; readonly eventSources: EventSourceAnalysis; readonly examples: ExampleAnalysis; readonly personas: ReturnType<typeof personaAnalysis>; readonly dependencies: ReturnType<typeof dependencyTargetAnalysis> } {\n const key = JSON.stringify([lines, otherSources, placement, path, isPlacementResolved]);\n let analysis = revisions.get(key);\n if (analysis === undefined) {\n analysis = analyze(lines, otherSources, placement, path, isPlacementResolved);\n if (revisions.size >= 16) revisions.delete(revisions.keys().next().value!);\n revisions.set(key, analysis);\n }\n return analysis;\n}\n"],"mappings":"6qBA4BA,MAAaA,EAAuB,qIAI9BC,kBAAY,IAAI,IAEtB,SAAS,gBAAgB,EAAiB,EAA4B,CAClE,IAAMC,EAASC,EAASC,CAAK,EACvBC,EAAQD,EAAM,SAAS,EAAM,IAAU,CAACF,EAAOI,IAAUC,EAASC,CAAI,IAAM,GAAK,MAAM,KAAKA,CAAI,EAAI,CAACA,EAAK,MAAM,KAAK,CAAC,CAAC,EAAE,EAAI,CAAC,CAAC,EACrI,GAAIH,EAAM,SAAS,QAAQ,GAAK,CAACA,EAAM,KAAK,GAAQ,CAAC,UAAW,QAAS,UAAW,QAAS,YAAa,WAAY,eAAe,CAAC,CAAC,SAASI,CAAI,CAAC,EACjJ,MAAO,CAAE,OAAQL,EAAM,KAAK;CAAI,EAAG,UAAWA,EAAM,KAAK,EAAG,KAAW,CAAE,KAAME,EAAQ,EAAG,OAAQ,CAAE,EAAE,CAAE,EAG5G,IAAMI,EAAoB,CAAC,EACrBC,EAAiB,CAAC,EACpBC,EAAS,GACbR,EAAM,SAAS,E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