@cratis/screenplay-language 5.3.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 +1 -1
- package/dist/bundles/compiler/Parsing/ApplicationContextParser.js.map +1 -1
- 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.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.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 +4 -4
- 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.map +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.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.map +1 -1
- package/dist/bundles/validation.js +2 -2
- package/dist/bundles/validation.js.map +1 -1
- package/dist/diagnostic-codes.d.ts +1 -0
- package/dist/diagnostic-codes.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-authoring.js","names":["operationAvailability","responseAnalysis","lines","symbols","source","phase","inputs","operation","input","typeReferenceText","name","value","hint","fences","fenceMap","line","withoutComment","before","indent","indentOf","chain","enclosingChain","enclosing","nearestEnclosingLine","analysis","operations","context","qualifiers","target","index","part","event","ownedOperation","system","operationImplementationItems","operationPhaseItems","production","targetLine","inProductionBody","mappedOperation","rhs","properties","parts","property","types","type","concept","operationItems","declaration","reference","start","end","column","location","equals","command","text","header","systems"],"sources":["../../operation-authoring.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { CompletionEntry, operationItems, operationPhaseItems, operationImplementationItems } from './completion-items';\nimport { enclosingChain, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { DocumentSymbols } from './symbols';\nimport { responseAnalysis } from './response-analysis';\nimport { OperationAnalysis, OperationDeclaration, OperationPhase } from './OperationAnalysis';\nimport { TypeReferenceSymbol, typeReferenceText } from './TypeReferenceSymbol';\n\nexport const operationAvailability = 'Syntax-only; not admitted by any supported executable model (ESM) version yet (PLAY0268) (#301). No semantic or requirement identity is assigned.';\n\nexport function analyzeOperations(lines: string[], symbols?: DocumentSymbols) {\n return responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [],\n symbols?.authoringPlacement, symbols?.authoringPath).operations;\n}\n\nexport function phaseState(phase: OperationPhase | null): string {\n return !phase ? 'not declared' : phase.file ? `file ${phase.file.path}` : phase.code ? `inline ${phase.code.language}` : 'pending';\n}\n\nexport function operationDetails(operation: OperationDeclaration): string {\n const inputs = operation.inputs.map(input => `${input.name} ${typeReferenceText(input.type)}`).join('\\n');\n const phase = (name: string, value: OperationPhase | null) => `${name}: ${name === 'compensate' && !value ? 'not declared' : phaseState(value)}${value?.description ? ` — ${value.description}` : ''}${value?.implementation?.hints.map(hint => `\\n hint: ${hint.text}`).join('') ?? ''}`;\n return `**operation ${[...operation.scope, operation.name].join('.')}**\\n\\n${operation.description ?? ''}\\n\\nUses ${operation.uses}\\n\\n\\`\\`\\`screenplay\\n${inputs}\\n\\`\\`\\`\\n\\n${phase('execute', operation.execute)}\\n\\n${phase('compensate', operation.compensate)}\\n\\n${operationAvailability}`;\n}\n\nexport function operationCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n const fences = fenceMap(lines);\n if (fences[line] || withoutComment(before).length < before.length) return null;\n const indent = before.trim() === '' ? before.length : indentOf(lines[line]);\n const chain = enclosingChain(lines, fences, line, indent);\n const enclosing = nearestEnclosingLine(lines, fences, line, indent) ?? '';\n const analysis = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols.authoringPlacement, symbols.authoringPath);\n const operations = analysis.operations;\n const context = operations.contexts.get(line);\n const targets = () => {\n if (!context) return [];\n const reference = before.match(/(?:produces|given\\s+operation|then\\s+(?:operation|compensated))\\s+([\\w.]*)$/)?.[1] ?? before.trim();\n const qualifiers = reference.split('.').slice(0, -1);\n return operations.targets(context.scope).filter(target => qualifiers.length === 0 ||\n qualifiers.length <= target.declaration.scope.length && qualifiers.every((part, index) => target.declaration.scope[target.declaration.scope.length - qualifiers.length + index] === part))\n .map(target => ({ label: target.name, insertText: qualifiers.length > 0 ? target.declaration.name : target.name, documentation: operationDetails(target.declaration) }));\n };\n if (chain.includes('specification') && /^\\s*(?:given\\s+operation|then\\s+(?:operation|compensated))\\s+[\\w.]*$/.test(before)) return targets();\n if (chain[0] === 'command' && /^\\s*produces\\s+[\\w.]*$/.test(before)) return targets().length ? [\n { label: 'event', insertText: 'event ${1:Name}', documentation: 'Declares an inline event.' },\n { label: 'operation', insertText: 'operation ${1:Name}\\n uses ${2:System}\\n ${3:input} ${4:Type} = ${5:source}', documentation: operationAvailability },\n ...symbols.events.map(event => ({ label: event.name, insertText: event.name, documentation: 'Declared event.' })), ...targets()\n ] : null;\n if (context?.commandLine !== undefined && chain[0] === 'produces' && /^produces\\s+when\\b/.test(enclosing) && /^\\s*[\\w.]*$/.test(before)) return targets();\n const ownedOperation = context?.operation;\n const operation = ownedOperation && (line === ownedOperation.location.line - 1 || indent > indentOf(lines[ownedOperation.location.line - 1])) ? ownedOperation : undefined;\n if (operation && /^\\s*uses\\s+\\w*$/.test(before) && !operation.inputs.some(input => input.location.line === line + 1)) return operations.systems.map(system => ({ label: system.name, insertText: system.name, documentation: `${system.description ?? 'External system'}. ${operationAvailability}` }));\n if (chain[0] === 'implementation' && ['execute', 'compensate'].includes(chain[1])) return operationImplementationItems;\n if (['execute', 'compensate'].includes(chain[0]) && operation) return operationPhaseItems;\n const production = context?.production;\n const targetLine = (production?.targetLocation ?? production?.location)?.line;\n const inProductionBody = targetLine !== undefined && line > targetLine - 1 && indent > indentOf(lines[targetLine - 1]);\n const mappedOperation = operation ?? (inProductionBody ? production?.declaration : undefined);\n // Typed ranges include blank lines and comments. The caret must still be inside\n // the target's body, not dedented to a command member or conditional target line.\n // Ancestor keywords cannot own mappings, including deeper composite paths.\n if (mappedOperation) {\n const rhs = before.match(/=\\s*([\\w.]*)$/);\n if (rhs && context?.commandLine !== undefined) {\n const command = analysis.commands.get(context.commandLine);\n let properties: readonly { name: string; type: TypeReferenceSymbol; isGenerated?: boolean }[] = command?.properties ?? [];\n const parts = rhs[1].split('.');\n for (const part of parts.slice(0, -1)) {\n const property = properties.find(property => property.name === part);\n if (!property || property.type.isCollection) return [];\n const types = operations.types.filter(type => type.name === property.type.name);\n if (types.length !== 1) return [];\n properties = types[0].properties;\n }\n return properties.map(property => ({ label: property.name, insertText: property.name, documentation: `${typeReferenceText(property.type)}${property.isGenerated ? ' — generated source, not request input' : ''}. ${operationAvailability}` }));\n }\n if (operation && /^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+\\w*$/.test(before)) return [{ label: 'optional', insertText: 'optional', documentation: 'Allows absence of the complete operation input value.' }];\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.[\\]?]*$/.test(before) && operation) return [...operations.concepts.map(concept => concept.name), ...operations.types.map(type => type.name), 'String', 'Uuid', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime'].map(name => ({ label: name, insertText: name, documentation: 'Operation input type.' }));\n if (operation) return operationItems;\n return mappedOperation.inputs.map(input => ({ label: input.name, insertText: `${input.name} = \\${1:source}`, documentation: `${typeReferenceText(input.type)}. ${operationAvailability}` }));\n }\n if (chain[0] === 'then' && /^then\\s+operation\\s+/.test(enclosing)) {\n const name = enclosing.match(/^then\\s+operation\\s+([\\w.]+)/)?.[1];\n const declaration = operations.references.filter(reference => reference.name === name && reference.location.line - 1 < line && reference.kind === 'operation').at(-1)?.declaration;\n if (declaration) {\n const value = before.match(/^\\s*(\\w+)\\s*=\\s*[^=]*$/);\n if (value) {\n const type = declaration.inputs.find(input => input.name === value[1])?.type;\n const concept = operations.concepts.filter(concept => concept.name === type?.name);\n if (concept.length === 1 && concept[0].type === 'Enum') return concept[0].values.map(value => ({ label: value, insertText: JSON.stringify(value), documentation: `${type?.name} value.` }));\n }\n return declaration.inputs.map(input => ({ label: input.name, insertText: `${input.name} = \\${1:value}`, documentation: `${typeReferenceText(input.type)}. Partial assertion; ${operationAvailability}` }));\n }\n }\n return null;\n}\n\n// Shared by both editor hosts. Only the parser-owned target span can bind a reference;\n// a repeated identifier in a trailing comment or a condition is not that reference.\nexport function operationReferenceAt(analysis: OperationAnalysis, lines: string[], line: number, start: number, end: number) {\n const source = withoutComment(lines[line] ?? '');\n return analysis.references.find(reference => {\n const target = reference.targetLocation ?? reference.location;\n return target.line === line + 1 && start >= target.column && end <= target.column + reference.name.length &&\n source.slice(target.column - 1, target.column - 1 + reference.name.length) === reference.name;\n });\n}\n\nexport function operationHover(lines: string[], line: number, start: number, end: number, symbols?: DocumentSymbols): string | null {\n const analysis = analyzeOperations(lines, symbols);\n const source = lines[line] ?? '';\n const at = (location: { line: number; column: number }, name: string) => {\n const column = location.column + (source[location.column - 1] === '@' ? 1 : 0);\n return location.line === line + 1 && start === column && end === column + name.length && source.slice(start - 1, end - 1) === name;\n };\n const context = analysis.contexts.get(line);\n const property = context?.operation?.inputs.find(input => at(input.location, input.name));\n if (property) return `**${property.name}** — ${typeReferenceText(property.type)}. Operation input, not a command request field. ${operationAvailability}`;\n const equals = source.indexOf('=');\n if (equals >= 0 && start - 1 > equals && context?.commandLine !== undefined && (context.operation || context.production?.declaration)) {\n const command = responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(text => text !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, symbols?.authoringPath).commands.get(context.commandLine);\n const expression = source.slice(equals + 1, end - 1).trim();\n const parts = expression.split('.');\n let properties: readonly { name: string; type: TypeReferenceSymbol }[] = command?.properties ?? [];\n for (const [index, part] of parts.entries()) {\n const property = properties.find(property => property.name === part);\n if (!property) break;\n if (index === parts.length - 1) return `**${part}** — ${typeReferenceText(property.type)}. Command source for an operation input. ${operationAvailability}`;\n const types = analysis.types.filter(type => type.name === property.type.name);\n if (types.length !== 1 || property.type.isCollection) break;\n properties = types[0].properties;\n }\n }\n const reference = operationReferenceAt(analysis, lines, line, start, end);\n if (reference?.declaration) return operationDetails(reference.declaration);\n if (reference?.kind === 'ambiguous') return `Ambiguous production: no declaration kind was selected. ${operationAvailability}`;\n const operation = context?.operation;\n if (operation && operation.location.line === line + 1) {\n const header = withoutComment(source).match(/^\\s*(?:produces\\s+)?operation\\s+/)?.[0];\n if (header && start === header.length + 1 && end === start + operation.name.length) return operationDetails(operation);\n }\n if (operation?.usesLocation?.line === line + 1 && start >= operation.usesLocation.column && end <= operation.usesLocation.column + operation.uses.length && withoutComment(source).slice(start - 1, end - 1) === operation.uses.slice(start - operation.usesLocation.column, end - operation.usesLocation.column)) {\n const systems = analysis.systems.filter(system => system.name === operation.uses);\n return systems.length === 1 ? `**system ${systems[0].name}**\\n\\n${systems[0].description ?? ''}\\n\\n${operationAvailability}` : `Unresolved or ambiguous external system. ${operationAvailability}`;\n }\n for (const phase of [operation?.execute, operation?.compensate]) {\n if (!phase) continue;\n if (phase.location.line === line + 1 || phase.implementation?.location.line === line + 1 || phase.implementation?.hints.some(hint => hint.location.line === line + 1)) return `${phaseState(phase)}\\n\\n${phase.description ?? ''}\\n\\n${phase.implementation?.hints.map(hint => hint.text).join('\\n') ?? ''}\\n\\n${operationAvailability}`;\n }\n const system = analysis.systems.find(system => system.location.path === (symbols?.authoringPath ?? 'current.play') && system.location.line === line + 1);\n return system ? `**system ${system.name}**\\n\\n${system.description ?? ''}\\n\\n${operationAvailability}` : null;\n}\n"],"mappings":"2ZAUA,MAAaA,EAAwB,oJAErC,SAAgB,kBAAkB,EAAiB,EAA2B,CAC1E,OAAOC,EAAiBC,EAAOC,GAAS,oBAAsBA,GAAS,kBAAkB,OAAO,GAAUC,IAAWF,EAAM,KAAK;CAAI,CAAC,GAAK,CAAC,EACvIC,GAAS,mBAAoBA,GAAS,aAAa,CAAC,CAAC,UAC7D,CAEA,SAAgB,WAAW,EAAsC,CAC7D,OAAQE,EAAyBA,EAAM,KAAO,QAAQA,EAAM,KAAK,OAASA,EAAM,KAAO,UAAUA,EAAM,KAAK,WAAa,UAAzG,cACpB,CAEA,SAAgB,iBAAiB,EAAyC,CACtE,IAAMC,EAASC,EAAU,OAAO,IAAI,GAAS,GAAGC,EAAM,KAAK,GAAGC,EAAkBD,EAAM,IAAI,GAAG,CAAC,CAAC,KAAK;CAAI,EAClG,OAAS,EAAc,IAAiC,GAAGE,EAAK,IAAIA,IAAS,cAAgB,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AAU,aAAa,QAAU4C,GAAO5C,EAAU,aAAa,OAASA,EAAU,KAAK,QAAUS,EAAeZ,CAAM,CAAC,CAAC,MAAM8C,EAAQ,EAAGC,EAAM,CAAC,IAAM5C,EAAU,KAAK,MAAM2C,EAAQ3C,EAAU,aAAa,OAAQ4C,EAAM5C,EAAU,aAAa,MAAM,EAAG,CAC/S,IAAMmD,EAAUlC,EAAS,QAAQ,OAAO,GAAUS,EAAO,OAAS1B,EAAU,IAAI,EAChF,OAAOmD,EAAQ,SAAW,EAAI,YAAYA,EAAQ,EAAE,CAAC,KAAK,QAAQA,EAAQ,EAAE,CAAC,aAAe,GAAG,MAAM1D,IAA0B,4CAA4CA,GAC/K,CACA,IAAK,IAAMK,IAAS,CAACE,GAAW,QAASA,GAAW,UAAU,EAC1D,GAAKF,IACDA,EAAM,SAAS,OAASU,EAAO,GAAKV,EAAM,gBAAgB,SAAS,OAASU,EAAO,GAAKV,EAAM,gBAAgB,MAAM,KAAK,GAAQO,EAAK,SAAS,OAASG,EAAO,CAAC,GAAG,MAAO,GAAG,WAAWV,CAAK,EAAE,MAAMA,EAAM,aAAe,GAAG,MAAMA,EAAM,gBAAgB,MAAM,IAAI,GAAQO,EAAK,IAAI,CAAC,CAAC,KAAK;CAAI,GAAK,GAAG,MAAMZ,IAErT,IAAMiC,EAAST,EAAS,QAAQ,KAAK,GAAUS,EAAO,SAAS,QAAU9B,GAAS,eAAiB,iBAAmB8B,EAAO,SAAS,OAASlB,EAAO,CAAC,EACvJ,OAAOkB,EAAS,YAAYA,EAAO,KAAK,QAAQA,EAAO,aAAe,GAAG,MAAMjC,IAA0B,IAC7G"}
|
|
1
|
+
{"version":3,"file":"operation-authoring.js","names":["operationAvailability","responseAnalysis","lines","symbols","source","phase","inputs","operation","input","typeReferenceText","name","value","hint","fences","fenceMap","line","withoutComment","before","indent","indentOf","chain","enclosingChain","enclosing","nearestEnclosingLine","analysis","operations","context","qualifiers","target","index","part","event","ownedOperation","system","operationImplementationItems","operationPhaseItems","production","targetLine","inProductionBody","mappedOperation","rhs","properties","parts","property","types","type","concept","operationItems","declaration","reference","start","end","column","location","equals","command","text","header","systems"],"sources":["../../operation-authoring.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { CompletionEntry, operationItems, operationPhaseItems, operationImplementationItems } from './completion-items';\nimport { enclosingChain, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { DocumentSymbols } from './symbols';\nimport { responseAnalysis } from './response-analysis';\nimport { OperationAnalysis, OperationDeclaration, OperationPhase } from './OperationAnalysis';\nimport { TypeReferenceSymbol, typeReferenceText } from './TypeReferenceSymbol';\n\nexport const operationAvailability = 'Syntax-only; not admitted by any supported executable model (ESM) version yet (PLAY0268) (#301). No semantic or requirement identity is assigned.';\n\nexport function analyzeOperations(lines: string[], symbols?: DocumentSymbols) {\n return responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [],\n symbols?.authoringPlacement, symbols?.authoringPath).operations;\n}\n\nexport function phaseState(phase: OperationPhase | null): string {\n return !phase ? 'not declared' : phase.file ? `file ${phase.file.path}` : phase.code ? `inline ${phase.code.language}` : 'pending';\n}\n\nexport function operationDetails(operation: OperationDeclaration): string {\n const inputs = operation.inputs.map(input => `${input.name} ${typeReferenceText(input.type)}`).join('\\n');\n const phase = (name: string, value: OperationPhase | null) => `${name}: ${name === 'compensate' && !value ? 'not declared' : phaseState(value)}${value?.description ? ` — ${value.description}` : ''}${value?.implementation?.hints.map(hint => `\\n hint: ${hint.text}`).join('') ?? ''}`;\n return `**operation ${[...operation.scope, operation.name].join('.')}**\\n\\n${operation.description ?? ''}\\n\\nUses ${operation.uses}\\n\\n\\`\\`\\`screenplay\\n${inputs}\\n\\`\\`\\`\\n\\n${phase('execute', operation.execute)}\\n\\n${phase('compensate', operation.compensate)}\\n\\n${operationAvailability}`;\n}\n\nexport function operationCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n const fences = fenceMap(lines);\n if (fences[line] || withoutComment(before).length < before.length) return null;\n const indent = before.trim() === '' ? before.length : indentOf(lines[line]);\n const chain = enclosingChain(lines, fences, line, indent);\n const enclosing = nearestEnclosingLine(lines, fences, line, indent) ?? '';\n const analysis = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols.authoringPlacement, symbols.authoringPath);\n const operations = analysis.operations;\n const context = operations.contexts.get(line);\n const targets = () => {\n if (!context) return [];\n const reference = before.match(/(?:produces|given\\s+operation|then\\s+(?:operation|compensated))\\s+([\\w.]*)$/)?.[1] ?? before.trim();\n const qualifiers = reference.split('.').slice(0, -1);\n return operations.targets(context.scope).filter(target => qualifiers.length === 0 ||\n qualifiers.length <= target.declaration.scope.length && qualifiers.every((part, index) => target.declaration.scope[target.declaration.scope.length - qualifiers.length + index] === part))\n .map(target => ({ label: target.name, insertText: qualifiers.length > 0 ? target.declaration.name : target.name, documentation: operationDetails(target.declaration) }));\n };\n if (chain.includes('specification') && /^\\s*(?:given\\s+operation|then\\s+(?:operation|compensated))\\s+[\\w.]*$/.test(before)) return targets();\n if (chain[0] === 'command' && /^\\s*produces\\s+[\\w.]*$/.test(before)) return targets().length ? [\n { label: 'event', insertText: 'event ${1:Name}', documentation: 'Declares an inline event.' },\n { label: 'operation', insertText: 'operation ${1:Name}\\n uses ${2:System}\\n ${3:input} ${4:Type} = ${5:source}', documentation: operationAvailability },\n ...symbols.events.map(event => ({ label: event.name, insertText: event.name, documentation: 'Declared event.' })), ...targets()\n ] : null;\n if (context?.commandLine !== undefined && chain[0] === 'produces' && /^produces\\s+when\\b/.test(enclosing) && /^\\s*[\\w.]*$/.test(before)) return targets();\n const ownedOperation = context?.operation;\n const operation = ownedOperation && (line === ownedOperation.location.line - 1 || indent > indentOf(lines[ownedOperation.location.line - 1])) ? ownedOperation : undefined;\n if (operation && /^\\s*uses\\s+\\w*$/.test(before) && !operation.inputs.some(input => input.location.line === line + 1)) return operations.systems.map(system => ({ label: system.name, insertText: system.name, documentation: `${system.description ?? 'External system'}. ${operationAvailability}` }));\n if (chain[0] === 'implementation' && ['execute', 'compensate'].includes(chain[1])) return operationImplementationItems;\n if (['execute', 'compensate'].includes(chain[0]) && operation) return operationPhaseItems;\n const production = context?.production;\n const targetLine = (production?.targetLocation ?? production?.location)?.line;\n const inProductionBody = targetLine !== undefined && line > targetLine - 1 && indent > indentOf(lines[targetLine - 1]);\n const mappedOperation = operation ?? (inProductionBody ? production?.declaration : undefined);\n // Typed ranges include blank lines and comments. The caret must still be inside\n // the target's body, not dedented to a command member or conditional target line.\n // Ancestor keywords cannot own mappings, including deeper composite paths.\n if (mappedOperation) {\n const rhs = before.match(/=\\s*([\\w.]*)$/);\n if (rhs && context?.commandLine !== undefined) {\n const command = analysis.commands.get(context.commandLine);\n let properties: readonly { name: string; type: TypeReferenceSymbol; isGenerated?: boolean }[] = command?.properties ?? [];\n const parts = rhs[1].split('.');\n for (const part of parts.slice(0, -1)) {\n const property = properties.find(property => property.name === part);\n if (!property || property.type.isCollection) return [];\n const types = operations.types.filter(type => type.name === property.type.name);\n if (types.length !== 1) return [];\n properties = types[0].properties;\n }\n return properties.map(property => ({ label: property.name, insertText: property.name, documentation: `${typeReferenceText(property.type)}${property.isGenerated ? ' — generated source, not request input' : ''}. ${operationAvailability}` }));\n }\n if (operation && /^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+\\w*$/.test(before)) return [{ label: 'optional', insertText: 'optional', documentation: 'Allows absence of the complete operation input value.' }];\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.[\\]?]*$/.test(before) && operation) return [...operations.concepts.map(concept => concept.name), ...operations.types.map(type => type.name), 'String', 'Uuid', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime'].map(name => ({ label: name, insertText: name, documentation: 'Operation input type.' }));\n if (operation) return operationItems;\n return mappedOperation.inputs.map(input => ({ label: input.name, insertText: `${input.name} = \\${1:source}`, documentation: `${typeReferenceText(input.type)}. ${operationAvailability}` }));\n }\n if (chain[0] === 'then' && /^then\\s+operation\\s+/.test(enclosing)) {\n const name = enclosing.match(/^then\\s+operation\\s+([\\w.]+)/)?.[1];\n const declaration = operations.references.filter(reference => reference.name === name && reference.location.line - 1 < line && reference.kind === 'operation').at(-1)?.declaration;\n if (declaration) {\n const value = before.match(/^\\s*(\\w+)\\s*=\\s*[^=]*$/);\n if (value) {\n const type = declaration.inputs.find(input => input.name === value[1])?.type;\n const concept = operations.concepts.filter(concept => concept.name === type?.name);\n if (concept.length === 1 && concept[0].type === 'Enum') return concept[0].values.map(value => ({ label: value, insertText: JSON.stringify(value), documentation: `${type?.name} value.` }));\n }\n return declaration.inputs.map(input => ({ label: input.name, insertText: `${input.name} = \\${1:value}`, documentation: `${typeReferenceText(input.type)}. Partial assertion; ${operationAvailability}` }));\n }\n }\n return null;\n}\n\n// Shared by both editor hosts. Only the parser-owned target span can bind a reference;\n// a repeated identifier in a trailing comment or a condition is not that reference.\nexport function operationReferenceAt(analysis: OperationAnalysis, lines: string[], line: number, start: number, end: number) {\n const source = withoutComment(lines[line] ?? '');\n return analysis.references.find(reference => {\n const target = reference.targetLocation ?? reference.location;\n return target.line === line + 1 && start >= target.column && end <= target.column + reference.name.length &&\n source.slice(target.column - 1, target.column - 1 + reference.name.length) === reference.name;\n });\n}\n\nexport function operationHover(lines: string[], line: number, start: number, end: number, symbols?: DocumentSymbols): string | null {\n const analysis = analyzeOperations(lines, symbols);\n const source = lines[line] ?? '';\n const at = (location: { line: number; column: number }, name: string) => {\n const column = location.column + (source[location.column - 1] === '@' ? 1 : 0);\n return location.line === line + 1 && start === column && end === column + name.length && source.slice(start - 1, end - 1) === name;\n };\n const context = analysis.contexts.get(line);\n const property = context?.operation?.inputs.find(input => at(input.location, input.name));\n if (property) return `**${property.name}** — ${typeReferenceText(property.type)}. Operation input, not a command request field. ${operationAvailability}`;\n const equals = source.indexOf('=');\n if (equals >= 0 && start - 1 > equals && context?.commandLine !== undefined && (context.operation || context.production?.declaration)) {\n const command = responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(text => text !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, symbols?.authoringPath).commands.get(context.commandLine);\n const expression = source.slice(equals + 1, end - 1).trim();\n const parts = expression.split('.');\n let properties: readonly { name: string; type: TypeReferenceSymbol }[] = command?.properties ?? [];\n for (const [index, part] of parts.entries()) {\n const property = properties.find(property => property.name === part);\n if (!property) break;\n if (index === parts.length - 1) return `**${part}** — ${typeReferenceText(property.type)}. Command source for an operation input. ${operationAvailability}`;\n const types = analysis.types.filter(type => type.name === property.type.name);\n if (types.length !== 1 || property.type.isCollection) break;\n properties = types[0].properties;\n }\n }\n const reference = operationReferenceAt(analysis, lines, line, start, end);\n if (reference?.declaration) return operationDetails(reference.declaration);\n if (reference?.kind === 'ambiguous') return `Ambiguous production: no declaration kind was selected. ${operationAvailability}`;\n const operation = context?.operation;\n if (operation && operation.location.line === line + 1) {\n const header = withoutComment(source).match(/^\\s*(?:produces\\s+)?operation\\s+/)?.[0];\n if (header && start === header.length + 1 && end === start + operation.name.length) return operationDetails(operation);\n }\n if (operation?.usesLocation?.line === line + 1 && start >= operation.usesLocation.column && end <= operation.usesLocation.column + operation.uses.length && withoutComment(source).slice(start - 1, end - 1) === operation.uses.slice(start - operation.usesLocation.column, end - operation.usesLocation.column)) {\n const systems = analysis.systems.filter(system => system.name === operation.uses);\n return systems.length === 1 ? `**system ${systems[0].name}**\\n\\n${systems[0].description ?? ''}\\n\\n${operationAvailability}` : `Unresolved or ambiguous external system. ${operationAvailability}`;\n }\n for (const phase of [operation?.execute, operation?.compensate]) {\n if (!phase) continue;\n if (phase.location.line === line + 1 || phase.implementation?.location.line === line + 1 || phase.implementation?.hints.some(hint => hint.location.line === line + 1)) return `${phaseState(phase)}\\n\\n${phase.description ?? ''}\\n\\n${phase.implementation?.hints.map(hint => hint.text).join('\\n') ?? ''}\\n\\n${operationAvailability}`;\n }\n const system = analysis.systems.find(system => system.location.path === (symbols?.authoringPath ?? 'current.play') && system.location.line === line + 1);\n return system ? `**system ${system.name}**\\n\\n${system.description ?? ''}\\n\\n${operationAvailability}` : null;\n}\n"],"mappings":"A,2ZAUA,MAAaA,EAAwB,oJAErC,SAAgB,kBAAkB,EAAiB,EAA2B,CAC1E,OAAOC,EAAiBC,EAAOC,GAAS,oBAAsBA,GAAS,kBAAkB,OAAO,GAAUC,IAAWF,EAAM,KAAK;CAAI,CAAC,GAAK,CAAC,EACvIC,GAAS,mBAAoBA,GAAS,aAAa,CAAC,CAAC,UAC7D,CAEA,SAAgB,WAAW,EAAsC,CAC7D,OAAQE,EAAyBA,EAAM,KAAO,QAAQA,EAAM,KAAK,OAASA,EAAM,KAAO,UAAUA,EAAM,KAAK,WAAa,UAAzG,cACpB,CAEA,SAAgB,iBAAiB,EAAyC,CACtE,IAAMC,EAASC,EAAU,OAAO,IAAI,GAAS,GAAGC,EAAM,KAAK,GAAGC,EAAkBD,EAAM,IAAI,GAAG,CAAC,CAAC,KAAK;CAAI,EAClG,OAAS,EAAc,IAAiC,GAAGE,EAAK,IAAIA,IAAS,cAAgB,CAACC,EAAQ,eAAiB,WAAWA,CAAK,IAAIA,GAAO,YAAc,MAAMA,EAAM,cAAgB,KAAKA,GAAO,gBAAgB,MAAM,IAAI,GAAQ,aAAaC,EAAK,MAAM,CAAC,CAAC,KAAK,EAAE,GAAK,KACtR,MAAO,eAAe,CAAC,GAAGL,EAAU,MAAOA,EAAU,IAAI,CAAC,CAAC,KAAK,GAAG,EAAE,QAAQA,EAAU,aAAe,GAAG,WAAWA,EAAU,KAAK,wBAAwBD,EAAO,cAAc,MAAM,UAAWC,EAAU,OAAO,EAAE,MAAM,MAAM,aAAcA,EAAU,UAAU,EAAE,MAAMP,GAC9Q,CAEA,SAAgB,qBAAqB,EAAiB,EAAc,EAAgB,EAAoD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K,IAAS,CAACE,GAAW,QAASA,GAAW,UAAU,EAC1D,GAAKF,IACDA,EAAM,SAAS,OAASU,EAAO,GAAKV,EAAM,gBAAgB,SAAS,OAASU,EAAO,GAAKV,EAAM,gBAAgB,MAAM,KAAK,GAAQO,EAAK,SAAS,OAASG,EAAO,CAAC,GAAG,MAAO,GAAG,WAAWV,CAAK,EAAE,MAAMA,EAAM,aAAe,GAAG,MAAMA,EAAM,gBAAgB,MAAM,IAAI,GAAQO,EAAK,IAAI,CAAC,CAAC,KAAK;CAAI,GAAK,GAAG,MAAMZ,IAErT,IAAMiC,EAAST,EAAS,QAAQ,KAAK,GAAUS,EAAO,SAAS,QAAU9B,GAAS,eAAiB,iBAAmB8B,EAAO,SAAS,OAASlB,EAAO,CAAC,EACvJ,OAAOkB,EAAS,YAAYA,EAAO,KAAK,QAAQA,EAAO,aAAe,GAAG,MAAMjC,IAA0B,IAC7G,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./_virtual/_virtual/_rolldown/runtime.js";import
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import"./compiler/index.js";import{synthesizePersonaCaller as e}from"./compiler/Syntax/PersonaCallers.js";import{withoutComment as t}from"./document-context.js";import{bmpWordCharacters as n}from"./bmp-word-characters.js";const r=RegExp(`^\\s*given caller as\\s+[${n}]*$`),i=RegExp(`^\\s*(?:given caller as|persona)\\s+([A-Za-z_][${n}]*)\\s*$`);function personaAnalysis(n,a){let o=n,s=new Map(o.personas.map(t=>[t.name,e(t,o)]));return{completions(e,n){return t(n).length<n.length||!r.test(n)?null:o.personas.map(e=>({label:e.name,insertText:e.name,documentation:`Authenticated deterministic witness of this persona. Negation, needed nonliteral claims, role-URI claims, implementations and policyless personas require an explicit caller.`}))},hover(e,n,r){let o=t(a[e]??``),c=i.exec(o);if(!c||o.slice(n-1,r-1)!==c[1])return null;let l=s.get(c[1]);return l?l.refusal?`**${c[1]} caller** — ${l.refusal.reason}${l.refusal.policy?` in policy ${l.refusal.policy}`:``}. Use an explicit \`given caller\`.`:`**${c[1]} caller** — authenticated.\n\nRoles: ${l.caller.roles.map(e=>JSON.stringify(e)).join(`, `)||`(none)`}.\n\nClaims: ${l.caller.claims.map(e=>`${JSON.stringify(e.type)} = ${JSON.stringify(e.value)}`).join(`, `)||`(none)`}.\n\nContributions: ${l.contributions.map(e=>`${e.policy}: ${e.kind}${e.type?` ${JSON.stringify(e.type)}`:``} ${JSON.stringify(e.value)}`).join(`; `)}. This witnesses one deterministic minimal caller, not every caller fitting the persona.`:null}}}export{personaAnalysis};
|
|
2
2
|
//# sourceMappingURL=persona-analysis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persona-analysis.js","names":["callerPrefix","bmpWordCharacters","personaLine","application","syntax","results","persona","synthesizePersonaCaller","withoutComment","before","text","lines","line","match","start","end","result","role","claim","atom"],"sources":["../../persona-analysis.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ApplicationSyntax, synthesizePersonaCaller } from '@cratis/screenplay-compiler';\nimport { CompletionEntry } from './completion-items';\nimport { withoutComment } from './document-context';\nimport { bmpWordCharacters } from './bmp-word-characters';\n\nconst callerPrefix = new RegExp(`^\\\\s*given caller as\\\\s+[${bmpWordCharacters}]*$`);\nconst personaLine = new RegExp(`^\\\\s*(?:given caller as|persona)\\\\s+([A-Za-z_][${bmpWordCharacters}]*)\\\\s*$`);\n\nexport function personaAnalysis(syntax: unknown, lines: string[]) {\n const application = syntax as ApplicationSyntax;\n const results = new Map(application.personas.map(persona => [persona.name, synthesizePersonaCaller(persona, application)]));\n return {\n completions(_line: number, before: string): CompletionEntry[] | null {\n if (withoutComment(before).length < before.length || !callerPrefix.test(before)) return null;\n return application.personas.map(persona => ({ label: persona.name, insertText: persona.name, documentation: 'Authenticated deterministic witness of this persona. Negation, needed nonliteral claims, role-URI claims, implementations and policyless personas require an explicit caller.' }));\n },\n hover(line: number, start: number, end: number): string | null {\n const text = withoutComment(lines[line] ?? '');\n const match = personaLine.exec(text);\n if (!match || text.slice(start - 1, end - 1) !== match[1]) return null;\n const result = results.get(match[1]);\n if (!result) return null;\n if (result.refusal) return `**${match[1]} caller** — ${result.refusal.reason}${result.refusal.policy ? ` in policy ${result.refusal.policy}` : ''}. Use an explicit \\`given caller\\`.`;\n return `**${match[1]} caller** — authenticated.\\n\\nRoles: ${result.caller!.roles.map(role => JSON.stringify(role)).join(', ') || '(none)'}.\\n\\nClaims: ${result.caller!.claims.map(claim => `${JSON.stringify(claim.type)} = ${JSON.stringify(claim.value)}`).join(', ') || '(none)'}.\\n\\nContributions: ${result.contributions.map(atom => `${atom.policy}: ${atom.kind}${atom.type ? ` ${JSON.stringify(atom.type)}` : ''} ${JSON.stringify(atom.value)}`).join('; ')}. This witnesses one deterministic minimal caller, not every caller fitting the persona.`;\n },\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"persona-analysis.js","names":["callerPrefix","bmpWordCharacters","personaLine","application","syntax","results","persona","synthesizePersonaCaller","withoutComment","before","text","lines","line","match","start","end","result","role","claim","atom"],"sources":["../../persona-analysis.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ApplicationSyntax, synthesizePersonaCaller } from '@cratis/screenplay-compiler';\nimport { CompletionEntry } from './completion-items';\nimport { withoutComment } from './document-context';\nimport { bmpWordCharacters } from './bmp-word-characters';\n\nconst callerPrefix = new RegExp(`^\\\\s*given caller as\\\\s+[${bmpWordCharacters}]*$`);\nconst personaLine = new RegExp(`^\\\\s*(?:given caller as|persona)\\\\s+([A-Za-z_][${bmpWordCharacters}]*)\\\\s*$`);\n\nexport function personaAnalysis(syntax: unknown, lines: string[]) {\n const application = syntax as ApplicationSyntax;\n const results = new Map(application.personas.map(persona => [persona.name, synthesizePersonaCaller(persona, application)]));\n return {\n completions(_line: number, before: string): CompletionEntry[] | null {\n if (withoutComment(before).length < before.length || !callerPrefix.test(before)) return null;\n return application.personas.map(persona => ({ label: persona.name, insertText: persona.name, documentation: 'Authenticated deterministic witness of this persona. Negation, needed nonliteral claims, role-URI claims, implementations and policyless personas require an explicit caller.' }));\n },\n hover(line: number, start: number, end: number): string | null {\n const text = withoutComment(lines[line] ?? '');\n const match = personaLine.exec(text);\n if (!match || text.slice(start - 1, end - 1) !== match[1]) return null;\n const result = results.get(match[1]);\n if (!result) return null;\n if (result.refusal) return `**${match[1]} caller** — ${result.refusal.reason}${result.refusal.policy ? ` in policy ${result.refusal.policy}` : ''}. Use an explicit \\`given caller\\`.`;\n return `**${match[1]} caller** — authenticated.\\n\\nRoles: ${result.caller!.roles.map(role => JSON.stringify(role)).join(', ') || '(none)'}.\\n\\nClaims: ${result.caller!.claims.map(claim => `${JSON.stringify(claim.type)} = ${JSON.stringify(claim.value)}`).join(', ') || '(none)'}.\\n\\nContributions: ${result.contributions.map(atom => `${atom.policy}: ${atom.kind}${atom.type ? ` ${JSON.stringify(atom.type)}` : ''} ${JSON.stringify(atom.value)}`).join('; ')}. This witnesses one deterministic minimal caller, not every caller fitting the persona.`;\n },\n };\n}\n"],"mappings":"A,+QAQA,MAAMA,EAAmB,OAAO,4BAA4BC,EAAkB,IAAI,EAC5EC,EAAkB,OAAO,kDAAkDD,EAAkB,SAAS,EAE5G,SAAgB,gBAAgB,EAAiB,EAAiB,CAC9D,IAAME,EAAcC,EACdC,EAAU,IAAI,IAAIF,EAAY,SAAS,IAAI,GAAW,CAACG,EAAQ,KAAMC,EAAwBD,EAASH,CAAW,CAAC,CAAC,CAAC,EAC1H,MAAO,CACH,YAAY,EAAe,EAA0C,CAEjE,OADIK,EAAeC,CAAM,CAAC,CAAC,OAASA,EAAO,QAAU,CAACT,EAAa,KAAKS,CAAM,EAAU,KACjFN,EAAY,SAAS,IAAI,IAAY,CAAE,MAAOG,EAAQ,KAAM,WAAYA,EAAQ,KAAM,cAAe,+KAAgL,EAAE,CAClS,EACA,MAAM,EAAc,EAAe,EAA4B,CAC3D,IAAMI,EAAOF,EAAeG,EAAMC,IAAS,EAAE,EACvCC,EAAQX,EAAY,KAAKQ,CAAI,EACnC,GAAI,CAACG,GAASH,EAAK,MAAMI,EAAQ,EAAGC,EAAM,CAAC,IAAMF,EAAM,GAAI,OAAO,KAClE,IAAMG,EAASX,EAAQ,IAAIQ,EAAM,EAAE,EAGnC,OAFKG,EACDA,EAAO,QAAgB,KAAKH,EAAM,GAAG,cAAcG,EAAO,QAAQ,SAASA,EAAO,QAAQ,OAAS,cAAcA,EAAO,QAAQ,SAAW,GAAG,qCAC3I,KAAKH,EAAM,GAAG,uCAAuCG,EAAO,OAAQ,MAAM,IAAI,GAAQ,KAAK,UAAUC,CAAI,CAAC,CAAC,CAAC,KAAK,IAAI,GAAK,SAAS,eAAeD,EAAO,OAAQ,OAAO,IAAI,GAAS,GAAG,KAAK,UAAUE,EAAM,IAAI,EAAE,KAAK,KAAK,UAAUA,EAAM,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,GAAK,SAAS,sBAAsBF,EAAO,cAAc,IAAI,GAAQ,GAAGG,EAAK,OAAO,IAAIA,EAAK,OAAOA,EAAK,KAAO,IAAI,KAAK,UAAUA,EAAK,IAAI,IAAM,GAAG,GAAG,KAAK,UAAUA,EAAK,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,0FAFpb,IAGxB,CACJ,CACJ,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./_virtual/_virtual/_rolldown/runtime.js";import{eventAnalysisSource as e}from"./event-analysis-source.js";import{
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{eventAnalysisSource as e}from"./event-analysis-source.js";import{propertyTypeReference as t,scanDocument as n}from"./symbols.js";import{responseAnalysis as r}from"./response-analysis.js";function productionDestinations(e){let n=e.properties.filter(e=>e.isIdentifier&&!t(e).isOptional&&!t(e).isCollection),r=n.length===1?n[0].name:void 0,i=e.produces??[];return{identifier:r,mixed:i.some(e=>e.target!==void 0&&e.target!==r)||i.some(e=>e.inline&&e.target===void 0)&&i.some(e=>!e.inline&&e.target===void 0)}}function destinationHints(t,i){let a=r(t,i?.authoringDocuments??i?.authoringSources,i?.authoringPlacement,i?.authoringPath),o=e(t);return n(o).commands.map(e=>({...e,produces:e.produces?.filter(e=>!a.operationProductionLines?.has(e.line)&&a.operations.references.some(t=>t.location.line-1===e.line&&t.kind===`event`)),productionHeaders:e.productionHeaders?.filter(e=>!a.operationProductionLines?.has(e))})).flatMap(e=>{let{identifier:t,mixed:n}=productionDestinations(e);if(n||e.productionHeaders?.length!==e.produces?.length)return[];let r=e.produces?.some(e=>e.target!==void 0||e.inline);return(e.produces??[]).flatMap(e=>e.target!==void 0||e.inline&&(t===void 0||/\bgeneration\b/.test(o[e.line]))||!e.inline&&r?[]:[{line:e.line,column:o[e.line].length+1,label:e.inline?`for ${t}`:`for <new event source>`}])})}export{destinationHints,productionDestinations};
|
|
2
2
|
//# sourceMappingURL=production-destinations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"production-destinations.js","names":["identifiers","command","property","propertyTypeReference","identifier","productions","production","analysis","responseAnalysis","lines","application","source","eventAnalysisSource","scanDocument","reference","line","mixed","hasPromotedDestination","sibling"],"sources":["../../production-destinations.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DestinationHint } from './DestinationHint';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { CommandSymbol, DocumentSymbols, propertyTypeReference, scanDocument } from './symbols';\nimport { responseAnalysis } from './response-analysis';\n\nexport function productionDestinations(command: CommandSymbol): { identifier?: string; mixed: boolean } {\n const identifiers = command.properties.filter(property => property.isIdentifier && !propertyTypeReference(property).isOptional && !propertyTypeReference(property).isCollection);\n const identifier = identifiers.length === 1 ? identifiers[0].name : undefined;\n const productions = command.produces ?? [];\n const mixed = productions.some(production => production.target !== undefined && production.target !== identifier) ||\n (productions.some(production => production.inline && production.target === undefined) &&\n productions.some(production => !production.inline && production.target === undefined));\n return { identifier, mixed };\n}\n\n// Shared by both editor adapters. Never suggest that a legacy allocated source is the command identifier.\nexport function destinationHints(lines: string[], application?: DocumentSymbols): DestinationHint[] {\n const analysis = responseAnalysis(lines, application?.authoringDocuments ?? application?.authoringSources, application?.authoringPlacement, application?.authoringPath);\n const source = eventAnalysisSource(lines);\n return scanDocument(source).commands.map(command => ({ ...command,\n produces: command.produces?.filter(production => !analysis.operationProductionLines?.has(production.line) && analysis.operations.references.some(reference => reference.location.line - 1 === production.line && reference.kind === 'event')),\n productionHeaders: command.productionHeaders?.filter(line => !analysis.operationProductionLines?.has(line)),\n })).flatMap(command => {\n const { identifier, mixed } = productionDestinations(command);\n if (mixed || command.productionHeaders?.length !== command.produces?.length) return [];\n const hasPromotedDestination = command.produces?.some(sibling => sibling.target !== undefined || sibling.inline);\n return (command.produces ?? []).flatMap(production => {\n if (production.target !== undefined || (production.inline && (identifier === undefined || /\\bgeneration\\b/.test(source[production.line])))) return [];\n // A sibling destination can promote the command default in the legacy binder.\n if (!production.inline && hasPromotedDestination) return [];\n return [{ line: production.line, column: source[production.line].length + 1, label: production.inline ? `for ${identifier}` : 'for <new event source>' }];\n });\n });\n}\n"],"mappings":"mPAQA,SAAgB,uBAAuB,EAAiE,CACpG,IAAMA,EAAcC,EAAQ,WAAW,OAAO,GAAYC,EAAS,cAAgB,CAACC,EAAsBD,CAAQ,CAAC,CAAC,YAAc,CAACC,EAAsBD,CAAQ,CAAC,CAAC,YAAY,EACzKE,EAAaJ,EAAY,SAAW,EAAIA,EAAY,EAAE,CAAC,KAAO,IAAA,GAC9DK,EAAcJ,EAAQ,UAAY,CAAC,EAIzC,MAAO,CAAE,aAAY,MAHPI,EAAY,KAAK,GAAcC,EAAW,SAAW,IAAA,IAAaA,EAAW,SAAWF,CAAU,GAC3GC,EAAY,KAAK,GAAcC,EAAW,QAAUA,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","names":["identifiers","command","property","propertyTypeReference","identifier","productions","production","analysis","responseAnalysis","lines","application","source","eventAnalysisSource","scanDocument","reference","line","mixed","hasPromotedDestination","sibling"],"sources":["../../production-destinations.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DestinationHint } from './DestinationHint';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { CommandSymbol, DocumentSymbols, propertyTypeReference, scanDocument } from './symbols';\nimport { responseAnalysis } from './response-analysis';\n\nexport function productionDestinations(command: CommandSymbol): { identifier?: string; mixed: boolean } {\n const identifiers = command.properties.filter(property => property.isIdentifier && !propertyTypeReference(property).isOptional && !propertyTypeReference(property).isCollection);\n const identifier = identifiers.length === 1 ? identifiers[0].name : undefined;\n const productions = command.produces ?? [];\n const mixed = productions.some(production => production.target !== undefined && production.target !== identifier) ||\n (productions.some(production => production.inline && production.target === undefined) &&\n productions.some(production => !production.inline && production.target === undefined));\n return { identifier, mixed };\n}\n\n// Shared by both editor adapters. Never suggest that a legacy allocated source is the command identifier.\nexport function destinationHints(lines: string[], application?: DocumentSymbols): DestinationHint[] {\n const analysis = responseAnalysis(lines, application?.authoringDocuments ?? application?.authoringSources, application?.authoringPlacement, application?.authoringPath);\n const source = eventAnalysisSource(lines);\n return scanDocument(source).commands.map(command => ({ ...command,\n produces: command.produces?.filter(production => !analysis.operationProductionLines?.has(production.line) && analysis.operations.references.some(reference => reference.location.line - 1 === production.line && reference.kind === 'event')),\n productionHeaders: command.productionHeaders?.filter(line => !analysis.operationProductionLines?.has(line)),\n })).flatMap(command => {\n const { identifier, mixed } = productionDestinations(command);\n if (mixed || command.productionHeaders?.length !== command.produces?.length) return [];\n const hasPromotedDestination = command.produces?.some(sibling => sibling.target !== undefined || sibling.inline);\n return (command.produces ?? []).flatMap(production => {\n if (production.target !== undefined || (production.inline && (identifier === undefined || /\\bgeneration\\b/.test(source[production.line])))) return [];\n // A sibling destination can promote the command default in the legacy binder.\n if (!production.inline && hasPromotedDestination) return [];\n return [{ line: production.line, column: source[production.line].length + 1, label: production.inline ? `for ${identifier}` : 'for <new event source>' }];\n });\n });\n}\n"],"mappings":"A,mPAQA,SAAgB,uBAAuB,EAAiE,CACpG,IAAMA,EAAcC,EAAQ,WAAW,OAAO,GAAYC,EAAS,cAAgB,CAACC,EAAsBD,CAAQ,CAAC,CAAC,YAAc,CAACC,EAAsBD,CAAQ,CAAC,CAAC,YAAY,EACzKE,EAAaJ,EAAY,SAAW,EAAIA,EAAY,EAAE,CAAC,KAAO,IAAA,GAC9DK,EAAcJ,EAAQ,UAAY,CAAC,EAIzC,MAAO,CAAE,aAAY,MAHPI,EAAY,KAAK,GAAcC,EAAW,SAAW,IAAA,IAAaA,EAAW,SAAWF,CAAU,GAC3GC,EAAY,KAAK,GAAcC,EAAW,QAAUA,EAAW,SAAW,IAAA,EAAS,GACnFD,EAAY,KAAK,GAAc,CAACC,EAAW,QAAUA,EAAW,SAAW,IAAA,EAAS,CAC9D,CAC/B,CAGA,SAAgB,iBAAiB,EAAiB,EAAkD,CAChG,IAAMC,EAAWC,EAAiBC,EAAOC,GAAa,oBAAsBA,GAAa,iBAAkBA,GAAa,mBAAoBA,GAAa,aAAa,EAChKC,EAASC,EAAoBH,CAAK,EACxC,OAAOI,EAAaF,CAAM,CAAC,CAAC,SAAS,IAAI,IAAY,CAAE,GAAGV,EACtD,SAAUA,EAAQ,UAAU,OAAO,GAAc,CAACM,EAAS,0BAA0B,IAAID,EAAW,IAAI,GAAKC,EAAS,WAAW,WAAW,KAAK,GAAaO,EAAU,SAAS,KAAO,IAAMR,EAAW,MAAQQ,EAAU,OAAS,OAAO,CAAC,EAC5O,kBAAmBb,EAAQ,mBAAmB,OAAO,GAAQ,CAACM,EAAS,0BAA0B,IAAIQ,CAAI,CAAC,CAC9G,EAAE,CAAC,CAAC,QAAQ,GAAW,CACnB,GAAM,CAAE,aAAY,SAAU,uBAAuBd,CAAO,EAC5D,GAAIe,GAASf,EAAQ,mBAAmB,SAAWA,EAAQ,UAAU,OAAQ,MAAO,CAAC,EACrF,IAAMgB,EAAyBhB,EAAQ,UAAU,KAAK,GAAWiB,EAAQ,SAAW,IAAA,IAAaA,EAAQ,MAAM,EAC/G,OAAQjB,EAAQ,UAAY,CAAC,EAAA,CAAG,QAAQ,GAChCK,EAAW,SAAW,IAAA,IAAcA,EAAW,SAAWF,IAAe,IAAA,IAAa,iBAAiB,KAAKO,EAAOL,EAAW,KAAK,IAEnI,CAACA,EAAW,QAAUW,EAA+B,CAAC,EACnD,CAAC,CAAE,KAAMX,EAAW,KAAM,OAAQK,EAAOL,EAAW,KAAK,CAAC,OAAS,EAAG,MAAOA,EAAW,OAAS,OAAOF,IAAe,wBAAyB,CAAC,CAC3J,CACL,CAAC,CACL,C"}
|
|
@@ -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,eAExCC,EAAU,CADG,IAAID,GAAa,oBAAsB,CAAC,EAAA,CAAG,OAAO,GAAYE,EAAS,OAASH,CAAO,EAAG,CAAE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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,IAAMK,EAAOH,EAAM,GACbI,EAASN,EAAK,QAAQK,EAAML,EAAK,QAAQ,MAAM,EAAI,CAAC,EAAI,EAC9D,GAAI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@@
|
|
|
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 +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|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":"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,UAAWA,EAAM,KAAK,EAAG,KAAW,CAAE,KAAME,EAAQ,EAAG,OAAQ,CAAE,EAAE,CAAE,EAG5G,IAAMI,EAAoB,CAAC,EACrBC,EAAiB,CAAC,EACpBC,EAAS,GACbR,EAAM,SAAS,EAAM,IAAU,CACvB,CAACF,EAAOI,IAAUC,EAASC,CAAI,IAAM,GAAK,MAAM,KAAKA,CAAI,IAAG,EAAS,uJAAuJ,KAAKA,CAAI,IACxOI,EAASF,EAAUC,EAAA,CAAM,KAAKL,CAAK,CACxC,CAAC,EACD,IAAMO,EAAQR,EAAM,SAAS,SAAS,EAAI,EA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,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,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,UAAWA,EAAM,KAAK,EAAG,KAAW,CAAE,KAAME,EAAQ,EAAG,OAAQ,CAAE,EAAE,CAAE,EAG5G,IAAMI,EAAoB,CA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AC/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
|