@cratis/screenplay-language 5.2.0 → 5.3.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/dist/bundles/TypeReferenceSymbol.js.map +1 -1
- package/dist/bundles/action-subject-authoring.js.map +1 -1
- package/dist/bundles/bmp-word-characters.js.map +1 -1
- package/dist/bundles/case-authoring.js +1 -1
- package/dist/bundles/case-authoring.js.map +1 -1
- package/dist/bundles/code-actions.js.map +1 -1
- package/dist/bundles/command-read-completions.js.map +1 -1
- package/dist/bundles/compiler/Authoring/ActionSubjectQuickFixes.js +3 -3
- package/dist/bundles/compiler/Authoring/ActionSubjectQuickFixes.js.map +1 -1
- package/dist/bundles/compiler/Authoring/QuickFixes.js +4 -4
- package/dist/bundles/compiler/Authoring/QuickFixes.js.map +1 -1
- package/dist/bundles/compiler/Authoring/StructuredValueQuickFix.js +1 -1
- package/dist/bundles/compiler/Authoring/StructuredValueQuickFix.js.map +1 -1
- package/dist/bundles/compiler/Authoring/TimelineQuickFixContext.js +4 -4
- package/dist/bundles/compiler/Authoring/TimelineQuickFixContext.js.map +1 -1
- package/dist/bundles/compiler/Authoring/TimelineQuickFixImports.js +2 -2
- package/dist/bundles/compiler/Authoring/TimelineQuickFixImports.js.map +1 -1
- package/dist/bundles/compiler/Authoring/TimelineQuickFixes.js +1 -1
- package/dist/bundles/compiler/Authoring/TimelineQuickFixes.js.map +1 -1
- package/dist/bundles/compiler/Dependencies/DeclaredDependencies.js.map +1 -1
- package/dist/bundles/compiler/Dependencies/DeclaredDependencyTargets.js.map +1 -1
- package/dist/bundles/compiler/Dependencies/DependencyGraph.js +1 -1
- package/dist/bundles/compiler/Dependencies/DependencyGraph.js.map +1 -1
- package/dist/bundles/compiler/Dependencies/DependencyKind.js.map +1 -1
- package/dist/bundles/compiler/Dependencies/InvalidDependencyQuery.js.map +1 -1
- package/dist/bundles/compiler/Dependencies/SliceReferences.js.map +1 -1
- package/dist/bundles/compiler/Dependencies/StronglyConnectedGroups.js.map +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticArgument.js.map +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -1
- package/dist/bundles/compiler/Diagnostics/ProductionDestinationDiagnostics.js +1 -1
- package/dist/bundles/compiler/Diagnostics/ProductionDestinationDiagnostics.js.map +1 -1
- package/dist/bundles/compiler/Diagnostics/SourceLocation.js.map +1 -1
- package/dist/bundles/compiler/Files/AuthoredOrder.js +1 -1
- package/dist/bundles/compiler/Files/AuthoredOrder.js.map +1 -1
- package/dist/bundles/compiler/Files/OrderingRoot.js +1 -1
- package/dist/bundles/compiler/Files/OrderingRoot.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js +1 -1
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayDocumentSource.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayFolderMerge.js +1 -1
- package/dist/bundles/compiler/Files/PlayFolderMerge.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayGlob.js +2 -1
- package/dist/bundles/compiler/Files/PlayGlob.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayImports.js +1 -1
- package/dist/bundles/compiler/Files/PlayImports.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayPlacement.js.map +1 -1
- package/dist/bundles/compiler/Files/TimelineOrder.js +1 -1
- package/dist/bundles/compiler/Files/TimelineOrder.js.map +1 -1
- package/dist/bundles/compiler/Generation/FiniteGenerationRules.js +1 -1
- package/dist/bundles/compiler/Generation/GenerationAssessmentCache.js.map +1 -1
- package/dist/bundles/compiler/Generation/GenerationChecksum.js.map +1 -1
- package/dist/bundles/compiler/Generation/GenerationPattern.js +1 -1
- package/dist/bundles/compiler/Generation/GenerationPattern.js.map +1 -1
- package/dist/bundles/compiler/Generation/GenerationPatternAssessment.js.map +1 -1
- package/dist/bundles/compiler/Generation/GenerationPatternParser.js.map +1 -1
- package/dist/bundles/compiler/Generation/GenerationPatternToken.js.map +1 -1
- package/dist/bundles/compiler/Generation/GenerationRuleProof.js +1 -1
- package/dist/bundles/compiler/Generation/InvalidGenerationPattern.js.map +1 -1
- package/dist/bundles/compiler/Generation/RegexCharacters.js.map +1 -1
- package/dist/bundles/compiler/Generation/RegexExpression.js.map +1 -1
- package/dist/bundles/compiler/Generation/RuleConsistency.js +1 -1
- package/dist/bundles/compiler/Parsing/ActionSubjectClause.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ActionSubjectInputs.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ActionSubjectResolution.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ApplicationContextParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ApplicationContextParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/AuthorizeParser.js +1 -1
- package/dist/bundles/compiler/Parsing/AuthorizeParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CanvasPlacement.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CaptureEventFixturesValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CaptureParser.js +1 -1
- package/dist/bundles/compiler/Parsing/CaptureParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ClockOperandParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CodeBlockParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CommandDestinationTypes.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CommandHandlerValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CommandParser.js +1 -1
- package/dist/bundles/compiler/Parsing/CommandParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CommandReadSources.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CommandResponseParser.js +1 -1
- package/dist/bundles/compiler/Parsing/CommandResponseParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CommandStreamCandidates.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CompositeStreamIdValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CompositionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/CompositionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ConceptComplianceParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ConceptComplianceParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ConditionDepthBudget.js +2 -0
- package/dist/bundles/compiler/Parsing/ConditionDepthBudget.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ConditionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ConditionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ConstraintParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ConstraintParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ConstraintPropertyValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/ConstraintPropertyValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ContinuationValues.js.map +1 -1
- package/dist/bundles/compiler/Parsing/DeclarationParsers.js +1 -1
- package/dist/bundles/compiler/Parsing/DeclarationParsers.js.map +1 -1
- package/dist/bundles/compiler/Parsing/DependencySourceParser.js +1 -1
- package/dist/bundles/compiler/Parsing/DependencySourceParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/DependsOnParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/DescriptionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/DescriptionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/DocumentationParser.js +1 -1
- package/dist/bundles/compiler/Parsing/DocumentationParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/EnumerationMembers.js +1 -1
- package/dist/bundles/compiler/Parsing/EnumerationMembers.js.map +1 -1
- package/dist/bundles/compiler/Parsing/EventMetadataParser.js +1 -1
- package/dist/bundles/compiler/Parsing/EventMetadataParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/EventSourceParser.js +1 -1
- package/dist/bundles/compiler/Parsing/EventSourceParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/EventSourceValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/EventSourceValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/EventSubjectValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/EventSubjectValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ExpressionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ExpressionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/FeatureBody.js +1 -1
- package/dist/bundles/compiler/Parsing/FeatureBody.js.map +1 -1
- package/dist/bundles/compiler/Parsing/FileImportParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/FileReferences.js.map +1 -1
- package/dist/bundles/compiler/Parsing/FoldedEventSources.js.map +1 -1
- package/dist/bundles/compiler/Parsing/GenerationBodyParser.js +1 -1
- package/dist/bundles/compiler/Parsing/GenerationBodyParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/GenerationParser.js +1 -1
- package/dist/bundles/compiler/Parsing/GenerationParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/GuardedActionInputs.js.map +1 -1
- package/dist/bundles/compiler/Parsing/GuardedActionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/GuardedActionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/GuardedActionShadowing.js.map +1 -1
- package/dist/bundles/compiler/Parsing/GuardedActionValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/GuardedActionValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/GuardedInteractions.js +1 -1
- package/dist/bundles/compiler/Parsing/GuardedInteractions.js.map +1 -1
- package/dist/bundles/compiler/Parsing/IdentifierComplianceValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/IdentifierComplianceValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/IdentityParser.js +1 -1
- package/dist/bundles/compiler/Parsing/IdentityParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/IdentityValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ImplementationParser.js +2 -2
- package/dist/bundles/compiler/Parsing/ImplementationParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ImportDiscovery.js +1 -1
- package/dist/bundles/compiler/Parsing/ImportDiscovery.js.map +1 -1
- package/dist/bundles/compiler/Parsing/InlineEventValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/InputUses.js +1 -1
- package/dist/bundles/compiler/Parsing/InputUses.js.map +1 -1
- package/dist/bundles/compiler/Parsing/InteractionAlternatives.js +1 -1
- package/dist/bundles/compiler/Parsing/InteractionAlternatives.js.map +1 -1
- package/dist/bundles/compiler/Parsing/InteractionExecutions.js +1 -1
- package/dist/bundles/compiler/Parsing/InteractionExecutions.js.map +1 -1
- package/dist/bundles/compiler/Parsing/LegacyTextRulePatterns.js.map +1 -1
- package/dist/bundles/compiler/Parsing/LineReader.js.map +1 -1
- package/dist/bundles/compiler/Parsing/LineText.js.map +1 -1
- package/dist/bundles/compiler/Parsing/MatchAmbiguity.js +1 -1
- package/dist/bundles/compiler/Parsing/MatchAmbiguity.js.map +1 -1
- package/dist/bundles/compiler/Parsing/MatchAmbiguityCharacters.js.map +1 -1
- package/dist/bundles/compiler/Parsing/MatchAmbiguityGraph.js.map +1 -1
- package/dist/bundles/compiler/Parsing/MatchAmbiguityParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/MatchOperandValidation.js +1 -1
- package/dist/bundles/compiler/Parsing/MatchOperandValidation.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ModuleBody.js +1 -1
- package/dist/bundles/compiler/Parsing/ModuleBody.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ObserverFilterParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ObserverFilterParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ObserverFilterValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/OperationParser.js +1 -1
- package/dist/bundles/compiler/Parsing/OperationParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/OperationValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/OperationValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ParserContext.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PersonaCallerValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PolicyParser.js +1 -1
- package/dist/bundles/compiler/Parsing/PolicyParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PortableMatchGroupName.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PortableMatchPattern.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PortableMatchSuggestions.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PossibleEventsParser.js +1 -1
- package/dist/bundles/compiler/Parsing/PossibleEventsParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ProducesParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ProducesParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionEventScopeValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionExpressionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionExpressionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionTargetValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionTargetValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PropertyLineParser.js +1 -1
- package/dist/bundles/compiler/Parsing/PropertyLineParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PublicEventMetadataValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/PublicEventMetadataValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PublicEventUsageCollector.js +1 -1
- package/dist/bundles/compiler/Parsing/PublicEventUsageCollector.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PublicEventUsageValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/PublicEventUsageValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PurposeParser.js +1 -1
- package/dist/bundles/compiler/Parsing/PurposeParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PurposeValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/QueryParser.js +1 -1
- package/dist/bundles/compiler/Parsing/QueryParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ReactionIdentityParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ReactionIdentityParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ReactionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ReactionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ReactionRefusalValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/ReactionRefusalValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ReadModelKeyValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ReadModelMemberTypeValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ReadsParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ReadsParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/RedeliveryValues.js.map +1 -1
- package/dist/bundles/compiler/Parsing/RefusalDeclarations.js +1 -1
- package/dist/bundles/compiler/Parsing/RefusalDeclarations.js.map +1 -1
- package/dist/bundles/compiler/Parsing/RefusalValueWalker.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ResponseCommandResolver.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ResponseDateValues.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ResponseValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/ResponseValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ScreenParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ScreenParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ScreenplayParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ScreenplayParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SeedParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SeedParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SliceParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SliceParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SourceLine.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SourceLineSplitter.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SourceOptionsParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SourceOptionsParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCaseParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCaseParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCaseValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCaseValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCommandExamples.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCommandExamples.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationExampleParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationExampleParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationRedeliveryValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationRedeliveryValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationResponseParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationResponseParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationRouteComparison.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationRouteComparison.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationStreamValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationStreamValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/StateMachineParser.js +1 -1
- package/dist/bundles/compiler/Parsing/StateMachineParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/StructuralInteractionSites.js.map +1 -1
- package/dist/bundles/compiler/Parsing/StructuredBlockParser.js +1 -1
- package/dist/bundles/compiler/Parsing/StructuredBlockParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/StructuredValueParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/TemplateReferenceText.js +1 -1
- package/dist/bundles/compiler/Parsing/TemplateReferenceText.js.map +1 -1
- package/dist/bundles/compiler/Parsing/TriggerDataParser.js +1 -1
- package/dist/bundles/compiler/Parsing/TriggerDataParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/UiBindingParser.js +1 -1
- package/dist/bundles/compiler/Parsing/UiBindingParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/UiProfileLegacyLayout.js +1 -1
- package/dist/bundles/compiler/Parsing/UiProfileLegacyLayout.js.map +1 -1
- package/dist/bundles/compiler/Parsing/WorkflowParser.js +1 -1
- package/dist/bundles/compiler/Parsing/WorkflowParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/checkPortableMatchPattern.js.map +1 -1
- package/dist/bundles/compiler/Parsing/hasExponentialMatchAmbiguity.js.map +1 -1
- package/dist/bundles/compiler/Parsing/trimMatchAmbiguityGraph.js.map +1 -1
- package/dist/bundles/compiler/ScreenActionSubjects.js.map +1 -1
- package/dist/bundles/compiler/ScreenplayCompiler.js +1 -1
- package/dist/bundles/compiler/ScreenplayCompiler.js.map +1 -1
- package/dist/bundles/compiler/Syntax/ActionSubjectInvariants.js.map +1 -1
- package/dist/bundles/compiler/Syntax/AuthoringProductionResolver.js.map +1 -1
- package/dist/bundles/compiler/Syntax/CaptureEventsSource.js.map +1 -1
- package/dist/bundles/compiler/Syntax/DependencySources.js.map +1 -1
- package/dist/bundles/compiler/Syntax/EventDeclarations.js.map +1 -1
- package/dist/bundles/compiler/Syntax/EventSourceCatalog.js.map +1 -1
- package/dist/bundles/compiler/Syntax/EventSourceReadConfidence.js.map +1 -1
- package/dist/bundles/compiler/Syntax/ExactMathFacts.js.map +1 -1
- package/dist/bundles/compiler/Syntax/ExactNumber.js.map +1 -1
- package/dist/bundles/compiler/Syntax/InvalidSyntaxJson.js.map +1 -1
- package/dist/bundles/compiler/Syntax/LegacyWireProjection.js.map +1 -1
- package/dist/bundles/compiler/Syntax/Operations.js.map +1 -1
- package/dist/bundles/compiler/Syntax/PersonaCallers.js.map +1 -1
- package/dist/bundles/compiler/Syntax/ProductionDestinations.js.map +1 -1
- package/dist/bundles/compiler/Syntax/PublicEventInvariants.js.map +1 -1
- package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js +1 -1
- package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js.map +1 -1
- package/dist/bundles/compiler/Syntax/SourceOptions.js.map +1 -1
- package/dist/bundles/compiler/Syntax/SpecificationCaseOrigin.js.map +1 -1
- package/dist/bundles/compiler/Syntax/StreamIdFormatter.js.map +1 -1
- package/dist/bundles/compiler/Syntax/StrictSyntaxJson.js +1 -1
- package/dist/bundles/compiler/Syntax/Structure.js.map +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxCollections.js +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxCollections.js.map +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxInvariants.js +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxInvariants.js.map +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxJson.js +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxJson.js.map +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxMemberContracts.js.map +1 -1
- package/dist/bundles/compiler/Syntax/index.js +1 -1
- package/dist/bundles/compiler/Text/ImplementationHintText.js.map +1 -1
- package/dist/bundles/compiler/Text/ReservedWords.js.map +1 -1
- package/dist/bundles/compiler/Text/SourceStreamNames.js.map +1 -1
- package/dist/bundles/compiler/Text/StringLiteral.js.map +1 -1
- package/dist/bundles/compiler/Text/ordinalIgnoreCaseKey.js.map +1 -1
- package/dist/bundles/compiler/Text/patterns.js.map +1 -1
- package/dist/bundles/compiler/index.js +1 -1
- package/dist/bundles/completion-items.js +18 -17
- package/dist/bundles/completion-items.js.map +1 -1
- package/dist/bundles/completion-planner.js +2 -2
- package/dist/bundles/completion-planner.js.map +1 -1
- package/dist/bundles/completions.js +1 -1
- package/dist/bundles/completions.js.map +1 -1
- package/dist/bundles/continuation-responses.js +1 -1
- package/dist/bundles/continuation-responses.js.map +1 -1
- package/dist/bundles/declarations.js.map +1 -1
- package/dist/bundles/dependency-completions.js.map +1 -1
- package/dist/bundles/dependency-target-analysis.js.map +1 -1
- package/dist/bundles/diagnostic-codes.js +1 -1
- package/dist/bundles/diagnostic-codes.js.map +1 -1
- package/dist/bundles/diagnostics.js +1 -1
- package/dist/bundles/diagnostics.js.map +1 -1
- package/dist/bundles/document-context.js.map +1 -1
- package/dist/bundles/documentation-item.js.map +1 -1
- package/dist/bundles/event-analysis-source.js.map +1 -1
- package/dist/bundles/event-context-catalog.js.map +1 -1
- package/dist/bundles/event-context.js.map +1 -1
- package/dist/bundles/event-source-authoring.js +11 -11
- package/dist/bundles/event-source-authoring.js.map +1 -1
- package/dist/bundles/example-analysis.js +2 -2
- package/dist/bundles/example-analysis.js.map +1 -1
- package/dist/bundles/example-authoring.js +2 -2
- package/dist/bundles/example-authoring.js.map +1 -1
- package/dist/bundles/example-declaration-items.js.map +1 -1
- package/dist/bundles/example-values.js.map +1 -1
- package/dist/bundles/file-imports.js.map +1 -1
- package/dist/bundles/file-references.js.map +1 -1
- package/dist/bundles/generation-completions.js.map +1 -1
- package/dist/bundles/hover-content.js +5 -5
- package/dist/bundles/hover-content.js.map +1 -1
- package/dist/bundles/hover.js.map +1 -1
- package/dist/bundles/index.js +1 -1
- package/dist/bundles/index.js.map +1 -1
- package/dist/bundles/inlay-hints.js.map +1 -1
- package/dist/bundles/inline-completions.js +1 -1
- package/dist/bundles/inline-completions.js.map +1 -1
- package/dist/bundles/inline-event-validation.js +1 -1
- package/dist/bundles/inline-event-validation.js.map +1 -1
- package/dist/bundles/keyword-docs.js +1 -1
- package/dist/bundles/keyword-docs.js.map +1 -1
- package/dist/bundles/language.js +1 -1
- package/dist/bundles/language.js.map +1 -1
- package/dist/bundles/named-rule-context.js.map +1 -1
- package/dist/bundles/operation-authoring.js +6 -6
- package/dist/bundles/operation-authoring.js.map +1 -1
- package/dist/bundles/persona-analysis.js +1 -1
- package/dist/bundles/persona-analysis.js.map +1 -1
- package/dist/bundles/production-destinations.js +1 -1
- package/dist/bundles/production-destinations.js.map +1 -1
- package/dist/bundles/purpose-items.js.map +1 -1
- package/dist/bundles/reaction-authoring.js +3 -3
- package/dist/bundles/reaction-authoring.js.map +1 -1
- package/dist/bundles/read-model-key-completions.js +1 -1
- package/dist/bundles/read-model-key-completions.js.map +1 -1
- package/dist/bundles/refusal-context.js.map +1 -1
- package/dist/bundles/response-analysis.js +1 -1
- package/dist/bundles/response-analysis.js.map +1 -1
- package/dist/bundles/response-completions.js +1 -1
- package/dist/bundles/response-completions.js.map +1 -1
- package/dist/bundles/response-tokens.js +2 -2
- package/dist/bundles/response-tokens.js.map +1 -1
- package/dist/bundles/scope-items.js +3 -3
- package/dist/bundles/scope-items.js.map +1 -1
- package/dist/bundles/structure-completions.js.map +1 -1
- package/dist/bundles/sub-language-registry.js.map +1 -1
- package/dist/bundles/sub-languages/capture/CompletionProvider.js.map +1 -1
- package/dist/bundles/sub-languages/capture/HoverProvider.js.map +1 -1
- package/dist/bundles/sub-languages/capture/Validator.js.map +1 -1
- package/dist/bundles/sub-languages/capture/index.js.map +1 -1
- package/dist/bundles/sub-languages/capture/language.js.map +1 -1
- package/dist/bundles/sub-languages/cdl.js.map +1 -1
- package/dist/bundles/sub-languages/pdl.js.map +1 -1
- package/dist/bundles/sub-languages/projection/CodeActionProvider.js.map +1 -1
- package/dist/bundles/sub-languages/projection/CompletionProvider.js +1 -1
- package/dist/bundles/sub-languages/projection/CompletionProvider.js.map +1 -1
- package/dist/bundles/sub-languages/projection/HoverProvider.js.map +1 -1
- package/dist/bundles/sub-languages/projection/Validator.js.map +1 -1
- package/dist/bundles/sub-languages/projection/index.js.map +1 -1
- package/dist/bundles/sub-languages/projection/language.js.map +1 -1
- package/dist/bundles/symbols.js +2 -2
- package/dist/bundles/symbols.js.map +1 -1
- package/dist/bundles/themes/screenplay-dark.js.map +1 -1
- package/dist/bundles/themes/screenplay-light.js.map +1 -1
- package/dist/bundles/tokens.js +1 -1
- package/dist/bundles/tokens.js.map +1 -1
- package/dist/bundles/validation.js +2 -2
- package/dist/bundles/validation.js.map +1 -1
- package/dist/completion-items.d.ts +1 -0
- package/dist/completion-items.d.ts.map +1 -1
- package/dist/completion-planner.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/scope-items.d.ts.map +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +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"}
|
|
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,E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import"./_virtual/_virtual/_rolldown/runtime.js";import{
|
|
2
|
-
`)}].map(e=>({...e,lines:e.source.split(/\r?\n/),symbols:
|
|
3
|
-
`),c=
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{enclosingChain as e,fenceMap as t,indentOf as n,withoutComment as r}from"./document-context.js";import{directBody as i,propertyTypeReference as a,scanDocument as o}from"./symbols.js";import{typeReferenceText as s}from"./TypeReferenceSymbol.js";function reactionReferenceAt(c,l,u,d,f){let p=t(c);if(p[l])return null;let m=r(c[l]??``),h=m.match(/^\s*when\s+([A-Za-z_][\p{L}\p{Mn}\p{Nd}\p{Pc}]*)\s*$/u);if(!h||e(c,p,l,n(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:o(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:r,declaration:a}=e[0],o=i(r.lines,t(r.lines),a.line,n(r.lines[a.line])),s=[r.lines[a.line].trim(),...o.map(e=>r.lines[e].trim())].join(`
|
|
3
|
+
`),c=r.lines[a.line].match(/\b(?:event|trigger)\s+/);return{name:g,content:`\`\`\`screenplay\n${s}\n\`\`\``,target:{name:g,location:{path:r.path,line:a.line+1,column:c.index+c[0].length+1},source:r.source}}};if(b.length>0)return selected(b);if(f?.authoringDocuments===void 0){let e=f?.events.filter(e=>e.name===g)??[];if(e.length>0){let t=Math.max(...e.map(e=>e.generation??1)),n=e.filter(e=>(e.generation??1)===t);return{name:g,content:n.length===1?`\`\`\`screenplay\nevent ${g}\n${n[0].properties.map(e=>`${e.name} ${s(a(e))}`).join(`
|
|
4
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
5
|
//# sourceMappingURL=reaction-authoring.js.map
|
|
@@ -1 +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,CAAK,EAC7B,GAAIF,EAAOG,GAAY,OAAO,KAC9B,IAAMC,EAAOC,EAAeH,EAAMC,IAAc,EAAE,EAC5CG,EAAQF,EAAK,MAAM,uDAAuD,EAChF,GAAI,CAACE,GAASC,EAAeL,EAAOF,EAAQG,EAAWK,EAASJ,CAAI,CAAC,CAAC,CAAC,KAAO,WAAY,OAAO,KACjG,IAAMK,EAAOH,EAAM,GACbI,EAASN,EAAK,QAAQK,EAAML,EAAK,QAAQ,MAAM,EAAI,CAAC,EAAI,EAC9D,GAAIO,IAAgBD,GAAUE,IAAcF,EAASD,EAAK,OAAQ,OAAO,KACzE,IAAMI,EAAUC,GAAa,eAAiB,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AAE,EAAG,OAAQX,EAAS,MAAO,CAAE,CAC3N,EACA,GAAIE,EAAO,OAAS,EAAG,OAAO,SAASA,CAAM,EAG7C,GAAIJ,GAAa,qBAAuB,IAAA,GAAW,CAC/C,IAAMc,EAAQd,GAAa,OAAO,OAAO,GAASM,EAAM,OAASX,CAAI,GAAK,CAAC,EAC3E,GAAImB,EAAM,OAAS,EAAG,CAClB,IAAMP,EAAa,KAAK,IAAI,GAAGO,EAAM,IAAI,GAASR,EAAM,YAAc,CAAC,CAAC,EAClEP,EAAUe,EAAM,OAAO,IAAUR,EAAM,YAAc,KAAOC,CAAU,EAE5E,MAAO,CAAE,OAAM,QADCR,EAAQ,SAAW,EAAI,2BAA2BJ,EAAK,IAAII,EAAQ,EAAE,CAAC,WAAW,IAAI,GAAY,GAAGgB,EAAS,KAAK,GAAGC,EAAkBC,EAAsBF,CAAQ,CAAC,GAAG,CAAC,CAAC,KAAK;CAAI,EAAE,UAAY,KAC1L,OAAQ,IAAK,CACzC,CACJ,CACA,IAAMG,EAAU,CAAC,GAAGjB,EAAQ,QAAQ,GAAYC,EAAS,QAAQ,OAAO,EAAG,GAAIF,GAAa,qBAAuB,IAAA,GAAYA,GAAa,SAAW,CAAC,EAAI,CAAC,CAAE,CAAC,CAAC,OAAO,GAAYmB,EAAS,YAAcxB,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"}
|
|
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":"A,4SAUA,SAAgB,oBAAoB,EAAiB,EAAmB,EAAqB,EAAmB,EAAyD,CACrK,IAAMA,EAASC,EAASC,CAAK,EAC7B,GAAIF,EAAOG,GAAY,OAAO,KAC9B,IAAMC,EAAOC,EAAeH,EAAMC,IAAc,EAAE,EAC5CG,EAAQF,EAAK,MAAM,uDAAuD,EAChF,GAAI,CAACE,GAASC,EAAeL,EAAOF,EAAQG,EAAWK,EAASJ,CAAI,CAAC,CAAC,CAAC,KAAO,WAAY,OAAO,KACjG,IA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C,CAAC,IAAI,IAAY,CAAE,WAAU,YAAayB,CAAQ,EAAE,CAC5I,CAAC,CAC5B,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./_virtual/_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{responseAnalysis as e}from"./response-analysis.js";import{enclosingHeaders as t,fenceMap as n,indentOf as r}from"./document-context.js";function readModelKeyCompletions(i,a,o,s){let c=t(i,n(i),a,r(o));if(c[0]!==`by`)return null;let l=c[1]??``,u=l.match(/^reads\s+([\w.]+)/),d=l.match(/^query\s+\w+\s*=>\s*(?:observable\s+)?([\w.]+)/);if(!u&&!d)return null;let f=e(i,s.authoringDocuments??s.authoringSources??[],s.authoringPlacement,s.authoringPath,s.authoringPlacementResolved),p=u?.[1]??d?.[1],m=f.readModels.filter(({model:e,scope:t})=>e.name===p||[...t,e.name].join(`.`)===p);return m.length===1?m[0].model.properties.filter(e=>e.isKey).map(e=>({label:e.name,insertText:u?`${e.name} = \${1:${e.name}}`:`${e.name} ${e.type.name}`,documentation:u?`Supply this key part by name. Composite protected command reads remain refused (PLAY0781 ByParts).`:`Supply every read-model key part by name for an optional single-instance query. Collection queries use equality filters instead of a by block.`})):[]}export{readModelKeyCompletions};
|
|
2
2
|
//# sourceMappingURL=read-model-key-completions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-model-key-completions.js","names":["headers","enclosingHeaders","lines","fenceMap","line","indentOf","before","owner","read","query","analysis","responseAnalysis","symbols","name","models","model","scope","property","part"],"sources":["../../read-model-key-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 { responseAnalysis } from './response-analysis';\nimport { DocumentSymbols } from './symbols';\nimport { CompletionEntry } from './completion-items';\nimport { enclosingHeaders, fenceMap, indentOf } from './document-context';\n\nexport function readModelKeyCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n const headers = enclosingHeaders(lines, fenceMap(lines), line, indentOf(before));\n if (headers[0] !== 'by') return null;\n const owner = headers[1] ?? '';\n const read = owner.match(/^reads\\s+([\\w.]+)/);\n const query = owner.match(/^query\\s+\\w+\\s*=>\\s*(?:observable\\s+)?([\\w.]+)/);\n if (!read && !query) return null;\n const analysis = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources ?? [], symbols.authoringPlacement, symbols.authoringPath, symbols.authoringPlacementResolved);\n const name = read?.[1] ?? query?.[1];\n const models = analysis.readModels.filter(({ model, scope }) => model.name === name || [...scope, model.name].join('.') === name);\n if (models.length !== 1) return [];\n const parts = models[0].model.properties.filter(property => property.isKey);\n return parts.map(part => ({ label: part.name, insertText: read ? `${part.name} = \\${1:${part.name}}` : `${part.name} ${part.type.name}`, documentation: read ? 'Supply this key part by name. Composite protected command reads remain refused (PLAY0781 ByParts).' : 'Supply every read-model key part by name for an optional single-instance query. Collection queries use equality filters instead of a by block.' }));\n}\n"],"mappings":"gMAQA,SAAgB,wBAAwB,EAAiB,EAAc,EAAgB,EAAoD,CACvI,IAAMA,EAAUC,EAAiBC,EAAOC,EAASD,CAAK,EAAGE,EAAMC,EAASC,CAAM,CAAC,EAC/E,GAAIN,EAAQ,KAAO,KAAM,OAAO,KAChC,IAAMO,EAAQP,EAAQ,IAAM,GACtBQ,EAAOD,EAAM,MAAM,mBAAmB,EACtCE,EAAQF,EAAM,MAAM,gDAAgD,EAC1E,GAAI,CAACC,GAAQ,CAACC,EAAO,OAAO,KAC5B,IAAMC,EAAWC,EAAiBT,EAAOU,EAAQ,oBAAsBA,EAAQ,kBAAoB,CAAC,EAAGA,EAAQ,mBAAoBA,EAAQ,cAAeA,EAAQ,0BAA0B,EACtLC,EAAOL,IAAO,IAAMC,IAAQ,GAC5BK,EAASJ,EAAS,WAAW,QAAQ,CAAE,QAAO,WAAYK,EAAM,OAASF,GAAQ,CAAC,GAAGG,EAAOD,EAAM,IAAI,CAAC,CAAC,KAAK,GAAG,IAAMF,CAAI,EAGhI,OAFIC,EAAO,SAAW,EACRA,EAAO,EAAE,CAAC,MAAM,WAAW,OAAO,GAAYG,EAAS,KAC1D,CAAC,CAAC,IAAI,IAAS,CAAE,MAAOC,EAAK,KAAM,WAAYV,EAAO,GAAGU,EAAK,KAAK,UAAUA,EAAK,KAAK,GAAK,GAAGA,EAAK,KAAK,GAAGA,EAAK,KAAK,OAAQ,cAAeV,EAAO,qGAAuG,gJAAiJ,EAAE,EAFzX,CAAC,CAGrC"}
|
|
1
|
+
{"version":3,"file":"read-model-key-completions.js","names":["headers","enclosingHeaders","lines","fenceMap","line","indentOf","before","owner","read","query","analysis","responseAnalysis","symbols","name","models","model","scope","property","part"],"sources":["../../read-model-key-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 { responseAnalysis } from './response-analysis';\nimport { DocumentSymbols } from './symbols';\nimport { CompletionEntry } from './completion-items';\nimport { enclosingHeaders, fenceMap, indentOf } from './document-context';\n\nexport function readModelKeyCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n const headers = enclosingHeaders(lines, fenceMap(lines), line, indentOf(before));\n if (headers[0] !== 'by') return null;\n const owner = headers[1] ?? '';\n const read = owner.match(/^reads\\s+([\\w.]+)/);\n const query = owner.match(/^query\\s+\\w+\\s*=>\\s*(?:observable\\s+)?([\\w.]+)/);\n if (!read && !query) return null;\n const analysis = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources ?? [], symbols.authoringPlacement, symbols.authoringPath, symbols.authoringPlacementResolved);\n const name = read?.[1] ?? query?.[1];\n const models = analysis.readModels.filter(({ model, scope }) => model.name === name || [...scope, model.name].join('.') === name);\n if (models.length !== 1) return [];\n const parts = models[0].model.properties.filter(property => property.isKey);\n return parts.map(part => ({ label: part.name, insertText: read ? `${part.name} = \\${1:${part.name}}` : `${part.name} ${part.type.name}`, documentation: read ? 'Supply this key part by name. Composite protected command reads remain refused (PLAY0781 ByParts).' : 'Supply every read-model key part by name for an optional single-instance query. Collection queries use equality filters instead of a by block.' }));\n}\n"],"mappings":"A,gMAQA,SAAgB,wBAAwB,EAAiB,EAAc,EAAgB,EAAoD,CACvI,IAAMA,EAAUC,EAAiBC,EAAOC,EAASD,CAAK,EAAGE,EAAMC,EAASC,CAAM,CAAC,EAC/E,GAAIN,EAAQ,KAAO,KAAM,OAAO,KAChC,IAAMO,EAAQP,EAAQ,IAAM,GACtBQ,EAAOD,EAAM,MAAM,mBAAmB,EACtCE,EAAQF,EAAM,MAAM,gDAAgD,EAC1E,GAAI,CAACC,GAAQ,CAACC,EAAO,OAAO,KAC5B,IAAMC,EAAWC,EAAiBT,EAAOU,EAAQ,oBAAsBA,EAAQ,kBAAoB,CAAC,EAAGA,EAAQ,mBAAoBA,EAAQ,cAAeA,EAAQ,0BAA0B,EACtLC,EAAOL,IAAO,IAAMC,IAAQ,GAC5BK,EAASJ,EAAS,WAAW,QAAQ,CAAE,QAAO,WAAYK,EAAM,OAASF,GAAQ,CAAC,GAAGG,EAAOD,EAAM,IAAI,CAAC,CAAC,KAAK,GAAG,IAAMF,CAAI,EAGhI,OAFIC,EAAO,SAAW,EACRA,EAAO,EAAE,CAAC,MAAM,WAAW,OAAO,GAAYG,EAAS,KAC1D,CAAC,CAAC,IAAI,IAAS,CAAE,MAAOC,EAAK,KAAM,WAAYV,EAAO,GAAGU,EAAK,KAAK,UAAUA,EAAK,KAAK,GAAK,GAAGA,EAAK,KAAK,GAAGA,EAAK,KAAK,OAAQ,cAAeV,EAAO,qGAAuG,gJAAiJ,EAAE,EAFzX,CAAC,CAGrC,C"}
|
|
@@ -1 +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"}
|
|
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":"A,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,C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import"./_virtual/_virtual/_rolldown/runtime.js";import{AuthoringProductionResolver as e}from"./compiler/Syntax/AuthoringProductionResolver.js";import{dependencySourcesOf as t}from"./compiler/Syntax/DependencySources.js";import{responseCommandResolver as n}from"./compiler/Parsing/ResponseCommandResolver.js";import{parseForAuthoring as r}from"./compiler/ScreenplayCompiler.js";import{EventSourceReadConfidence as i}from"./compiler/Syntax/EventSourceReadConfidence.js";import{parsePlacedDocuments as a}from"./compiler/Files/PlayApplicationAssembly.js";import"./compiler/index.js";import{fenceMap as o,indentOf as s,withoutComment as c}from"./document-context.js";import{exampleAnalysis as l}from"./example-analysis.js";import{personaAnalysis as u}from"./persona-analysis.js";import{dependencyTargetAnalysis as d}from"./dependency-target-analysis.js";const f=`Executable as ESM v7. Generated values require fixtures in reference execution; other unadmitted constructs still prevent binding.`,p=/* @__PURE__ */ new Map;function authoringSource(e,t){let n=o(e),r=e.flatMap((e,t)=>!n[t]&&s(e)===0&&/^\w/.test(e)&&!/^(?:time\s+zone\b|reaction\s+batches\b|command\s+reads\s+(?!\/\/)\S+)/.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 i=[],a=[],c=!1;e.forEach((e,t)=>{!n[t]&&s(e)===0&&/^\w/.test(e)&&(c=/^(?:concept|type|import|domain|system|eventsource|policy|persona|identity|time\s+zone|reaction\s+batches|command\s+reads(?=\s+(?!\/\/)\S))\b/.test(e)),(c?i:a).push(t)});let l=r.includes(`feature`)?1:r.includes(`slice`)?2:3,u=t.slice(0,l);return{source:[...i.map(t=>e[t]),...u,...a.map(t=>` `.repeat(l*2)+e[t])].join(`
|
|
2
|
+
`),locations:e.map((e,t)=>({line:t+1,column:0}))};let i=[],a=[],c=!1;e.forEach((e,t)=>{!n[t]&&s(e)===0&&/^\w/.test(e)&&(c=/^(?:concept|type|import|domain|system|eventsource|policy|persona|identity|context|time\s+zone|reaction\s+batches|command\s+reads(?=\s+(?!\/\/)\S))\b/.test(e)),(c?i:a).push(t)});let l=r.includes(`feature`)?1:r.includes(`slice`)?2:3,u=t.slice(0,l);return{source:[...i.map(t=>e[t]),...u,...a.map(t=>` `.repeat(l*2)+e[t])].join(`
|
|
3
3
|
`),locations:[...i.map(e=>({line:e+1,column:0})),...u.map(()=>({line:0,column:0})),...a.map(e=>({line:e+1,column:l*2}))]}}function analyze(f,p,m,h=`current.play`,g=!0){let _=p.map((e,t)=>typeof e==`string`?{path:`other-${t}.play`,source:e}:e).filter(e=>e.path!==h),v=[{path:h,source:f.join(`
|
|
4
4
|
`),placement:m,isPlacementResolved:g},..._],y=new Set(v.flatMap(e=>[...e.source.matchAll(/\w+/g)].map(e=>e[0]).concat(e.placement??[]))),fresh=e=>{let t=e;for(let n=1;y.has(t);n++)t=`${e}${n}`;return y.add(t),t},b=fresh(`EditorAuthoring`),x=fresh(`FragmentFeature`),S=/* @__PURE__ */ new Set([b,x]),C=v.map((e,t)=>{let n=t===0?f:e.source.split(`
|
|
5
5
|
`),r=fresh(`Fragment${t}`);S.add(r);let i=e.placement?.length?{source:e.source,locations:n.map((e,t)=>({line:t+1,column:0}))}:authoringSource(n,[`module ${b}`,` feature ${x}`,` slice StateChange ${r}`]);return{...e,...i,placement:e.placement??[]}}),w=C[0],ee=new Map(C.map(e=>[e.path,e.locations])),T=a([...C.slice(1),w],void 0,!0),E=/* @__PURE__ */ new Map,D=/* @__PURE__ */ new Map,O=/* @__PURE__ */ new WeakSet,walk=e=>{if(typeof e!=`object`||!e||O.has(e))return;if(O.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=ee.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===h&&(t.kind===`CommandSyntax`&&E.set(t.location.line-1,e),t.kind===`SpecificationSyntax`&&D.set(t.location.line-1,e))}};walk(T.value),walk(T.physicalEventSources),walk(T.continuationValues);for(let e of T.diagnostics)walk(e.location);let k=T.diagnostics.some(e=>{if(![`PLAY0022`,`PLAY0024`,`PLAY0029`].includes(e.code))return!1;let t=C.find(t=>t.path===e.location.path),n=v.find(t=>t.path===e.location.path)?.source.split(`
|
|
@@ -1 +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","reducer","dependencySourcesOf","slice","operationProductionLines","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","commandSlices","observer","examples","exampleAnalysis","routeOwners","event","eventSources","candidate","dependencyAnalysis","dependencies","localDependencies","parseForAuthoring","dependencyTargetAnalysis","qualifier","placement","resolveCommand","responseCommandResolver","continuationResponses","use","fields","properties","property","response","returned","field","type","detail","personaAnalysis","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, dependencySourcesOf, Diagnostic, EventSourceReadConfidence, FeatureSyntax, OperationSyntax, parseForAuthoring, parsePlacedDocuments, responseCommandResolver, SpecificationSyntax } from '@cratis/screenplay-compiler';\nimport { fenceMap, indentOf, withoutComment } from './document-context';\nimport { ResponseAnalysis } from './ResponseAnalysis';\nimport { ContinuationResponseField } from './ContinuationResponseField';\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 { AuthoredReadModelKeys } from './AuthoredReadModelKeys';\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) && !/^(?:time\\s+zone\\b|reaction\\s+batches\\b|command\\s+reads\\s+(?!\\/\\/)\\S+)/.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|time\\s+zone|reaction\\s+batches|command\\s+reads(?=\\s+(?!\\/\\/)\\S))\\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 readModels: readonly AuthoredReadModelKeys[]; 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 // Editor context can omit imported declarations. Defer only those missing types; imports whose\n // targets are present in the merged inventory still receive declaration-dependent validation.\n const parsed = parsePlacedDocuments([...preparedDocuments.slice(1), prepared], undefined, true);\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 walk(parsed.continuationValues);\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 for (const { slice } of productions.slices) for (const reducer of dependencySourcesOf(slice).reducers ?? []) walk(reducer);\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, EventSourceAnalysis['contexts'] extends ReadonlyMap<number, infer Context> ? Context : never>();\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 commandSlices = new Map(productions.slices.flatMap(({ slice }) => slice.commands.map(command => [command, slice] as const)));\n for (const command of commands.values()) {\n const slice = commandSlices.get(command);\n if (!slice) continue;\n for (const production of command.produces) {\n if (!productions.isEventProduction(production, slice)) continue;\n for (const line of range(production.location.line - 1)) sourceContexts.set(line, { command, production: true });\n if (production.stream) {\n routes.push(production.stream);\n for (const line of range(production.stream.location.line - 1)) sourceContexts.set(line, { command, production: true, route: production.stream });\n }\n }\n }\n for (const { slice } of productions.slices) {\n for (const observer of [...slice.reactions, ...dependencySourcesOf(slice).reducers ?? []].filter(observer => observer.location.path === path && observer.location.line > 0)) {\n for (const line of range(observer.location.line - 1)) sourceContexts.set(line, { observer });\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 resolveCommand = responseCommandResolver(productions.slices.flatMap(({ slice, scope }) => slice.commands.map(command => ({ command, scope }))), parsed.value.imports);\n const continuationResponses = new Map<number, readonly ContinuationResponseField[]>();\n for (const use of parsed.continuationValues.filter(use => use.location.path === path)) {\n const fields = new Map<string, ContinuationResponseField>();\n for (const name of [...use.success].reverse().filter(name => !use.parameters.includes(name))) {\n const command = resolveCommand(name, use.scope);\n if (!command?.response) continue;\n const properties = new Map(command.properties.map(property => [property.name, property.type]));\n const response = command.response;\n const returned = response.kind === 'ScalarCommandResponseSyntax' ? [{ name: response.source.property, source: response.source, type: null }] : response.fields;\n for (const field of returned) {\n const type = field.type ?? properties.get(field.source.property);\n if (type && !use.locals.includes(field.name) && !fields.has(field.name)) fields.set(field.name, { name: field.name, type, command: command.name });\n }\n }\n continuationResponses.set(use.location.line - 1, [...fields.values()]);\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, continuationResponses, commands, specifications, diagnostics, operationProductionLines, operations, eventSources, readModels: productions.slices.flatMap(({ slice, scope }) => (slice.readModels ?? []).map(model => ({ model, scope: scope.filter(segment => !syntheticScopes.has(segment)) }))), 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 readModels: readonly AuthoredReadModelKeys[]; 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":"k1BA6BA,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,GAAK,CAAC,wEAAwE,KAAKA,CAAI,EAAI,CAACA,EAAK,MAAM,KAAK,CAAC,CAAC,EAAE,EAAI,CAAC,CAAC,EAC5N,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,UAA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iB,EAAiB,EAAwD,CAAC,EAAG,EAA+B,EAAO,eAAgB,EAAsB,GAAuU,CAC7f,IAAM+E,EAAM,KAAK,UAAU,CAAC/E,EAAOa,EAAcwF,EAAWtF,EAAMoG,CAAmB,CAAC,EAClFC,EAAWvH,EAAU,IAAIkF,CAAG,EAMhC,OALIqC,IAAa,IAAA,KACb,EAAW,QAAQpH,EAAOa,EAAcwF,EAAWtF,EAAMoG,CAAmB,EACxEtH,EAAU,MAAQ,IAAIA,EAAU,OAAOA,EAAU,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAM,EACzEA,EAAU,IAAIkF,EAAKqC,CAAQ,GAExBA,CACX"}
|
|
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","reducer","dependencySourcesOf","slice","operationProductionLines","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","commandSlices","observer","examples","exampleAnalysis","routeOwners","event","eventSources","candidate","dependencyAnalysis","dependencies","localDependencies","parseForAuthoring","dependencyTargetAnalysis","qualifier","placement","resolveCommand","responseCommandResolver","continuationResponses","use","fields","properties","property","response","returned","field","type","detail","personaAnalysis","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, dependencySourcesOf, Diagnostic, EventSourceReadConfidence, FeatureSyntax, OperationSyntax, parseForAuthoring, parsePlacedDocuments, responseCommandResolver, SpecificationSyntax } from '@cratis/screenplay-compiler';\nimport { fenceMap, indentOf, withoutComment } from './document-context';\nimport { ResponseAnalysis } from './ResponseAnalysis';\nimport { ContinuationResponseField } from './ContinuationResponseField';\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 { AuthoredReadModelKeys } from './AuthoredReadModelKeys';\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) && !/^(?:time\\s+zone\\b|reaction\\s+batches\\b|command\\s+reads\\s+(?!\\/\\/)\\S+)/.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|context|time\\s+zone|reaction\\s+batches|command\\s+reads(?=\\s+(?!\\/\\/)\\S))\\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 readModels: readonly AuthoredReadModelKeys[]; 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 // Editor context can omit imported declarations. Defer only those missing types; imports whose\n // targets are present in the merged inventory still receive declaration-dependent validation.\n const parsed = parsePlacedDocuments([...preparedDocuments.slice(1), prepared], undefined, true);\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 walk(parsed.continuationValues);\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 for (const { slice } of productions.slices) for (const reducer of dependencySourcesOf(slice).reducers ?? []) walk(reducer);\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, EventSourceAnalysis['contexts'] extends ReadonlyMap<number, infer Context> ? Context : never>();\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 commandSlices = new Map(productions.slices.flatMap(({ slice }) => slice.commands.map(command => [command, slice] as const)));\n for (const command of commands.values()) {\n const slice = commandSlices.get(command);\n if (!slice) continue;\n for (const production of command.produces) {\n if (!productions.isEventProduction(production, slice)) continue;\n for (const line of range(production.location.line - 1)) sourceContexts.set(line, { command, production: true });\n if (production.stream) {\n routes.push(production.stream);\n for (const line of range(production.stream.location.line - 1)) sourceContexts.set(line, { command, production: true, route: production.stream });\n }\n }\n }\n for (const { slice } of productions.slices) {\n for (const observer of [...slice.reactions, ...dependencySourcesOf(slice).reducers ?? []].filter(observer => observer.location.path === path && observer.location.line > 0)) {\n for (const line of range(observer.location.line - 1)) sourceContexts.set(line, { observer });\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 resolveCommand = responseCommandResolver(productions.slices.flatMap(({ slice, scope }) => slice.commands.map(command => ({ command, scope }))), parsed.value.imports);\n const continuationResponses = new Map<number, readonly ContinuationResponseField[]>();\n for (const use of parsed.continuationValues.filter(use => use.location.path === path)) {\n const fields = new Map<string, ContinuationResponseField>();\n for (const name of [...use.success].reverse().filter(name => !use.parameters.includes(name))) {\n const command = resolveCommand(name, use.scope);\n if (!command?.response) continue;\n const properties = new Map(command.properties.map(property => [property.name, property.type]));\n const response = command.response;\n const returned = response.kind === 'ScalarCommandResponseSyntax' ? [{ name: response.source.property, source: response.source, type: null }] : response.fields;\n for (const field of returned) {\n const type = field.type ?? properties.get(field.source.property);\n if (type && !use.locals.includes(field.name) && !fields.has(field.name)) fields.set(field.name, { name: field.name, type, command: command.name });\n }\n }\n continuationResponses.set(use.location.line - 1, [...fields.values()]);\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, continuationResponses, commands, specifications, diagnostics, operationProductionLines, operations, eventSources, readModels: productions.slices.flatMap(({ slice, scope }) => (slice.readModels ?? []).map(model => ({ model, scope: scope.filter(segment => !syntheticScopes.has(segment)) }))), 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 readModels: readonly AuthoredReadModelKeys[]; 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":"A,k1BA6BA,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,GAAK,CAAC,wEAAwE,KA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AY,eAAc,WAAYtE,EAAY,OAAO,SAAS,CAAE,QAAO,YAAaI,EAAM,YAAc,CAAC,EAAA,CAAG,IAAI,IAAU,CAAE,QAAO,MAAOiB,EAAM,OAAO,GAAW,CAACxC,EAAgB,IAAI+B,CAAO,CAAC,CAAE,EAAE,CAAC,EAAG,WAAU,SAAU2D,EAAgBpF,EAAO,MAAO9B,CAAK,EAAG,cAAa,CACxY,CAEA,SAAgB,iBAAiB,EAAiB,EAAwD,CAAC,EAAG,EAA+B,EAAO,eAAgB,EAAsB,GAAuU,CAC7f,IAAM+E,EAAM,KAAK,UAAU,CAAC/E,EAAOa,EAAcwF,EAAWtF,EAAMoG,CAAmB,CAAC,EAClFC,EAAWvH,EAAU,IAAIkF,CAAG,EAMhC,OALIqC,IAAa,IAAA,KACb,EAAW,QAAQpH,EAAOa,EAAcwF,EAAWtF,EAAMoG,CAAmB,EACxEtH,EAAU,MAAQ,IAAIA,EAAU,OAAOA,EAAU,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAM,EACzEA,EAAU,IAAIkF,EAAKqC,CAAQ,GAExBA,CACX,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./_virtual/_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{enclosingChain as e,fenceMap as t,indentOf as n,nearestEnclosingLine as r,withoutComment as i}from"./document-context.js";import{optionalTypeItems as a}from"./completion-items.js";import{propertyTypeReference as o,scanDocument as s}from"./symbols.js";import{typeReferenceText as c}from"./TypeReferenceSymbol.js";import{responseAnalysis as l,responseAvailability as u}from"./response-analysis.js";import{primitiveTypes as d}from"./language.js";function responseCompletions(f,p,m,h){let g=t(f);if(g[p]||i(m).length<m.length)return null;let _=m.trim()===``?m.length:n(f[p]),v=e(f,g,p,_),y=r(f,g,p,_),namedCommand=e=>{let t=h.commands.filter(t=>t.name===e);return t.length===1?t[0]:void 0},fixtureName=e=>h.concepts.find(t=>t.name===o(e).name)?.primitive===`String`?`generated-value`:`uuid`,entry=(e,t=e.name)=>({label:e.name,insertText:t,documentation:`${c(o(e))}${e.isGenerated?` — generated, not request/form input`:``}. ${u}`});if(v.includes(`command`)){let e=s(f).commands.filter(e=>e.line<p).at(-1);if(!e)return null;if(v[0]===`command`){if(/^\s*returns\s+@?\w*$/.test(m))return!/returns\s+@/.test(m)&&e.properties.some(e=>e.name===`returns`&&e.line===p)?null:e.properties.map(e=>entry(e,`${/returns\s+@/.test(m)?``:`@`}${e.name}`));let t=m.match(/^\s*@?[a-z_]\w*\s+([\w.]+)\s+(\w*)$/);if(t&&[`generated`,`identifier`].some(e=>e.startsWith(t[2]))){let e=h.concepts.find(e=>e.name===t[1]);if(e?.primitive===`Uuid`||e?.primitive===`String`&&e.generationStrategy!==void 0)return[...`optional`.startsWith(t[2])?a:[],{label:`generated`,insertText:`generated`,documentation:`Required scalar generatable concept; not a request/form input. Concept rules select ESM V20: Proven binds silently, Refuted reports PLAY0688 and Unproven reports PLAY0689. ${u}`},{label:`generated identifier`,insertText:`generated identifier`,documentation:`Specification fixture uses an indented for value. ${u}`},{label:`identifier`,insertText:`identifier`,documentation:`Names the event source identifier.`}]}if(/^\s*@?[a-z_]\w*\s+[\w.]+\s+generated\s+\w*$/.test(m))return[{label:`identifier`,insertText:`identifier`,documentation:u}]}if(v[0]===`returns`)return/=\s*@?\w*$/.test(m)?e.properties.map(e=>entry(e)):/^\s*@?[a-z_]\w*\s+[\w.]*$/.test(m)?[...h.concepts.map(e=>e.name),...h.types.map(e=>e.name),...d].map(e=>({label:e,insertText:e,documentation:`Explicit response type must exactly match the source. ${u}`})):e.properties.map(e=>entry(e,`${e.name} = ${e.name}`))}if(v[0]===`form`&&y&&(/^\s*field\s+\w*$/.test(m)||m.trim()===``)){let e=namedCommand(y.match(/\bfor\s+([\w.]+)$/)?.[1]);if(e)return e.properties.filter(e=>!e.isGenerated).map(e=>entry(e,m.trim()===``?`field ${e.name}`:e.name))}if(v.includes(`specification`)){if(v[0]===`when`&&y){let e=y.match(/^when\s+([\w.]+)$/)?.[1],t=namedCommand(e);if(!t)return null;if(/^\s*generated\s+\w*$/.test(m))return t.properties.filter(e=>e.isGenerated&&!e.isIdentifier).map(e=>entry(e,`${e.name} = "\${1:${fixtureName(e)}}"`));if(m.trim()===``)return[...t.properties.filter(e=>!e.isGenerated).map(e=>entry(e,`${e.name} = \${1:value}`)),...t.properties.filter(e=>e.isGenerated&&!e.isIdentifier).map(e=>({...entry(e,`generated ${e.name} = "\${1:${fixtureName(e)}}"`),label:`generated ${e.name}`})),...t.properties.some(e=>e.isGenerated&&e.isIdentifier)?[{label:`for`,insertText:`for "\${1:${fixtureName(t.properties.find(e=>e.isGenerated&&e.isIdentifier))}}"`,documentation:`Generated identifier fixture, not request input. ${u}`}]:[]]}if(v[0]===`then`&&/^then\s+returns$/.test(y??``)){let e=namedCommand([...l(f).specifications.values()].filter(e=>e.location.line-1<p).at(-1)?.when?.commandType);if(e?.response?.kind===`RecordCommandResponseSyntax`){let t=new Map(e.properties.map(e=>[e.name,e]));return e.response.fields.map(e=>{let n=t.get(e.source.property),r=e.type??(n?o(n):void 0);return{label:e.name,insertText:`${e.name} = \${1:value}`,documentation:`${r?c(r):`Unresolved type`}. ${u}`}})}}}return null}export{responseCompletions};
|
|
2
2
|
//# sourceMappingURL=response-completions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-completions.js","names":["fences","fenceMap","lines","line","withoutComment","before","indent","indentOf","chain","enclosingChain","enclosing","nearestEnclosingLine","matches","symbols","command","name","concept","propertyTypeReference","property","typeReferenceText","responseAvailability","scanDocument","modifier","word","optionalTypeItems","type","primitiveTypes","responseAnalysis","specification","properties","source","field"],"sources":["../../response-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 { enclosingChain, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { CompletionEntry, optionalTypeItems } from './completion-items';\nimport { DocumentSymbols, PropertySymbol, propertyTypeReference, scanDocument } from './symbols';\nimport { typeReferenceText } from './TypeReferenceSymbol';\nimport { responseAvailability, responseAnalysis } from './response-analysis';\nimport { primitiveTypes } from './language';\n\nexport function responseCompletions(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 namedCommand = (name: string | undefined) => {\n const matches = symbols.commands.filter(command => command.name === name);\n return matches.length === 1 ? matches[0] : undefined;\n };\n const fixtureName = (property: PropertySymbol): string => symbols.concepts.find(concept => concept.name === propertyTypeReference(property).name)?.primitive === 'String' ? 'generated-value' : 'uuid';\n const entry = (property: PropertySymbol, insertText = property.name): CompletionEntry => ({\n label: property.name, insertText,\n documentation: `${typeReferenceText(propertyTypeReference(property))}${property.isGenerated ? ' — generated, not request/form input' : ''}. ${responseAvailability}`,\n });\n if (chain.includes('command')) {\n // Merged symbol line offsets belong to different documents. Only the current (possibly\n // unsaved) source can own the cursor; application symbols are for external lookup.\n const command = scanDocument(lines).commands.filter(command => command.line < line).at(-1);\n if (!command) return null;\n if (chain[0] === 'command') {\n if (/^\\s*returns\\s+@?\\w*$/.test(before)) {\n if (!/returns\\s+@/.test(before) && command.properties.some(property => property.name === 'returns' && property.line === line)) return null;\n return command.properties.map(property => entry(property, `${/returns\\s+@/.test(before) ? '' : '@'}${property.name}`));\n }\n const modifier = before.match(/^\\s*@?[a-z_]\\w*\\s+([\\w.]+)\\s+(\\w*)$/);\n if (modifier && ['generated', 'identifier'].some(word => word.startsWith(modifier[2]))) {\n const concept = symbols.concepts.find(concept => concept.name === modifier[1]);\n if (concept?.primitive === 'Uuid' || (concept?.primitive === 'String' && concept.generationStrategy !== undefined)) return [\n ...('optional'.startsWith(modifier[2]) ? optionalTypeItems : []),\n { label: 'generated', insertText: 'generated', documentation: `Required scalar generatable concept; not a request/form input. Concept rules select ESM V20: Proven binds silently, Refuted reports PLAY0688 and Unproven reports PLAY0689. ${responseAvailability}` },\n { label: 'generated identifier', insertText: 'generated identifier', documentation: `Specification fixture uses an indented for value. ${responseAvailability}` },\n { label: 'identifier', insertText: 'identifier', documentation: 'Names the event source identifier.' },\n ];\n }\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.]+\\s+generated\\s+\\w*$/.test(before)) return [{ label: 'identifier', insertText: 'identifier', documentation: responseAvailability }];\n }\n if (chain[0] === 'returns') {\n if (/=\\s*@?\\w*$/.test(before)) return command.properties.map(property => entry(property));\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.]*$/.test(before)) return [...symbols.concepts.map(concept => concept.name), ...symbols.types.map(type => type.name), ...primitiveTypes].map(name => ({ label: name, insertText: name, documentation: `Explicit response type must exactly match the source. ${responseAvailability}` }));\n return command.properties.map(property => entry(property, `${property.name} = ${property.name}`));\n }\n }\n if (chain[0] === 'form' && enclosing && (/^\\s*field\\s+\\w*$/.test(before) || before.trim() === '')) {\n const command = namedCommand(enclosing.match(/\\bfor\\s+([\\w.]+)$/)?.[1]);\n if (command) return command.properties.filter(property => !property.isGenerated).map(property => entry(property, before.trim() === '' ? `field ${property.name}` : property.name));\n }\n if (chain.includes('specification')) {\n if (chain[0] === 'when' && enclosing) {\n const name = enclosing.match(/^when\\s+([\\w.]+)$/)?.[1];\n const command = namedCommand(name);\n if (!command) return null;\n if (/^\\s*generated\\s+\\w*$/.test(before)) return command.properties.filter(property => property.isGenerated && !property.isIdentifier).map(property => entry(property, `${property.name} = \"\\${1:${fixtureName(property)}}\"`));\n if (before.trim() === '') return [\n ...command.properties.filter(property => !property.isGenerated).map(property => entry(property, `${property.name} = \\${1:value}`)),\n ...command.properties.filter(property => property.isGenerated && !property.isIdentifier).map(property => ({ ...entry(property, `generated ${property.name} = \"\\${1:${fixtureName(property)}}\"`), label: `generated ${property.name}` })),\n ...(command.properties.some(property => property.isGenerated && property.isIdentifier) ? [{ label: 'for', insertText: `for \"\\${1:${fixtureName(command.properties.find(property => property.isGenerated && property.isIdentifier)!)}}\"`, documentation: `Generated identifier fixture, not request input. ${responseAvailability}` }] : []),\n ];\n }\n if (chain[0] === 'then' && /^then\\s+returns$/.test(enclosing ?? '')) {\n const specification = [...responseAnalysis(lines).specifications.values()].filter(specification => specification.location.line - 1 < line).at(-1);\n const command = namedCommand(specification?.when?.commandType);\n if (command?.response?.kind === 'RecordCommandResponseSyntax') {\n const properties = new Map(command.properties.map(property => [property.name, property]));\n return command.response.fields.map(field => {\n const source = properties.get(field.source.property);\n const type = field.type ?? (source ? propertyTypeReference(source) : undefined);\n return { label: field.name, insertText: `${field.name} = \\${1:value}`, documentation: `${type ? typeReferenceText(type) : 'Unresolved type'}. ${responseAvailability}` };\n });\n }\n }\n }\n return null;\n}\n"],"mappings":"mfAUA,SAAgB,oBAAoB,EAAiB,EAAc,EAAgB,EAAoD,CACnI,IAAMA,EAASC,EAASC,CAAK,EAC7B,GAAIF,EAAOG,IAASC,EAAeC,CAAM,CAAC,CAAC,OAASA,EAAO,OAAQ,OAAO,KAC1E,IAAMC,EAASD,EAAO,KAAK,IAAM,GAAKA,EAAO,OAASE,EAASL,EAAMC,EAAK,EACpEK,EAAQC,EAAeP,EAAOF,EAAQG,EAAMG,CAAM,EAClDI,EAAYC,EAAqBT,EAAOF,EAAQG,EAAMG,CAAM,EAC5D,aAAgB,GAA6B,CAC/C,IAAMM,EAAUC,EAAQ,SAAS,OAAO,GAAWC,EAAQ,OAASC,CAAI,EACxE,OAAOH,EAAQ,SAAW,EAAIA,EAAQ,GAAK,IAAA,EAC/C,EACM,YAAe,GAAqCC,EAAQ,SAAS,KAAK,GAAWG,EAAQ,OAASC,EAAsBC,CAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,YAAc,SAAW,kBAAoB,OAC1L,OAAS,EAA0B,EAAaA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M,CAAI,EAAI,kBAAkB,IAAIL,GAAuB,CAC3K,CAAC,CACL,CACJ,CACJ,CACA,OAAO,IACX"}
|
|
1
|
+
{"version":3,"file":"response-completions.js","names":["fences","fenceMap","lines","line","withoutComment","before","indent","indentOf","chain","enclosingChain","enclosing","nearestEnclosingLine","matches","symbols","command","name","concept","propertyTypeReference","property","typeReferenceText","responseAvailability","scanDocument","modifier","word","optionalTypeItems","type","primitiveTypes","responseAnalysis","specification","properties","source","field"],"sources":["../../response-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 { enclosingChain, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { CompletionEntry, optionalTypeItems } from './completion-items';\nimport { DocumentSymbols, PropertySymbol, propertyTypeReference, scanDocument } from './symbols';\nimport { typeReferenceText } from './TypeReferenceSymbol';\nimport { responseAvailability, responseAnalysis } from './response-analysis';\nimport { primitiveTypes } from './language';\n\nexport function responseCompletions(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 namedCommand = (name: string | undefined) => {\n const matches = symbols.commands.filter(command => command.name === name);\n return matches.length === 1 ? matches[0] : undefined;\n };\n const fixtureName = (property: PropertySymbol): string => symbols.concepts.find(concept => concept.name === propertyTypeReference(property).name)?.primitive === 'String' ? 'generated-value' : 'uuid';\n const entry = (property: PropertySymbol, insertText = property.name): CompletionEntry => ({\n label: property.name, insertText,\n documentation: `${typeReferenceText(propertyTypeReference(property))}${property.isGenerated ? ' — generated, not request/form input' : ''}. ${responseAvailability}`,\n });\n if (chain.includes('command')) {\n // Merged symbol line offsets belong to different documents. Only the current (possibly\n // unsaved) source can own the cursor; application symbols are for external lookup.\n const command = scanDocument(lines).commands.filter(command => command.line < line).at(-1);\n if (!command) return null;\n if (chain[0] === 'command') {\n if (/^\\s*returns\\s+@?\\w*$/.test(before)) {\n if (!/returns\\s+@/.test(before) && command.properties.some(property => property.name === 'returns' && property.line === line)) return null;\n return command.properties.map(property => entry(property, `${/returns\\s+@/.test(before) ? '' : '@'}${property.name}`));\n }\n const modifier = before.match(/^\\s*@?[a-z_]\\w*\\s+([\\w.]+)\\s+(\\w*)$/);\n if (modifier && ['generated', 'identifier'].some(word => word.startsWith(modifier[2]))) {\n const concept = symbols.concepts.find(concept => concept.name === modifier[1]);\n if (concept?.primitive === 'Uuid' || (concept?.primitive === 'String' && concept.generationStrategy !== undefined)) return [\n ...('optional'.startsWith(modifier[2]) ? optionalTypeItems : []),\n { label: 'generated', insertText: 'generated', documentation: `Required scalar generatable concept; not a request/form input. Concept rules select ESM V20: Proven binds silently, Refuted reports PLAY0688 and Unproven reports PLAY0689. ${responseAvailability}` },\n { label: 'generated identifier', insertText: 'generated identifier', documentation: `Specification fixture uses an indented for value. ${responseAvailability}` },\n { label: 'identifier', insertText: 'identifier', documentation: 'Names the event source identifier.' },\n ];\n }\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.]+\\s+generated\\s+\\w*$/.test(before)) return [{ label: 'identifier', insertText: 'identifier', documentation: responseAvailability }];\n }\n if (chain[0] === 'returns') {\n if (/=\\s*@?\\w*$/.test(before)) return command.properties.map(property => entry(property));\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.]*$/.test(before)) return [...symbols.concepts.map(concept => concept.name), ...symbols.types.map(type => type.name), ...primitiveTypes].map(name => ({ label: name, insertText: name, documentation: `Explicit response type must exactly match the source. ${responseAvailability}` }));\n return command.properties.map(property => entry(property, `${property.name} = ${property.name}`));\n }\n }\n if (chain[0] === 'form' && enclosing && (/^\\s*field\\s+\\w*$/.test(before) || before.trim() === '')) {\n const command = namedCommand(enclosing.match(/\\bfor\\s+([\\w.]+)$/)?.[1]);\n if (command) return command.properties.filter(property => !property.isGenerated).map(property => entry(property, before.trim() === '' ? `field ${property.name}` : property.name));\n }\n if (chain.includes('specification')) {\n if (chain[0] === 'when' && enclosing) {\n const name = enclosing.match(/^when\\s+([\\w.]+)$/)?.[1];\n const command = namedCommand(name);\n if (!command) return null;\n if (/^\\s*generated\\s+\\w*$/.test(before)) return command.properties.filter(property => property.isGenerated && !property.isIdentifier).map(property => entry(property, `${property.name} = \"\\${1:${fixtureName(property)}}\"`));\n if (before.trim() === '') return [\n ...command.properties.filter(property => !property.isGenerated).map(property => entry(property, `${property.name} = \\${1:value}`)),\n ...command.properties.filter(property => property.isGenerated && !property.isIdentifier).map(property => ({ ...entry(property, `generated ${property.name} = \"\\${1:${fixtureName(property)}}\"`), label: `generated ${property.name}` })),\n ...(command.properties.some(property => property.isGenerated && property.isIdentifier) ? [{ label: 'for', insertText: `for \"\\${1:${fixtureName(command.properties.find(property => property.isGenerated && property.isIdentifier)!)}}\"`, documentation: `Generated identifier fixture, not request input. ${responseAvailability}` }] : []),\n ];\n }\n if (chain[0] === 'then' && /^then\\s+returns$/.test(enclosing ?? '')) {\n const specification = [...responseAnalysis(lines).specifications.values()].filter(specification => specification.location.line - 1 < line).at(-1);\n const command = namedCommand(specification?.when?.commandType);\n if (command?.response?.kind === 'RecordCommandResponseSyntax') {\n const properties = new Map(command.properties.map(property => [property.name, property]));\n return command.response.fields.map(field => {\n const source = properties.get(field.source.property);\n const type = field.type ?? (source ? propertyTypeReference(source) : undefined);\n return { label: field.name, insertText: `${field.name} = \\${1:value}`, documentation: `${type ? typeReferenceText(type) : 'Unresolved type'}. ${responseAvailability}` };\n });\n }\n }\n }\n return null;\n}\n"],"mappings":"A,mfAUA,SAAgB,oBAAoB,EAAiB,EAAc,EAAgB,EAAoD,CACnI,IAAMA,EAASC,EAASC,CAAK,EAC7B,GAAIF,EAAOG,IAASC,EAAeC,CAAM,CAAC,CAAC,OAASA,EAAO,OAAQ,OAAO,KAC1E,IAAMC,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,KAAO,EAAIzB,CAAI,CAAC,CAAC,GAAG,EACrG,CAAC,EAAE,MAAM,WAAW,EAC7D,GAAIW,GAAS,UAAU,OAAS,8BAA+B,CAC3D,IAAMe,EAAa,IAAI,IAAIf,EAAQ,WAAW,IAAI,GAAY,CAACI,EAAS,KAAMA,CAAQ,CAAC,CAAC,EACxF,OAAOJ,EAAQ,SAAS,OAAO,IAAI,GAAS,CACxC,IAAMgB,EAASD,EAAW,IAAIE,EAAM,OAAO,QAAQ,EAC7CN,EAAOM,EAAM,OAASD,EAASb,EAAsBa,CAAM,EAAI,IAAA,IACrE,MAAO,CAAE,MAAOC,EAAM,KAAM,WAAY,GAAGA,EAAM,KAAK,gBAAiB,cAAe,GAAGN,EAAON,EAAkBM,CAAI,EAAI,kBAAkB,IAAIL,GAAuB,CAC3K,CAAC,CACL,CACJ,CACJ,CACA,OAAO,IACX,C"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"./_virtual/_virtual/_rolldown/runtime.js";import{
|
|
2
|
-
`))??[],r?.authoringPlacement,a,r?.authoringPlacementResolved);for(let e of o.eventSources.declarations.filter(e=>e.location.path===a)){add(e.location.line,e.location.column,11,0),e.identifier&&add(e.identifier.location.line,e.identifier.location.column,e.identifier.name.length,2);for(let t of e.streams){add(t.location.line,t.location.column,6,0),t.streamId&&add(t.streamId.location.line,t.streamId.location.column,t.streamId.name.length,2);let e=t.directiveLocations?.streamId;e&&add(e.line,e.column,8,0);for(let e of t.streamIdParts)add(e.location.line,e.location.column,e.name.length,1),add(e.type.location.line,e.type.location.column,e.type.name.length,2)}}for(let e of o.eventSources.routes){add(e.location.line,e.location.column,6,0),e.referenceLocation&&add(e.referenceLocation.line,e.referenceLocation.column,`${e.eventSource}.${e.stream}`.length,2),e.streamId&&add(e.streamId.location.line,e.streamId.location.column,8,0);let t=e.directiveLocations?.streamId;t&&add(t.line,t.column,8,0);for(let t of e.streamIdParts)add(t.location.line,t.location.column,t.property.length,1)}for(let
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{responseAnalysis as e}from"./response-analysis.js";import{withoutComment as t}from"./document-context.js";const n=[`keyword`,`property`,`type`];function responseTokens(n,r){let i=[],add=(e,t,r,a)=>{let o=n[e-1];if(o===void 0||t<1||r<1)return;let s=t-1+ +(o[t-1]===`@`);s+r<=o.length&&i.push({line:e-1,column:s,length:r,type:a})},a=r?.authoringPath??`current.play`,o=e(n,r?.authoringDocuments??r?.authoringSources?.filter(e=>e!==n.join(`
|
|
2
|
+
`))??[],r?.authoringPlacement,a,r?.authoringPlacementResolved);for(let e of o.eventSources.declarations.filter(e=>e.location.path===a)){add(e.location.line,e.location.column,11,0),e.identifier&&add(e.identifier.location.line,e.identifier.location.column,e.identifier.name.length,2);for(let t of e.streams){add(t.location.line,t.location.column,6,0),t.streamId&&add(t.streamId.location.line,t.streamId.location.column,t.streamId.name.length,2);let e=t.directiveLocations?.streamId;e&&add(e.line,e.column,8,0);for(let e of t.streamIdParts)add(e.location.line,e.location.column,e.name.length,1),add(e.type.location.line,e.type.location.column,e.type.name.length,2)}}for(let e of o.eventSources.routes){add(e.location.line,e.location.column,6,0),e.referenceLocation&&add(e.referenceLocation.line,e.referenceLocation.column,`${e.eventSource}.${e.stream}`.length,2),e.streamId&&add(e.streamId.location.line,e.streamId.location.column,8,0);let t=e.directiveLocations?.streamId;t&&add(t.line,t.column,8,0);for(let t of e.streamIdParts)add(t.location.line,t.location.column,t.property.length,1)}for(let e of o.commands.values()){for(let r of e.properties){if(!r.isGenerated)continue;let e=t(n[r.location.line-1]??``);add(r.location.line,e.lastIndexOf(`generated`)+1,9,0)}let r=e.response;if(r){if(add(r.location.line,r.location.column,7,0),r.kind===`ScalarCommandResponseSyntax`)add(r.source.location.line,r.source.location.column,r.source.property.length,1);else for(let e of r.fields)add(e.location.line,e.location.column,e.name.length,1),add(e.source.location.line,e.source.location.column,e.source.property.length,1),e.type&&add(e.type.location.line,e.type.location.column,e.type.name.length,2)}}for(let e of o.specifications.values()){for(let t of e.thenEvents??[])t.noStream&&add(t.noStream.location.line,t.noStream.location.column,9,0);for(let t of e.when?.generatedValues??[])add(t.location.line,t.location.column,9,0);e.thenReturns&&add(e.thenReturns.location.line,(n[e.thenReturns.location.line-1]??``).indexOf(`returns`)+1,7,0)}for(let e of o.operations.systems.filter(e=>e.location.path===a))add(e.location.line,e.location.column,6,0);for(let e of o.operations.declarations.filter(e=>e.location.path===a)){let r=t(n[e.location.line-1]??``).indexOf(`operation`,e.location.column-1);r>=0&&add(e.location.line,r+1,9,0);for(let t of e.inputs)add(t.location.line,t.location.column,t.name.length,1),add(t.type.location.line,t.type.location.column,t.type.name.length,2);e.usesLocation&&add(e.usesLocation.line,(n[e.usesLocation.line-1]??``).indexOf(`uses`)+1,4,0);for(let r of[e.execute,e.compensate]){if(!r)continue;let e=t(n[r.location.line-1]??``).trim();add(r.location.line,r.location.column,e.length,0),r.implementation&&add(r.implementation.location.line,r.implementation.location.column,14,0);for(let e of r.implementation?.hints??[])add(e.location.line,e.location.column,4,0)}}let s=i.sort((e,t)=>e.line-t.line||e.column-t.column);return s.filter((e,t)=>t===0||e.line!==s[t-1].line||e.column>=s[t-1].column+s[t-1].length)}export{n as responseTokenTypes,responseTokens};
|
|
3
3
|
//# sourceMappingURL=response-tokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-tokens.js","names":["responseTokenTypes","tokens","source","lines","line","column","length","start","path","symbols","analysis","responseAnalysis","stream","header","part","route","command","property","withoutComment","response","field","specification","event","fixture","system","operation","keyword","input","phase","name","hint","ordered","left","right","index","token"],"sources":["../../response-tokens.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 { responseAnalysis } from './response-analysis';\nimport { DocumentSymbols } from './symbols';\nimport { withoutComment } from './document-context';\n\nexport const responseTokenTypes = ['keyword', 'property', 'type'] as const;\n\n// Semantic overlays resolve the local returns ambiguity that a line-based grammar cannot.\nexport function responseTokens(lines: string[], symbols?: DocumentSymbols): { line: number; column: number; length: number; type: number }[] {\n const tokens: { line: number; column: number; length: number; type: number }[] = [];\n const add = (line: number, column: number, length: number, type: number) => {\n const source = lines[line - 1];\n if (source === undefined || column < 1 || length < 1) return;\n const start = column - 1 + (source[column - 1] === '@' ? 1 : 0);\n if (start + length <= source.length) tokens.push({ line: line - 1, column: start, length, type });\n };\n const path = symbols?.authoringPath ?? 'current.play';\n const analysis = responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, path, symbols?.authoringPlacementResolved);\n for (const source of analysis.eventSources.declarations.filter(source => source.location.path === path)) {\n add(source.location.line, source.location.column, 11, 0);\n if (source.identifier) add(source.identifier.location.line, source.identifier.location.column, source.identifier.name.length, 2);\n for (const stream of source.streams) {\n add(stream.location.line, stream.location.column, 6, 0);\n if (stream.streamId) add(stream.streamId.location.line, stream.streamId.location.column, stream.streamId.name.length, 2);\n const header = stream.directiveLocations?.streamId;\n if (header) add(header.line, header.column, 8, 0);\n for (const part of stream.streamIdParts) {\n add(part.location.line, part.location.column, part.name.length, 1);\n add(part.type.location.line, part.type.location.column, part.type.name.length, 2);\n }\n }\n }\n for (const route of analysis.eventSources.routes) {\n add(route.location.line, route.location.column, 6, 0);\n if (route.referenceLocation) add(route.referenceLocation.line, route.referenceLocation.column, `${route.eventSource}.${route.stream}`.length, 2);\n if (route.streamId) add(route.streamId.location.line, route.streamId.location.column, 8, 0);\n const header = route.directiveLocations?.streamId;\n if (header) add(header.line, header.column, 8, 0);\n for (const part of route.streamIdParts) add(part.location.line, part.location.column, part.property.length, 1);\n }\n for (const command of analysis.commands.values()) {\n for (const property of command.properties) {\n if (!property.isGenerated) continue;\n const source = withoutComment(lines[property.location.line - 1] ?? '');\n add(property.location.line, source.lastIndexOf('generated') + 1, 9, 0);\n }\n const response = command.response;\n if (!response) continue;\n add(response.location.line, response.location.column, 7, 0);\n if (response.kind === 'ScalarCommandResponseSyntax') {\n add(response.source.location.line, response.source.location.column, response.source.property.length, 1);\n } else for (const field of response.fields) {\n add(field.location.line, field.location.column, field.name.length, 1);\n add(field.source.location.line, field.source.location.column, field.source.property.length, 1);\n if (field.type) add(field.type.location.line, field.type.location.column, field.type.name.length, 2);\n }\n }\n for (const specification of analysis.specifications.values()) {\n for (const event of specification.thenEvents ?? []) {\n if (event.noStream) add(event.noStream.location.line, event.noStream.location.column, 9, 0);\n }\n for (const fixture of specification.when?.generatedValues ?? []) {\n add(fixture.location.line, fixture.location.column, 9, 0);\n }\n if (specification.thenReturns) add(specification.thenReturns.location.line, (lines[specification.thenReturns.location.line - 1] ?? '').indexOf('returns') + 1, 7, 0);\n }\n for (const system of analysis.operations.systems.filter(system => system.location.path === path)) {\n add(system.location.line, system.location.column, 6, 0);\n }\n for (const operation of analysis.operations.declarations.filter(operation => operation.location.path === path)) {\n const header = withoutComment(lines[operation.location.line - 1] ?? '');\n const keyword = header.indexOf('operation', operation.location.column - 1);\n if (keyword >= 0) add(operation.location.line, keyword + 1, 9, 0);\n for (const input of operation.inputs) {\n add(input.location.line, input.location.column, input.name.length, 1);\n add(input.type.location.line, input.type.location.column, input.type.name.length, 2);\n }\n if (operation.usesLocation) add(operation.usesLocation.line, (lines[operation.usesLocation.line - 1] ?? '').indexOf('uses') + 1, 4, 0);\n for (const phase of [operation.execute, operation.compensate]) {\n if (!phase) continue;\n const name = withoutComment(lines[phase.location.line - 1] ?? '').trim();\n add(phase.location.line, phase.location.column, name.length, 0);\n if (phase.implementation) add(phase.implementation.location.line, phase.implementation.location.column, 14, 0);\n for (const hint of phase.implementation?.hints ?? []) add(hint.location.line, hint.location.column, 4, 0);\n }\n }\n // Overlays never overlap or duplicate a typed token, even with recovered malformed syntax.\n const ordered = tokens.sort((left, right) => left.line - right.line || left.column - right.column);\n return ordered.filter((token, index) => index === 0 || token.line !== ordered[index - 1].line || token.column >= ordered[index - 1].column + ordered[index - 1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AAQA,EAAM,KAAK,OAAQ,CAAC,EACpE,IAAIA,EAAM,KAAK,SAAS,KAAMA,EAAM,KAAK,SAAS,OAAQA,EAAM,KAAK,KAAK,OAAQ,CAAC,EAEnFF,EAAU,cAAc,IAAIA,EAAU,aAAa,MAAOtB,EAAMsB,EAAU,aAAa,KAAO,IAAM,GAAA,CAAI,QAAQ,MAAM,EAAI,EAAG,EAAG,CAAC,EACrI,IAAK,IAAMG,IAAS,CAACH,EAAU,QAASA,EAAU,UAAU,EAAG,CAC3D,GAAI,CAACG,EAAO,SACZ,IAAMC,EAAOX,EAAef,EAAMyB,EAAM,SAAS,KAAO,IAAM,EAAE,CAAC,CAAC,KAAK,EACvE,IAAIA,EAAM,SAAS,KAAMA,EAAM,SAAS,OAAQC,EAAK,OAAQ,CAAC,EAC1DD,EAAM,gBAAgB,IAAIA,EAAM,eAAe,SAAS,KAAMA,EAAM,eAAe,SAAS,OAAQ,GAAI,CAAC,EAC7G,IAAK,IAAME,KAAQF,EAAM,gBAAgB,OAAS,CAAC,EAAG,IAAIE,EAAK,SAAS,KAAMA,EAAK,SAAS,OAAQ,EAAG,CAAC,CAC5G,CACJ,CAEA,IAAMC,EAAU9B,EAAO,MAAM,EAAM,IAAU+B,EAAK,KAAOC,EAAM,MAAQD,EAAK,OAASC,EAAM,MAAM,EACjG,OAAOF,EAAQ,QAAQ,EAAO,IAAUG,IAAU,GAAKC,EAAM,OAASJ,EAAQG,EAAQ,EAAE,CAAC,MAAQC,EAAM,QAAUJ,EAAQG,EAAQ,EAAE,CAAC,OAASH,EAAQG,EAAQ,EAAE,CAAC,MAAM,CAC1K"}
|
|
1
|
+
{"version":3,"file":"response-tokens.js","names":["responseTokenTypes","tokens","source","lines","line","column","length","start","path","symbols","analysis","responseAnalysis","stream","header","part","route","command","property","withoutComment","response","field","specification","event","fixture","system","operation","keyword","input","phase","name","hint","ordered","left","right","index","token"],"sources":["../../response-tokens.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 { responseAnalysis } from './response-analysis';\nimport { DocumentSymbols } from './symbols';\nimport { withoutComment } from './document-context';\n\nexport const responseTokenTypes = ['keyword', 'property', 'type'] as const;\n\n// Semantic overlays resolve the local returns ambiguity that a line-based grammar cannot.\nexport function responseTokens(lines: string[], symbols?: DocumentSymbols): { line: number; column: number; length: number; type: number }[] {\n const tokens: { line: number; column: number; length: number; type: number }[] = [];\n const add = (line: number, column: number, length: number, type: number) => {\n const source = lines[line - 1];\n if (source === undefined || column < 1 || length < 1) return;\n const start = column - 1 + (source[column - 1] === '@' ? 1 : 0);\n if (start + length <= source.length) tokens.push({ line: line - 1, column: start, length, type });\n };\n const path = symbols?.authoringPath ?? 'current.play';\n const analysis = responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, path, symbols?.authoringPlacementResolved);\n for (const source of analysis.eventSources.declarations.filter(source => source.location.path === path)) {\n add(source.location.line, source.location.column, 11, 0);\n if (source.identifier) add(source.identifier.location.line, source.identifier.location.column, source.identifier.name.length, 2);\n for (const stream of source.streams) {\n add(stream.location.line, stream.location.column, 6, 0);\n if (stream.streamId) add(stream.streamId.location.line, stream.streamId.location.column, stream.streamId.name.length, 2);\n const header = stream.directiveLocations?.streamId;\n if (header) add(header.line, header.column, 8, 0);\n for (const part of stream.streamIdParts) {\n add(part.location.line, part.location.column, part.name.length, 1);\n add(part.type.location.line, part.type.location.column, part.type.name.length, 2);\n }\n }\n }\n for (const route of analysis.eventSources.routes) {\n add(route.location.line, route.location.column, 6, 0);\n if (route.referenceLocation) add(route.referenceLocation.line, route.referenceLocation.column, `${route.eventSource}.${route.stream}`.length, 2);\n if (route.streamId) add(route.streamId.location.line, route.streamId.location.column, 8, 0);\n const header = route.directiveLocations?.streamId;\n if (header) add(header.line, header.column, 8, 0);\n for (const part of route.streamIdParts) add(part.location.line, part.location.column, part.property.length, 1);\n }\n for (const command of analysis.commands.values()) {\n for (const property of command.properties) {\n if (!property.isGenerated) continue;\n const source = withoutComment(lines[property.location.line - 1] ?? '');\n add(property.location.line, source.lastIndexOf('generated') + 1, 9, 0);\n }\n const response = command.response;\n if (!response) continue;\n add(response.location.line, response.location.column, 7, 0);\n if (response.kind === 'ScalarCommandResponseSyntax') {\n add(response.source.location.line, response.source.location.column, response.source.property.length, 1);\n } else for (const field of response.fields) {\n add(field.location.line, field.location.column, field.name.length, 1);\n add(field.source.location.line, field.source.location.column, field.source.property.length, 1);\n if (field.type) add(field.type.location.line, field.type.location.column, field.type.name.length, 2);\n }\n }\n for (const specification of analysis.specifications.values()) {\n for (const event of specification.thenEvents ?? []) {\n if (event.noStream) add(event.noStream.location.line, event.noStream.location.column, 9, 0);\n }\n for (const fixture of specification.when?.generatedValues ?? []) {\n add(fixture.location.line, fixture.location.column, 9, 0);\n }\n if (specification.thenReturns) add(specification.thenReturns.location.line, (lines[specification.thenReturns.location.line - 1] ?? '').indexOf('returns') + 1, 7, 0);\n }\n for (const system of analysis.operations.systems.filter(system => system.location.path === path)) {\n add(system.location.line, system.location.column, 6, 0);\n }\n for (const operation of analysis.operations.declarations.filter(operation => operation.location.path === path)) {\n const header = withoutComment(lines[operation.location.line - 1] ?? '');\n const keyword = header.indexOf('operation', operation.location.column - 1);\n if (keyword >= 0) add(operation.location.line, keyword + 1, 9, 0);\n for (const input of operation.inputs) {\n add(input.location.line, input.location.column, input.name.length, 1);\n add(input.type.location.line, input.type.location.column, input.type.name.length, 2);\n }\n if (operation.usesLocation) add(operation.usesLocation.line, (lines[operation.usesLocation.line - 1] ?? '').indexOf('uses') + 1, 4, 0);\n for (const phase of [operation.execute, operation.compensate]) {\n if (!phase) continue;\n const name = withoutComment(lines[phase.location.line - 1] ?? '').trim();\n add(phase.location.line, phase.location.column, name.length, 0);\n if (phase.implementation) add(phase.implementation.location.line, phase.implementation.location.column, 14, 0);\n for (const hint of phase.implementation?.hints ?? []) add(hint.location.line, hint.location.column, 4, 0);\n }\n }\n // Overlays never overlap or duplicate a typed token, even with recovered malformed syntax.\n const ordered = tokens.sort((left, right) => left.line - right.line || left.column - right.column);\n return ordered.filter((token, index) => index === 0 || token.line !== ordered[index - 1].line || token.column >= ordered[index - 1].column + ordered[index - 1].length);\n}\n"],"mappings":"A,kKAOA,MAAaA,EAAqB,CAAC,UAAW,WAAY,MAAM,EAGhE,SAAgB,eAAe,EAAiB,EAA6F,CACzI,IAAMC,EAA2E,CAAC,EAC5E,KAAO,EAAc,EAAgB,EAAgB,IAAiB,CACxE,IAAMC,EAASC,EAAMC,EAAO,GAC5B,GAAIF,IAAW,IAAA,IAAaG,EAAS,GAAKC,EAAS,EAAG,OACtD,IAAMC,EAAQF,EAAS,GAAK,IAAOA,EAAS,KAAO,KAC/CE,EAAQD,GAAUJ,EAAO,QAAQD,EAAO,KAAK,CAAE,KAAMG,EAAO,EAAG,OAAQG,EAAO,SAAQ,MAAK,CAAC,CACpG,EACMC,EAAOC,GAAS,eAAiB,eACjCC,EAAWC,EAAiBR,EAAOM,GAAS,oBAAsBA,GAAS,kBAAkB,OAAO,GAAUP,IAAWC,EAAM,KAAK;CAAI,CAAC,GAAK,CAAC,EAAGM,GAAS,mBAAoBD,EAAMC,GAAS,0BAA0B,EAC9N,IAAK,IAAMP,KAAUQ,EAAS,aAAa,aAAa,OAAO,GAAUR,EAAO,SAAS,OAASM,CAAI,EAAG,CACrG,IAAIN,EAAO,SAAS,KAAMA,EAAO,SAAS,OAAQ,GAAI,CAAC,EACnDA,EAAO,YAAY,IAAIA,EAAO,WAAW,SAAS,KAAMA,EAAO,WAAW,SAAS,OAAQA,EAAO,WAAW,KAAK,OAAQ,CAAC,EAC/H,IAAK,IAAMU,KAAUV,EAAO,QAAS,CACjC,IAAIU,EAAO,SAAS,KAAMA,EAAO,SAAS,OAAQ,EAAG,CAAC,EAClDA,EAAO,UAAU,IAAIA,EAAO,SAAS,SAAS,KAAMA,EAAO,SAAS,SAAS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
-
import"./_virtual/_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{exampleDeclarationItems as e}from"./example-declaration-items.js";import{documentationItem as t}from"./documentation-item.js";import{purposeReferenceItem as n}from"./purpose-items.js";const r=[{label:`on`,insertText:"on ${1|click,select,submit,change,load,unload,enter,leave|}\n ${2:execute command}",documentation:`Wires what happens on an interaction - a click, a submit, entering or leaving the screen.`},{label:`uses`,insertText:"uses ${1:Behavior}",documentation:`Attaches a named behavior declared at the top level.`}],i=[n,t,...e,{label:`description`,insertText:'description "${1:what this module is for}"',documentation:`A human-readable description.`},{label:`authorize`,insertText:"authorize ${1:PolicyName}",documentation:`Policies that must pass for everything in the module.`},{label:`depends on`,insertText:"depends on ${1:Name}",documentation:`Declares an allowed module or feature dependency. Opts this container into independent explicit-reference checks.`},{label:`import "…"`,insertText:'import "${1:*/*.play}"',documentation:"Imports `.play` files into this module — their top level is the module's body."},{label:`feature`,insertText:`feature \${1:Name}
|
|
2
2
|
`,documentation:`Groups related slices into a vertical feature.`},{label:`screen`,insertText:"screen ${1:Name}\n data ${2:ReadModel} via query ${3:QueryName}",documentation:`Declares a module-level UI screen.`},{label:`screen template`,insertText:`screen template \${1:Name}
|
|
3
3
|
fits slot \${2:content}
|
|
4
4
|
|
|
5
|
-
\${3:slot}`,documentation:`Declares a reusable screen shape that fits a slot of the shell.`},{label:`dialog template`,insertText:"dialog template ${1:Name}\n ${2:body}\n ${3:actions}",documentation:`Declares a reusable dialog shape that opens over the shell.`},{label:`form`,insertText:'form ${1:Name} for ${2:Command}\n field ${3:property} label "${4:Label}"',documentation:`Declares a form bound to a command.`},{label:`contribute`,insertText:'contribute to ${1:Navigation}\n navigate to ${2:Screen}\n label "${3:Label}"',documentation:`Contributes an entry to a slot of the shell, such as navigation.`},{label:`navigation sidebar extends`,insertText:'navigation ${1|sidebar,topbar|} ${2|extends,overrides,inherits|}\n item ${3:id} title "${4:Title}" target ${5:Module.Feature}',documentation:"Changes a navigation region for this module: `extends` adds items after the application's, `overrides` replaces them, `inherits` shows the application's."},...r],a=[t
|
|
5
|
+
\${3:slot}`,documentation:`Declares a reusable screen shape that fits a slot of the shell.`},{label:`dialog template`,insertText:"dialog template ${1:Name}\n ${2:body}\n ${3:actions}",documentation:`Declares a reusable dialog shape that opens over the shell.`},{label:`form`,insertText:'form ${1:Name} for ${2:Command}\n field ${3:property} label "${4:Label}"',documentation:`Declares a form bound to a command.`},{label:`contribute`,insertText:'contribute to ${1:Navigation}\n navigate to ${2:Screen}\n label "${3:Label}"',documentation:`Contributes an entry to a slot of the shell, such as navigation.`},{label:`navigation sidebar extends`,insertText:'navigation ${1|sidebar,topbar|} ${2|extends,overrides,inherits|}\n item ${3:id} title "${4:Title}" target ${5:Module.Feature}',documentation:"Changes a navigation region for this module: `extends` adds items after the application's, `overrides` replaces them, `inherits` shows the application's."},...r],a=[n,t,...e,{label:`description`,insertText:'description "${1:what this feature is for}"',documentation:`A human-readable description.`},{label:`authorize`,insertText:"authorize ${1:PolicyName}",documentation:`Policies that must pass for everything in the feature.`},{label:`depends on`,insertText:"depends on ${1:Name}",documentation:`Declares an allowed module or feature dependency. Sibling feature names resolve before module names.`},{label:`import "…"`,insertText:'import "${1:*.play}"',documentation:"Imports `.play` files into this feature — their top level is the feature's body."},{label:`feature`,insertText:`feature \${1:Name}
|
|
6
6
|
`,documentation:`Declares a nested sub-feature.`},{label:`slice StateChange`,insertText:`slice StateChange \${1:Name}
|
|
7
7
|
`,documentation:`A command → events flow; something that changes the system.`},{label:`slice StateView`,insertText:`slice StateView \${1:Name}
|
|
8
8
|
`,documentation:`A query + projection + screen; something that reads the system.`},{label:`slice Automation`,insertText:`slice Automation \${1:Name}
|
|
9
9
|
`,documentation:`A reaction or reducer; something that runs when something happens.`},{label:`slice Translate`,insertText:`slice Translate \${1:Name}
|
|
10
|
-
`,documentation:`A capture; converts external data into events.`},{label:`contribute`,insertText:'contribute to ${1:Navigation}\n navigate to ${2:Screen}\n label "${3:Label}"',documentation:`Contributes an entry to a slot of the shell, such as navigation.`},...r],o=[
|
|
10
|
+
`,documentation:`A capture; converts external data into events.`},{label:`contribute`,insertText:'contribute to ${1:Navigation}\n navigate to ${2:Screen}\n label "${3:Label}"',documentation:`Contributes an entry to a slot of the shell, such as navigation.`},...r],o=[t,{label:`passive`,insertText:`passive`,documentation:`Opts into replay on demand for command decisions, not materialization. Default active, never inferred; queries and screens cannot observe this model.`},{label:`description`,insertText:'description "${1:what one instance holds}"',documentation:`A human-readable description.`},{label:`file`,insertText:"file ${1:Path}",documentation:`Names the file this read model is realized by.`},{label:`property`,insertText:"${1:property} ${2:Type}",documentation:`A property of the read model — a name and a type reference.`}],s=[{label:`from`,insertText:"from ${1:Source.Stream}",documentation:`Observe matching routed facts only, without filtering stream ids. ESM v10.`},{label:`description`,insertText:'description "${1:what the reducer does}"',documentation:`A human-readable description.`},{label:`on`,insertText:"on ${1:EventType}\n ```csharp\n ${2}\n ```",documentation:`A rule applied when the event occurs, in code or from a file.`}],c=[{label:`description`,insertText:'description "${1:input surface intent}"',documentation:`Report-only description of the form.`},{label:`populate via query`,insertText:"populate via query ${1:Query} by ${2:parameter}",documentation:`Fills the form from a query before it is shown.`},{label:`populate from item`,insertText:`populate from item`,documentation:`Fills the form from the item the screen was opened for.`},{label:`field`,insertText:'field ${1:property} label "${2:Label}"',documentation:`A form field bound to a command property.`},...r],l=[{label:`navigate to`,insertText:"navigate to ${1:Screen}",documentation:`The screen the entry opens.`},{label:`label`,insertText:'label "${1:Label}"',documentation:`The text of the entry.`},{label:`order`,insertText:"order ${1:10}",documentation:`Where the entry sits among the others; lower comes first.`}],u=[{label:`description`,insertText:'description "${1:what the behavior does}"',documentation:`A human-readable description.`},{label:`parameter`,insertText:"parameter ${1:name} ${2:Type}",documentation:`A value the behavior is given where it is attached.`},{label:`order`,insertText:"order ${1:10}",documentation:`The order behaviors attached to the same element run in.`},{label:`on`,insertText:"on ${1|click,select,submit,change,load,unload,enter,leave|}\n ${2:execute command}",documentation:`Wires what happens on an interaction.`}],step=(e,t,n)=>({label:e,insertText:t,documentation:n}),d=[step(`execute`,"execute ${1:command}",`Runs a command.`),step(`navigate to`,"navigate to ${1:Screen}",`Opens a screen.`),step(`open`,"open ${1:Dialog}",`Opens a dialog.`),step(`close`,`close`,`Closes the dialog.`),step(`refresh`,"refresh ${1:query}",`Reloads a query.`),step(`set`,"set ${1:name} ${2:value}",`Sets a value.`),step(`notify`,'notify ${1|info,warning,error|} "${2:message}"',`Shows a notification.`),step(`confirm`,`confirm \${1:message}
|
|
11
11
|
on success
|
|
12
12
|
\${2:execute command}`,`Asks before continuing.`),step(`raise`,"raise ${1:Trigger}",`Raises a trigger.`)],f=[step(`on success`,`on success
|
|
13
13
|
\${1:notify info "Done"}`,`What happens when it succeeds.`),step(`on failure`,`on failure
|