@cratis/screenplay-language 4.249.2 → 4.250.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.
@@ -1 +1 @@
1
- {"version":3,"file":"DiagnosticCodes.js","names":["DiagnosticCodes"],"sources":["../../../../../../Compiler/Diagnostics/DiagnosticCodes.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// Shared diagnostic names, including the explicitly C#-only checks below. Catalogue membership does\n// not imply TypeScript validation support; see Documentation/screenplay/editor-diagnostics.md.\nexport const DiagnosticCodes = {\n InvalidActionSubjectClause: 'PLAY0817',\n InferredActionSubject: 'PLAY0818',\n ChangedActionSubject: 'PLAY0819',\n AmbiguousActionInputBinding: 'PLAY0820',\n UnsupportedActionSubjectContext: 'PLAY0821',\n DuplicateBehaviorAttachment: 'PLAY0340',\n UnknownMatchPattern: 'PLAY0366',\n InvalidMatchPattern: 'PLAY0367',\n PatternOutsidePortableMatchDialect: 'PLAY0699',\n AmbiguousMatchPattern: 'PLAY0803',\n ContextSourcedPerformedQueryArgument: 'PLAY0810', // C# only\n DeprecatedStudioTextRulePattern: 'PLAY0787',\n InvalidIdentityDeclaration: 'PLAY0633',\n DuplicateIdentity: 'PLAY0634',\n InvalidIdentityDetail: 'PLAY0635',\n UnknownIdentitySource: 'PLAY0636',\n IdentityDetailWithoutSource: 'PLAY0637',\n IdentitySourceWithBody: 'PLAY0638',\n DuplicateIdentityDetail: 'PLAY0639',\n BuiltInIdentityDetail: 'PLAY0640',\n UnknownIdentityQuery: 'PLAY0641',\n InvalidIdentityQuery: 'PLAY0642',\n IdentityQueryWithoutKey: 'PLAY0643',\n InvalidIdentityQueryKey: 'PLAY0644',\n IdentityQueryAuthorizationDependency: 'PLAY0645',\n IdentityQueryTypeMismatch: 'PLAY0646',\n InvalidReactionIdentity: 'PLAY0647',\n GatedInvocationWithoutIdentity: 'PLAY0648',\n UnusedReactionIdentity: 'PLAY0649',\n UnusedReactionRole: 'PLAY0650',\n UnsatisfiedReactionIdentity: 'PLAY0651',\n ReactionPrivilegeEscalation: 'PLAY0652',\n // C#-only whole-model public event boundaries; membership is not TypeScript validation support.\n CommandProducesPublicEvent: 'PLAY0607',\n PublicEventRequiresOutboundTranslation: 'PLAY0608',\n OutboundPublicEventCount: 'PLAY0609',\n ForeignPublicEventConsumer: 'PLAY0610',\n OutboundTranslationInput: 'PLAY0611',\n InboundTranslationOutput: 'PLAY0612',\n ForeignPublicEventProduced: 'PLAY0613',\n PublicTranslationRequiresDirection: 'PLAY0614',\n TranslationConstructDirection: 'PLAY0615',\n InboundTranslationInput: 'PLAY0616',\n OutboundTranslationOutput: 'PLAY0617',\n EventTargetOutsideOutboundTranslation: 'PLAY0618',\n EventsSourceOutsideInboundTranslation: 'PLAY0619',\n InvalidCaptureEventsSource: 'PLAY0620',\n CaptureEventsFromSeveralOrigins: 'PLAY0687',\n DirectionlessTranslationReactsToOwnCapture: 'PLAY0694',\n PendingIntentWithOtherHandler: 'PLAY0698',\n CommandHandlerRequiresAttachment: 'PLAY0800', // C# only\n DescribedCommandNotImplemented: 'PLAY0695', // C# only\n DescribedCommandWithoutProductions: 'PLAY0696', // C# only\n DescribedCommandCardinalityNotAdmitted: 'PLAY0697', // C# only\n CaptureEventsKeyNotRequired: 'PLAY0700',\n CaptureEventSourceKeyOutsideEvents: 'PLAY0809',\n CaptureEventsRecordFixture: 'PLAY0701',\n RefutedGeneratedConceptRule: 'PLAY0688',\n UnprovenGeneratedConceptRule: 'PLAY0689',\n // Syntax shared with C#; the reference checks (owners, instances, cycles, outlets, scopes, packages) are C#-only.\n InvalidExposureDeclaration: 'PLAY0621',\n UnknownExposureOwner: 'PLAY0622',\n ReExposureCycle: 'PLAY0623',\n ReExposureBroken: 'PLAY0624',\n InvalidInstanceContribution: 'PLAY0625',\n UnknownContributionInstance: 'PLAY0626',\n ContributionNotExposed: 'PLAY0627',\n ContributionTypeMismatch: 'PLAY0628',\n UnknownTemplateContentSlot: 'PLAY0629',\n UnknownNavigationOutlet: 'PLAY0630',\n TemplateScopeMismatch: 'PLAY0631',\n IncompatibleComponentPackage: 'PLAY0632',\n UnknownNavigationDestination: 'PLAY0654',\n UnknownScreenContributionPoint: 'PLAY0655',\n TemplateNestingCycle: 'PLAY0656',\n TemplateCategoryMissing: 'PLAY0720', // C# only: template declarations are not modeled by this compiler.\n InvalidTemplateVersionRange: 'PLAY0721',\n LegacyProfileLayout: 'PLAY0791', // The other ui profile root template rules (PLAY0790, PLAY0792-PLAY0799) are C# only: this compiler does not model a ui profile.\n UnknownTemplateBlueprint: 'PLAY0722', // C# only: ui profile packages are not modeled by this compiler.\n DuplicateComplianceMarker: 'PLAY0653',\n LegacyComplianceMarker: 'PLAY0565',\n UnknownComplianceMarker: 'PLAY0566',\n InvalidSecretScope: 'PLAY0567',\n DuplicateSecretScope: 'PLAY0568',\n SecretScopeIgnoredForPii: 'PLAY0569',\n InvalidPersonalDataQualifier: 'PLAY0570',\n DuplicateSpecialCategory: 'PLAY0571',\n InvalidPurposeDeclaration: 'PLAY0596',\n InvalidPurposeVocabulary: 'PLAY0597',\n DuplicatePurposeField: 'PLAY0598',\n DuplicatePurposeDeclaration: 'PLAY0599',\n UnknownPurpose: 'PLAY0600',\n PurposeInterestMismatch: 'PLAY0601',\n PersonalDataWithoutPurpose: 'PLAY0602',\n SpecialDataWithoutCondition: 'PLAY0603',\n CriminalDataWithoutAuthorization: 'PLAY0604',\n PurposeWithoutBasis: 'PLAY0605',\n UnusedPurpose: 'PLAY0606',\n // C#-only: opt-in completeness, scoped action/refusal reference validation, and semantic binding.\n ConflictingScreenDataBinding: 'PLAY0530',\n ScreenDataQueryMismatch: 'PLAY0531',\n ActionWithoutInputSurface: 'PLAY0532',\n CommandWithoutInputSurface: 'PLAY0533',\n ReadModelFieldWithoutOrigin: 'PLAY0534',\n QueryParameterNotHeldByView: 'PLAY0535',\n UnconsumedEvent: 'PLAY0536',\n UnreachableScreen: 'PLAY0537',\n UnknownActionSubjectField: 'PLAY0345',\n UnresolvedActionSubject: 'PLAY0346',\n UnreachableActionAlternative: 'PLAY0347',\n UnknownActionArgumentProperty: 'PLAY0348',\n UnreachableRefusalBranch: 'PLAY0540',\n InvalidRefusalValue: 'PLAY0541',\n UnknownRefusalConstraint: 'PLAY0542',\n UnknownRedeliveryReaction: 'PLAY0544',\n IndeterminateNegatedClaimTarget: 'PLAY0546',\n InvalidRefusalBranch: 'PLAY0538',\n InvalidRefusalBranchBody: 'PLAY0539',\n UnmatchedRedeliveredOccurrence: 'PLAY0543',\n InvalidNoEventsExpectation: 'PLAY0545',\n InvalidProducesDeclaration: 'PLAY0042',\n ProducesWhenWithoutEvent: 'PLAY0043',\n InvalidPropertyMapping: 'PLAY0044',\n DuplicateProducesTarget: 'PLAY0193',\n EventSourceIdInPayload: 'PLAY0469',\n ExplicitProducesTargetsRequired: 'PLAY0470',\n RedundantEventId: 'PLAY0471',\n InvalidEventId: 'PLAY0472',\n InlineEventCollision: 'PLAY0473',\n InlineEventOutsideCommand: 'PLAY0474',\n InlineEventGeneration: 'PLAY0475',\n ReservedProductionMetadata: 'PLAY0476',\n InvalidEventDocumentation: 'PLAY0477',\n OmittedProductionDestination: 'PLAY0478',\n UnknownConstraintProperty: 'PLAY0391',\n UnknownTopLevelConstruct: 'PLAY0001',\n InvalidDomainDeclaration: 'PLAY0002',\n DuplicateDomain: 'PLAY0003',\n DomainNotFirst: 'PLAY0004',\n InvalidImportDeclaration: 'PLAY0005',\n TabIndentation: 'PLAY0006',\n InvalidConceptDeclaration: 'PLAY0007',\n UnknownPrimitiveType: 'PLAY0008',\n InvalidEnumerationValue: 'PLAY0009',\n UnknownConceptDirective: 'PLAY0010',\n ValidateReadAsEnumerationBlock: 'PLAY0011',\n AttributeReasonWithoutAttribute: 'PLAY0012',\n DuplicateAttributeReason: 'PLAY0013',\n InvalidTypeDeclaration: 'PLAY0014',\n TypeWithoutProperties: 'PLAY0015',\n InvalidPropertyDeclaration: 'PLAY0016',\n IdentifierOutsideCommand: 'PLAY0017',\n InvalidEventDeclaration: 'PLAY0018',\n IdentifierOnEventProperty: 'PLAY0019',\n TagPropertyReadAsTag: 'PLAY0020',\n InvalidModuleDeclaration: 'PLAY0021',\n UnknownModuleDirective: 'PLAY0022',\n InvalidFeatureDeclaration: 'PLAY0023',\n UnknownFeatureDirective: 'PLAY0024',\n InvalidSliceDeclaration: 'PLAY0027',\n UnknownSliceType: 'PLAY0028',\n UnknownSliceDirective: 'PLAY0029',\n InvalidPersonaDeclaration: 'PLAY0030',\n InvalidPersonaPolicyReference: 'PLAY0031',\n UnknownPersonaDirective: 'PLAY0032',\n InvalidCommandDeclaration: 'PLAY0033',\n UnknownCommandDirective: 'PLAY0034',\n DuplicateCommandIdentifier: 'PLAY0036',\n InvalidQueryDeclaration: 'PLAY0047',\n UnknownQueryDirective: 'PLAY0048',\n InvalidQueryParameter: 'PLAY0049',\n InvalidProjectionDeclaration: 'PLAY0056',\n EmptyProjection: 'PLAY0057',\n UnknownProjectionDirective: 'PLAY0058',\n FromWithoutEvent: 'PLAY0061',\n InvalidEventReference: 'PLAY0062',\n InvalidJoinDeclaration: 'PLAY0063',\n JoinWithoutEvent: 'PLAY0064',\n InvalidChildrenDeclaration: 'PLAY0065',\n InvalidNestedDeclaration: 'PLAY0066',\n NestedBlockWithoutFrom: 'PLAY0067',\n InvalidRemoveDeclaration: 'PLAY0068',\n UnknownRemoveDirective: 'PLAY0069',\n InvalidClearDeclaration: 'PLAY0070',\n ClearWithOutsideNestedBlock: 'PLAY0071',\n InvalidSpecificationDeclaration: 'PLAY0094',\n UnknownSpecificationDirective: 'PLAY0095',\n InvalidSpecificationWhen: 'PLAY0096',\n DuplicateSpecificationWhen: 'PLAY0097',\n InvalidThenError: 'PLAY0098',\n InvalidReadModelStep: 'PLAY0099',\n InvalidEventStep: 'PLAY0100',\n InvalidSpecificationValue: 'PLAY0101',\n InvalidScreenDeclaration: 'PLAY0102',\n UnknownScreenDirective: 'PLAY0103',\n InvalidDataDirective: 'PLAY0104',\n InvalidActionDirective: 'PLAY0105',\n UnknownActionDirective: 'PLAY0106',\n InvalidNavigation: 'PLAY0107',\n InvalidScreenLayoutSlot: 'PLAY0108',\n UnknownLayoutDirective: 'PLAY0026',\n InvalidTitleDirective: 'PLAY0109',\n UnknownTableDirective: 'PLAY0110',\n UnknownSummaryDirective: 'PLAY0111',\n AuthorizeWithoutPolicy: 'PLAY0122',\n InvalidPolicyReference: 'PLAY0123',\n InvalidConstraintDeclaration: 'PLAY0132',\n ConstraintWithoutRule: 'PLAY0133',\n InvalidConstraintBody: 'PLAY0134',\n DuplicateConstraintBody: 'PLAY0135',\n InvalidReactionDeclaration: 'PLAY0136',\n InvalidReactionTrigger: 'PLAY0137',\n ReactionWithoutTrigger: 'PLAY0138',\n InvalidValidateDeclaration: 'PLAY0140',\n InvalidValidationRule: 'PLAY0141',\n InvalidRuleName: 'PLAY0143',\n UnknownRuleImplementationDirective: 'PLAY0144',\n InvalidDescription: 'PLAY0145',\n EmptyDescription: 'PLAY0146',\n DuplicateDescription: 'PLAY0147',\n TagWithoutValue: 'PLAY0148',\n InvalidTagValue: 'PLAY0149',\n UnknownContextPath: 'PLAY0153',\n UnknownContextCausedByProperty: 'PLAY0154',\n UnknownContextIdentityProperty: 'PLAY0155',\n ExpectedCodeFence: 'PLAY0163',\n UnclosedCodeBlock: 'PLAY0164',\n DuplicateDeclaration: 'PLAY0168',\n RepeatedSingularDeclarationAcrossFiles: 'PLAY0172',\n RepeatedDeclarationAcrossFiles: 'PLAY0173',\n ConflictingDescriptionAcrossFiles: 'PLAY0174',\n UnexpectedTokenInAuthorize: 'PLAY0184',\n UnclosedAuthorizeGroup: 'PLAY0185',\n InvalidReadModelDeclaration: 'PLAY0186',\n InvalidInvokesDeclaration: 'PLAY0194',\n InvalidScopeDeclaration: 'PLAY0199',\n DuplicateScope: 'PLAY0200',\n InvalidIntervalTrigger: 'PLAY0249',\n InvalidScheduleTrigger: 'PLAY0250',\n DuplicateReactionTrigger: 'PLAY0253',\n InvalidSpecificationEventSource: 'PLAY0275',\n DuplicateSpecificationEventSource: 'PLAY0276',\n InvalidProjectionVariantDeclaration: 'PLAY0277',\n InvalidEntersOnDeclaration: 'PLAY0279',\n NestedProjectionVariantNotAllowed: 'PLAY0280',\n InvalidStructuredValue: 'PLAY0291',\n DuplicateStructuredValueMember: 'PLAY0294',\n ConflictingSpecificationActions: 'PLAY0358',\n InvalidSpecificationEventOrder: 'PLAY0359',\n InvalidValidationSeverity: 'PLAY0368',\n VariantRequiresEnteringEvent: 'PLAY0382',\n /** An event is used more than once in one projection level's event or join set. */\n DuplicateEventInProjectionScope: 'PLAY0801',\n /** An event source has the reserved stored name Default, or an event stream has the reserved stored name All, including through an id pin. */\n ReservedStoredName: 'PLAY0802',\n DuplicateProjectionVariant: 'PLAY0384',\n DuplicateVariantEnteringEvent: 'PLAY0385',\n InvalidSpecificationDenied: 'PLAY0388',\n DuplicateAuthorizationAcrossFiles: 'PLAY0394',\n FileConstraintOnlySupportsUniqueness: 'PLAY0396',\n LegacyInlineCodeFence: 'PLAY0397',\n InvalidEventGeneration: 'PLAY0446',\n InvalidFileImport: 'PLAY0454',\n FileImportMatchesNothing: 'PLAY0455',\n ImportedFileNotFound: 'PLAY0456',\n ConflictingImportPlacement: 'PLAY0457',\n ImportCycle: 'PLAY0458',\n ModuleInPlacedFile: 'PLAY0459',\n UnexpectedInPlacedFile: 'PLAY0460',\n InvalidSpecificationClock: 'PLAY0461',\n InvalidSpecificationTrigger: 'PLAY0462',\n InvalidSpecificationCapture: 'PLAY0463',\n InvalidSpecificationQueryAction: 'PLAY0464',\n MismatchedSpecificationQueryResult: 'PLAY0465',\n UnknownSpecificationQueryArgument: 'PLAY0468',\n InvalidSpecificationQuery: 'PLAY0265',\n UnknownSpecificationQueryDirective: 'PLAY0266',\n DuplicateSpecificationQueryArguments: 'PLAY0267',\n InvalidAbsentReadModelStep: 'PLAY0453',\n LegacyOptionalSuffix: 'PLAY0479',\n InvalidOptionalModifierOrder: 'PLAY0480',\n OptionalReadsNotSupported: 'PLAY0481',\n InvalidSpecificationCaller: 'PLAY0386',\n DuplicateSpecificationCallerOrDenied: 'PLAY0387',\n GeneratedPropertyOutsideCommand: 'PLAY0482',\n InvalidGeneratedType: 'PLAY0483',\n InvalidGeneratedModifierOrder: 'PLAY0484',\n DuplicateEventSubject: 'PLAY0590',\n InvalidSubjectType: 'PLAY0591',\n ProtectedSubjectType: 'PLAY0592',\n InvalidSubjectOwner: 'PLAY0593',\n ReadModelSubjectNotSupported: 'PLAY0594',\n InvalidSubjectModifierOrder: 'PLAY0595',\n GeneratedPropertySuppliedAsInput: 'PLAY0485',\n InvalidCommandResponse: 'PLAY0486',\n InvalidResponseSource: 'PLAY0487',\n DuplicateResponseField: 'PLAY0488',\n InvalidResponseShape: 'PLAY0489',\n InvalidGeneratedFixture: 'PLAY0490',\n InvalidReturnExpectation: 'PLAY0491',\n InvalidImplementationBlock: 'PLAY0492',\n InvalidImplementationHint: 'PLAY0493',\n ConflictingImplementationSources: 'PLAY0494',\n UnknownType: 'PLAY0165',\n InvalidSystemDeclaration: 'PLAY0495',\n InvalidOperationDeclaration: 'PLAY0496',\n InvalidProductionReference: 'PLAY0497',\n ProductionDeclarationCollision: 'PLAY0498',\n OperationOutsideCommand: 'PLAY0499',\n InvalidSystemReference: 'PLAY0500',\n InvalidOperationMapping: 'PLAY0501',\n InvalidOperationSpecification: 'PLAY0502',\n InvalidCaptureDeclaration: 'PLAY0078',\n UnknownCaptureDirective: 'PLAY0079',\n InvalidMapEntry: 'PLAY0080',\n InvalidTranslation: 'PLAY0081',\n InvalidSplitDeclaration: 'PLAY0082',\n InvalidSplitTarget: 'PLAY0083',\n InvalidAppendDeclaration: 'PLAY0084',\n UnknownAppendDirective: 'PLAY0085',\n WhenWithoutTrigger: 'PLAY0086',\n InvalidWhenClause: 'PLAY0087',\n InvalidWhenTransitionClause: 'PLAY0088',\n MixedWhenCombinators: 'PLAY0089',\n WhenCombinatorWithoutProperty: 'PLAY0090',\n UnknownCaptureBlockDirective: 'PLAY0091',\n InvalidCompositeKeyPart: 'PLAY0072',\n TemplateInCompositeKey: 'PLAY0073',\n EmptyCompositeKey: 'PLAY0074',\n InvalidProjectionMapping: 'PLAY0075',\n ExpectedLiteralValue: 'PLAY0150',\n InvalidExpression: 'PLAY0152',\n UnterminatedInterpolation: 'PLAY0157',\n UnterminatedTemplateExpression: 'PLAY0156',\n ProjectionDocumentWithoutProjection: 'PLAY0055',\n CaptureDocumentWithoutCapture: 'PLAY0077',\n SpecificationDocumentWithoutSpecification: 'PLAY0093',\n InvalidSeedDeclaration: 'PLAY0128',\n InvalidSeedGroup: 'PLAY0129',\n InvalidSeedEvent: 'PLAY0130',\n InvalidSeedPropertyAssignment: 'PLAY0131',\n InvalidPolicyDeclaration: 'PLAY0112',\n UnknownPolicyDirective: 'PLAY0113',\n PolicyWithoutRequirement: 'PLAY0114',\n ExpectedRoleName: 'PLAY0118',\n ExpectedClaimName: 'PLAY0119',\n ExpectedClaimMatches: 'PLAY0120',\n ExpectedClaimMatchTarget: 'PLAY0121',\n MixedPolicyImplementation: 'PLAY0440',\n RepeatedPolicyRequirement: 'PLAY0441',\n AnonymousPolicyCombined: 'PLAY0804',\n NegatedAnonymousPolicy: 'PLAY0805',\n UnexpectedTokenInPolicyCondition: 'PLAY0115',\n ExpectedPolicyCondition: 'PLAY0116',\n UnclosedPolicyConditionGroup: 'PLAY0117',\n UnexpectedTokenInCondition: 'PLAY0158',\n ExpectedCondition: 'PLAY0159',\n ExpectedComparisonOperator: 'PLAY0161',\n ExpectedComparisonValue: 'PLAY0162',\n InvalidActionAlternative: 'PLAY0341',\n GuardedActionWithoutAlternatives: 'PLAY0342',\n MisplacedActionOtherwise: 'PLAY0343',\n UnsupportedActionConditionOperand: 'PLAY0344',\n InvalidInteractionArgument: 'PLAY0319',\n UnclosedConditionGroup: 'PLAY0160',\n InvalidNumericDirective: 'PLAY0508',\n DuplicateNumericDirective: 'PLAY0509',\n LateNumericDirective: 'PLAY0510',\n InexactNumericLiteral: 'PLAY0511',\n MixedNumericModes: 'PLAY0512',\n IncompatibleNumericSource: 'PLAY0513',\n EventFromLaterSlice: 'PLAY0516',\n TimelineCycleGroup: 'PLAY0517',\n InvalidSpecificationExample: 'PLAY0518',\n DuplicateSpecificationAssignment: 'PLAY0519',\n UnresolvedSpecificationExampleType: 'PLAY0520',\n SpecificationExampleNameCollision: 'PLAY0521',\n SpecificationExampleKindMismatch: 'PLAY0522',\n InvalidSpecificationExampleValue: 'PLAY0523',\n MissingSpecificationProperty: 'PLAY0524',\n UnadmittedSpecificationExampleValue: 'PLAY0525',\n InvalidSpecificationExampleBody: 'PLAY0526',\n AmbiguousReference: 'PLAY0198',\n InvalidSpecificationStream: 'PLAY0547',\n SpecificationStreamOnCommand: 'PLAY0548',\n InvalidSpecificationStreamRoute: 'PLAY0549',\n InvalidSpecificationStreamEventSource: 'PLAY0550',\n SpecificationStreamContradictsCommand: 'PLAY0551',\n InvalidDependencyTarget: 'PLAY0554',\n RepeatedDependencyDeclaration: 'PLAY0555',\n UndeclaredDependency: 'PLAY0552',\n UnusedDependencyDeclaration: 'PLAY0553',\n MutualDependencyDeclarations: 'PLAY0556',\n AuthorizationRefusalWithoutIdentity: 'PLAY0557',\n InvalidDocumentation: 'PLAY0558',\n ConflictingDocumentationAcrossFiles: 'PLAY0559',\n InvalidSpecificationCallerPersona: 'PLAY0572',\n UnsynthesizablePersonaCaller: 'PLAY0573',\n PersonaWithoutGate: 'PLAY0574',\n GateWithoutPersona: 'PLAY0575',\n AmbiguousPersonaCaller: 'PLAY0576',\n InvalidSpecificationParameter: 'PLAY0577',\n InvalidSpecificationCase: 'PLAY0578',\n DuplicateSpecificationParameter: 'PLAY0579',\n DuplicateSpecificationCase: 'PLAY0580',\n IncompleteSpecificationTable: 'PLAY0581',\n InvalidSpecificationCaseAssignment: 'PLAY0582',\n InvalidSpecificationCaseValue: 'PLAY0583',\n InvalidSpecificationCaseReference: 'PLAY0584',\n OptionalSpecificationParameterTarget: 'PLAY0585',\n SpecificationCaseNameCollision: 'PLAY0586',\n IncompatibleSpecificationParameterType: 'PLAY0587',\n UnusedSpecificationParameter: 'PLAY0588',\n SingularSpecificationTableExpansion: 'PLAY0589',\n UnsupportedInteractionAlternatives: 'PLAY0560',\n MixedInteractionAlternatives: 'PLAY0561',\n InteractionAlternativeWithoutActions: 'PLAY0562',\n InlineInteractionAlternative: 'PLAY0563',\n LegacyInteractionWhere: 'PLAY0564',\n InvalidEventSourceDeclaration: 'PLAY0503',\n InvalidCommandStream: 'PLAY0504',\n AmbiguousCommandStream: 'PLAY0505',\n UnsupportedStreamIdType: 'PLAY0506',\n RedundantSourceStreamId: 'PLAY0507',\n UnknownEvent: 'PLAY0166',\n UnknownReadModelProperty: 'PLAY0514',\n PiiNotSupportedOnIdentifier: 'PLAY0515',\n HandlerWithoutImplementation: 'PLAY0045',\n UnknownHandlerDirective: 'PLAY0046',\n CommandWithProducesAndHandler: 'PLAY0035',\n AbsoluteFileReference: 'PLAY0264',\n InvalidTriggerData: 'PLAY0246',\n InvalidReadModelKey: 'PLAY0660',\n IncompleteReadModelKey: 'PLAY0661', // C# only: scoped read-model key resolution.\n InvalidReadModelKeyLookup: 'PLAY0662', // Shape checks shared; scoped lookup checks are C# only.\n ProductionRouteOutsideCommand: 'PLAY0663',\n RedundantProductionRoute: 'PLAY0664',\n InvalidObserverFilter: 'PLAY0665',\n ObserverFilterExcludesEveryProducer: 'PLAY0666', // C# only: statically known producer routes.\n ReducerIdentityMismatch: 'PLAY0690',\n InvalidReactionBatchesDeclaration: 'PLAY0693',\n InvalidCommandReadsDeclaration: 'PLAY0780',\n InvalidTimeZoneDeclaration: 'PLAY0812',\n InvalidCommandCalendar: 'PLAY0813',\n InvalidSpecificationTimeZone: 'PLAY0814',\n InvalidSpecificationInvocation: 'PLAY0815',\n UnreachableSpecificationInvocation: 'PLAY0816', // C# only: the outcome consistency check is native.\n GenerationSupportBudgetExceeded: 'PLAY0691',\n EmptyGenerationSupport: 'PLAY0692', // C# only: conservative nominal producer identity comparison.\n MixedEnumerationNumbering: 'PLAY0667',\n DuplicateEnumerationNumber: 'PLAY0668',\n EnumerationNumberOutsideInt32: 'PLAY0669',\n MalformedEnumerationNumber: 'PLAY0670',\n UnpinnedStoredEnumeration: 'PLAY0671',\n ReadsWithChildren: 'PLAY0451',\n UnknownGenerationStrategy: 'PLAY0672',\n InvalidGenerationArgument: 'PLAY0673',\n InvalidGenerationModifier: 'PLAY0674',\n DuplicateGenerationModifier: 'PLAY0675',\n DuplicateGeneration: 'PLAY0676',\n InvalidGenerationPrimitive: 'PLAY0677',\n InvalidGenerationPrefix: 'PLAY0678',\n InvalidGenerationAlphabet: 'PLAY0679',\n InvalidTypeIdPrefix: 'PLAY0680',\n GenerationSizeOutsideRange: 'PLAY0681',\n ReservedSequenceGeneration: 'PLAY0682',\n LowGenerationEntropy: 'PLAY0683',\n LowGeneratedIdentifierEntropy: 'PLAY0684',\n ResponseNameUsedOnFailure: 'PLAY0685',\n // Retired by ESM v16; preserved for compatibility with earlier native compiler diagnostics.\n EventIdPinNotCarriedToRenderers: 'PLAY0686',\n InvalidToolbarButton: 'PLAY0760',\n} as const;\n"],"mappings":"AAKA,MAAaA,EAAkB,CAC3B,2BAA4B,WAC5B,sBAAuB,WACvB,qBAAsB,WACtB,4BAA6B,WAC7B,gCAAiC,WACjC,4BAA6B,WAC7B,oBAAqB,WACrB,oBAAqB,WACrB,mCAAoC,WACpC,sBAAuB,WACvB,qCAAsC,WACtC,gCAAiC,WACjC,2BAA4B,WAC5B,kBAAmB,WACnB,sBAAuB,WACvB,sBAAuB,WACvB,4BAA6B,WAC7B,uBAAwB,WACxB,wBAAyB,WACzB,sBAAuB,WACvB,qBAAsB,WACtB,qBAAsB,WACtB,wBAAyB,WACzB,wBAAyB,WACzB,qCAAsC,WACtC,0BAA2B,WAC3B,wBAAyB,WACzB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oC,WACpC,gCAAiC,WACjC,uBAAwB,WACxB,0BAA2B,WAC3B,2BAA4B,WAC5B,8BAA+B,WAC/B,2BAA4B,WAC5B,0BAA2B,WAC3B,kBAAmB,WACnB,0BAA2B,WAC3B,0BAA2B,WAC3B,0BAA2B,WAC3B,4BAA6B,WAC7B,oBAAqB,WACrB,2BAA4B,WAC5B,wBAAyB,WACzB,0BAA2B,WAC3B,oBAAqB,WACrB,2BAA4B,WAC5B,2BAA4B,WAC5B,qBAAsB,WACtB,8BAA+B,WAC/B,0BAA2B,WAE3B,gCAAiC,WACjC,qBAAsB,UAC1B"}
1
+ {"version":3,"file":"DiagnosticCodes.js","names":["DiagnosticCodes"],"sources":["../../../../../../Compiler/Diagnostics/DiagnosticCodes.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// Shared diagnostic names, including the explicitly C#-only checks below. Catalogue membership does\n// not imply TypeScript validation support; see Documentation/screenplay/editor-diagnostics.md.\nexport const DiagnosticCodes = {\n InvalidActionSubjectClause: 'PLAY0817',\n InferredActionSubject: 'PLAY0818',\n ChangedActionSubject: 'PLAY0819',\n AmbiguousActionInputBinding: 'PLAY0820',\n UnsupportedActionSubjectContext: 'PLAY0821',\n DuplicateBehaviorAttachment: 'PLAY0340',\n UnknownMatchPattern: 'PLAY0366',\n InvalidMatchPattern: 'PLAY0367',\n PatternOutsidePortableMatchDialect: 'PLAY0699',\n AmbiguousMatchPattern: 'PLAY0803',\n ContextSourcedPerformedQueryArgument: 'PLAY0810', // C# only\n DeprecatedStudioTextRulePattern: 'PLAY0787',\n InvalidIdentityDeclaration: 'PLAY0633',\n DuplicateIdentity: 'PLAY0634',\n InvalidIdentityDetail: 'PLAY0635',\n UnknownIdentitySource: 'PLAY0636',\n IdentityDetailWithoutSource: 'PLAY0637',\n IdentitySourceWithBody: 'PLAY0638',\n DuplicateIdentityDetail: 'PLAY0639',\n BuiltInIdentityDetail: 'PLAY0640',\n UnknownIdentityQuery: 'PLAY0641',\n InvalidIdentityQuery: 'PLAY0642',\n IdentityQueryWithoutKey: 'PLAY0643',\n InvalidIdentityQueryKey: 'PLAY0644',\n IdentityQueryAuthorizationDependency: 'PLAY0645',\n IdentityQueryTypeMismatch: 'PLAY0646',\n InvalidReactionIdentity: 'PLAY0647',\n GatedInvocationWithoutIdentity: 'PLAY0648',\n UnusedReactionIdentity: 'PLAY0649',\n UnusedReactionRole: 'PLAY0650',\n UnsatisfiedReactionIdentity: 'PLAY0651',\n ReactionPrivilegeEscalation: 'PLAY0652',\n // C#-only whole-model public event boundaries; membership is not TypeScript validation support.\n CommandProducesPublicEvent: 'PLAY0607',\n PublicEventRequiresOutboundTranslation: 'PLAY0608',\n OutboundPublicEventCount: 'PLAY0609',\n ForeignPublicEventConsumer: 'PLAY0610',\n OutboundTranslationInput: 'PLAY0611',\n InboundTranslationOutput: 'PLAY0612',\n ForeignPublicEventProduced: 'PLAY0613',\n PublicTranslationRequiresDirection: 'PLAY0614',\n TranslationConstructDirection: 'PLAY0615',\n InboundTranslationInput: 'PLAY0616',\n OutboundTranslationOutput: 'PLAY0617',\n EventTargetOutsideOutboundTranslation: 'PLAY0618',\n EventsSourceOutsideInboundTranslation: 'PLAY0619',\n InvalidCaptureEventsSource: 'PLAY0620',\n CaptureEventsFromSeveralOrigins: 'PLAY0687',\n DirectionlessTranslationReactsToOwnCapture: 'PLAY0694',\n PendingIntentWithOtherHandler: 'PLAY0698',\n CommandHandlerRequiresAttachment: 'PLAY0800', // C# only\n DescribedCommandNotImplemented: 'PLAY0695', // C# only\n DescribedCommandWithoutProductions: 'PLAY0696', // C# only\n DescribedCommandCardinalityNotAdmitted: 'PLAY0697', // C# only\n CaptureEventsKeyNotRequired: 'PLAY0700',\n CaptureEventSourceKeyOutsideEvents: 'PLAY0809',\n CaptureEventsRecordFixture: 'PLAY0701',\n RefutedGeneratedConceptRule: 'PLAY0688',\n UnprovenGeneratedConceptRule: 'PLAY0689',\n // Syntax shared with C#; the reference checks (owners, instances, cycles, outlets, scopes, packages) are C#-only.\n InvalidExposureDeclaration: 'PLAY0621',\n UnknownExposureOwner: 'PLAY0622',\n ReExposureCycle: 'PLAY0623',\n ReExposureBroken: 'PLAY0624',\n InvalidInstanceContribution: 'PLAY0625',\n UnknownContributionInstance: 'PLAY0626',\n ContributionNotExposed: 'PLAY0627',\n ContributionTypeMismatch: 'PLAY0628',\n UnknownTemplateContentSlot: 'PLAY0629',\n UnknownNavigationOutlet: 'PLAY0630',\n TemplateScopeMismatch: 'PLAY0631',\n IncompatibleComponentPackage: 'PLAY0632',\n UnknownNavigationDestination: 'PLAY0654',\n UnknownScreenContributionPoint: 'PLAY0655',\n TemplateNestingCycle: 'PLAY0656',\n TemplateCategoryMissing: 'PLAY0720', // C# only: template declarations are not modeled by this compiler.\n InvalidTemplateVersionRange: 'PLAY0721',\n LegacyProfileLayout: 'PLAY0791', // The other ui profile root template rules (PLAY0790, PLAY0792-PLAY0799) are C# only: this compiler does not model a ui profile.\n UnknownTemplateBlueprint: 'PLAY0722', // C# only: ui profile packages are not modeled by this compiler.\n DuplicateComplianceMarker: 'PLAY0653',\n LegacyComplianceMarker: 'PLAY0565',\n UnknownComplianceMarker: 'PLAY0566',\n InvalidSecretScope: 'PLAY0567',\n DuplicateSecretScope: 'PLAY0568',\n SecretScopeIgnoredForPii: 'PLAY0569',\n InvalidPersonalDataQualifier: 'PLAY0570',\n DuplicateSpecialCategory: 'PLAY0571',\n InvalidPurposeDeclaration: 'PLAY0596',\n InvalidPurposeVocabulary: 'PLAY0597',\n DuplicatePurposeField: 'PLAY0598',\n DuplicatePurposeDeclaration: 'PLAY0599',\n UnknownPurpose: 'PLAY0600',\n PurposeInterestMismatch: 'PLAY0601',\n PersonalDataWithoutPurpose: 'PLAY0602',\n SpecialDataWithoutCondition: 'PLAY0603',\n CriminalDataWithoutAuthorization: 'PLAY0604',\n PurposeWithoutBasis: 'PLAY0605',\n UnusedPurpose: 'PLAY0606',\n // C#-only: opt-in completeness, scoped action/refusal reference validation, and semantic binding.\n ConflictingScreenDataBinding: 'PLAY0530',\n ScreenDataQueryMismatch: 'PLAY0531',\n ActionWithoutInputSurface: 'PLAY0532',\n CommandWithoutInputSurface: 'PLAY0533',\n ReadModelFieldWithoutOrigin: 'PLAY0534',\n QueryParameterNotHeldByView: 'PLAY0535',\n UnconsumedEvent: 'PLAY0536',\n UnreachableScreen: 'PLAY0537',\n UnknownActionSubjectField: 'PLAY0345',\n UnresolvedActionSubject: 'PLAY0346',\n UnreachableActionAlternative: 'PLAY0347',\n UnknownActionArgumentProperty: 'PLAY0348',\n UnreachableRefusalBranch: 'PLAY0540',\n InvalidRefusalValue: 'PLAY0541',\n UnknownRefusalConstraint: 'PLAY0542',\n UnknownRedeliveryReaction: 'PLAY0544',\n IndeterminateNegatedClaimTarget: 'PLAY0546',\n InvalidRefusalBranch: 'PLAY0538',\n InvalidRefusalBranchBody: 'PLAY0539',\n UnmatchedRedeliveredOccurrence: 'PLAY0543',\n InvalidNoEventsExpectation: 'PLAY0545',\n InvalidProducesDeclaration: 'PLAY0042',\n ProducesWhenWithoutEvent: 'PLAY0043',\n InvalidPropertyMapping: 'PLAY0044',\n DuplicateProducesTarget: 'PLAY0193',\n EventSourceIdInPayload: 'PLAY0469',\n ExplicitProducesTargetsRequired: 'PLAY0470',\n RedundantEventId: 'PLAY0471',\n InvalidEventId: 'PLAY0472',\n InlineEventCollision: 'PLAY0473',\n InlineEventOutsideCommand: 'PLAY0474',\n InlineEventGeneration: 'PLAY0475',\n ReservedProductionMetadata: 'PLAY0476',\n InvalidEventDocumentation: 'PLAY0477',\n OmittedProductionDestination: 'PLAY0478',\n UnknownConstraintProperty: 'PLAY0391',\n UnknownTopLevelConstruct: 'PLAY0001',\n InvalidDomainDeclaration: 'PLAY0002',\n DuplicateDomain: 'PLAY0003',\n DomainNotFirst: 'PLAY0004',\n InvalidImportDeclaration: 'PLAY0005',\n TabIndentation: 'PLAY0006',\n InvalidConceptDeclaration: 'PLAY0007',\n UnknownPrimitiveType: 'PLAY0008',\n InvalidEnumerationValue: 'PLAY0009',\n UnknownConceptDirective: 'PLAY0010',\n ValidateReadAsEnumerationBlock: 'PLAY0011',\n AttributeReasonWithoutAttribute: 'PLAY0012',\n DuplicateAttributeReason: 'PLAY0013',\n InvalidTypeDeclaration: 'PLAY0014',\n TypeWithoutProperties: 'PLAY0015',\n InvalidPropertyDeclaration: 'PLAY0016',\n IdentifierOutsideCommand: 'PLAY0017',\n InvalidEventDeclaration: 'PLAY0018',\n IdentifierOnEventProperty: 'PLAY0019',\n TagPropertyReadAsTag: 'PLAY0020',\n InvalidModuleDeclaration: 'PLAY0021',\n UnknownModuleDirective: 'PLAY0022',\n InvalidFeatureDeclaration: 'PLAY0023',\n UnknownFeatureDirective: 'PLAY0024',\n InvalidSliceDeclaration: 'PLAY0027',\n UnknownSliceType: 'PLAY0028',\n UnknownSliceDirective: 'PLAY0029',\n InvalidPersonaDeclaration: 'PLAY0030',\n InvalidPersonaPolicyReference: 'PLAY0031',\n UnknownPersonaDirective: 'PLAY0032',\n InvalidCommandDeclaration: 'PLAY0033',\n UnknownCommandDirective: 'PLAY0034',\n DuplicateCommandIdentifier: 'PLAY0036',\n InvalidQueryDeclaration: 'PLAY0047',\n UnknownQueryDirective: 'PLAY0048',\n InvalidQueryParameter: 'PLAY0049',\n InvalidProjectionDeclaration: 'PLAY0056',\n EmptyProjection: 'PLAY0057',\n UnknownProjectionDirective: 'PLAY0058',\n FromWithoutEvent: 'PLAY0061',\n InvalidEventReference: 'PLAY0062',\n InvalidJoinDeclaration: 'PLAY0063',\n JoinWithoutEvent: 'PLAY0064',\n InvalidChildrenDeclaration: 'PLAY0065',\n InvalidNestedDeclaration: 'PLAY0066',\n NestedBlockWithoutFrom: 'PLAY0067',\n InvalidRemoveDeclaration: 'PLAY0068',\n UnknownRemoveDirective: 'PLAY0069',\n InvalidClearDeclaration: 'PLAY0070',\n ClearWithOutsideNestedBlock: 'PLAY0071',\n InvalidSpecificationDeclaration: 'PLAY0094',\n UnknownSpecificationDirective: 'PLAY0095',\n InvalidSpecificationWhen: 'PLAY0096',\n DuplicateSpecificationWhen: 'PLAY0097',\n InvalidThenError: 'PLAY0098',\n InvalidReadModelStep: 'PLAY0099',\n InvalidEventStep: 'PLAY0100',\n InvalidSpecificationValue: 'PLAY0101',\n InvalidScreenDeclaration: 'PLAY0102',\n UnknownScreenDirective: 'PLAY0103',\n InvalidDataDirective: 'PLAY0104',\n InvalidActionDirective: 'PLAY0105',\n UnknownActionDirective: 'PLAY0106',\n InvalidNavigation: 'PLAY0107',\n InvalidScreenLayoutSlot: 'PLAY0108',\n UnknownLayoutDirective: 'PLAY0026',\n InvalidTitleDirective: 'PLAY0109',\n UnknownTableDirective: 'PLAY0110',\n UnknownSummaryDirective: 'PLAY0111',\n AuthorizeWithoutPolicy: 'PLAY0122',\n InvalidPolicyReference: 'PLAY0123',\n InvalidConstraintDeclaration: 'PLAY0132',\n ConstraintWithoutRule: 'PLAY0133',\n InvalidConstraintBody: 'PLAY0134',\n DuplicateConstraintBody: 'PLAY0135',\n InvalidReactionDeclaration: 'PLAY0136',\n InvalidReactionTrigger: 'PLAY0137',\n ReactionWithoutTrigger: 'PLAY0138',\n InvalidValidateDeclaration: 'PLAY0140',\n InvalidValidationRule: 'PLAY0141',\n InvalidRuleName: 'PLAY0143',\n UnknownRuleImplementationDirective: 'PLAY0144',\n InvalidDescription: 'PLAY0145',\n EmptyDescription: 'PLAY0146',\n DuplicateDescription: 'PLAY0147',\n TagWithoutValue: 'PLAY0148',\n InvalidTagValue: 'PLAY0149',\n UnknownContextPath: 'PLAY0153',\n UnknownContextCausedByProperty: 'PLAY0154',\n UnknownContextIdentityProperty: 'PLAY0155',\n ExpectedCodeFence: 'PLAY0163',\n UnclosedCodeBlock: 'PLAY0164',\n DuplicateDeclaration: 'PLAY0168',\n RepeatedSingularDeclarationAcrossFiles: 'PLAY0172',\n RepeatedDeclarationAcrossFiles: 'PLAY0173',\n ConflictingDescriptionAcrossFiles: 'PLAY0174',\n UnexpectedTokenInAuthorize: 'PLAY0184',\n UnclosedAuthorizeGroup: 'PLAY0185',\n InvalidReadModelDeclaration: 'PLAY0186',\n InvalidInvokesDeclaration: 'PLAY0194',\n InvalidScopeDeclaration: 'PLAY0199',\n DuplicateScope: 'PLAY0200',\n InvalidIntervalTrigger: 'PLAY0249',\n InvalidScheduleTrigger: 'PLAY0250',\n DuplicateReactionTrigger: 'PLAY0253',\n InvalidSpecificationEventSource: 'PLAY0275',\n DuplicateSpecificationEventSource: 'PLAY0276',\n InvalidProjectionVariantDeclaration: 'PLAY0277',\n InvalidEntersOnDeclaration: 'PLAY0279',\n NestedProjectionVariantNotAllowed: 'PLAY0280',\n InvalidStructuredValue: 'PLAY0291',\n DuplicateStructuredValueMember: 'PLAY0294',\n ConflictingSpecificationActions: 'PLAY0358',\n InvalidSpecificationEventOrder: 'PLAY0359',\n InvalidValidationSeverity: 'PLAY0368',\n VariantRequiresEnteringEvent: 'PLAY0382',\n /** An event is used more than once in one projection level's event or join set. */\n DuplicateEventInProjectionScope: 'PLAY0801',\n /** An event source has the reserved stored name Default, or an event stream has the reserved stored name All, including through an id pin. */\n ReservedStoredName: 'PLAY0802',\n DuplicateProjectionVariant: 'PLAY0384',\n DuplicateVariantEnteringEvent: 'PLAY0385',\n InvalidSpecificationDenied: 'PLAY0388',\n DuplicateAuthorizationAcrossFiles: 'PLAY0394',\n FileConstraintOnlySupportsUniqueness: 'PLAY0396',\n LegacyInlineCodeFence: 'PLAY0397',\n InvalidEventGeneration: 'PLAY0446',\n InvalidFileImport: 'PLAY0454',\n FileImportMatchesNothing: 'PLAY0455',\n ImportedFileNotFound: 'PLAY0456',\n ConflictingImportPlacement: 'PLAY0457',\n ImportCycle: 'PLAY0458',\n ModuleInPlacedFile: 'PLAY0459',\n UnexpectedInPlacedFile: 'PLAY0460',\n InvalidSpecificationClock: 'PLAY0461',\n InvalidSpecificationTrigger: 'PLAY0462',\n InvalidSpecificationCapture: 'PLAY0463',\n InvalidSpecificationQueryAction: 'PLAY0464',\n MismatchedSpecificationQueryResult: 'PLAY0465',\n UnknownSpecificationQueryArgument: 'PLAY0468',\n InvalidSpecificationQuery: 'PLAY0265',\n UnknownSpecificationQueryDirective: 'PLAY0266',\n DuplicateSpecificationQueryArguments: 'PLAY0267',\n InvalidAbsentReadModelStep: 'PLAY0453',\n LegacyOptionalSuffix: 'PLAY0479',\n InvalidOptionalModifierOrder: 'PLAY0480',\n OptionalReadsNotSupported: 'PLAY0481',\n InvalidSpecificationCaller: 'PLAY0386',\n DuplicateSpecificationCallerOrDenied: 'PLAY0387',\n GeneratedPropertyOutsideCommand: 'PLAY0482',\n InvalidGeneratedType: 'PLAY0483',\n InvalidGeneratedModifierOrder: 'PLAY0484',\n DuplicateEventSubject: 'PLAY0590',\n InvalidSubjectType: 'PLAY0591',\n ProtectedSubjectType: 'PLAY0592',\n InvalidSubjectOwner: 'PLAY0593',\n ReadModelSubjectNotSupported: 'PLAY0594',\n InvalidSubjectModifierOrder: 'PLAY0595',\n GeneratedPropertySuppliedAsInput: 'PLAY0485',\n InvalidCommandResponse: 'PLAY0486',\n InvalidResponseSource: 'PLAY0487',\n DuplicateResponseField: 'PLAY0488',\n InvalidResponseShape: 'PLAY0489',\n InvalidGeneratedFixture: 'PLAY0490',\n InvalidReturnExpectation: 'PLAY0491',\n InvalidImplementationBlock: 'PLAY0492',\n InvalidImplementationHint: 'PLAY0493',\n ConflictingImplementationSources: 'PLAY0494',\n UnknownType: 'PLAY0165',\n InvalidSystemDeclaration: 'PLAY0495',\n InvalidOperationDeclaration: 'PLAY0496',\n InvalidProductionReference: 'PLAY0497',\n ProductionDeclarationCollision: 'PLAY0498',\n OperationOutsideCommand: 'PLAY0499',\n InvalidSystemReference: 'PLAY0500',\n InvalidOperationMapping: 'PLAY0501',\n InvalidOperationSpecification: 'PLAY0502',\n InvalidCaptureDeclaration: 'PLAY0078',\n UnknownCaptureDirective: 'PLAY0079',\n InvalidMapEntry: 'PLAY0080',\n InvalidTranslation: 'PLAY0081',\n InvalidSplitDeclaration: 'PLAY0082',\n InvalidSplitTarget: 'PLAY0083',\n InvalidAppendDeclaration: 'PLAY0084',\n UnknownAppendDirective: 'PLAY0085',\n WhenWithoutTrigger: 'PLAY0086',\n InvalidWhenClause: 'PLAY0087',\n InvalidWhenTransitionClause: 'PLAY0088',\n MixedWhenCombinators: 'PLAY0089',\n WhenCombinatorWithoutProperty: 'PLAY0090',\n UnknownCaptureBlockDirective: 'PLAY0091',\n InvalidCompositeKeyPart: 'PLAY0072',\n TemplateInCompositeKey: 'PLAY0073',\n EmptyCompositeKey: 'PLAY0074',\n InvalidProjectionMapping: 'PLAY0075',\n ExpectedLiteralValue: 'PLAY0150',\n InvalidExpression: 'PLAY0152',\n UnterminatedInterpolation: 'PLAY0157',\n UnterminatedTemplateExpression: 'PLAY0156',\n ProjectionDocumentWithoutProjection: 'PLAY0055',\n CaptureDocumentWithoutCapture: 'PLAY0077',\n SpecificationDocumentWithoutSpecification: 'PLAY0093',\n InvalidSeedDeclaration: 'PLAY0128',\n InvalidSeedGroup: 'PLAY0129',\n InvalidSeedEvent: 'PLAY0130',\n InvalidSeedPropertyAssignment: 'PLAY0131',\n InvalidPolicyDeclaration: 'PLAY0112',\n UnknownPolicyDirective: 'PLAY0113',\n PolicyWithoutRequirement: 'PLAY0114',\n ExpectedRoleName: 'PLAY0118',\n ExpectedClaimName: 'PLAY0119',\n ExpectedClaimMatches: 'PLAY0120',\n ExpectedClaimMatchTarget: 'PLAY0121',\n MixedPolicyImplementation: 'PLAY0440',\n RepeatedPolicyRequirement: 'PLAY0441',\n AnonymousPolicyCombined: 'PLAY0804',\n NegatedAnonymousPolicy: 'PLAY0805',\n UnexpectedTokenInPolicyCondition: 'PLAY0115',\n ExpectedPolicyCondition: 'PLAY0116',\n UnclosedPolicyConditionGroup: 'PLAY0117',\n UnexpectedTokenInCondition: 'PLAY0158',\n ExpectedCondition: 'PLAY0159',\n ExpectedComparisonOperator: 'PLAY0161',\n ExpectedComparisonValue: 'PLAY0162',\n InvalidActionAlternative: 'PLAY0341',\n GuardedActionWithoutAlternatives: 'PLAY0342',\n MisplacedActionOtherwise: 'PLAY0343',\n UnsupportedActionConditionOperand: 'PLAY0344',\n InvalidInteractionArgument: 'PLAY0319',\n UnclosedConditionGroup: 'PLAY0160',\n InvalidNumericDirective: 'PLAY0508',\n DuplicateNumericDirective: 'PLAY0509',\n LateNumericDirective: 'PLAY0510',\n InexactNumericLiteral: 'PLAY0511',\n MixedNumericModes: 'PLAY0512',\n IncompatibleNumericSource: 'PLAY0513',\n EventFromLaterSlice: 'PLAY0516',\n TimelineCycleGroup: 'PLAY0517',\n InvalidSpecificationExample: 'PLAY0518',\n DuplicateSpecificationAssignment: 'PLAY0519',\n UnresolvedSpecificationExampleType: 'PLAY0520',\n SpecificationExampleNameCollision: 'PLAY0521',\n SpecificationExampleKindMismatch: 'PLAY0522',\n InvalidSpecificationExampleValue: 'PLAY0523',\n MissingSpecificationProperty: 'PLAY0524',\n UnadmittedSpecificationExampleValue: 'PLAY0525',\n InvalidSpecificationExampleBody: 'PLAY0526',\n AmbiguousReference: 'PLAY0198',\n InvalidSpecificationStream: 'PLAY0547',\n SpecificationStreamOnCommand: 'PLAY0548',\n InvalidSpecificationStreamRoute: 'PLAY0549',\n InvalidSpecificationStreamEventSource: 'PLAY0550',\n SpecificationStreamContradictsCommand: 'PLAY0551',\n InvalidDependencyTarget: 'PLAY0554',\n RepeatedDependencyDeclaration: 'PLAY0555',\n UndeclaredDependency: 'PLAY0552',\n UnusedDependencyDeclaration: 'PLAY0553',\n MutualDependencyDeclarations: 'PLAY0556',\n AuthorizationRefusalWithoutIdentity: 'PLAY0557',\n InvalidDocumentation: 'PLAY0558',\n ConflictingDocumentationAcrossFiles: 'PLAY0559',\n InvalidSpecificationCallerPersona: 'PLAY0572',\n UnsynthesizablePersonaCaller: 'PLAY0573',\n PersonaWithoutGate: 'PLAY0574',\n GateWithoutPersona: 'PLAY0575',\n AmbiguousPersonaCaller: 'PLAY0576',\n InvalidSpecificationParameter: 'PLAY0577',\n InvalidSpecificationCase: 'PLAY0578',\n DuplicateSpecificationParameter: 'PLAY0579',\n DuplicateSpecificationCase: 'PLAY0580',\n IncompleteSpecificationTable: 'PLAY0581',\n InvalidSpecificationCaseAssignment: 'PLAY0582',\n InvalidSpecificationCaseValue: 'PLAY0583',\n InvalidSpecificationCaseReference: 'PLAY0584',\n OptionalSpecificationParameterTarget: 'PLAY0585',\n SpecificationCaseNameCollision: 'PLAY0586',\n IncompatibleSpecificationParameterType: 'PLAY0587',\n UnusedSpecificationParameter: 'PLAY0588',\n SingularSpecificationTableExpansion: 'PLAY0589',\n UnsupportedInteractionAlternatives: 'PLAY0560',\n MixedInteractionAlternatives: 'PLAY0561',\n InteractionAlternativeWithoutActions: 'PLAY0562',\n InlineInteractionAlternative: 'PLAY0563',\n LegacyInteractionWhere: 'PLAY0564',\n InvalidEventSourceDeclaration: 'PLAY0503',\n InvalidCommandStream: 'PLAY0504',\n AmbiguousCommandStream: 'PLAY0505',\n UnsupportedStreamIdType: 'PLAY0506',\n RedundantSourceStreamId: 'PLAY0507',\n UnknownEvent: 'PLAY0166',\n UnknownReadModelProperty: 'PLAY0514',\n PiiNotSupportedOnIdentifier: 'PLAY0515',\n HandlerWithoutImplementation: 'PLAY0045',\n UnknownHandlerDirective: 'PLAY0046',\n CommandWithProducesAndHandler: 'PLAY0035', // Retired: handlers may declare produces as their result contract. Reserved forever.\n AbsoluteFileReference: 'PLAY0264',\n InvalidTriggerData: 'PLAY0246',\n InvalidReadModelKey: 'PLAY0660',\n IncompleteReadModelKey: 'PLAY0661', // C# only: scoped read-model key resolution.\n InvalidReadModelKeyLookup: 'PLAY0662', // Shape checks shared; scoped lookup checks are C# only.\n ProductionRouteOutsideCommand: 'PLAY0663',\n RedundantProductionRoute: 'PLAY0664',\n InvalidObserverFilter: 'PLAY0665',\n ObserverFilterExcludesEveryProducer: 'PLAY0666', // C# only: statically known producer routes.\n ReducerIdentityMismatch: 'PLAY0690',\n InvalidReactionBatchesDeclaration: 'PLAY0693',\n InvalidCommandReadsDeclaration: 'PLAY0780',\n InvalidTimeZoneDeclaration: 'PLAY0812',\n InvalidCommandCalendar: 'PLAY0813',\n InvalidSpecificationTimeZone: 'PLAY0814',\n InvalidSpecificationInvocation: 'PLAY0815',\n UnreachableSpecificationInvocation: 'PLAY0816', // C# only: the outcome consistency check is native.\n GenerationSupportBudgetExceeded: 'PLAY0691',\n EmptyGenerationSupport: 'PLAY0692', // C# only: conservative nominal producer identity comparison.\n MixedEnumerationNumbering: 'PLAY0667',\n DuplicateEnumerationNumber: 'PLAY0668',\n EnumerationNumberOutsideInt32: 'PLAY0669',\n MalformedEnumerationNumber: 'PLAY0670',\n UnpinnedStoredEnumeration: 'PLAY0671',\n ReadsWithChildren: 'PLAY0451',\n UnknownGenerationStrategy: 'PLAY0672',\n InvalidGenerationArgument: 'PLAY0673',\n InvalidGenerationModifier: 'PLAY0674',\n DuplicateGenerationModifier: 'PLAY0675',\n DuplicateGeneration: 'PLAY0676',\n InvalidGenerationPrimitive: 'PLAY0677',\n InvalidGenerationPrefix: 'PLAY0678',\n InvalidGenerationAlphabet: 'PLAY0679',\n InvalidTypeIdPrefix: 'PLAY0680',\n GenerationSizeOutsideRange: 'PLAY0681',\n ReservedSequenceGeneration: 'PLAY0682',\n LowGenerationEntropy: 'PLAY0683',\n LowGeneratedIdentifierEntropy: 'PLAY0684',\n ResponseNameUsedOnFailure: 'PLAY0685',\n // Retired by ESM v16; preserved for compatibility with earlier native compiler diagnostics.\n EventIdPinNotCarriedToRenderers: 'PLAY0686',\n InvalidToolbarButton: 'PLAY0760',\n} as const;\n"],"mappings":"AAKA,MAAaA,EAAkB,CAC3B,2BAA4B,WAC5B,sBAAuB,WACvB,qBAAsB,WACtB,4BAA6B,WAC7B,gCAAiC,WACjC,4BAA6B,WAC7B,oBAAqB,WACrB,oBAAqB,W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B,WAC9B,wBAAyB,WACzB,8BAA+B,WAC/B,sBAAuB,WACvB,mBAAoB,WACpB,oBAAqB,WACrB,uBAAwB,WACxB,0BAA2B,WAC3B,8BAA+B,WAC/B,yBAA0B,WAC1B,sBAAuB,WACvB,oCAAqC,WACrC,wBAAyB,WACzB,kCAAmC,WACnC,+BAAgC,WAChC,2BAA4B,WAC5B,uBAAwB,WACxB,6BAA8B,WAC9B,+BAAgC,WAChC,mCAAoC,WACpC,gCAAiC,WACjC,uBAAwB,WACxB,0BAA2B,WAC3B,2BAA4B,WAC5B,8BAA+B,WAC/B,2BAA4B,WAC5B,0BAA2B,WAC3B,kBAAmB,WACnB,0BAA2B,WAC3B,0BAA2B,WAC3B,0BAA2B,WAC3B,4BAA6B,WAC7B,oBAAqB,WACrB,2BAA4B,WAC5B,wBAAyB,WACzB,0BAA2B,WAC3B,oBAAqB,WACrB,2BAA4B,WAC5B,2BAA4B,WAC5B,qBAAsB,WACtB,8BAA+B,WAC/B,0BAA2B,WAE3B,gCAAiC,WACjC,qBAAsB,UAC1B"}
@@ -1,2 +1,2 @@
1
- import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";function isPendingHandler(e){return e.implementation!=null&&e.file===null&&e.code===null}function validateHandlerOccurrences(t,n){if(t.some(e=>e.handler!==null&&isPendingHandler(e.handler)))for(let r of t.slice(1))n.error(e.PendingIntentWithOtherHandler,`A pending handler intent cannot coexist with another handler on the same command.`,r.location)}function validateApplicationHandlers(e,t){let validateFeature=e=>{for(let n of e.slices)validateCommandHandlers(n.commands,t);e.features.forEach(validateFeature)};for(let t of e.modules)t.features.forEach(validateFeature)}function validateCommandHandlers(e,t){let n=/* @__PURE__ */ new Map;for(let t of e)n.set(t.name,[...n.get(t.name)??[],t]);for(let e of n.values())validateHandlerOccurrences(e.flatMap(e=>e.handler==null?[]:[{handler:e.handler,location:e.handler.location}]),t)}export{isPendingHandler,validateApplicationHandlers,validateCommandHandlers,validateHandlerOccurrences};
1
+ import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";function isPendingHandler(e){return e.implementation!=null&&e.file===null&&e.code===null}function validateHandlerOccurrences(t,n){let r=t.some(e=>e.handler!==null&&isPendingHandler(e.handler)),i=r?e.PendingIntentWithOtherHandler:e.DuplicateDeclaration,a=r?`A pending handler intent cannot coexist with another handler on the same command.`:`A command cannot declare more than one handler.`;for(let e of t.slice(1))n.error(i,a,e.location)}function validateApplicationHandlers(e,t){let validateFeature=e=>{for(let n of e.slices)validateCommandHandlers(n.commands,t);e.features.forEach(validateFeature)};for(let t of e.modules)t.features.forEach(validateFeature)}function validateCommandHandlers(e,t){let n=/* @__PURE__ */ new Map;for(let t of e)n.set(t.name,[...n.get(t.name)??[],t]);for(let e of n.values())validateHandlerOccurrences(e.flatMap(e=>e.handler==null?[]:[{handler:e.handler,location:e.handler.location}]),t)}export{isPendingHandler,validateApplicationHandlers,validateCommandHandlers,validateHandlerOccurrences};
2
2
  //# sourceMappingURL=CommandHandlerValidator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommandHandlerValidator.js","names":["handler","occurrences","entry","context","DiagnosticCodes","slice","feature","module","application","groups","command","commands","group"],"sources":["../../../../../../Compiler/Parsing/CommandHandlerValidator.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 { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { SourceLocation } from '../Diagnostics/SourceLocation';\nimport { CommandSyntax } from '../Syntax/Commands';\nimport { HandlerSyntax } from '../Syntax/Implementations';\nimport { ApplicationSyntax, FeatureSyntax } from '../Syntax/Structure';\nimport { ParserContext } from './ParserContext';\n\nexport function isPendingHandler(handler: HandlerSyntax): boolean {\n return handler.implementation != null && handler.file === null && handler.code === null;\n}\n\nexport function validateHandlerOccurrences(occurrences: readonly { handler: HandlerSyntax | null; location: SourceLocation }[], context: ParserContext): void {\n if (!occurrences.some(entry => entry.handler !== null && isPendingHandler(entry.handler))) return;\n for (const entry of occurrences.slice(1)) {\n context.error(DiagnosticCodes.PendingIntentWithOtherHandler, 'A pending handler intent cannot coexist with another handler on the same command.', entry.location);\n }\n}\n\nexport function validateApplicationHandlers(application: ApplicationSyntax, context: ParserContext): void {\n const validateFeature = (feature: FeatureSyntax): void => {\n for (const slice of feature.slices) validateCommandHandlers(slice.commands, context);\n feature.features.forEach(validateFeature);\n };\n for (const module of application.modules) module.features.forEach(validateFeature);\n}\n\nexport function validateCommandHandlers(commands: readonly CommandSyntax[], context: ParserContext): void {\n const groups = new Map<string, CommandSyntax[]>();\n for (const command of commands) groups.set(command.name, [...(groups.get(command.name) ?? []), command]);\n for (const group of groups.values()) {\n validateHandlerOccurrences(group.flatMap(command => command.handler == null ? [] : [{ handler: command.handler, location: command.handler.location }]), context);\n }\n}\n"],"mappings":"yHAUA,SAAgB,iBAAiB,EAAiC,CAC9D,OAAOA,EAAQ,gBAAkB,MAAQA,EAAQ,OAAS,MAAQA,EAAQ,OAAS,IACvF,CAEA,SAAgB,2BAA2B,EAAqF,EAA8B,CAC1J,GAAKC,EAAY,KAAK,GAASC,EAAM,UAAY,MAAQ,iBAAiBA,EAAM,OAAO,CAAC,EACxF,IAAK,IAAMA,KAASD,EAAY,MAAM,CAAC,EACnCE,EAAQ,MAAMC,EAAgB,8BAA+B,oFAAqFF,EAAM,QAAQ,CAExK,CAEA,SAAgB,4BAA4B,EAAgC,EAA8B,CACtG,IAAM,gBAAmB,GAAiC,CACtD,IAAK,IAAMG,KAASC,EAAQ,OAAQ,wBAAwBD,EAAM,SAAUF,CAAO,EACnFG,EAAQ,SAAS,QAAQ,eAAe,CAC5C,EACA,IAAK,IAAMC,KAAUC,EAAY,QAASD,EAAO,SAAS,QAAQ,eAAe,CACrF,CAEA,SAAgB,wBAAwB,EAAoC,EAA8B,CACtG,IAAME,kBAAS,IAAI,IACnB,IAAK,IAAMC,KAAWC,EAAUF,EAAO,IAAIC,EAAQ,KAAM,CAAC,GAAID,EAAO,IAAIC,EAAQ,IAAI,GAAK,CAAC,EAAIA,CAAO,CAAC,EACvG,IAAK,IAAME,KAASH,EAAO,OAAO,EAC9B,2BAA2BG,EAAM,QAAQ,GAAWF,EAAQ,SAAW,KAAO,CAAC,EAAI,CAAC,CAAE,QAASA,EAAQ,QAAS,SAAUA,EAAQ,QAAQ,QAAS,CAAC,CAAC,EAAGP,CAAO,CAEvK"}
1
+ {"version":3,"file":"CommandHandlerValidator.js","names":["handler","hasPending","occurrences","entry","code","DiagnosticCodes","message","context","slice","feature","module","application","groups","command","commands","group"],"sources":["../../../../../../Compiler/Parsing/CommandHandlerValidator.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 { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { SourceLocation } from '../Diagnostics/SourceLocation';\nimport { CommandSyntax } from '../Syntax/Commands';\nimport { HandlerSyntax } from '../Syntax/Implementations';\nimport { ApplicationSyntax, FeatureSyntax } from '../Syntax/Structure';\nimport { ParserContext } from './ParserContext';\n\nexport function isPendingHandler(handler: HandlerSyntax): boolean {\n return handler.implementation != null && handler.file === null && handler.code === null;\n}\n\nexport function validateHandlerOccurrences(occurrences: readonly { handler: HandlerSyntax | null; location: SourceLocation }[], context: ParserContext): void {\n const hasPending = occurrences.some(entry => entry.handler !== null && isPendingHandler(entry.handler));\n const code = hasPending ? DiagnosticCodes.PendingIntentWithOtherHandler : DiagnosticCodes.DuplicateDeclaration;\n const message = hasPending\n ? 'A pending handler intent cannot coexist with another handler on the same command.'\n : 'A command cannot declare more than one handler.';\n for (const entry of occurrences.slice(1)) {\n context.error(code, message, entry.location);\n }\n}\n\nexport function validateApplicationHandlers(application: ApplicationSyntax, context: ParserContext): void {\n const validateFeature = (feature: FeatureSyntax): void => {\n for (const slice of feature.slices) validateCommandHandlers(slice.commands, context);\n feature.features.forEach(validateFeature);\n };\n for (const module of application.modules) module.features.forEach(validateFeature);\n}\n\nexport function validateCommandHandlers(commands: readonly CommandSyntax[], context: ParserContext): void {\n const groups = new Map<string, CommandSyntax[]>();\n for (const command of commands) groups.set(command.name, [...(groups.get(command.name) ?? []), command]);\n for (const group of groups.values()) {\n validateHandlerOccurrences(group.flatMap(command => command.handler == null ? [] : [{ handler: command.handler, location: command.handler.location }]), context);\n }\n}\n"],"mappings":"yHAUA,SAAgB,iBAAiB,EAAiC,CAC9D,OAAOA,EAAQ,gBAAkB,MAAQA,EAAQ,OAAS,MAAQA,EAAQ,OAAS,IACvF,CAEA,SAAgB,2BAA2B,EAAqF,EAA8B,CAC1J,IAAMC,EAAaC,EAAY,KAAK,GAASC,EAAM,UAAY,MAAQ,iBAAiBA,EAAM,OAAO,CAAC,EAChGC,EAAOH,EAAaI,EAAgB,8BAAgCA,EAAgB,qBACpFC,EAAUL,EACV,oFACA,kDACN,IAAK,IAAME,KAASD,EAAY,MAAM,CAAC,EACnCK,EAAQ,MAAMH,EAAME,EAASH,EAAM,QAAQ,CAEnD,CAEA,SAAgB,4BAA4B,EAAgC,EAA8B,CACtG,IAAM,gBAAmB,GAAiC,CACtD,IAAK,IAAMK,KAASC,EAAQ,OAAQ,wBAAwBD,EAAM,SAAUD,CAAO,EACnFE,EAAQ,SAAS,QAAQ,eAAe,CAC5C,EACA,IAAK,IAAMC,KAAUC,EAAY,QAASD,EAAO,SAAS,QAAQ,eAAe,CACrF,CAEA,SAAgB,wBAAwB,EAAoC,EAA8B,CACtG,IAAME,kBAAS,IAAI,IACnB,IAAK,IAAMC,KAAWC,EAAUF,EAAO,IAAIC,EAAQ,KAAM,CAAC,GAAID,EAAO,IAAIC,EAAQ,IAAI,GAAK,CAAC,EAAIA,CAAO,CAAC,EACvG,IAAK,IAAME,KAASH,EAAO,OAAO,EAC9B,2BAA2BG,EAAM,QAAQ,GAAWF,EAAQ,SAAW,KAAO,CAAC,EAAI,CAAC,CAAE,QAASA,EAAQ,QAAS,SAAUA,EAAQ,QAAQ,QAAS,CAAC,CAAC,EAAGN,CAAO,CAEvK"}
@@ -1,2 +1,2 @@
1
- import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{stringBodyPattern as t,unescapeString as n}from"../Text/StringLiteral.js";import{pattern as r}from"../Text/patterns.js";import{locationOf as i}from"./SourceLine.js";import{dependencySources as a}from"../Syntax/DependencySources.js";import{parseMappingSource as o}from"./ExpressionParser.js";import{isPendingHandler as s,validateHandlerOccurrences as c}from"./CommandHandlerValidator.js";import{firstWord as l}from"./LineText.js";import{reportInvalidModifierOrder as u,reportLegacyOptionalSuffix as d,tryParseProperty as f}from"./PropertyLineParser.js";import{combineAuthorize as p,parseAuthorize as m}from"./AuthorizeParser.js";import{parseDescription as h}from"./DescriptionParser.js";import{parseDocumentation as g}from"./DocumentationParser.js";import{parseCondition as _}from"./ConditionParser.js";import{ParserContext as v}from"./ParserContext.js";import{isReactionIdentityLine as y,misplacedReactionIdentity as b}from"./ReactionIdentityParser.js";import{sourceStreamPattern as x}from"../Text/SourceStreamNames.js";import{parseCommandStream as S}from"./EventSourceParser.js";import{isCode as C,isFile as w,parseCode as T,parseFile as E,parseHandler as D,parseImplementationWrapper as O}from"./ImplementationParser.js";import{parseCommandResponse as k,scalarResponsePattern as A}from"./CommandResponseParser.js";import{matchSubject as j,validateMatchOperand as M}from"./MatchOperandValidation.js";import{commandReadSources as N}from"./CommandReadSources.js";import{captureConcurrency as P}from"./DependencySourceParser.js";import{parseReads as F}from"./ReadsParser.js";import{parseProduces as I}from"./ProducesParser.js";const L=r(`^command\\s+([A-Za-z_]\\w*)$`),R=x(`^stream\\s+[A-Za-z_]\\w*\\.[A-Za-z_]\\w*$`),z=r(`^calendar\\s+(?:"|from\\s+\\$context\\.)`),B=r(`^calendar\\s+(?:"(${t})"|from\\s+\\$context\\.([A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*))$`),V=r(`\\bseverity\\s+(\\S+)$`),H=r(`\\bmessage\\s+(?:"(${t})"|(\\$strings\\.\\S*))$`),U=r(`^([\\w.]+)\\s+(.+)$`),W=r(`^(not empty|length ==|decimals <=|all >=|all >|matches|not contains|contains|starts with|ends with|max|min|rule|>=|<=|==|!=|>|<)\\s*(.*)$`),G=x(`^[A-Za-z_]\\w*$`),K=r(`^reads\\s+[A-Z]\\w*\\s+optional(?:\\s|$)`),q={max:`Max`,min:`Min`,">":`GreaterThan`,">=":`GreaterThanOrEqual`,"<":`LessThan`,"<=":`LessThanOrEqual`,"==":`Equal`,"!=":`NotEqual`,"length ==":`Length`,"decimals <=":`DecimalPlaces`,matches:`Matches`,contains:`Contains`,"not contains":`NotContains`,"starts with":`StartsWith`,"ends with":`EndsWith`,"all >":`AllGreaterThan`,"all >=":`AllGreaterThanOrEqual`},J={information:`Information`,warning:`Warning`,error:`Error`},Y=/* @__PURE__ */ new Set([`reads`,`concurrency`]),ee=/* @__PURE__ */ new Set([`description`,`documentation`,`handler`,`concurrency`]);function parseCommand(e,t){let n=/* @__PURE__ */ new Set,r=new v(e.reader.fork(),e.path,e.languages);return r.sourceOptions=e.sourceOptions,r.streamCandidates=e.streamCandidates,parseCommandBody(r,t,void 0,n),parseCommandBody(e,t,n)}function parseCommandBody(t,r,o,d){let _=L.exec(r.content)?.[1]??``;_===``&&t.error(e.InvalidCommandDeclaration,`Invalid command declaration '${r.content}' - expected 'command <Name>'`,i(r));let v=[],x=[],C,w=[],T=[],E=[],O=[],j,M=null,V=null,H=null,U=null,W=[],G=null,q=[],J=null;for(let a=t.peekChild(r.indent);a!==void 0;a=t.peekChild(r.indent)){t.reader.takeSignificant();let r=l(a.content),s=f(a);if(r===`calendar`&&z.test(a.content)){let r=B.exec(a.content);J!==null||r===null?t.error(e.InvalidCommandCalendar,`A command declares at most one 'calendar "<id>"' or 'calendar from $context.<member>'.`,i(a)):J={kind:`CommandCalendarSyntax`,id:r[1]===void 0?null:n(r[1]),contextMember:r[2]??null,location:i(a)}}else if(s!==void 0&&(ee.has(r)||r===`validate`&&a.content!==`validate csharp`))C=addProperty(t,v,s,_,a,C);else if(r===`returns`){let e=A.exec(a.content);e!==null&&!e[1].startsWith(`@`)&&s!==void 0?o===void 0?(v.push(s),x.push({line:a,candidate:s,response:null})):o.has(s.type.name)?x.push({line:a,candidate:null,response:k(t,a)}):C=addProperty(t,v,s,_,a,C):s===void 0?u(t,a)?t.skipBlock(a.indent):x.push({line:a,candidate:null,response:k(t,a)}):C=addProperty(t,v,s,_,a,C)}else if(r===`stream`&&R.test(a.content)&&s!==void 0&&t.streamCandidates?.hasSource(s.type.name.split(`.`)[0])===!0){let[n,r]=s.type.name.split(`.`),o=t.streamCandidates.hasPropertyType(s.type.name)&&t.streamCandidates.hasUniqueStream(n,r),c=S(t,a,s,o);(G!==null||q.length>0)&&t.error(e.InvalidCommandStream,`A command declares at most one stream route.`,i(a)),o||G!==null?q.push(c):G=c}else if(r===`runs`&&y(a))b(t,a);else if(r===`description`)M=h(t,a,M,`Command '${_}'`);else if(r===`documentation`)V=g(t,a,V,`Command '${_}'`);else if(r===`authorize`)H=p(H,m(t,a));else if(r===`validate`){let e=parseValidate(t,a,`command`,_);e!==void 0&&w.push(e)}else if(r===`produces`){let e=I(t,a,!0);e!==void 0&&T.push(e)}else if(r===`handler`)U=D(t,a),W.push({handler:U,location:i(a)});else if(Y.has(r)){let n=r===`reads`?F(t,a):void 0;n!==void 0&&O.push(n),r===`concurrency`&&j===void 0&&(j=P(t,a));let o=/^reads\s+([A-Z]\w*)(?:\s+as\s+([a-z_]\w*))?(?:\s+by\s+([a-z_]\w*))?$/.exec(a.content);o!==null&&E.push({readModel:o[1],alias:o[2]??null}),K.test(a.content)&&t.error(e.OptionalReadsNotSupported,`Optional reads are not yet supported (see #308).`,i(a)),t.skipOpaqueBlock(a.indent)}else s===void 0?(u(t,a),t.error(e.UnknownCommandDirective,`Unexpected '${a.content}' in command body`,i(a)),t.skipBlock(a.indent)):C=addProperty(t,v,s,_,a,C)}let te=new Set(x.flatMap(e=>e.candidate===null?[]:[e.candidate])),X=new Set(v.filter(e=>!te.has(e)).map(e=>e.name));x.some(e=>e.candidate!==null&&!X.has(e.candidate.type.name)&&e.candidate.type.name!==`returns`)&&X.add(`returns`);for(let e of X)d?.add(e);let Z=null,Q=/* @__PURE__ */ new Set;for(let n of x){let r=n.response;if(n.candidate!==null){if(!X.has(n.candidate.type.name))continue;Q.add(n.candidate),r={kind:`ScalarCommandResponseSyntax`,source:{kind:`PropertyResponseSourceSyntax`,property:n.candidate.type.name,location:n.candidate.type.location},location:i(n.line)}}r!==null&&(Z===null?Z=r:t.error(e.InvalidCommandResponse,`A command declares at most one unconditional response.`,i(n.line)))}c(W,t),U!==null&&!s(U)&&T.length>0&&t.error(e.CommandWithProducesAndHandler,`Command '${_}' cannot declare both 'produces' and 'handler'`,i(r));let $={kind:`CommandSyntax`,name:_,description:M,documentation:V,authorize:H,properties:v.filter(e=>!Q.has(e)),validations:w,produces:T,handler:U,response:Z,stream:G,streamCandidates:q,...J===null?{}:{calendar:J},location:i(r)};return N.set($,E),a.set($,{reads:O,concurrency:j}),$}function addProperty(t,n,r,i,a,o){return d(t,r.type,a),r.isIdentifier&&o!==void 0&&(t.error(e.DuplicateCommandIdentifier,`Command '${i}' already marks '${o.name}' as identifier - only one property can be the identifier`,r.location),r={...r,isIdentifier:!1}),n.push(r),o??(r.isIdentifier?r:void 0)}function parseValidate(t,r,a,o){if(r.content===`validate`){let s=t.peekChild(r.indent);if(s!==void 0&&s.content.startsWith("```")){t.reader.takeSignificant();let e=T(t.valueContext,s);return e===null&&t.skipFencedBody(),{kind:`CodeValidateSyntax`,code:e,location:i(r)}}let c=[],u=[],d;for(let s=t.peekChild(r.indent);s!==void 0;s=t.peekChild(r.indent)){if(t.reader.takeSignificant(),a===`concept`){if(t.sourceOptions.numericMode===`legacy`&&s.content.startsWith("```")){t.skipFencedBody();continue}if(d!==void 0&&s.indent<=d&&(d=void 0),d!==void 0||l(s.content)===`implementation`){t.error(e.InvalidValidationRule,`Invalid validation rule '${s.content}'`,i(s)),d??=s.indent;continue}}if(l(s.content)===`require`){let e=_(a===`concept`?t.valueContext:t,s.content.substring(7).trim(),i(s)),r=null,o=`Error`,c=!1;for(let e=t.peekChild(s.indent);e!==void 0;e=t.peekChild(s.indent)){t.reader.takeSignificant();let i=H.exec(e.content);i!==null&&i.index===0?r=i[1]===void 0?i[2]:n(i[1]):l(e.content)===`severity`?(c||(o=J[e.content.substring(8).trim()]??`Error`),c=!0):t.skipOpaqueBlock(e.indent)}e!==null&&u.push({kind:`RequirementSyntax`,condition:e,message:r,severity:o,location:i(s)});continue}let r=parseValidationRule(t,a===`concept`?{...s,content:`value ${s.content}`}:s,a,o);r!==void 0&&c.push(r)}return{kind:`DeclarativeValidateSyntax`,rules:c,requirements:u,location:i(r)}}if(a===`concept`&&l(r.content.substring(8).trimStart())===`checksum`){let e=parseValidationRule(t,{...r,content:`value ${r.content.substring(8).trimStart()}`},a,o);return e===void 0?void 0:{kind:`DeclarativeValidateSyntax`,rules:[e],requirements:[],location:i(r)}}if(r.content===`validate csharp`){let e=T(t.valueContext,{...r,content:`csharp`});return e===null&&t.skipOpaqueBlock(r.indent),{kind:`CodeValidateSyntax`,code:e,location:i(r)}}t.error(e.InvalidValidateDeclaration,`Invalid validate declaration '${r.content}' - expected 'validate' or 'validate csharp'`,i(r)),t.skipBlock(r.indent)}function parseValidationRule(t,n,r,a){let o=l(U.exec(n.content)?.[2]??``)===`checksum`,s=r===`concept`&&!o?t.valueContext:t,{content:c,message:u}=splitMessage(n.content),d=splitSeverity(s,n,c);if(d===void 0)return;let f=U.exec(d.content);if(f===null){s.error(e.InvalidValidationRule,`Invalid validation rule '${n.content}'`,i(n));return}let p=parseRule(s,f[2],n);if(p===void 0)return;p.kind===`Matches`&&p.value!==null&&M(t,p.value,i(n),n.raw,j(t,r,a,f[1]));let m=p.kind===`Rule`?parseRuleImplementation(t,n,r===`command`):{file:null,code:null,implementation:null};return{kind:`ValidationRuleSyntax`,property:f[1],rule:p.kind,value:p.value,message:u,severity:d.severity,...m,location:i(n)}}function parseRuleImplementation(t,n,r){let a=t.peekChild(n.indent);if(a===void 0)return{file:null,code:null,implementation:null};t.reader.takeSignificant();let o=r&&l(a.content)===`implementation`,s=o?O(t,a):{file:w(a)?E(t,a):null,code:!w(a)&&C(t,a)?T(t,a):null,implementation:null};!o&&s.file===null&&s.code===null&&(t.error(e.UnknownRuleImplementationDirective,`Unexpected '${a.content}' in rule implementation - expected 'file <path>' or an inline code block`,i(a)),t.skipBlock(a.indent));for(let a=t.peekChild(n.indent);a!==void 0&&(o||r&&l(a.content)===`implementation`);a=t.peekChild(n.indent))t.reader.takeSignificant(),t.error(o&&l(a.content)===`implementation`?e.InvalidImplementationBlock:e.ConflictingImplementationSources,`A named rule has one implementation wrapper and cannot mix wrapped and direct sources.`,i(a)),C(t,a)?T(t,a):t.skipBlock(a.indent);return s}function splitMessage(e){let t=H.exec(e);if(t===null)return{content:e,message:null};let r=t[1]===void 0?t[2]:n(t[1]);return{content:e.substring(0,t.index).trimEnd(),message:r}}function splitSeverity(t,n,r){let a=V.exec(r);if(a===null)return{content:r,severity:`Error`};let o=J[a[1]];if(o===void 0)t.error(e.InvalidValidationSeverity,`Unknown validation severity '${a[1]}' - expected information, warning or error`,i(n));else return{content:r.substring(0,a.index).trimEnd(),severity:o}}function parseRule(t,n,r){if(n===`not empty`)return{kind:`NotEmpty`,value:null};if(l(n)===`checksum`){let a=n.substring(8).trim();if(a!==`luhn`&&a!==`mod11`&&a!==`mod97`){t.error(e.InvalidGenerationArgument,`Checksum validation requires luhn, mod11 or mod97.`,i(r));return}return{kind:`Checksum`,value:{kind:`LiteralExpressionSyntax`,value:a,location:i(r)}}}let a=W.exec(n);if(a===null)t.error(e.InvalidValidationRule,`Invalid validation rule '${r.content}'`,i(r));else{if(a[1]===`rule`){let n=a[2].trim();if(!G.test(n)){t.error(e.InvalidRuleName,`Invalid rule name '${n}' in '${r.content}' - expected 'rule <Name>' with an identifier`,i(r));return}return{kind:`Rule`,value:{kind:`PathExpressionSyntax`,path:n,location:i(r)}}}return{kind:q[a[1]],value:o(a[2],i(r),t)}}}export{parseCommand,parseValidate};
1
+ import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{stringBodyPattern as t,unescapeString as n}from"../Text/StringLiteral.js";import{pattern as r}from"../Text/patterns.js";import{locationOf as i}from"./SourceLine.js";import{dependencySources as a}from"../Syntax/DependencySources.js";import{parseMappingSource as o}from"./ExpressionParser.js";import{validateHandlerOccurrences as s}from"./CommandHandlerValidator.js";import{firstWord as c}from"./LineText.js";import{reportInvalidModifierOrder as l,reportLegacyOptionalSuffix as u,tryParseProperty as d}from"./PropertyLineParser.js";import{combineAuthorize as f,parseAuthorize as p}from"./AuthorizeParser.js";import{parseDescription as m}from"./DescriptionParser.js";import{parseDocumentation as h}from"./DocumentationParser.js";import{parseCondition as g}from"./ConditionParser.js";import{ParserContext as _}from"./ParserContext.js";import{isReactionIdentityLine as v,misplacedReactionIdentity as y}from"./ReactionIdentityParser.js";import{sourceStreamPattern as b}from"../Text/SourceStreamNames.js";import{parseCommandStream as x}from"./EventSourceParser.js";import{isCode as S,isFile as C,parseCode as w,parseFile as T,parseHandler as E,parseImplementationWrapper as D}from"./ImplementationParser.js";import{parseCommandResponse as O,scalarResponsePattern as k}from"./CommandResponseParser.js";import{matchSubject as A,validateMatchOperand as j}from"./MatchOperandValidation.js";import{commandReadSources as M}from"./CommandReadSources.js";import{captureConcurrency as N}from"./DependencySourceParser.js";import{parseReads as P}from"./ReadsParser.js";import{parseProduces as F}from"./ProducesParser.js";const I=r(`^command\\s+([A-Za-z_]\\w*)$`),L=b(`^stream\\s+[A-Za-z_]\\w*\\.[A-Za-z_]\\w*$`),ee=r(`^calendar\\s+(?:"|from\\s+\\$context\\.)`),R=r(`^calendar\\s+(?:"(${t})"|from\\s+\\$context\\.([A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*))$`),z=r(`\\bseverity\\s+(\\S+)$`),B=r(`\\bmessage\\s+(?:"(${t})"|(\\$strings\\.\\S*))$`),V=r(`^([\\w.]+)\\s+(.+)$`),H=r(`^(not empty|length ==|decimals <=|all >=|all >|matches|not contains|contains|starts with|ends with|max|min|rule|>=|<=|==|!=|>|<)\\s*(.*)$`),U=b(`^[A-Za-z_]\\w*$`),W=r(`^reads\\s+[A-Z]\\w*\\s+optional(?:\\s|$)`),G={max:`Max`,min:`Min`,">":`GreaterThan`,">=":`GreaterThanOrEqual`,"<":`LessThan`,"<=":`LessThanOrEqual`,"==":`Equal`,"!=":`NotEqual`,"length ==":`Length`,"decimals <=":`DecimalPlaces`,matches:`Matches`,contains:`Contains`,"not contains":`NotContains`,"starts with":`StartsWith`,"ends with":`EndsWith`,"all >":`AllGreaterThan`,"all >=":`AllGreaterThanOrEqual`},K={information:`Information`,warning:`Warning`,error:`Error`},q=/* @__PURE__ */ new Set([`reads`,`concurrency`]),J=/* @__PURE__ */ new Set([`description`,`documentation`,`handler`,`concurrency`]);function parseCommand(e,t){let n=/* @__PURE__ */ new Set,r=new _(e.reader.fork(),e.path,e.languages);return r.sourceOptions=e.sourceOptions,r.streamCandidates=e.streamCandidates,parseCommandBody(r,t,void 0,n),parseCommandBody(e,t,n)}function parseCommandBody(t,r,o,u){let g=I.exec(r.content)?.[1]??``;g===``&&t.error(e.InvalidCommandDeclaration,`Invalid command declaration '${r.content}' - expected 'command <Name>'`,i(r));let _=[],b=[],S,C=[],w=[],T=[],D=[],A,j=null,z=null,B=null,V=null,H=[],U=null,G=[],K=null;for(let a=t.peekChild(r.indent);a!==void 0;a=t.peekChild(r.indent)){t.reader.takeSignificant();let r=c(a.content),s=d(a);if(r===`calendar`&&ee.test(a.content)){let r=R.exec(a.content);K!==null||r===null?t.error(e.InvalidCommandCalendar,`A command declares at most one 'calendar "<id>"' or 'calendar from $context.<member>'.`,i(a)):K={kind:`CommandCalendarSyntax`,id:r[1]===void 0?null:n(r[1]),contextMember:r[2]??null,location:i(a)}}else if(s!==void 0&&(J.has(r)||r===`validate`&&a.content!==`validate csharp`))S=addProperty(t,_,s,g,a,S);else if(r===`returns`){let e=k.exec(a.content);e!==null&&!e[1].startsWith(`@`)&&s!==void 0?o===void 0?(_.push(s),b.push({line:a,candidate:s,response:null})):o.has(s.type.name)?b.push({line:a,candidate:null,response:O(t,a)}):S=addProperty(t,_,s,g,a,S):s===void 0?l(t,a)?t.skipBlock(a.indent):b.push({line:a,candidate:null,response:O(t,a)}):S=addProperty(t,_,s,g,a,S)}else if(r===`stream`&&L.test(a.content)&&s!==void 0&&t.streamCandidates?.hasSource(s.type.name.split(`.`)[0])===!0){let[n,r]=s.type.name.split(`.`),o=t.streamCandidates.hasPropertyType(s.type.name)&&t.streamCandidates.hasUniqueStream(n,r),c=x(t,a,s,o);(U!==null||G.length>0)&&t.error(e.InvalidCommandStream,`A command declares at most one stream route.`,i(a)),o||U!==null?G.push(c):U=c}else if(r===`runs`&&v(a))y(t,a);else if(r===`description`)j=m(t,a,j,`Command '${g}'`);else if(r===`documentation`)z=h(t,a,z,`Command '${g}'`);else if(r===`authorize`)B=f(B,p(t,a));else if(r===`validate`){let e=parseValidate(t,a,`command`,g);e!==void 0&&C.push(e)}else if(r===`produces`){let e=F(t,a,!0);e!==void 0&&w.push(e)}else if(r===`handler`)V=E(t,a),H.push({handler:V,location:i(a)});else if(q.has(r)){let n=r===`reads`?P(t,a):void 0;n!==void 0&&D.push(n),r===`concurrency`&&A===void 0&&(A=N(t,a));let o=/^reads\s+([A-Z]\w*)(?:\s+as\s+([a-z_]\w*))?(?:\s+by\s+([a-z_]\w*))?$/.exec(a.content);o!==null&&T.push({readModel:o[1],alias:o[2]??null}),W.test(a.content)&&t.error(e.OptionalReadsNotSupported,`Optional reads are not yet supported (see #308).`,i(a)),t.skipOpaqueBlock(a.indent)}else s===void 0?(l(t,a),t.error(e.UnknownCommandDirective,`Unexpected '${a.content}' in command body`,i(a)),t.skipBlock(a.indent)):S=addProperty(t,_,s,g,a,S)}let Y=new Set(b.flatMap(e=>e.candidate===null?[]:[e.candidate])),X=new Set(_.filter(e=>!Y.has(e)).map(e=>e.name));b.some(e=>e.candidate!==null&&!X.has(e.candidate.type.name)&&e.candidate.type.name!==`returns`)&&X.add(`returns`);for(let e of X)u?.add(e);let Z=null,Q=/* @__PURE__ */ new Set;for(let n of b){let r=n.response;if(n.candidate!==null){if(!X.has(n.candidate.type.name))continue;Q.add(n.candidate),r={kind:`ScalarCommandResponseSyntax`,source:{kind:`PropertyResponseSourceSyntax`,property:n.candidate.type.name,location:n.candidate.type.location},location:i(n.line)}}r!==null&&(Z===null?Z=r:t.error(e.InvalidCommandResponse,`A command declares at most one unconditional response.`,i(n.line)))}s(H,t);let $={kind:`CommandSyntax`,name:g,description:j,documentation:z,authorize:B,properties:_.filter(e=>!Q.has(e)),validations:C,produces:w,handler:V,response:Z,stream:U,streamCandidates:G,...K===null?{}:{calendar:K},location:i(r)};return M.set($,T),a.set($,{reads:D,concurrency:A}),$}function addProperty(t,n,r,i,a,o){return u(t,r.type,a),r.isIdentifier&&o!==void 0&&(t.error(e.DuplicateCommandIdentifier,`Command '${i}' already marks '${o.name}' as identifier - only one property can be the identifier`,r.location),r={...r,isIdentifier:!1}),n.push(r),o??(r.isIdentifier?r:void 0)}function parseValidate(t,r,a,o){if(r.content===`validate`){let s=t.peekChild(r.indent);if(s!==void 0&&s.content.startsWith("```")){t.reader.takeSignificant();let e=w(t.valueContext,s);return e===null&&t.skipFencedBody(),{kind:`CodeValidateSyntax`,code:e,location:i(r)}}let l=[],u=[],d;for(let s=t.peekChild(r.indent);s!==void 0;s=t.peekChild(r.indent)){if(t.reader.takeSignificant(),a===`concept`){if(t.sourceOptions.numericMode===`legacy`&&s.content.startsWith("```")){t.skipFencedBody();continue}if(d!==void 0&&s.indent<=d&&(d=void 0),d!==void 0||c(s.content)===`implementation`){t.error(e.InvalidValidationRule,`Invalid validation rule '${s.content}'`,i(s)),d??=s.indent;continue}}if(c(s.content)===`require`){let e=g(a===`concept`?t.valueContext:t,s.content.substring(7).trim(),i(s)),r=null,o=`Error`,l=!1;for(let e=t.peekChild(s.indent);e!==void 0;e=t.peekChild(s.indent)){t.reader.takeSignificant();let i=B.exec(e.content);i!==null&&i.index===0?r=i[1]===void 0?i[2]:n(i[1]):c(e.content)===`severity`?(l||(o=K[e.content.substring(8).trim()]??`Error`),l=!0):t.skipOpaqueBlock(e.indent)}e!==null&&u.push({kind:`RequirementSyntax`,condition:e,message:r,severity:o,location:i(s)});continue}let r=parseValidationRule(t,a===`concept`?{...s,content:`value ${s.content}`}:s,a,o);r!==void 0&&l.push(r)}return{kind:`DeclarativeValidateSyntax`,rules:l,requirements:u,location:i(r)}}if(a===`concept`&&c(r.content.substring(8).trimStart())===`checksum`){let e=parseValidationRule(t,{...r,content:`value ${r.content.substring(8).trimStart()}`},a,o);return e===void 0?void 0:{kind:`DeclarativeValidateSyntax`,rules:[e],requirements:[],location:i(r)}}if(r.content===`validate csharp`){let e=w(t.valueContext,{...r,content:`csharp`});return e===null&&t.skipOpaqueBlock(r.indent),{kind:`CodeValidateSyntax`,code:e,location:i(r)}}t.error(e.InvalidValidateDeclaration,`Invalid validate declaration '${r.content}' - expected 'validate' or 'validate csharp'`,i(r)),t.skipBlock(r.indent)}function parseValidationRule(t,n,r,a){let o=c(V.exec(n.content)?.[2]??``)===`checksum`,s=r===`concept`&&!o?t.valueContext:t,{content:l,message:u}=splitMessage(n.content),d=splitSeverity(s,n,l);if(d===void 0)return;let f=V.exec(d.content);if(f===null){s.error(e.InvalidValidationRule,`Invalid validation rule '${n.content}'`,i(n));return}let p=parseRule(s,f[2],n);if(p===void 0)return;p.kind===`Matches`&&p.value!==null&&j(t,p.value,i(n),n.raw,A(t,r,a,f[1]));let m=p.kind===`Rule`?parseRuleImplementation(t,n,r===`command`):{file:null,code:null,implementation:null};return{kind:`ValidationRuleSyntax`,property:f[1],rule:p.kind,value:p.value,message:u,severity:d.severity,...m,location:i(n)}}function parseRuleImplementation(t,n,r){let a=t.peekChild(n.indent);if(a===void 0)return{file:null,code:null,implementation:null};t.reader.takeSignificant();let o=r&&c(a.content)===`implementation`,s=o?D(t,a):{file:C(a)?T(t,a):null,code:!C(a)&&S(t,a)?w(t,a):null,implementation:null};!o&&s.file===null&&s.code===null&&(t.error(e.UnknownRuleImplementationDirective,`Unexpected '${a.content}' in rule implementation - expected 'file <path>' or an inline code block`,i(a)),t.skipBlock(a.indent));for(let a=t.peekChild(n.indent);a!==void 0&&(o||r&&c(a.content)===`implementation`);a=t.peekChild(n.indent))t.reader.takeSignificant(),t.error(o&&c(a.content)===`implementation`?e.InvalidImplementationBlock:e.ConflictingImplementationSources,`A named rule has one implementation wrapper and cannot mix wrapped and direct sources.`,i(a)),S(t,a)?w(t,a):t.skipBlock(a.indent);return s}function splitMessage(e){let t=B.exec(e);if(t===null)return{content:e,message:null};let r=t[1]===void 0?t[2]:n(t[1]);return{content:e.substring(0,t.index).trimEnd(),message:r}}function splitSeverity(t,n,r){let a=z.exec(r);if(a===null)return{content:r,severity:`Error`};let o=K[a[1]];if(o===void 0)t.error(e.InvalidValidationSeverity,`Unknown validation severity '${a[1]}' - expected information, warning or error`,i(n));else return{content:r.substring(0,a.index).trimEnd(),severity:o}}function parseRule(t,n,r){if(n===`not empty`)return{kind:`NotEmpty`,value:null};if(c(n)===`checksum`){let a=n.substring(8).trim();if(a!==`luhn`&&a!==`mod11`&&a!==`mod97`){t.error(e.InvalidGenerationArgument,`Checksum validation requires luhn, mod11 or mod97.`,i(r));return}return{kind:`Checksum`,value:{kind:`LiteralExpressionSyntax`,value:a,location:i(r)}}}let a=H.exec(n);if(a===null)t.error(e.InvalidValidationRule,`Invalid validation rule '${r.content}'`,i(r));else{if(a[1]===`rule`){let n=a[2].trim();if(!U.test(n)){t.error(e.InvalidRuleName,`Invalid rule name '${n}' in '${r.content}' - expected 'rule <Name>' with an identifier`,i(r));return}return{kind:`Rule`,value:{kind:`PathExpressionSyntax`,path:n,location:i(r)}}}return{kind:G[a[1]],value:o(a[2],i(r),t)}}}export{parseCommand,parseValidate};
2
2
  //# sourceMappingURL=CommandParser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommandParser.js","names":["header","pattern","routeHeader","sourceStreamPattern","calendarPrefix","calendarPattern","stringBodyPattern","severityPattern","messagePattern","rulePattern","operandPattern","ruleNamePattern","optionalReads","operandKinds","severities","opaqueDirectives","propertyShapedDirectives","names","lookahead","ParserContext","context","line","name","DiagnosticCodes","locationOf","properties","responses","identifier","validations","produces","reads","referenceReads","concurrency","description","documentation","authorize","handler","handlers","stream","streamCandidates","calendar","child","keyword","firstWord","asProperty","tryParseProperty","match","unescapeString","scalar","scalarResponsePattern","responseNames","parseCommandResponse","reportInvalidModifierOrder","source","streamName","ambiguous","route","parseCommandStream","isReactionIdentityLine","misplacedReactionIdentity","parseDescription","parseDocumentation","combineAuthorize","parseAuthorize","validate","production","parseProduces","parseHandler","reference","parseReads","captureConcurrency","read","candidates","entry","property","discoveredNames","response","removed","parsed","validateHandlerOccurrences","isPendingHandler","syntax","commandReadSources","dependencySources","reportLegacyOptionalSuffix","commandName","fence","code","parseCode","rules","requirements","wrapperIndent","owner","condition","parseCondition","message","severity","hasSeverity","directive","matched","rule","ownerName","checksum","valueContext","withSeverity","validateMatchOperand","matchSubject","body","wrapped","commandOwner","parseImplementationWrapper","isFile","parseFile","isCode","extra","content","text","algorithm","operand","parseMappingSource"],"sources":["../../../../../../Compiler/Parsing/CommandParser.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 { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { isPendingHandler, validateHandlerOccurrences } from './CommandHandlerValidator';\nimport { SourceLocation } from '../Diagnostics/SourceLocation';\nimport { RequirementSyntax } from '../Syntax/Conditions';\nimport { parseCondition } from './ConditionParser';\nimport { AuthorizeSyntax } from '../Syntax/Authorization';\nimport { CommandSyntax, ValidateSyntax, ValidationRuleKind, ValidationRuleSyntax, ValidationSeverity } from '../Syntax/Commands';\nimport { PropertySyntax } from '../Syntax/Declarations';\nimport { CommandCalendarSyntax } from '../Syntax/Calendar';\nimport { CommandStreamSyntax } from '../Syntax/EventSources';\nimport { parseCommandStream } from './EventSourceParser';\nimport { ExpressionSyntax } from '../Syntax/Expressions';\nimport { ProducesSyntax } from '../Syntax/Reactions';\nimport { CommandResponseSyntax } from '../Syntax/Responses';\nimport { pattern } from '../Text/patterns';\nimport { sourceStreamPattern } from '../Text/SourceStreamNames';\nimport { stringBodyPattern, unescapeString } from '../Text/StringLiteral';\nimport { combineAuthorize, parseAuthorize } from './AuthorizeParser';\nimport { parseCommandResponse, scalarResponsePattern } from './CommandResponseParser';\nimport { parseDescription } from './DescriptionParser';\nimport { parseDocumentation } from './DocumentationParser';\nimport { isCode, isFile, parseCode, parseFile, parseHandler, parseImplementationWrapper } from './ImplementationParser';\nimport { CodeBlockSyntax, FileReferenceSyntax, HandlerSyntax, ImplementationSyntax } from '../Syntax/Implementations';\nimport { parseMappingSource } from './ExpressionParser';\nimport { firstWord } from './LineText';\nimport { ParserContext } from './ParserContext';\nimport { matchSubject, validateMatchOperand } from './MatchOperandValidation';\nimport { isReactionIdentityLine, misplacedReactionIdentity } from './ReactionIdentityParser';\nimport { commandReadSources } from './CommandReadSources';\nimport { dependencySources, ReadsSyntax, ConcurrencySyntax } from '../Syntax/DependencySources';\nimport { captureConcurrency } from './DependencySourceParser';\nimport { parseReads } from './ReadsParser';\nimport { parseProduces } from './ProducesParser';\nimport { reportInvalidModifierOrder, reportLegacyOptionalSuffix, tryParseProperty } from './PropertyLineParser';\nimport { locationOf, SourceLine } from './SourceLine';\n\nconst header = pattern('^command\\\\s+([A-Za-z_]\\\\w*)$');\nconst routeHeader = sourceStreamPattern('^stream\\\\s+[A-Za-z_]\\\\w*\\\\.[A-Za-z_]\\\\w*$');\nconst calendarPrefix = pattern('^calendar\\\\s+(?:\"|from\\\\s+\\\\$context\\\\.)');\nconst calendarPattern = pattern(`^calendar\\\\s+(?:\"(${stringBodyPattern})\"|from\\\\s+\\\\$context\\\\.([A-Za-z_][A-Za-z0-9_]*(?:\\\\.[A-Za-z_][A-Za-z0-9_]*)*))$`);\nconst severityPattern = pattern('\\\\bseverity\\\\s+(\\\\S+)$');\nconst messagePattern = pattern(`\\\\bmessage\\\\s+(?:\"(${stringBodyPattern})\"|(\\\\$strings\\\\.\\\\S*))$`);\nconst rulePattern = pattern('^([\\\\w.]+)\\\\s+(.+)$');\nconst operandPattern = pattern('^(not empty|length ==|decimals <=|all >=|all >|matches|not contains|contains|starts with|ends with|max|min|rule|>=|<=|==|!=|>|<)\\\\s*(.*)$');\nconst ruleNamePattern = sourceStreamPattern('^[A-Za-z_]\\\\w*$');\nconst optionalReads = pattern('^reads\\\\s+[A-Z]\\\\w*\\\\s+optional(?:\\\\s|$)');\n\n// Every operand the pattern matches has a kind, so an operand never goes unrecognized here.\nconst operandKinds: Record<string, ValidationRuleKind> = {\n max: 'Max',\n min: 'Min',\n '>': 'GreaterThan',\n '>=': 'GreaterThanOrEqual',\n '<': 'LessThan',\n '<=': 'LessThanOrEqual',\n '==': 'Equal',\n '!=': 'NotEqual',\n 'length ==': 'Length',\n 'decimals <=': 'DecimalPlaces',\n matches: 'Matches',\n contains: 'Contains',\n 'not contains': 'NotContains',\n 'starts with': 'StartsWith',\n 'ends with': 'EndsWith',\n 'all >': 'AllGreaterThan',\n 'all >=': 'AllGreaterThanOrEqual',\n};\n\nconst severities: Record<string, ValidationSeverity> = { information: 'Information', warning: 'Warning', error: 'Error' };\n\n// Command directives this compiler does not model. They are skipped whole.\nconst opaqueDirectives = new Set(['reads', 'concurrency']);\n\n// The bare directives cannot take a type reference, so a line with property shape is a property whatever\n// keyword it starts with - 'description String' declares a property called description.\nconst propertyShapedDirectives = new Set(['description', 'documentation', 'handler', 'concurrency']);\n\nexport function parseCommand(context: ParserContext, line: SourceLine): CommandSyntax {\n // Properties are leaves, not indentation owners. Resolve ambiguous returns spelling\n // before the committed pass decides whether its deeper lines belong to a response.\n const names = new Set<string>();\n const lookahead = new ParserContext(context.reader.fork(), context.path, context.languages);\n lookahead.sourceOptions = context.sourceOptions;\n lookahead.streamCandidates = context.streamCandidates;\n parseCommandBody(lookahead, line, undefined, names);\n return parseCommandBody(context, line, names);\n}\n\nfunction parseCommandBody(context: ParserContext, line: SourceLine, responseNames?: ReadonlySet<string>, discoveredNames?: Set<string>): CommandSyntax {\n const name = header.exec(line.content)?.[1] ?? '';\n if (name === '') {\n context.error(DiagnosticCodes.InvalidCommandDeclaration, `Invalid command declaration '${line.content}' - expected 'command <Name>'`, locationOf(line));\n }\n const properties: PropertySyntax[] = [];\n const responses: { line: SourceLine; candidate: PropertySyntax | null; response: CommandResponseSyntax | null }[] = [];\n let identifier: PropertySyntax | undefined;\n const validations: ValidateSyntax[] = [];\n const produces: ProducesSyntax[] = [];\n const reads: { readModel: string; alias: string | null }[] = [];\n const referenceReads: ReadsSyntax[] = [];\n let concurrency: ConcurrencySyntax | undefined;\n let description: string | null = null;\n let documentation: string | null = null;\n let authorize: AuthorizeSyntax | null = null;\n let handler: HandlerSyntax | null = null;\n const handlers: { handler: HandlerSyntax | null; location: SourceLocation }[] = [];\n let stream: CommandStreamSyntax | null = null;\n const streamCandidates: CommandStreamSyntax[] = [];\n let calendar: CommandCalendarSyntax | null = null;\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n const keyword = firstWord(child.content);\n const asProperty = tryParseProperty(child);\n if (keyword === 'calendar' && calendarPrefix.test(child.content)) {\n const match = calendarPattern.exec(child.content);\n if (calendar !== null || match === null) {\n context.error(DiagnosticCodes.InvalidCommandCalendar, 'A command declares at most one \\'calendar \"<id>\"\\' or \\'calendar from $context.<member>\\'.', locationOf(child));\n } else {\n calendar = { kind: 'CommandCalendarSyntax', id: match[1] === undefined ? null : unescapeString(match[1]), contextMember: match[2] ?? null, location: locationOf(child) };\n }\n } else if (asProperty !== undefined && (propertyShapedDirectives.has(keyword) || (keyword === 'validate' && child.content !== 'validate csharp'))) {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n } else if (keyword === 'returns') {\n const scalar = scalarResponsePattern.exec(child.content);\n if (scalar !== null && !scalar[1].startsWith('@') && asProperty !== undefined) {\n if (responseNames === undefined) {\n properties.push(asProperty);\n responses.push({ line: child, candidate: asProperty, response: null });\n } else if (responseNames.has(asProperty.type.name)) {\n responses.push({ line: child, candidate: null, response: parseCommandResponse(context, child) });\n } else {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n }\n } else if (asProperty !== undefined) {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n } else if (reportInvalidModifierOrder(context, child)) {\n context.skipBlock(child.indent);\n } else {\n responses.push({ line: child, candidate: null, response: parseCommandResponse(context, child) });\n }\n } else if (keyword === 'stream' && routeHeader.test(child.content) && asProperty !== undefined && context.streamCandidates?.hasSource(asProperty.type.name.split('.')[0]) === true) {\n const [source, streamName] = asProperty.type.name.split('.');\n const ambiguous = context.streamCandidates.hasPropertyType(asProperty.type.name) && context.streamCandidates.hasUniqueStream(source, streamName);\n const route = parseCommandStream(context, child, asProperty, ambiguous);\n if (stream !== null || streamCandidates.length > 0) context.error(DiagnosticCodes.InvalidCommandStream, 'A command declares at most one stream route.', locationOf(child));\n if (ambiguous || stream !== null) streamCandidates.push(route);\n else stream = route;\n } else if (keyword === 'runs' && isReactionIdentityLine(child)) {\n misplacedReactionIdentity(context, child);\n } else if (keyword === 'description') {\n description = parseDescription(context, child, description, `Command '${name}'`);\n } else if (keyword === 'documentation') {\n documentation = parseDocumentation(context, child, documentation, `Command '${name}'`);\n } else if (keyword === 'authorize') {\n authorize = combineAuthorize(authorize, parseAuthorize(context, child));\n } else if (keyword === 'validate') {\n const validate = parseValidate(context, child, 'command', name);\n if (validate !== undefined) {\n validations.push(validate);\n }\n } else if (keyword === 'produces') {\n const production = parseProduces(context, child, true);\n if (production !== undefined) produces.push(production);\n } else if (keyword === 'handler') {\n handler = parseHandler(context, child);\n handlers.push({ handler, location: locationOf(child) });\n } else if (opaqueDirectives.has(keyword)) {\n const reference = keyword === 'reads' ? parseReads(context, child) : undefined;\n if (reference !== undefined) referenceReads.push(reference);\n if (keyword === 'concurrency' && concurrency === undefined) concurrency = captureConcurrency(context, child);\n const read = /^reads\\s+([A-Z]\\w*)(?:\\s+as\\s+([a-z_]\\w*))?(?:\\s+by\\s+([a-z_]\\w*))?$/.exec(child.content);\n if (read !== null) reads.push({ readModel: read[1], alias: read[2] ?? null });\n if (optionalReads.test(child.content)) {\n context.error(DiagnosticCodes.OptionalReadsNotSupported, 'Optional reads are not yet supported (see #308).', locationOf(child));\n }\n context.skipOpaqueBlock(child.indent);\n } else if (asProperty !== undefined) {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n } else {\n reportInvalidModifierOrder(context, child);\n context.error(DiagnosticCodes.UnknownCommandDirective, `Unexpected '${child.content}' in command body`, locationOf(child));\n context.skipBlock(child.indent);\n }\n }\n const candidates = new Set(responses.flatMap(entry => entry.candidate === null ? [] : [entry.candidate]));\n const names = new Set(properties.filter(property => !candidates.has(property)).map(property => property.name));\n if (responses.some(entry => entry.candidate !== null && !names.has(entry.candidate.type.name) && entry.candidate.type.name !== 'returns')) names.add('returns');\n for (const name of names) discoveredNames?.add(name);\n let response: CommandResponseSyntax | null = null;\n const removed = new Set<PropertySyntax>();\n for (const entry of responses) {\n let parsed = entry.response;\n if (entry.candidate !== null) {\n if (!names.has(entry.candidate.type.name)) continue;\n removed.add(entry.candidate);\n parsed = { kind: 'ScalarCommandResponseSyntax', source: { kind: 'PropertyResponseSourceSyntax', property: entry.candidate.type.name, location: entry.candidate.type.location }, location: locationOf(entry.line) };\n }\n if (parsed === null) continue;\n if (response !== null) {\n context.error(DiagnosticCodes.InvalidCommandResponse, 'A command declares at most one unconditional response.', locationOf(entry.line));\n } else {\n response = parsed;\n }\n }\n validateHandlerOccurrences(handlers, context);\n if (handler !== null && !isPendingHandler(handler) && produces.length > 0) {\n context.error(DiagnosticCodes.CommandWithProducesAndHandler, `Command '${name}' cannot declare both 'produces' and 'handler'`, locationOf(line));\n }\n const syntax: CommandSyntax = { kind: 'CommandSyntax', name, description, documentation, authorize, properties: properties.filter(property => !removed.has(property)), validations, produces, handler, response, stream, streamCandidates, ...(calendar === null ? {} : { calendar }), location: locationOf(line) };\n commandReadSources.set(syntax, reads);\n dependencySources.set(syntax, { reads: referenceReads, concurrency });\n return syntax;\n}\n\nfunction addProperty(context: ParserContext, properties: PropertySyntax[], property: PropertySyntax, commandName: string, line: SourceLine, identifier: PropertySyntax | undefined): PropertySyntax | undefined {\n reportLegacyOptionalSuffix(context, property.type, line);\n if (property.isIdentifier && identifier !== undefined) {\n context.error(DiagnosticCodes.DuplicateCommandIdentifier, `Command '${commandName}' already marks '${identifier.name}' as identifier - only one property can be the identifier`, property.location);\n property = { ...property, isIdentifier: false };\n }\n properties.push(property);\n return identifier ?? (property.isIdentifier ? property : undefined);\n}\n\n// Reads a 'validate' block: declarative rules, or code - which is recognized but not modeled.\nexport function parseValidate(context: ParserContext, line: SourceLine, owner: 'command' | 'concept', ownerName: string): ValidateSyntax | undefined {\n if (line.content === 'validate') {\n const fence = context.peekChild(line.indent);\n if (fence !== undefined && fence.content.startsWith('```')) {\n context.reader.takeSignificant();\n const code = parseCode(context.valueContext, fence);\n if (code === null) context.skipFencedBody();\n return { kind: 'CodeValidateSyntax', code, location: locationOf(line) };\n }\n const rules: ValidationRuleSyntax[] = [];\n const requirements: RequirementSyntax[] = [];\n let wrapperIndent: number | undefined;\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n if (owner === 'concept') {\n if (context.sourceOptions.numericMode === 'legacy' && child.content.startsWith('```')) { context.skipFencedBody(); continue; }\n if (wrapperIndent !== undefined && child.indent <= wrapperIndent) wrapperIndent = undefined;\n if (wrapperIndent !== undefined || firstWord(child.content) === 'implementation') {\n context.error(DiagnosticCodes.InvalidValidationRule, `Invalid validation rule '${child.content}'`, locationOf(child));\n wrapperIndent ??= child.indent;\n continue;\n }\n }\n if (firstWord(child.content) === 'require') {\n const condition = parseCondition(owner === 'concept' ? context.valueContext : context, child.content.substring('require'.length).trim(), locationOf(child));\n let message: string | null = null;\n let severity: ValidationSeverity = 'Error';\n let hasSeverity = false;\n for (let directive = context.peekChild(child.indent); directive !== undefined; directive = context.peekChild(child.indent)) {\n context.reader.takeSignificant();\n const matched = messagePattern.exec(directive.content);\n if (matched !== null && matched.index === 0) message = matched[1] !== undefined ? unescapeString(matched[1]) : matched[2];\n else if (firstWord(directive.content) === 'severity') {\n if (!hasSeverity) severity = severities[directive.content.substring('severity'.length).trim()] ?? 'Error';\n hasSeverity = true;\n } else context.skipOpaqueBlock(directive.indent);\n }\n if (condition !== null) requirements.push({ kind: 'RequirementSyntax', condition, message, severity, location: locationOf(child) });\n continue;\n }\n const rule = parseValidationRule(context, owner === 'concept' ? { ...child, content: `value ${child.content}` } : child, owner, ownerName);\n if (rule !== undefined) {\n rules.push(rule);\n }\n }\n return { kind: 'DeclarativeValidateSyntax', rules, requirements, location: locationOf(line) };\n }\n if (owner === 'concept' && firstWord(line.content.substring('validate'.length).trimStart()) === 'checksum') {\n const ruleLine = { ...line, content: `value ${line.content.substring('validate'.length).trimStart()}` };\n const rule = parseValidationRule(context, ruleLine, owner, ownerName);\n return rule === undefined ? undefined : { kind: 'DeclarativeValidateSyntax', rules: [rule], requirements: [], location: locationOf(line) };\n }\n if (line.content === 'validate csharp') {\n const code = parseCode(context.valueContext, { ...line, content: 'csharp' });\n if (code === null) context.skipOpaqueBlock(line.indent);\n return { kind: 'CodeValidateSyntax', code, location: locationOf(line) };\n }\n context.error(DiagnosticCodes.InvalidValidateDeclaration, `Invalid validate declaration '${line.content}' - expected 'validate' or 'validate csharp'`, locationOf(line));\n context.skipBlock(line.indent);\n return undefined;\n}\n\nfunction parseValidationRule(context: ParserContext, line: SourceLine, owner: 'command' | 'concept', ownerName: string): ValidationRuleSyntax | undefined {\n // Checksum is a new declaration, not enrichment of a formerly opaque Legacy rule.\n const checksum = firstWord(rulePattern.exec(line.content)?.[2] ?? '') === 'checksum';\n const valueContext = owner === 'concept' && !checksum ? context.valueContext : context;\n const { content: withSeverity, message } = splitMessage(line.content);\n const severity = splitSeverity(valueContext, line, withSeverity);\n if (severity === undefined) {\n return undefined;\n }\n const match = rulePattern.exec(severity.content);\n if (match === null) {\n valueContext.error(DiagnosticCodes.InvalidValidationRule, `Invalid validation rule '${line.content}'`, locationOf(line));\n return undefined;\n }\n const parsed = parseRule(valueContext, match[2], line);\n if (parsed === undefined) {\n return undefined;\n }\n if (parsed.kind === 'Matches' && parsed.value !== null) validateMatchOperand(context, parsed.value, locationOf(line), line.raw, matchSubject(context, owner, ownerName, match[1]));\n const source = parsed.kind === 'Rule' ? parseRuleImplementation(context, line, owner === 'command') : { file: null, code: null, implementation: null };\n return {\n kind: 'ValidationRuleSyntax',\n property: match[1],\n rule: parsed.kind,\n value: parsed.value,\n message,\n severity: severity.severity,\n ...source,\n location: locationOf(line),\n };\n}\n\nfunction parseRuleImplementation(context: ParserContext, rule: SourceLine, commandOwner: boolean): { file: FileReferenceSyntax | null; code: CodeBlockSyntax | null; implementation: ImplementationSyntax | null } {\n const body = context.peekChild(rule.indent);\n if (body === undefined) return { file: null, code: null, implementation: null };\n context.reader.takeSignificant();\n const wrapped = commandOwner && firstWord(body.content) === 'implementation';\n const source = wrapped ? parseImplementationWrapper(context, body) : {\n file: isFile(body) ? parseFile(context, body) : null,\n code: !isFile(body) && isCode(context, body) ? parseCode(context, body) : null,\n implementation: null,\n };\n if (!wrapped && source.file === null && source.code === null) {\n context.error(DiagnosticCodes.UnknownRuleImplementationDirective, `Unexpected '${body.content}' in rule implementation - expected 'file <path>' or an inline code block`, locationOf(body));\n context.skipBlock(body.indent);\n }\n for (let extra = context.peekChild(rule.indent); extra !== undefined && (wrapped || (commandOwner && firstWord(extra.content) === 'implementation')); extra = context.peekChild(rule.indent)) {\n context.reader.takeSignificant();\n context.error(wrapped && firstWord(extra.content) === 'implementation' ? DiagnosticCodes.InvalidImplementationBlock : DiagnosticCodes.ConflictingImplementationSources,\n 'A named rule has one implementation wrapper and cannot mix wrapped and direct sources.', locationOf(extra));\n if (isCode(context, extra)) parseCode(context, extra);\n else context.skipBlock(extra.indent);\n }\n return source;\n}\n\nfunction splitMessage(content: string): { content: string; message: string | null } {\n const match = messagePattern.exec(content);\n if (match === null) {\n return { content, message: null };\n }\n const message = match[1] !== undefined ? unescapeString(match[1]) : match[2];\n return { content: content.substring(0, match.index).trimEnd(), message };\n}\n\nfunction splitSeverity(context: ParserContext, line: SourceLine, text: string): { content: string; severity: ValidationSeverity } | undefined {\n const match = severityPattern.exec(text);\n if (match === null) {\n return { content: text, severity: 'Error' };\n }\n const severity = severities[match[1]];\n if (severity === undefined) {\n context.error(DiagnosticCodes.InvalidValidationSeverity, `Unknown validation severity '${match[1]}' - expected information, warning or error`, locationOf(line));\n return undefined;\n }\n return { content: text.substring(0, match.index).trimEnd(), severity };\n}\n\nfunction parseRule(context: ParserContext, rule: string, line: SourceLine): { kind: ValidationRuleKind; value: ExpressionSyntax | null } | undefined {\n if (rule === 'not empty') {\n return { kind: 'NotEmpty', value: null };\n }\n if (firstWord(rule) === 'checksum') {\n const algorithm = rule.substring('checksum'.length).trim();\n if (algorithm !== 'luhn' && algorithm !== 'mod11' && algorithm !== 'mod97') {\n context.error(DiagnosticCodes.InvalidGenerationArgument, 'Checksum validation requires luhn, mod11 or mod97.', locationOf(line));\n return undefined;\n }\n return { kind: 'Checksum', value: { kind: 'LiteralExpressionSyntax', value: algorithm, location: locationOf(line) } };\n }\n const operand = operandPattern.exec(rule);\n if (operand === null) {\n context.error(DiagnosticCodes.InvalidValidationRule, `Invalid validation rule '${line.content}'`, locationOf(line));\n return undefined;\n }\n if (operand[1] === 'rule') {\n const name = operand[2].trim();\n if (!ruleNamePattern.test(name)) {\n context.error(DiagnosticCodes.InvalidRuleName, `Invalid rule name '${name}' in '${line.content}' - expected 'rule <Name>' with an identifier`, locationOf(line));\n return undefined;\n }\n return { kind: 'Rule', value: { kind: 'PathExpressionSyntax', path: name, location: locationOf(line) } };\n }\n return { kind: operandKinds[operand[1]], value: parseMappingSource(operand[2], locationOf(line), context) };\n}\n"],"mappings":"ytDAuCA,MAAMA,EAASC,EAAQ,8BAA8B,EAC/CC,EAAcC,EAAoB,2CAA2C,EAC7EC,EAAiBH,EAAQ,0CAA0C,EACnEI,EAAkBJ,EAAQ,qBAAqBK,EAAkB,iFAAiF,EAClJC,EAAkBN,EAAQ,wBAAwB,EAClDO,EAAiBP,EAAQ,sBAAsBK,EAAkB,yBAAyB,EAC1FG,EAAcR,EAAQ,qBAAqB,EAC3CS,EAAiBT,EAAQ,2IAA2I,EACpKU,EAAkBR,EAAoB,iBAAiB,EACvDS,EAAgBX,EAAQ,0CAA0C,EAGlEY,EAAmD,CACrD,IAAK,MACL,IAAK,MACL,IAAK,cACL,KAAM,qBACN,IAAK,WACL,KAAM,kBACN,KAAM,QACN,KAAM,WACN,YAAa,SACb,cAAe,gBACf,QAAS,UACT,SAAU,WACV,eAAgB,cAChB,cAAe,aACf,YAAa,WACb,QAAS,iBACT,SAAU,uBACd,EAEMC,EAAiD,CAAE,YAAa,cAAe,QAAS,UAAW,MAAO,OAAQ,EAGlHC,kBAAmB,IAAI,IAAI,CAAC,QAAS,aAAa,CAAC,EAInDC,mBAA2B,IAAI,IAAI,CAAC,cAAe,gBAAiB,UAAW,aAAa,CAAC,EAEnG,SAAgB,aAAa,EAAwB,EAAiC,CAGlF,IAAMC,kBAAQ,IAAI,IACZC,EAAY,IAAIC,EAAcC,EAAQ,OAAO,KAAK,EAAGA,EAAQ,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,MAAMG,EAAgB,sBAAuB,4BAA4BF,EAAK,QAAQ,GAAIG,EAAWH,CAAI,CAAC,MAGtH,IAAIiG,EAAQ,KAAO,OAAQ,CACvB,IAAMhG,EAAOgG,EAAQ,EAAE,CAAC,KAAK,EAC7B,GAAI,CAAC3G,EAAgB,KAAKW,CAAI,EAAG,CAC7BF,EAAQ,MAAMG,EAAgB,gBAAiB,sBAAsBD,EAAK,QAAQD,EAAK,QAAQ,+CAAgDG,EAAWH,CAAI,CAAC,EAC/J,MACJ,CACA,MAAO,CAAE,KAAM,OAAQ,MAAO,CAAE,KAAM,uBAAwB,KAAMC,EAAM,SAAUE,EAAWH,CAAI,CAAE,CAAE,CAC3G,CACA,MAAO,CAAE,KAAMR,EAAayG,EAAQ,IAAK,MAAOC,EAAmBD,EAAQ,GAAI9F,EAAWH,CAAI,EAAGD,CAAO,CAAE,CAD1G,CAEJ"}
1
+ {"version":3,"file":"CommandParser.js","names":["header","pattern","routeHeader","sourceStreamPattern","calendarPrefix","calendarPattern","stringBodyPattern","severityPattern","messagePattern","rulePattern","operandPattern","ruleNamePattern","optionalReads","operandKinds","severities","opaqueDirectives","propertyShapedDirectives","names","lookahead","ParserContext","context","line","name","DiagnosticCodes","locationOf","properties","responses","identifier","validations","produces","reads","referenceReads","concurrency","description","documentation","authorize","handler","handlers","stream","streamCandidates","calendar","child","keyword","firstWord","asProperty","tryParseProperty","match","unescapeString","scalar","scalarResponsePattern","responseNames","parseCommandResponse","reportInvalidModifierOrder","source","streamName","ambiguous","route","parseCommandStream","isReactionIdentityLine","misplacedReactionIdentity","parseDescription","parseDocumentation","combineAuthorize","parseAuthorize","validate","production","parseProduces","parseHandler","reference","parseReads","captureConcurrency","read","candidates","entry","property","discoveredNames","response","removed","parsed","validateHandlerOccurrences","syntax","commandReadSources","dependencySources","reportLegacyOptionalSuffix","commandName","fence","code","parseCode","rules","requirements","wrapperIndent","owner","condition","parseCondition","message","severity","hasSeverity","directive","matched","rule","ownerName","checksum","valueContext","withSeverity","validateMatchOperand","matchSubject","body","wrapped","commandOwner","parseImplementationWrapper","isFile","parseFile","isCode","extra","content","text","algorithm","operand","parseMappingSource"],"sources":["../../../../../../Compiler/Parsing/CommandParser.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 { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { validateHandlerOccurrences } from './CommandHandlerValidator';\nimport { SourceLocation } from '../Diagnostics/SourceLocation';\nimport { RequirementSyntax } from '../Syntax/Conditions';\nimport { parseCondition } from './ConditionParser';\nimport { AuthorizeSyntax } from '../Syntax/Authorization';\nimport { CommandSyntax, ValidateSyntax, ValidationRuleKind, ValidationRuleSyntax, ValidationSeverity } from '../Syntax/Commands';\nimport { PropertySyntax } from '../Syntax/Declarations';\nimport { CommandCalendarSyntax } from '../Syntax/Calendar';\nimport { CommandStreamSyntax } from '../Syntax/EventSources';\nimport { parseCommandStream } from './EventSourceParser';\nimport { ExpressionSyntax } from '../Syntax/Expressions';\nimport { ProducesSyntax } from '../Syntax/Reactions';\nimport { CommandResponseSyntax } from '../Syntax/Responses';\nimport { pattern } from '../Text/patterns';\nimport { sourceStreamPattern } from '../Text/SourceStreamNames';\nimport { stringBodyPattern, unescapeString } from '../Text/StringLiteral';\nimport { combineAuthorize, parseAuthorize } from './AuthorizeParser';\nimport { parseCommandResponse, scalarResponsePattern } from './CommandResponseParser';\nimport { parseDescription } from './DescriptionParser';\nimport { parseDocumentation } from './DocumentationParser';\nimport { isCode, isFile, parseCode, parseFile, parseHandler, parseImplementationWrapper } from './ImplementationParser';\nimport { CodeBlockSyntax, FileReferenceSyntax, HandlerSyntax, ImplementationSyntax } from '../Syntax/Implementations';\nimport { parseMappingSource } from './ExpressionParser';\nimport { firstWord } from './LineText';\nimport { ParserContext } from './ParserContext';\nimport { matchSubject, validateMatchOperand } from './MatchOperandValidation';\nimport { isReactionIdentityLine, misplacedReactionIdentity } from './ReactionIdentityParser';\nimport { commandReadSources } from './CommandReadSources';\nimport { dependencySources, ReadsSyntax, ConcurrencySyntax } from '../Syntax/DependencySources';\nimport { captureConcurrency } from './DependencySourceParser';\nimport { parseReads } from './ReadsParser';\nimport { parseProduces } from './ProducesParser';\nimport { reportInvalidModifierOrder, reportLegacyOptionalSuffix, tryParseProperty } from './PropertyLineParser';\nimport { locationOf, SourceLine } from './SourceLine';\n\nconst header = pattern('^command\\\\s+([A-Za-z_]\\\\w*)$');\nconst routeHeader = sourceStreamPattern('^stream\\\\s+[A-Za-z_]\\\\w*\\\\.[A-Za-z_]\\\\w*$');\nconst calendarPrefix = pattern('^calendar\\\\s+(?:\"|from\\\\s+\\\\$context\\\\.)');\nconst calendarPattern = pattern(`^calendar\\\\s+(?:\"(${stringBodyPattern})\"|from\\\\s+\\\\$context\\\\.([A-Za-z_][A-Za-z0-9_]*(?:\\\\.[A-Za-z_][A-Za-z0-9_]*)*))$`);\nconst severityPattern = pattern('\\\\bseverity\\\\s+(\\\\S+)$');\nconst messagePattern = pattern(`\\\\bmessage\\\\s+(?:\"(${stringBodyPattern})\"|(\\\\$strings\\\\.\\\\S*))$`);\nconst rulePattern = pattern('^([\\\\w.]+)\\\\s+(.+)$');\nconst operandPattern = pattern('^(not empty|length ==|decimals <=|all >=|all >|matches|not contains|contains|starts with|ends with|max|min|rule|>=|<=|==|!=|>|<)\\\\s*(.*)$');\nconst ruleNamePattern = sourceStreamPattern('^[A-Za-z_]\\\\w*$');\nconst optionalReads = pattern('^reads\\\\s+[A-Z]\\\\w*\\\\s+optional(?:\\\\s|$)');\n\n// Every operand the pattern matches has a kind, so an operand never goes unrecognized here.\nconst operandKinds: Record<string, ValidationRuleKind> = {\n max: 'Max',\n min: 'Min',\n '>': 'GreaterThan',\n '>=': 'GreaterThanOrEqual',\n '<': 'LessThan',\n '<=': 'LessThanOrEqual',\n '==': 'Equal',\n '!=': 'NotEqual',\n 'length ==': 'Length',\n 'decimals <=': 'DecimalPlaces',\n matches: 'Matches',\n contains: 'Contains',\n 'not contains': 'NotContains',\n 'starts with': 'StartsWith',\n 'ends with': 'EndsWith',\n 'all >': 'AllGreaterThan',\n 'all >=': 'AllGreaterThanOrEqual',\n};\n\nconst severities: Record<string, ValidationSeverity> = { information: 'Information', warning: 'Warning', error: 'Error' };\n\n// Command directives this compiler does not model. They are skipped whole.\nconst opaqueDirectives = new Set(['reads', 'concurrency']);\n\n// The bare directives cannot take a type reference, so a line with property shape is a property whatever\n// keyword it starts with - 'description String' declares a property called description.\nconst propertyShapedDirectives = new Set(['description', 'documentation', 'handler', 'concurrency']);\n\nexport function parseCommand(context: ParserContext, line: SourceLine): CommandSyntax {\n // Properties are leaves, not indentation owners. Resolve ambiguous returns spelling\n // before the committed pass decides whether its deeper lines belong to a response.\n const names = new Set<string>();\n const lookahead = new ParserContext(context.reader.fork(), context.path, context.languages);\n lookahead.sourceOptions = context.sourceOptions;\n lookahead.streamCandidates = context.streamCandidates;\n parseCommandBody(lookahead, line, undefined, names);\n return parseCommandBody(context, line, names);\n}\n\nfunction parseCommandBody(context: ParserContext, line: SourceLine, responseNames?: ReadonlySet<string>, discoveredNames?: Set<string>): CommandSyntax {\n const name = header.exec(line.content)?.[1] ?? '';\n if (name === '') {\n context.error(DiagnosticCodes.InvalidCommandDeclaration, `Invalid command declaration '${line.content}' - expected 'command <Name>'`, locationOf(line));\n }\n const properties: PropertySyntax[] = [];\n const responses: { line: SourceLine; candidate: PropertySyntax | null; response: CommandResponseSyntax | null }[] = [];\n let identifier: PropertySyntax | undefined;\n const validations: ValidateSyntax[] = [];\n const produces: ProducesSyntax[] = [];\n const reads: { readModel: string; alias: string | null }[] = [];\n const referenceReads: ReadsSyntax[] = [];\n let concurrency: ConcurrencySyntax | undefined;\n let description: string | null = null;\n let documentation: string | null = null;\n let authorize: AuthorizeSyntax | null = null;\n let handler: HandlerSyntax | null = null;\n const handlers: { handler: HandlerSyntax | null; location: SourceLocation }[] = [];\n let stream: CommandStreamSyntax | null = null;\n const streamCandidates: CommandStreamSyntax[] = [];\n let calendar: CommandCalendarSyntax | null = null;\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n const keyword = firstWord(child.content);\n const asProperty = tryParseProperty(child);\n if (keyword === 'calendar' && calendarPrefix.test(child.content)) {\n const match = calendarPattern.exec(child.content);\n if (calendar !== null || match === null) {\n context.error(DiagnosticCodes.InvalidCommandCalendar, 'A command declares at most one \\'calendar \"<id>\"\\' or \\'calendar from $context.<member>\\'.', locationOf(child));\n } else {\n calendar = { kind: 'CommandCalendarSyntax', id: match[1] === undefined ? null : unescapeString(match[1]), contextMember: match[2] ?? null, location: locationOf(child) };\n }\n } else if (asProperty !== undefined && (propertyShapedDirectives.has(keyword) || (keyword === 'validate' && child.content !== 'validate csharp'))) {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n } else if (keyword === 'returns') {\n const scalar = scalarResponsePattern.exec(child.content);\n if (scalar !== null && !scalar[1].startsWith('@') && asProperty !== undefined) {\n if (responseNames === undefined) {\n properties.push(asProperty);\n responses.push({ line: child, candidate: asProperty, response: null });\n } else if (responseNames.has(asProperty.type.name)) {\n responses.push({ line: child, candidate: null, response: parseCommandResponse(context, child) });\n } else {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n }\n } else if (asProperty !== undefined) {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n } else if (reportInvalidModifierOrder(context, child)) {\n context.skipBlock(child.indent);\n } else {\n responses.push({ line: child, candidate: null, response: parseCommandResponse(context, child) });\n }\n } else if (keyword === 'stream' && routeHeader.test(child.content) && asProperty !== undefined && context.streamCandidates?.hasSource(asProperty.type.name.split('.')[0]) === true) {\n const [source, streamName] = asProperty.type.name.split('.');\n const ambiguous = context.streamCandidates.hasPropertyType(asProperty.type.name) && context.streamCandidates.hasUniqueStream(source, streamName);\n const route = parseCommandStream(context, child, asProperty, ambiguous);\n if (stream !== null || streamCandidates.length > 0) context.error(DiagnosticCodes.InvalidCommandStream, 'A command declares at most one stream route.', locationOf(child));\n if (ambiguous || stream !== null) streamCandidates.push(route);\n else stream = route;\n } else if (keyword === 'runs' && isReactionIdentityLine(child)) {\n misplacedReactionIdentity(context, child);\n } else if (keyword === 'description') {\n description = parseDescription(context, child, description, `Command '${name}'`);\n } else if (keyword === 'documentation') {\n documentation = parseDocumentation(context, child, documentation, `Command '${name}'`);\n } else if (keyword === 'authorize') {\n authorize = combineAuthorize(authorize, parseAuthorize(context, child));\n } else if (keyword === 'validate') {\n const validate = parseValidate(context, child, 'command', name);\n if (validate !== undefined) {\n validations.push(validate);\n }\n } else if (keyword === 'produces') {\n const production = parseProduces(context, child, true);\n if (production !== undefined) produces.push(production);\n } else if (keyword === 'handler') {\n handler = parseHandler(context, child);\n handlers.push({ handler, location: locationOf(child) });\n } else if (opaqueDirectives.has(keyword)) {\n const reference = keyword === 'reads' ? parseReads(context, child) : undefined;\n if (reference !== undefined) referenceReads.push(reference);\n if (keyword === 'concurrency' && concurrency === undefined) concurrency = captureConcurrency(context, child);\n const read = /^reads\\s+([A-Z]\\w*)(?:\\s+as\\s+([a-z_]\\w*))?(?:\\s+by\\s+([a-z_]\\w*))?$/.exec(child.content);\n if (read !== null) reads.push({ readModel: read[1], alias: read[2] ?? null });\n if (optionalReads.test(child.content)) {\n context.error(DiagnosticCodes.OptionalReadsNotSupported, 'Optional reads are not yet supported (see #308).', locationOf(child));\n }\n context.skipOpaqueBlock(child.indent);\n } else if (asProperty !== undefined) {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n } else {\n reportInvalidModifierOrder(context, child);\n context.error(DiagnosticCodes.UnknownCommandDirective, `Unexpected '${child.content}' in command body`, locationOf(child));\n context.skipBlock(child.indent);\n }\n }\n const candidates = new Set(responses.flatMap(entry => entry.candidate === null ? [] : [entry.candidate]));\n const names = new Set(properties.filter(property => !candidates.has(property)).map(property => property.name));\n if (responses.some(entry => entry.candidate !== null && !names.has(entry.candidate.type.name) && entry.candidate.type.name !== 'returns')) names.add('returns');\n for (const name of names) discoveredNames?.add(name);\n let response: CommandResponseSyntax | null = null;\n const removed = new Set<PropertySyntax>();\n for (const entry of responses) {\n let parsed = entry.response;\n if (entry.candidate !== null) {\n if (!names.has(entry.candidate.type.name)) continue;\n removed.add(entry.candidate);\n parsed = { kind: 'ScalarCommandResponseSyntax', source: { kind: 'PropertyResponseSourceSyntax', property: entry.candidate.type.name, location: entry.candidate.type.location }, location: locationOf(entry.line) };\n }\n if (parsed === null) continue;\n if (response !== null) {\n context.error(DiagnosticCodes.InvalidCommandResponse, 'A command declares at most one unconditional response.', locationOf(entry.line));\n } else {\n response = parsed;\n }\n }\n validateHandlerOccurrences(handlers, context);\n const syntax: CommandSyntax = { kind: 'CommandSyntax', name, description, documentation, authorize, properties: properties.filter(property => !removed.has(property)), validations, produces, handler, response, stream, streamCandidates, ...(calendar === null ? {} : { calendar }), location: locationOf(line) };\n commandReadSources.set(syntax, reads);\n dependencySources.set(syntax, { reads: referenceReads, concurrency });\n return syntax;\n}\n\nfunction addProperty(context: ParserContext, properties: PropertySyntax[], property: PropertySyntax, commandName: string, line: SourceLine, identifier: PropertySyntax | undefined): PropertySyntax | undefined {\n reportLegacyOptionalSuffix(context, property.type, line);\n if (property.isIdentifier && identifier !== undefined) {\n context.error(DiagnosticCodes.DuplicateCommandIdentifier, `Command '${commandName}' already marks '${identifier.name}' as identifier - only one property can be the identifier`, property.location);\n property = { ...property, isIdentifier: false };\n }\n properties.push(property);\n return identifier ?? (property.isIdentifier ? property : undefined);\n}\n\n// Reads a 'validate' block: declarative rules, or code - which is recognized but not modeled.\nexport function parseValidate(context: ParserContext, line: SourceLine, owner: 'command' | 'concept', ownerName: string): ValidateSyntax | undefined {\n if (line.content === 'validate') {\n const fence = context.peekChild(line.indent);\n if (fence !== undefined && fence.content.startsWith('```')) {\n context.reader.takeSignificant();\n const code = parseCode(context.valueContext, fence);\n if (code === null) context.skipFencedBody();\n return { kind: 'CodeValidateSyntax', code, location: locationOf(line) };\n }\n const rules: ValidationRuleSyntax[] = [];\n const requirements: RequirementSyntax[] = [];\n let wrapperIndent: number | undefined;\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n if (owner === 'concept') {\n if (context.sourceOptions.numericMode === 'legacy' && child.content.startsWith('```')) { context.skipFencedBody(); continue; }\n if (wrapperIndent !== undefined && child.indent <= wrapperIndent) wrapperIndent = undefined;\n if (wrapperIndent !== undefined || firstWord(child.content) === 'implementation') {\n context.error(DiagnosticCodes.InvalidValidationRule, `Invalid validation rule '${child.content}'`, locationOf(child));\n wrapperIndent ??= child.indent;\n continue;\n }\n }\n if (firstWord(child.content) === 'require') {\n const condition = parseCondition(owner === 'concept' ? context.valueContext : context, child.content.substring('require'.length).trim(), locationOf(child));\n let message: string | null = null;\n let severity: ValidationSeverity = 'Error';\n let hasSeverity = false;\n for (let directive = context.peekChild(child.indent); directive !== undefined; directive = context.peekChild(child.indent)) {\n context.reader.takeSignificant();\n const matched = messagePattern.exec(directive.content);\n if (matched !== null && matched.index === 0) message = matched[1] !== undefined ? unescapeString(matched[1]) : matched[2];\n else if (firstWord(directive.content) === 'severity') {\n if (!hasSeverity) severity = severities[directive.content.substring('severity'.length).trim()] ?? 'Error';\n hasSeverity = true;\n } else context.skipOpaqueBlock(directive.indent);\n }\n if (condition !== null) requirements.push({ kind: 'RequirementSyntax', condition, message, severity, location: locationOf(child) });\n continue;\n }\n const rule = parseValidationRule(context, owner === 'concept' ? { ...child, content: `value ${child.content}` } : child, owner, ownerName);\n if (rule !== undefined) {\n rules.push(rule);\n }\n }\n return { kind: 'DeclarativeValidateSyntax', rules, requirements, location: locationOf(line) };\n }\n if (owner === 'concept' && firstWord(line.content.substring('validate'.length).trimStart()) === 'checksum') {\n const ruleLine = { ...line, content: `value ${line.content.substring('validate'.length).trimStart()}` };\n const rule = parseValidationRule(context, ruleLine, owner, ownerName);\n return rule === undefined ? undefined : { kind: 'DeclarativeValidateSyntax', rules: [rule], requirements: [], location: locationOf(line) };\n }\n if (line.content === 'validate csharp') {\n const code = parseCode(context.valueContext, { ...line, content: 'csharp' });\n if (code === null) context.skipOpaqueBlock(line.indent);\n return { kind: 'CodeValidateSyntax', code, location: locationOf(line) };\n }\n context.error(DiagnosticCodes.InvalidValidateDeclaration, `Invalid validate declaration '${line.content}' - expected 'validate' or 'validate csharp'`, locationOf(line));\n context.skipBlock(line.indent);\n return undefined;\n}\n\nfunction parseValidationRule(context: ParserContext, line: SourceLine, owner: 'command' | 'concept', ownerName: string): ValidationRuleSyntax | undefined {\n // Checksum is a new declaration, not enrichment of a formerly opaque Legacy rule.\n const checksum = firstWord(rulePattern.exec(line.content)?.[2] ?? '') === 'checksum';\n const valueContext = owner === 'concept' && !checksum ? context.valueContext : context;\n const { content: withSeverity, message } = splitMessage(line.content);\n const severity = splitSeverity(valueContext, line, withSeverity);\n if (severity === undefined) {\n return undefined;\n }\n const match = rulePattern.exec(severity.content);\n if (match === null) {\n valueContext.error(DiagnosticCodes.InvalidValidationRule, `Invalid validation rule '${line.content}'`, locationOf(line));\n return undefined;\n }\n const parsed = parseRule(valueContext, match[2], line);\n if (parsed === undefined) {\n return undefined;\n }\n if (parsed.kind === 'Matches' && parsed.value !== null) validateMatchOperand(context, parsed.value, locationOf(line), line.raw, matchSubject(context, owner, ownerName, match[1]));\n const source = parsed.kind === 'Rule' ? parseRuleImplementation(context, line, owner === 'command') : { file: null, code: null, implementation: null };\n return {\n kind: 'ValidationRuleSyntax',\n property: match[1],\n rule: parsed.kind,\n value: parsed.value,\n message,\n severity: severity.severity,\n ...source,\n location: locationOf(line),\n };\n}\n\nfunction parseRuleImplementation(context: ParserContext, rule: SourceLine, commandOwner: boolean): { file: FileReferenceSyntax | null; code: CodeBlockSyntax | null; implementation: ImplementationSyntax | null } {\n const body = context.peekChild(rule.indent);\n if (body === undefined) return { file: null, code: null, implementation: null };\n context.reader.takeSignificant();\n const wrapped = commandOwner && firstWord(body.content) === 'implementation';\n const source = wrapped ? parseImplementationWrapper(context, body) : {\n file: isFile(body) ? parseFile(context, body) : null,\n code: !isFile(body) && isCode(context, body) ? parseCode(context, body) : null,\n implementation: null,\n };\n if (!wrapped && source.file === null && source.code === null) {\n context.error(DiagnosticCodes.UnknownRuleImplementationDirective, `Unexpected '${body.content}' in rule implementation - expected 'file <path>' or an inline code block`, locationOf(body));\n context.skipBlock(body.indent);\n }\n for (let extra = context.peekChild(rule.indent); extra !== undefined && (wrapped || (commandOwner && firstWord(extra.content) === 'implementation')); extra = context.peekChild(rule.indent)) {\n context.reader.takeSignificant();\n context.error(wrapped && firstWord(extra.content) === 'implementation' ? DiagnosticCodes.InvalidImplementationBlock : DiagnosticCodes.ConflictingImplementationSources,\n 'A named rule has one implementation wrapper and cannot mix wrapped and direct sources.', locationOf(extra));\n if (isCode(context, extra)) parseCode(context, extra);\n else context.skipBlock(extra.indent);\n }\n return source;\n}\n\nfunction splitMessage(content: string): { content: string; message: string | null } {\n const match = messagePattern.exec(content);\n if (match === null) {\n return { content, message: null };\n }\n const message = match[1] !== undefined ? unescapeString(match[1]) : match[2];\n return { content: content.substring(0, match.index).trimEnd(), message };\n}\n\nfunction splitSeverity(context: ParserContext, line: SourceLine, text: string): { content: string; severity: ValidationSeverity } | undefined {\n const match = severityPattern.exec(text);\n if (match === null) {\n return { content: text, severity: 'Error' };\n }\n const severity = severities[match[1]];\n if (severity === undefined) {\n context.error(DiagnosticCodes.InvalidValidationSeverity, `Unknown validation severity '${match[1]}' - expected information, warning or error`, locationOf(line));\n return undefined;\n }\n return { content: text.substring(0, match.index).trimEnd(), severity };\n}\n\nfunction parseRule(context: ParserContext, rule: string, line: SourceLine): { kind: ValidationRuleKind; value: ExpressionSyntax | null } | undefined {\n if (rule === 'not empty') {\n return { kind: 'NotEmpty', value: null };\n }\n if (firstWord(rule) === 'checksum') {\n const algorithm = rule.substring('checksum'.length).trim();\n if (algorithm !== 'luhn' && algorithm !== 'mod11' && algorithm !== 'mod97') {\n context.error(DiagnosticCodes.InvalidGenerationArgument, 'Checksum validation requires luhn, mod11 or mod97.', locationOf(line));\n return undefined;\n }\n return { kind: 'Checksum', value: { kind: 'LiteralExpressionSyntax', value: algorithm, location: locationOf(line) } };\n }\n const operand = operandPattern.exec(rule);\n if (operand === null) {\n context.error(DiagnosticCodes.InvalidValidationRule, `Invalid validation rule '${line.content}'`, locationOf(line));\n return undefined;\n }\n if (operand[1] === 'rule') {\n const name = operand[2].trim();\n if (!ruleNamePattern.test(name)) {\n context.error(DiagnosticCodes.InvalidRuleName, `Invalid rule name '${name}' in '${line.content}' - expected 'rule <Name>' with an identifier`, locationOf(line));\n return undefined;\n }\n return { kind: 'Rule', value: { kind: 'PathExpressionSyntax', path: name, location: locationOf(line) } };\n }\n return { kind: operandKinds[operand[1]], value: parseMappingSource(operand[2], locationOf(line), context) };\n}\n"],"mappings":"msDAuCA,MAAMA,EAASC,EAAQ,8BAA8B,EAC/CC,EAAcC,EAAoB,2CAA2C,EAC7EC,GAAiBH,EAAQ,0CAA0C,EACnEI,EAAkBJ,EAAQ,qBAAqBK,EAAkB,iFAAiF,EAClJC,EAAkBN,EAAQ,wBAAwB,EAClDO,EAAiBP,EAAQ,sBAAsBK,EAAkB,yBAAyB,EAC1FG,EAAcR,EAAQ,qBAAqB,EAC3CS,EAAiBT,EAAQ,2IAA2I,EACpKU,EAAkBR,EAAoB,iBAAiB,EACvDS,EAAgBX,EAAQ,0CAA0C,EAGlEY,EAAmD,CACrD,IAAK,MACL,IAAK,MACL,IAAK,cACL,KAAM,qBACN,IAAK,WACL,KAAM,kBACN,KAAM,QACN,KAAM,WACN,YAAa,SACb,cAAe,gBACf,QAAS,UACT,SAAU,WACV,eAAgB,cAChB,cAAe,aACf,YAAa,WACb,QAAS,iBACT,SAAU,uBACd,EAEMC,EAAiD,CAAE,YAAa,cAAe,QAAS,UAAW,MAAO,OAAQ,EAGlHC,kBAAmB,IAAI,IAAI,CAAC,QAAS,aAAa,CAA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AAe,KAAKyF,CAAI,EACxC,GAAIkB,IAAY,KACZjG,EAAQ,MAAMG,EAAgB,sBAAuB,4BAA4BF,EAAK,QAAQ,GAAIG,EAAWH,CAAI,CAAC,MAGtH,IAAIgG,EAAQ,KAAO,OAAQ,CACvB,IAAM/F,EAAO+F,EAAQ,EAAE,CAAC,KAAK,EAC7B,GAAI,CAAC1G,EAAgB,KAAKW,CAAI,EAAG,CAC7BF,EAAQ,MAAMG,EAAgB,gBAAiB,sBAAsBD,EAAK,QAAQD,EAAK,QAAQ,+CAAgDG,EAAWH,CAAI,CAAC,EAC/J,MACJ,CACA,MAAO,CAAE,KAAM,OAAQ,MAAO,CAAE,KAAM,uBAAwB,KAAMC,EAAM,SAAUE,EAAWH,CAAI,CAAE,CAAE,CAC3G,CACA,MAAO,CAAE,KAAMR,EAAawG,EAAQ,IAAK,MAAOC,EAAmBD,EAAQ,GAAI7F,EAAWH,CAAI,EAAGD,CAAO,CAAE,CAD1G,CAEJ"}
@@ -1,3 +1,3 @@
1
- import"./_virtual/_virtual/_rolldown/runtime.js";import{clauseKeywords as e}from"./language.js";import{bmpWordCharacters as t}from"./bmp-word-characters.js";import{typeReferenceSymbol as n}from"./TypeReferenceSymbol.js";import{unescapeString as r}from"./compiler/Text/StringLiteral.js";import{eventBodyReservedWords as i}from"./compiler/Text/ReservedWords.js";import"./compiler/index.js";import{fenceMap as a,indentOf as o}from"./document-context.js";import{eventAnalysisSource as s}from"./event-analysis-source.js";import{responseAnalysis as c}from"./response-analysis.js";import{fileReferenceOn as l}from"./file-references.js";const u=/^concept\s+(\w+)\s*:\s*(\w+)((?:\s+@\w+)*)\s*$/,d=RegExp(`^@?([a-z_][${t}]*)(?:\\s*=\\s*(-?(?:0|[1-9][0-9]*)))?(?:\\s*//.*)?$`),f=/^\s*(@?[a-z_]\w*)\s+([\w.]+(?:\[\])?(?:\?|\s+optional)?)(\s+generated)?(\s+identifier)?(\s+subject)?\s*$/,p=/^([a-z_]\w*)\s+reason\s+"((?:[^"\\]|\\.)*)"\s*$/,m=/^\s*reads\s+([A-Z]\w*)(?:\s+as\s+([a-z_]\w*))?(?:\s+by\s+([a-z_]\w*))?\s*$/,h=[`authorize`,`produces`,`reads`],g=/^(?:(?:or|and)\s+)?[A-Za-z_(][\p{L}\p{Mn}\p{Nd}\p{Pc}\s()]*$/u,_=i,v=[`tag`,`for`,`generation`,`origin`,`namespace`,`sequence`,`correlation`,`causation`,`causedBy`,`occurred`],y=/^\s*(?:by|filter)\s+([a-z_]\w*)\s+([\w.]+(?:\[\])?(?:\?|\s+optional)?)(?:\s+from\s+.+)?\s*$/;function propertyTypeReference(e){return e.typeReference??n(e.type)}function sourceTypeAt(e,t){let n=e.slice(t-1).match(/^[\p{L}\p{Mn}\p{Nd}\p{Pc}.]+(?:\[\])?(?:\?|\s+optional\b)?/u)?.[0]??``;return{text:n,startColumn:t,endColumn:t+n.length}}function propertiesIn(e,t,r){return t.map(t=>({index:t,match:e[t].match(f)})).filter(e=>e.match!==null).filter(({match:e})=>e[1].startsWith(`@`)||e[1]===`as`||!r.includes(e[1])).map(({index:t,match:r})=>({name:r[1].replace(/^@/,``),type:r[2],typeReference:n(r[2]),sourceType:sourceTypeAt(e[t],e[t].match(/^\s*\S+\s+/)[0].length+1),isIdentifier:r[4]!==void 0,...r[3]===void 0?{}:{isGenerated:!0},...r[5]===void 0?{}:{isSubject:!0},line:t}))}function collectBody(e,t,n,r){let i=[];for(let a=n+1;a<e.length;a++){if(t[a])continue;let n=e[a];if(n.trim().length!==0){if(o(n)<=r)break;i.push(a)}}return i}function directBody(e,t,n,r){let i=collectBody(e,t,n,r).filter(n=>!t[n]&&!/^\s*(?:\/\/|#)/.test(e[n]));if(!/^\s*command\b/.test(e[n]))return i;let a,s=!1;return i.filter(t=>{let n=o(e[t]),r=e[t].trim();return a!==void 0&&n>a&&(!s||g.test(r))?!1:(a=r!==`validate csharp`&&propertiesIn(e,[t],h).length>0||/^description(?:\s|$)/.test(r)?void 0:n,s=/^authorize(?:\s|$)/.test(r),!0)})}const b=/* @__PURE__ */ new Map;function scanDocument(t){let i=t.join(`
1
+ import"./_virtual/_virtual/_rolldown/runtime.js";import{clauseKeywords as e}from"./language.js";import{bmpWordCharacters as t}from"./bmp-word-characters.js";import{typeReferenceSymbol as n}from"./TypeReferenceSymbol.js";import{unescapeString as r}from"./compiler/Text/StringLiteral.js";import{eventBodyReservedWords as i}from"./compiler/Text/ReservedWords.js";import"./compiler/index.js";import{fenceMap as a,indentOf as o}from"./document-context.js";import{eventAnalysisSource as s}from"./event-analysis-source.js";import{responseAnalysis as c}from"./response-analysis.js";import{fileReferenceOn as l}from"./file-references.js";const u=/^concept\s+(\w+)\s*:\s*(\w+)((?:\s+@?\w+)*)\s*$/,d=RegExp(`^@?([a-z_][${t}]*)(?:\\s*=\\s*(-?(?:0|[1-9][0-9]*)))?(?:\\s*//.*)?$`),f=/^\s*(@?[a-z_]\w*)\s+([\w.]+(?:\[\])?(?:\?|\s+optional)?)(\s+generated)?(\s+identifier)?(\s+subject)?\s*$/,p=/^([a-z_]\w*)\s+reason\s+"((?:[^"\\]|\\.)*)"\s*$/,m=/^\s*reads\s+([A-Z]\w*)(?:\s+as\s+([a-z_]\w*))?(?:\s+by\s+([a-z_]\w*))?\s*$/,h=[`authorize`,`produces`,`reads`],g=/^(?:(?:or|and)\s+)?[A-Za-z_(][\p{L}\p{Mn}\p{Nd}\p{Pc}\s()]*$/u,_=i,v=[`tag`,`for`,`generation`,`origin`,`namespace`,`sequence`,`correlation`,`causation`,`causedBy`,`occurred`],y=/^\s*(?:by|filter)\s+([a-z_]\w*)\s+([\w.]+(?:\[\])?(?:\?|\s+optional)?)(?:\s+from\s+.+)?\s*$/;function propertyTypeReference(e){return e.typeReference??n(e.type)}function sourceTypeAt(e,t){let n=e.slice(t-1).match(/^[\p{L}\p{Mn}\p{Nd}\p{Pc}.]+(?:\[\])?(?:\?|\s+optional\b)?/u)?.[0]??``;return{text:n,startColumn:t,endColumn:t+n.length}}function propertiesIn(e,t,r){return t.map(t=>({index:t,match:e[t].match(f)})).filter(e=>e.match!==null).filter(({match:e})=>e[1].startsWith(`@`)||e[1]===`as`||!r.includes(e[1])).map(({index:t,match:r})=>({name:r[1].replace(/^@/,``),type:r[2],typeReference:n(r[2]),sourceType:sourceTypeAt(e[t],e[t].match(/^\s*\S+\s+/)[0].length+1),isIdentifier:r[4]!==void 0,...r[3]===void 0?{}:{isGenerated:!0},...r[5]===void 0?{}:{isSubject:!0},line:t}))}function collectBody(e,t,n,r){let i=[];for(let a=n+1;a<e.length;a++){if(t[a])continue;let n=e[a];if(n.trim().length!==0){if(o(n)<=r)break;i.push(a)}}return i}function directBody(e,t,n,r){let i=collectBody(e,t,n,r).filter(n=>!t[n]&&!/^\s*(?:\/\/|#)/.test(e[n]));if(!/^\s*command\b/.test(e[n]))return i;let a,s=!1;return i.filter(t=>{let n=o(e[t]),r=e[t].trim();return a!==void 0&&n>a&&(!s||g.test(r))?!1:(a=r!==`validate csharp`&&propertiesIn(e,[t],h).length>0||/^description(?:\s|$)/.test(r)?void 0:n,s=/^authorize(?:\s|$)/.test(r),!0)})}const b=/* @__PURE__ */ new Map;function scanDocument(t){let i=t.join(`
2
2
  `),f=b.get(i);if(f)return f;let h=c(t),g={...h.identityDetails?.length?{identityDetails:h.identityDetails}:{},authoringSources:[i],eventSources:h.eventSources.declarations,imports:[],concepts:[],types:[],policies:[],events:[],commands:[],queries:[],screens:[],triggers:[]};t=s(t);let x=a(t),S=t,C=x,w=t.map(e=>e.replace(/\s*=(?!=|>).*/,``));for(let i=0;i<t.length;i++){if(x[i])continue;let a=t[i],s=a.trim(),c=o(a),f=S[i].trim().match(/^import\s+([\w.]+)(?:\s+from\s+"(?:[^"\\]|\\.)*")?\s*$/);if(f&&c===0){let e=f[1],t=e.split(`.`).pop()??e;g.imports.push({qualifiedName:e,shortName:t,line:i});continue}let b=s.match(u);if(b){let e=collectBody(t,x,i,c),n=e.map(e=>t[e].trim()),r=Math.min(...e.filter(e=>!x[e]&&t[e].trim()!==``).map(e=>o(t[e]))),a=e.find(e=>!x[e]&&o(t[e])===r&&/^\s*generate\s+\w+/.test(t[e])),s=a===void 0?void 0:t[a].match(/^\s*generate\s+(\w+)/)?.[1],l={};for(let e of n){let t=e.match(p);t&&l[t[1]]===void 0&&(l[t[1]]=t[2])}let u=b[2]===`Enum`?n.filter(e=>e!==`validate`).map(e=>d.exec(e)).filter(e=>e!==null):[],f=u.map(e=>e[1]),m=u.length>0&&u.every(e=>e[2]!==void 0)?u.map(e=>Number(e[2])):void 0;g.concepts.push({name:b[1],primitive:b[2],attributes:b[3].trim().split(/\s+/).filter(Boolean),attributeReasons:l,enumValues:f,...m===void 0?{}:{enumNumbers:m},...s===void 0?{}:{generationStrategy:s},line:i});continue}let T=s.match(/^type\s+(\w+)\s*$/);if(T){g.types.push({name:T[1],properties:propertiesIn(t,collectBody(t,x,i,c),e),line:i});continue}let E=s.match(/^policy\s+(\w+)\s*$/);if(E){let e=collectBody(t,x,i,c).filter(e=>!x[e]).map(e=>t[e].trim());g.policies.push({name:E[1],requires:e,line:i});continue}let D=S[i].trim().match(/^(?:(?:produces|(?<public>public))\s+)?event\s+(?<name>\w+)(?:\s+generation\s+(?<generation>\d+))?(?:\s+from\s+(?<origin>"(?:[^"\\]|\\.)*"))?\s*$/);if(D){let e=s.startsWith(`produces `),t=directBody(S,C,i,c),n=e?t:t.filter(e=>l(S[e],e)===void 0);g.events.push({name:D.groups.name,...D.groups.generation?{generation:Number(D.groups.generation)}:{},...D.groups.public||D.groups.origin?{visibility:`Public`}:{},...D.groups.origin?{origin:r(D.groups.origin.slice(1,-1))}:{},inline:e,properties:propertiesIn(e?w:S,n,e?v:_),line:i});continue}let O=h.commands.get(i);if(O){let e=directBody(t,x,i,c),n=e.filter(e=>/^\s*produces\b/.test(t[e])&&!h.operationProductionLines?.has(e));g.commands.push({name:O.name,properties:O.properties.map(e=>({name:e.name,type:`${e.type.name}${e.type.isCollection?`[]`:``}${e.type.isOptional?` optional`:``}`,typeReference:{name:e.type.name,isCollection:e.type.isCollection,isOptional:e.type.isOptional},sourceType:sourceTypeAt(t[e.type.location.line-1],e.type.location.column),isIdentifier:e.isIdentifier||/\sidentifier\s*$/.test(t[e.location.line-1]),...e.isGenerated?{isGenerated:!0}:{},line:e.location.line-1})),response:O.response,productionHeaders:n,produces:n.flatMap(e=>{let t=S[e].trim(),n=/^produces\s+event\b/.test(t),r=/^produces\s+when\b/.test(t),i=r?directBody(S,C,e,o(S[e]))[0]:e;if(i===void 0)return[];let a=r?S[i].trim():t.match(n?/^produces\s+event\s+([A-Za-z_]\w*)(?:\s+generation\s+\d+)?\s*$/:/^produces\s+([A-Z]\w*)\s*$/)?.[1];if(a===void 0||!/^[A-Za-z_]\w*$/.test(a))return[];let s=directBody(S,C,i,o(S[i])),c=s.map(e=>S[e].trim().match(/^for(?:\s+(.*))?$/)).filter(e=>e!==null);return[{name:a,inline:n,conditional:r,line:e,target:c.length===0?void 0:c.length===1?c[0][1]??``:``,mappings:s.flatMap(e=>{let t=S[e].trim().match(n?/^(@?[a-z_]\w*)\s+[\w.]+(?:\[\])?(?:\?|\s+optional)?\s*=(?!=|>)\s*(.+)$/:/^(@?[\w.]+)\s*=(?!=|>)\s*(.+)$/);return t===null?[]:[{name:t[1].replace(/^@/,``),source:t[2],line:e}]})}]}),reads:e.filter(e=>!x[e]).map(e=>({line:e,match:t[e].match(m)})).filter(e=>e.match!==null).map(({line:e,match:t})=>({view:t[1],...t[2]?{alias:t[2]}:{},...t[3]?{by:t[3]}:{},line:e})),line:i});continue}let k=s.match(/^query\s+(\w+)\s*=>\s*(?:observable\s+)?([\w.]+(?:\[\])?(?:\?|\s+optional)?)\s*$/);if(k){let e=collectBody(t,x,i,c).map(e=>({index:e,match:t[e].match(y)})).filter(e=>e.match!==null).map(({index:e,match:r})=>({name:r[1],type:r[2],typeReference:n(r[2]),sourceType:sourceTypeAt(t[e],t[e].match(/^\s*(?:by|filter)\s+\S+\s+/)[0].length+1),isIdentifier:!1,line:e}));g.queries.push({name:k[1],returnType:k[2],returnTypeReference:n(k[2]),parameters:e,line:i});continue}let A=s.match(/^screen\s+(\w+)\s*$/);if(A){g.screens.push({name:A[1],line:i});continue}let j=s.match(/^trigger\s+(\w+)\s*$/);j&&c===0&&g.triggers.push({name:j[1],line:i})}return b.size>=16&&b.delete(b.keys().next().value),b.set(i,g),g}function mergeSymbols(...e){return{...e.some(e=>e.identityDetails?.length)?{identityDetails:e.flatMap(e=>e.identityDetails??[])}:{},authoringSources:e.flatMap(e=>e.authoringSources??[]),...e.some(e=>e.authoringDocuments)?{authoringDocuments:e.flatMap(e=>e.authoringDocuments??[])}:{},eventSources:e.flatMap(e=>e.eventSources??[]),imports:e.flatMap(e=>e.imports),concepts:e.flatMap(e=>e.concepts),types:e.flatMap(e=>e.types),policies:e.flatMap(e=>e.policies),events:e.flatMap(e=>e.events),commands:e.flatMap(e=>e.commands),queries:e.flatMap(e=>e.queries),screens:e.flatMap(e=>e.screens),triggers:e.flatMap(e=>e.triggers)}}function symbolsForBuffer(e,t){let n=t?.authoringPath??`current.play`,r=t?.authoringDocuments?.find(e=>e.path===n);return{...mergeSymbols(scanDocument(e),t??mergeSymbols()),authoringDocuments:t?.authoringDocuments,authoringPath:n,authoringPlacement:t?.authoringPlacement??r?.placement,authoringPlacementResolved:t?.authoringPlacementResolved??r?.isPlacementResolved}}function knownEventNames(e){return[...e.events.map(e=>e.name),...e.imports.map(e=>e.shortName)]}const x=[`Startup`,`Shutdown`];function knownTriggerNames(e){return[...knownEventNames(e),...e.triggers.map(e=>e.name),...x]}function knownTypeNames(e,t){return[...t,...e.concepts.map(e=>e.name),...e.types.map(e=>e.name),...e.imports.map(e=>e.shortName)]}export{x as builtInTriggerNames,directBody,knownEventNames,knownTriggerNames,knownTypeNames,mergeSymbols,propertyTypeReference,scanDocument,symbolsForBuffer};
3
3
  //# sourceMappingURL=symbols.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"symbols.js","names":["conceptPattern","enumerationMemberPattern","bmpWordCharacters","propertyPattern","attributeReasonPattern","readPattern","commandReserved","authorizationContinuation","eventReserved","eventBodyReservedWords","inlineEventReserved","queryParameterPattern","property","typeReferenceSymbol","text","line","startColumn","body","lines","index","entry","match","reserved","start","fences","indentOf","indent","blockIndent","authorization","childIndent","symbolRevisions","source","cached","analysis","responseAnalysis","symbols","eventAnalysisSource","fenceMap","eventLines","eventFences","eventPropertyLines","trimmed","importMatch","qualifiedName","shortName","conceptMatch","bodyLines","i","directIndent","generationLine","generationStrategy","attributeReasons","reason","members","enumValues","member","enumNumbers","typeMatch","clauseKeywords","policyMatch","requires","eventMatch","inline","propertyBody","fileReferenceOn","unescapeString","command","productionHeaders","header","conditional","eventLine","name","children","targets","queryMatch","parameters","screenMatch","triggerMatch","documents","document","path","application","current","event","imported","builtInTriggerNames","trigger","primitives","concept","type"],"sources":["../../symbols.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 { EventVisibility, eventBodyReservedWords, unescapeString } from '@cratis/screenplay-compiler';\nimport { fenceMap, indentOf } from './document-context';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { CommandResponseSymbol, responseAnalysis } from './response-analysis';\nimport { fileReferenceOn } from './file-references';\nimport { clauseKeywords } from './language';\nimport { bmpWordCharacters } from './bmp-word-characters';\nimport { AuthoringDocument } from './AuthoringDocument';\nimport { AuthoredEventSource } from './AuthoredEventSource';\nimport { ProductionSymbol } from './ProductionSymbol';\nimport { TypeReferenceSymbol, typeReferenceSymbol } from './TypeReferenceSymbol';\n\nexport interface PropertySymbol {\n name: string;\n type: string;\n typeReference?: TypeReferenceSymbol;\n // Exact spelling and UTF-16 columns in the authoring source, independent of normalization.\n sourceType?: { text: string; startColumn: number; endColumn: number };\n isIdentifier: boolean;\n isGenerated?: boolean;\n isSubject?: boolean;\n line: number;\n}\n\nexport interface ConceptSymbol {\n name: string;\n primitive: string;\n attributes: string[];\n attributeReasons: Record<string, string>;\n enumValues: string[];\n enumNumbers?: number[];\n generationStrategy?: string;\n line: number;\n}\n\nexport interface TypeSymbol {\n name: string;\n properties: PropertySymbol[];\n line: number;\n}\n\nexport interface PolicySymbol {\n name: string;\n requires: string[];\n line: number;\n}\n\nexport interface EventSymbol {\n // Public editor declarations stay structural; the compiler is privately bundled.\n visibility?: 'Private' | 'Public';\n origin?: string;\n name: string;\n generation?: number;\n inline?: boolean;\n properties: PropertySymbol[];\n line: number;\n}\n\nexport interface CommandSymbol extends NamedSymbol {\n properties: PropertySymbol[];\n reads?: ReadSymbol[];\n produces?: ProductionSymbol[];\n productionHeaders?: number[];\n response?: CommandResponseSymbol | null;\n}\n\nexport interface ReadSymbol {\n view: string;\n alias?: string;\n by?: string;\n line: number;\n}\n\nexport interface NamedSymbol {\n name: string;\n line: number;\n}\n\nexport interface QuerySymbol extends NamedSymbol {\n returnType: string;\n returnTypeReference?: TypeReferenceSymbol;\n parameters: PropertySymbol[];\n}\n\nexport interface ImportSymbol {\n qualifiedName: string;\n shortName: string;\n line: number;\n}\n\nexport interface DocumentSymbols {\n identityDetails?: readonly { readonly name: string; readonly type: string; readonly line: number }[];\n authoringSources?: readonly string[];\n authoringPath?: string;\n authoringPlacement?: readonly string[];\n authoringPlacementResolved?: boolean;\n authoringDocuments?: readonly AuthoringDocument[];\n eventSources?: readonly AuthoredEventSource[];\n imports: ImportSymbol[];\n concepts: ConceptSymbol[];\n types: TypeSymbol[];\n policies: PolicySymbol[];\n events: EventSymbol[];\n commands: CommandSymbol[];\n queries: QuerySymbol[];\n screens: NamedSymbol[];\n triggers: NamedSymbol[];\n}\n\nconst conceptPattern = /^concept\\s+(\\w+)\\s*:\\s*(\\w+)((?:\\s+@\\w+)*)\\s*$/;\nconst enumerationMemberPattern = new RegExp(`^@?([a-z_][${bmpWordCharacters}]*)(?:\\\\s*=\\\\s*(-?(?:0|[1-9][0-9]*)))?(?:\\\\s*//.*)?$`);\nconst propertyPattern = /^\\s*(@?[a-z_]\\w*)\\s+([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(\\s+generated)?(\\s+identifier)?(\\s+subject)?\\s*$/;\nconst attributeReasonPattern = /^([a-z_]\\w*)\\s+reason\\s+\"((?:[^\"\\\\]|\\\\.)*)\"\\s*$/;\nconst readPattern = /^\\s*reads\\s+([A-Z]\\w*)(?:\\s+as\\s+([a-z_]\\w*))?(?:\\s+by\\s+([a-z_]\\w*))?\\s*$/;\nconst commandReserved = ['authorize', 'produces', 'reads'];\n// AuthorizeParser's continuation pattern, including the compiler's Unicode word characters.\nconst authorizationContinuation = /^(?:(?:or|and)\\s+)?[A-Za-z_(][\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}\\s()]*$/u;\n// Use the compiler's contextual inventory, not the global completion vocabulary.\nconst eventReserved = eventBodyReservedWords;\nconst inlineEventReserved = ['tag', 'for', 'generation', 'origin', 'namespace', 'sequence', 'correlation', 'causation', 'causedBy', 'occurred'];\nconst queryParameterPattern =\n /^\\s*(?:by|filter)\\s+([a-z_]\\w*)\\s+([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(?:\\s+from\\s+.+)?\\s*$/;\n\n// Property-shaped clauses depend on their owner. Commands reserve only authorize,\n// produces and reads; bare directives such as description and handler can be properties.\n// The @ escape always denotes a property, and 'as' keeps its established property meaning.\nexport function propertyTypeReference(property: PropertySymbol): TypeReferenceSymbol {\n return property.typeReference ?? typeReferenceSymbol(property.type);\n}\n\nfunction sourceTypeAt(line: string, startColumn: number): NonNullable<PropertySymbol['sourceType']> {\n const text = line.slice(startColumn - 1).match(/^[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}.]+(?:\\[\\])?(?:\\?|\\s+optional\\b)?/u)?.[0] ?? '';\n return { text, startColumn, endColumn: startColumn + text.length };\n}\n\nfunction propertiesIn(lines: string[], body: number[], reserved: readonly string[]): PropertySymbol[] {\n return body\n .map((index) => ({ index, match: lines[index].match(propertyPattern) }))\n .filter((entry): entry is { index: number; match: RegExpMatchArray } => entry.match !== null)\n .filter(({ match }) => match[1].startsWith('@') || match[1] === 'as' || !reserved.includes(match[1]))\n .map(({ index, match }) => ({\n name: match[1].replace(/^@/, ''),\n type: match[2],\n typeReference: typeReferenceSymbol(match[2]),\n sourceType: sourceTypeAt(lines[index], lines[index].match(/^\\s*\\S+\\s+/)![0].length + 1),\n isIdentifier: match[4] !== undefined,\n ...(match[3] !== undefined ? { isGenerated: true } : {}),\n ...(match[5] !== undefined ? { isSubject: true } : {}),\n line: index,\n }));\n}\n\nfunction collectBody(lines: string[], fences: boolean[], start: number, indent: number): number[] {\n const body: number[] = [];\n for (let index = start + 1; index < lines.length; index++) {\n if (fences[index]) {\n continue;\n }\n const line = lines[index];\n if (line.trim().length === 0) continue;\n if (indentOf(line) <= indent) break;\n body.push(index);\n }\n return body;\n}\n\n// Event/production parsers accept every greater indent, not just the smallest child indent.\n// Command block directives own their nested lines; properties do not. Fenced prose is never syntax.\nexport function directBody(lines: string[], fences: boolean[], start: number, indent: number): number[] {\n const body = collectBody(lines, fences, start, indent).filter(index => !fences[index] && !/^\\s*(?:\\/\\/|#)/.test(lines[index]));\n if (!/^\\s*command\\b/.test(lines[start])) return body;\n let blockIndent: number | undefined;\n let authorization = false;\n return body.filter(index => {\n const childIndent = indentOf(lines[index]);\n const text = lines[index].trim();\n // AuthorizeParser owns only consecutive deeper lines with requirement shape.\n // Unlike opaque blocks, a nonmatching line returns control to CommandParser.\n if (blockIndent !== undefined && childIndent > blockIndent &&\n (!authorization || authorizationContinuation.test(text))) return false;\n const property = text !== 'validate csharp' && propertiesIn(lines, [index], commandReserved).length > 0;\n // Description consumes only a quoted value or a fence (already excluded above).\n const leaf = property || /^description(?:\\s|$)/.test(text);\n blockIndent = leaf ? undefined : childIndent;\n authorization = /^authorize(?:\\s|$)/.test(text);\n return true;\n });\n}\n\nconst symbolRevisions = new Map<string, DocumentSymbols>();\n\nexport function scanDocument(lines: string[]): DocumentSymbols {\n const source = lines.join('\\n');\n const cached = symbolRevisions.get(source);\n if (cached) return cached;\n const analysis = responseAnalysis(lines);\n const symbols: DocumentSymbols = {\n ...(analysis.identityDetails?.length ? { identityDetails: analysis.identityDetails } : {}),\n authoringSources: [source],\n eventSources: analysis.eventSources.declarations,\n imports: [],\n concepts: [],\n types: [],\n policies: [],\n events: [],\n commands: [],\n queries: [],\n screens: [],\n triggers: [],\n };\n // One normalization pass for every declaration, including comments on fence openers.\n lines = eventAnalysisSource(lines);\n const fences = fenceMap(lines);\n const eventLines = lines;\n const eventFences = fences;\n // Typed inline mappings share property syntax once their source expression is removed.\n // Do this once, never once per inline event.\n const eventPropertyLines = lines.map(line => line.replace(/\\s*=(?!=|>).*/, ''));\n\n for (let index = 0; index < lines.length; index++) {\n if (fences[index]) continue;\n const line = lines[index];\n const trimmed = line.trim();\n const indent = indentOf(line);\n\n const importMatch = eventLines[index].trim().match(/^import\\s+([\\w.]+)(?:\\s+from\\s+\"(?:[^\"\\\\]|\\\\.)*\")?\\s*$/);\n if (importMatch && indent === 0) {\n const qualifiedName = importMatch[1];\n const shortName = qualifiedName.split('.').pop() ?? qualifiedName;\n symbols.imports.push({ qualifiedName, shortName, line: index });\n continue;\n }\n\n const conceptMatch = trimmed.match(conceptPattern);\n if (conceptMatch) {\n const bodyLines = collectBody(lines, fences, index, indent);\n const body = bodyLines.map((i) => lines[i].trim());\n const directIndent = Math.min(...bodyLines.filter(i => !fences[i] && lines[i].trim() !== '').map(i => indentOf(lines[i])));\n const generationLine = bodyLines.find(i => !fences[i] && indentOf(lines[i]) === directIndent && /^\\s*generate\\s+\\w+/.test(lines[i]));\n const generationStrategy = generationLine === undefined ? undefined : lines[generationLine].match(/^\\s*generate\\s+(\\w+)/)?.[1];\n const attributeReasons: Record<string, string> = {};\n for (const line of body) {\n const reason = line.match(attributeReasonPattern);\n if (reason && attributeReasons[reason[1]] === undefined) {\n attributeReasons[reason[1]] = reason[2];\n }\n }\n const members = conceptMatch[2] === 'Enum'\n ? body.filter(line => line !== 'validate').map(line => enumerationMemberPattern.exec(line)).filter(match => match !== null)\n : [];\n const enumValues = members.map(member => member[1]);\n const enumNumbers = members.length > 0 && members.every(member => member[2] !== undefined) ? members.map(member => Number(member[2])) : undefined;\n symbols.concepts.push({\n name: conceptMatch[1],\n primitive: conceptMatch[2],\n attributes: conceptMatch[3].trim().split(/\\s+/).filter(Boolean),\n attributeReasons,\n enumValues,\n ...(enumNumbers === undefined ? {} : { enumNumbers }),\n ...(generationStrategy === undefined ? {} : { generationStrategy }),\n line: index,\n });\n continue;\n }\n\n const typeMatch = trimmed.match(/^type\\s+(\\w+)\\s*$/);\n if (typeMatch) {\n symbols.types.push({\n name: typeMatch[1],\n properties: propertiesIn(lines, collectBody(lines, fences, index, indent), clauseKeywords),\n line: index,\n });\n continue;\n }\n\n const policyMatch = trimmed.match(/^policy\\s+(\\w+)\\s*$/);\n if (policyMatch) {\n const requires = collectBody(lines, fences, index, indent)\n .filter((i) => !fences[i])\n .map((i) => lines[i].trim());\n symbols.policies.push({ name: policyMatch[1], requires, line: index });\n continue;\n }\n\n const eventMatch = eventLines[index].trim().match(/^(?:(?:produces|(?<public>public))\\s+)?event\\s+(?<name>\\w+)(?:\\s+generation\\s+(?<generation>\\d+))?(?:\\s+from\\s+(?<origin>\"(?:[^\"\\\\]|\\\\.)*\"))?\\s*$/);\n if (eventMatch) {\n const inline = trimmed.startsWith('produces ');\n const body = directBody(eventLines, eventFences, index, indent);\n // Standalone events distinguish file metadata from properties by path shape.\n const propertyBody = inline ? body : body.filter(line => fileReferenceOn(eventLines[line], line) === undefined);\n symbols.events.push({\n name: eventMatch.groups!.name,\n ...(eventMatch.groups!.generation ? { generation: Number(eventMatch.groups!.generation) } : {}),\n ...(eventMatch.groups!.public || eventMatch.groups!.origin ? { visibility: EventVisibility.Public } : {}),\n ...(eventMatch.groups!.origin ? { origin: unescapeString(eventMatch.groups!.origin.slice(1, -1)) } : {}),\n inline,\n properties: propertiesIn(inline ? eventPropertyLines : eventLines,\n propertyBody, inline ? inlineEventReserved : eventReserved),\n line: index,\n });\n continue;\n }\n\n const command = analysis.commands.get(index);\n if (command) {\n // A command property is a leaf, not an indentation owner. Share the parser-shaped\n // body with properties, productions, advice and destination hints.\n const body = directBody(lines, fences, index, indent);\n const productionHeaders = body.filter(line => /^\\s*produces\\b/.test(lines[line]) && !analysis.operationProductionLines?.has(line));\n symbols.commands.push({\n name: command.name,\n properties: command.properties.map(property => ({\n name: property.name,\n type: `${property.type.name}${property.type.isCollection ? '[]' : ''}${property.type.isOptional ? ' optional' : ''}`,\n typeReference: { name: property.type.name, isCollection: property.type.isCollection, isOptional: property.type.isOptional },\n sourceType: sourceTypeAt(lines[property.type.location.line - 1], property.type.location.column),\n isIdentifier: property.isIdentifier || /\\sidentifier\\s*$/.test(lines[property.location.line - 1]),\n ...(property.isGenerated ? { isGenerated: true } : {}),\n line: property.location.line - 1,\n })),\n response: command.response,\n productionHeaders,\n produces: productionHeaders.flatMap(line => {\n const header = eventLines[line].trim();\n const inline = /^produces\\s+event\\b/.test(header);\n const conditional = /^produces\\s+when\\b/.test(header);\n const eventLine = conditional ? directBody(eventLines, eventFences, line, indentOf(eventLines[line]))[0] : line;\n if (eventLine === undefined) return [];\n const name = conditional ? eventLines[eventLine].trim() : header.match(inline ? /^produces\\s+event\\s+([A-Za-z_]\\w*)(?:\\s+generation\\s+\\d+)?\\s*$/ : /^produces\\s+([A-Z]\\w*)\\s*$/)?.[1];\n if (name === undefined || !/^[A-Za-z_]\\w*$/.test(name)) return [];\n const children = directBody(eventLines, eventFences, eventLine, indentOf(eventLines[eventLine]));\n const targets = children.map(index => eventLines[index].trim().match(/^for(?:\\s+(.*))?$/)).filter(match => match !== null);\n // Empty or repeated targets are uncertain, not implicit destinations.\n const target = targets.length === 0 ? undefined : targets.length === 1 ? targets[0][1] ?? '' : '';\n const mappings = children.flatMap(index => {\n const match = eventLines[index].trim().match(inline ? /^(@?[a-z_]\\w*)\\s+[\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?\\s*=(?!=|>)\\s*(.+)$/ : /^(@?[\\w.]+)\\s*=(?!=|>)\\s*(.+)$/);\n return match === null ? [] : [{ name: match[1].replace(/^@/, ''), source: match[2], line: index }];\n });\n return [{ name, inline, conditional, line, target, mappings }];\n }),\n reads: body.filter((line) => !fences[line])\n .map((line) => ({ line, match: lines[line].match(readPattern) }))\n .filter((entry): entry is { line: number; match: RegExpMatchArray } => entry.match !== null)\n .map(({ line, match }) => ({\n view: match[1],\n ...(match[2] ? { alias: match[2] } : {}),\n ...(match[3] ? { by: match[3] } : {}),\n line,\n })),\n line: index,\n });\n continue;\n }\n\n // The return type shape is the compiler's, dots and all - QueryParser's\n // ^query\\s+([A-Za-z_]\\w*)\\s*=>\\s*(observable\\s+)?([\\w.]+(?:\\[\\])?\\??)$. A narrower one here\n // silently drops the query from the symbol table, and with it every check and completion that\n // reads from it.\n const queryMatch = trimmed.match(/^query\\s+(\\w+)\\s*=>\\s*(?:observable\\s+)?([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)\\s*$/);\n if (queryMatch) {\n // The return type names a read model, which no construct declares — only the\n // 'by' and 'filter' parameters resolve against the document's own types.\n const parameters = collectBody(lines, fences, index, indent)\n .map((i) => ({ index: i, match: lines[i].match(queryParameterPattern) }))\n .filter(\n (entry): entry is { index: number; match: RegExpMatchArray } =>\n entry.match !== null,\n )\n .map(({ index: line, match }) => ({\n name: match[1],\n type: match[2],\n typeReference: typeReferenceSymbol(match[2]),\n sourceType: sourceTypeAt(lines[line], lines[line].match(/^\\s*(?:by|filter)\\s+\\S+\\s+/)![0].length + 1),\n isIdentifier: false,\n line,\n }));\n symbols.queries.push({\n name: queryMatch[1],\n returnType: queryMatch[2],\n returnTypeReference: typeReferenceSymbol(queryMatch[2]),\n parameters,\n line: index,\n });\n continue;\n }\n\n const screenMatch = trimmed.match(/^screen\\s+(\\w+)\\s*$/);\n if (screenMatch) {\n symbols.screens.push({ name: screenMatch[1], line: index });\n continue;\n }\n\n const triggerMatch = trimmed.match(/^trigger\\s+(\\w+)\\s*$/);\n if (triggerMatch && indent === 0) {\n symbols.triggers.push({ name: triggerMatch[1], line: index });\n }\n }\n\n if (symbolRevisions.size >= 16) symbolRevisions.delete(symbolRevisions.keys().next().value!);\n symbolRevisions.set(source, symbols);\n return symbols;\n}\n\n// The symbols of several documents as one - what an application spread over files declares. Lines refer to\n// the document each symbol came from, so the result names things; it does not locate them.\nexport function mergeSymbols(...documents: DocumentSymbols[]): DocumentSymbols {\n return {\n ...(documents.some(document => document.identityDetails?.length) ? { identityDetails: documents.flatMap(document => document.identityDetails ?? []) } : {}),\n authoringSources: documents.flatMap(document => document.authoringSources ?? []),\n ...(documents.some(document => document.authoringDocuments) ? { authoringDocuments: documents.flatMap(document => document.authoringDocuments ?? []) } : {}),\n eventSources: documents.flatMap(document => document.eventSources ?? []),\n imports: documents.flatMap((document) => document.imports),\n concepts: documents.flatMap((document) => document.concepts),\n types: documents.flatMap((document) => document.types),\n policies: documents.flatMap((document) => document.policies),\n events: documents.flatMap((document) => document.events),\n commands: documents.flatMap((document) => document.commands),\n queries: documents.flatMap((document) => document.queries),\n screens: documents.flatMap((document) => document.screens),\n triggers: documents.flatMap((document) => document.triggers),\n };\n}\n\n// Name scans are not physical input documents. Keep the host's authoritative paths separate,\n// and let responseAnalysis replace the current document with this buffer exactly once.\nexport function symbolsForBuffer(lines: string[], application?: DocumentSymbols): DocumentSymbols {\n const path = application?.authoringPath ?? 'current.play';\n const current = application?.authoringDocuments?.find(document => document.path === path);\n return { ...mergeSymbols(scanDocument(lines), application ?? mergeSymbols()),\n authoringDocuments: application?.authoringDocuments,\n authoringPath: path,\n authoringPlacement: application?.authoringPlacement ?? current?.placement,\n authoringPlacementResolved: application?.authoringPlacementResolved ?? current?.isPlacementResolved,\n };\n}\n\nexport function knownEventNames(symbols: DocumentSymbols): string[] {\n return [\n ...symbols.events.map((event) => event.name),\n ...symbols.imports.map((imported) => imported.shortName),\n ];\n}\n\n// The built-in host signals, which have no declaration to scan for because every application has them.\nexport const builtInTriggerNames = ['Startup', 'Shutdown'];\n\n// What a reaction's `when` may name: an event, a declared trigger, or a host signal. The compiler resolves\n// the three in that order, and the editor offers them the same way rather than guessing which was meant.\nexport function knownTriggerNames(symbols: DocumentSymbols): string[] {\n return [\n ...knownEventNames(symbols),\n ...symbols.triggers.map((trigger) => trigger.name),\n ...builtInTriggerNames,\n ];\n}\n\n// Everything a property type reference can resolve to — the primitives, the declared\n// concepts and types, and the short names of the imports.\nexport function knownTypeNames(symbols: DocumentSymbols, primitives: readonly string[]): string[] {\n return [\n ...primitives,\n ...symbols.concepts.map((concept) => concept.name),\n ...symbols.types.map((type) => type.name),\n ...symbols.imports.map((imported) => imported.shortName),\n ];\n}\n"],"mappings":"qnBAgHA,MAAMA,EAAiB,iDACjBC,EAA+B,OAAO,cAAcC,EAAkB,qDAAqD,EAC3HC,EAAkB,2GAClBC,EAAyB,kDACzBC,EAAc,6EACdC,EAAkB,CAAC,YAAa,WAAY,OAAO,EAEnDC,EAA4B,gEAE5BC,EAAgBC,EAChBC,EAAsB,CAAC,MAAO,MAAO,aAAc,SAAU,YAAa,WAAY,cAAe,YAAa,WAAY,UAAU,EACxIC,EACF,8FAKJ,SAAgB,sBAAsB,EAA+C,CACjF,OAAOC,EAAS,eAAiBC,EAAoBD,EAAS,IAAI,CACtE,CAEA,SAAS,aAAa,EAAc,EAAgE,CAChG,IAAME,EAAOC,EAAK,MAAMC,EAAc,CAAC,CAAC,CAAC,MAAM,6DAA6D,CAAC,GAAG,IAAM,GACtH,MAAO,CAAE,OAAM,cAAa,UAAWA,EAAcF,EAAK,MAAO,CACrE,CAEA,SAAS,aAAa,EAAiB,EAAgB,EAA+C,CAClG,OAAOG,EACF,IAAK,IAAW,CAAE,QAAO,MAAOC,EAAMC,EAAM,CAAC,MAAMhB,CAAe,CAAE,EAAE,CAAC,CACvE,OAAQ,GAA+DiB,EAAM,QAAU,IAAI,CAAC,CAC5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KAAK,GAAYF,EAAS,OAASC,CAAI,EACxF,MAAO,CAAE,GAAG,aAAa,aAAa9D,CAAK,EAAG+D,GAAe,aAAa,CAAC,EACvE,mBAAoBA,GAAa,mBACjC,cAAeD,EACf,mBAAoBC,GAAa,oBAAsBC,GAAS,UAChE,2BAA4BD,GAAa,4BAA8BC,GAAS,mBACpF,CACJ,CAEA,SAAgB,gBAAgB,EAAoC,CAChE,MAAO,CACH,GAAG/C,EAAQ,OAAO,IAAK,GAAUgD,EAAM,IAAI,EAC3C,GAAGhD,EAAQ,QAAQ,IAAK,GAAaiD,EAAS,SAAS,CAC3D,CACJ,CAGA,MAAaC,EAAsB,CAAC,UAAW,UAAU,EAIzD,SAAgB,kBAAkB,EAAoC,CAClE,MAAO,CACH,GAAG,gBAAgBlD,CAAO,EAC1B,GAAGA,EAAQ,SAAS,IAAK,GAAYmD,EAAQ,IAAI,EACjD,GAAGD,CACP,CACJ,CAIA,SAAgB,eAAe,EAA0B,EAAyC,CAC9F,MAAO,CACH,GAAGE,EACH,GAAGpD,EAAQ,SAAS,IAAK,GAAYqD,EAAQ,IAAI,EACjD,GAAGrD,EAAQ,MAAM,IAAK,GAASsD,EAAK,IAAI,EACxC,GAAGtD,EAAQ,QAAQ,IAAK,GAAaiD,EAAS,SAAS,CAC3D,CACJ"}
1
+ {"version":3,"file":"symbols.js","names":["conceptPattern","enumerationMemberPattern","bmpWordCharacters","propertyPattern","attributeReasonPattern","readPattern","commandReserved","authorizationContinuation","eventReserved","eventBodyReservedWords","inlineEventReserved","queryParameterPattern","property","typeReferenceSymbol","text","line","startColumn","body","lines","index","entry","match","reserved","start","fences","indentOf","indent","blockIndent","authorization","childIndent","symbolRevisions","source","cached","analysis","responseAnalysis","symbols","eventAnalysisSource","fenceMap","eventLines","eventFences","eventPropertyLines","trimmed","importMatch","qualifiedName","shortName","conceptMatch","bodyLines","i","directIndent","generationLine","generationStrategy","attributeReasons","reason","members","enumValues","member","enumNumbers","typeMatch","clauseKeywords","policyMatch","requires","eventMatch","inline","propertyBody","fileReferenceOn","unescapeString","command","productionHeaders","header","conditional","eventLine","name","children","targets","queryMatch","parameters","screenMatch","triggerMatch","documents","document","path","application","current","event","imported","builtInTriggerNames","trigger","primitives","concept","type"],"sources":["../../symbols.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 { EventVisibility, eventBodyReservedWords, unescapeString } from '@cratis/screenplay-compiler';\nimport { fenceMap, indentOf } from './document-context';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { CommandResponseSymbol, responseAnalysis } from './response-analysis';\nimport { fileReferenceOn } from './file-references';\nimport { clauseKeywords } from './language';\nimport { bmpWordCharacters } from './bmp-word-characters';\nimport { AuthoringDocument } from './AuthoringDocument';\nimport { AuthoredEventSource } from './AuthoredEventSource';\nimport { ProductionSymbol } from './ProductionSymbol';\nimport { TypeReferenceSymbol, typeReferenceSymbol } from './TypeReferenceSymbol';\n\nexport interface PropertySymbol {\n name: string;\n type: string;\n typeReference?: TypeReferenceSymbol;\n // Exact spelling and UTF-16 columns in the authoring source, independent of normalization.\n sourceType?: { text: string; startColumn: number; endColumn: number };\n isIdentifier: boolean;\n isGenerated?: boolean;\n isSubject?: boolean;\n line: number;\n}\n\nexport interface ConceptSymbol {\n name: string;\n primitive: string;\n attributes: string[];\n attributeReasons: Record<string, string>;\n enumValues: string[];\n enumNumbers?: number[];\n generationStrategy?: string;\n line: number;\n}\n\nexport interface TypeSymbol {\n name: string;\n properties: PropertySymbol[];\n line: number;\n}\n\nexport interface PolicySymbol {\n name: string;\n requires: string[];\n line: number;\n}\n\nexport interface EventSymbol {\n // Public editor declarations stay structural; the compiler is privately bundled.\n visibility?: 'Private' | 'Public';\n origin?: string;\n name: string;\n generation?: number;\n inline?: boolean;\n properties: PropertySymbol[];\n line: number;\n}\n\nexport interface CommandSymbol extends NamedSymbol {\n properties: PropertySymbol[];\n reads?: ReadSymbol[];\n produces?: ProductionSymbol[];\n productionHeaders?: number[];\n response?: CommandResponseSymbol | null;\n}\n\nexport interface ReadSymbol {\n view: string;\n alias?: string;\n by?: string;\n line: number;\n}\n\nexport interface NamedSymbol {\n name: string;\n line: number;\n}\n\nexport interface QuerySymbol extends NamedSymbol {\n returnType: string;\n returnTypeReference?: TypeReferenceSymbol;\n parameters: PropertySymbol[];\n}\n\nexport interface ImportSymbol {\n qualifiedName: string;\n shortName: string;\n line: number;\n}\n\nexport interface DocumentSymbols {\n identityDetails?: readonly { readonly name: string; readonly type: string; readonly line: number }[];\n authoringSources?: readonly string[];\n authoringPath?: string;\n authoringPlacement?: readonly string[];\n authoringPlacementResolved?: boolean;\n authoringDocuments?: readonly AuthoringDocument[];\n eventSources?: readonly AuthoredEventSource[];\n imports: ImportSymbol[];\n concepts: ConceptSymbol[];\n types: TypeSymbol[];\n policies: PolicySymbol[];\n events: EventSymbol[];\n commands: CommandSymbol[];\n queries: QuerySymbol[];\n screens: NamedSymbol[];\n triggers: NamedSymbol[];\n}\n\nconst conceptPattern = /^concept\\s+(\\w+)\\s*:\\s*(\\w+)((?:\\s+@?\\w+)*)\\s*$/;\nconst enumerationMemberPattern = new RegExp(`^@?([a-z_][${bmpWordCharacters}]*)(?:\\\\s*=\\\\s*(-?(?:0|[1-9][0-9]*)))?(?:\\\\s*//.*)?$`);\nconst propertyPattern = /^\\s*(@?[a-z_]\\w*)\\s+([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(\\s+generated)?(\\s+identifier)?(\\s+subject)?\\s*$/;\nconst attributeReasonPattern = /^([a-z_]\\w*)\\s+reason\\s+\"((?:[^\"\\\\]|\\\\.)*)\"\\s*$/;\nconst readPattern = /^\\s*reads\\s+([A-Z]\\w*)(?:\\s+as\\s+([a-z_]\\w*))?(?:\\s+by\\s+([a-z_]\\w*))?\\s*$/;\nconst commandReserved = ['authorize', 'produces', 'reads'];\n// AuthorizeParser's continuation pattern, including the compiler's Unicode word characters.\nconst authorizationContinuation = /^(?:(?:or|and)\\s+)?[A-Za-z_(][\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}\\s()]*$/u;\n// Use the compiler's contextual inventory, not the global completion vocabulary.\nconst eventReserved = eventBodyReservedWords;\nconst inlineEventReserved = ['tag', 'for', 'generation', 'origin', 'namespace', 'sequence', 'correlation', 'causation', 'causedBy', 'occurred'];\nconst queryParameterPattern =\n /^\\s*(?:by|filter)\\s+([a-z_]\\w*)\\s+([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(?:\\s+from\\s+.+)?\\s*$/;\n\n// Property-shaped clauses depend on their owner. Commands reserve only authorize,\n// produces and reads; bare directives such as description and handler can be properties.\n// The @ escape always denotes a property, and 'as' keeps its established property meaning.\nexport function propertyTypeReference(property: PropertySymbol): TypeReferenceSymbol {\n return property.typeReference ?? typeReferenceSymbol(property.type);\n}\n\nfunction sourceTypeAt(line: string, startColumn: number): NonNullable<PropertySymbol['sourceType']> {\n const text = line.slice(startColumn - 1).match(/^[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}.]+(?:\\[\\])?(?:\\?|\\s+optional\\b)?/u)?.[0] ?? '';\n return { text, startColumn, endColumn: startColumn + text.length };\n}\n\nfunction propertiesIn(lines: string[], body: number[], reserved: readonly string[]): PropertySymbol[] {\n return body\n .map((index) => ({ index, match: lines[index].match(propertyPattern) }))\n .filter((entry): entry is { index: number; match: RegExpMatchArray } => entry.match !== null)\n .filter(({ match }) => match[1].startsWith('@') || match[1] === 'as' || !reserved.includes(match[1]))\n .map(({ index, match }) => ({\n name: match[1].replace(/^@/, ''),\n type: match[2],\n typeReference: typeReferenceSymbol(match[2]),\n sourceType: sourceTypeAt(lines[index], lines[index].match(/^\\s*\\S+\\s+/)![0].length + 1),\n isIdentifier: match[4] !== undefined,\n ...(match[3] !== undefined ? { isGenerated: true } : {}),\n ...(match[5] !== undefined ? { isSubject: true } : {}),\n line: index,\n }));\n}\n\nfunction collectBody(lines: string[], fences: boolean[], start: number, indent: number): number[] {\n const body: number[] = [];\n for (let index = start + 1; index < lines.length; index++) {\n if (fences[index]) {\n continue;\n }\n const line = lines[index];\n if (line.trim().length === 0) continue;\n if (indentOf(line) <= indent) break;\n body.push(index);\n }\n return body;\n}\n\n// Event/production parsers accept every greater indent, not just the smallest child indent.\n// Command block directives own their nested lines; properties do not. Fenced prose is never syntax.\nexport function directBody(lines: string[], fences: boolean[], start: number, indent: number): number[] {\n const body = collectBody(lines, fences, start, indent).filter(index => !fences[index] && !/^\\s*(?:\\/\\/|#)/.test(lines[index]));\n if (!/^\\s*command\\b/.test(lines[start])) return body;\n let blockIndent: number | undefined;\n let authorization = false;\n return body.filter(index => {\n const childIndent = indentOf(lines[index]);\n const text = lines[index].trim();\n // AuthorizeParser owns only consecutive deeper lines with requirement shape.\n // Unlike opaque blocks, a nonmatching line returns control to CommandParser.\n if (blockIndent !== undefined && childIndent > blockIndent &&\n (!authorization || authorizationContinuation.test(text))) return false;\n const property = text !== 'validate csharp' && propertiesIn(lines, [index], commandReserved).length > 0;\n // Description consumes only a quoted value or a fence (already excluded above).\n const leaf = property || /^description(?:\\s|$)/.test(text);\n blockIndent = leaf ? undefined : childIndent;\n authorization = /^authorize(?:\\s|$)/.test(text);\n return true;\n });\n}\n\nconst symbolRevisions = new Map<string, DocumentSymbols>();\n\nexport function scanDocument(lines: string[]): DocumentSymbols {\n const source = lines.join('\\n');\n const cached = symbolRevisions.get(source);\n if (cached) return cached;\n const analysis = responseAnalysis(lines);\n const symbols: DocumentSymbols = {\n ...(analysis.identityDetails?.length ? { identityDetails: analysis.identityDetails } : {}),\n authoringSources: [source],\n eventSources: analysis.eventSources.declarations,\n imports: [],\n concepts: [],\n types: [],\n policies: [],\n events: [],\n commands: [],\n queries: [],\n screens: [],\n triggers: [],\n };\n // One normalization pass for every declaration, including comments on fence openers.\n lines = eventAnalysisSource(lines);\n const fences = fenceMap(lines);\n const eventLines = lines;\n const eventFences = fences;\n // Typed inline mappings share property syntax once their source expression is removed.\n // Do this once, never once per inline event.\n const eventPropertyLines = lines.map(line => line.replace(/\\s*=(?!=|>).*/, ''));\n\n for (let index = 0; index < lines.length; index++) {\n if (fences[index]) continue;\n const line = lines[index];\n const trimmed = line.trim();\n const indent = indentOf(line);\n\n const importMatch = eventLines[index].trim().match(/^import\\s+([\\w.]+)(?:\\s+from\\s+\"(?:[^\"\\\\]|\\\\.)*\")?\\s*$/);\n if (importMatch && indent === 0) {\n const qualifiedName = importMatch[1];\n const shortName = qualifiedName.split('.').pop() ?? qualifiedName;\n symbols.imports.push({ qualifiedName, shortName, line: index });\n continue;\n }\n\n const conceptMatch = trimmed.match(conceptPattern);\n if (conceptMatch) {\n const bodyLines = collectBody(lines, fences, index, indent);\n const body = bodyLines.map((i) => lines[i].trim());\n const directIndent = Math.min(...bodyLines.filter(i => !fences[i] && lines[i].trim() !== '').map(i => indentOf(lines[i])));\n const generationLine = bodyLines.find(i => !fences[i] && indentOf(lines[i]) === directIndent && /^\\s*generate\\s+\\w+/.test(lines[i]));\n const generationStrategy = generationLine === undefined ? undefined : lines[generationLine].match(/^\\s*generate\\s+(\\w+)/)?.[1];\n const attributeReasons: Record<string, string> = {};\n for (const line of body) {\n const reason = line.match(attributeReasonPattern);\n if (reason && attributeReasons[reason[1]] === undefined) {\n attributeReasons[reason[1]] = reason[2];\n }\n }\n const members = conceptMatch[2] === 'Enum'\n ? body.filter(line => line !== 'validate').map(line => enumerationMemberPattern.exec(line)).filter(match => match !== null)\n : [];\n const enumValues = members.map(member => member[1]);\n const enumNumbers = members.length > 0 && members.every(member => member[2] !== undefined) ? members.map(member => Number(member[2])) : undefined;\n symbols.concepts.push({\n name: conceptMatch[1],\n primitive: conceptMatch[2],\n attributes: conceptMatch[3].trim().split(/\\s+/).filter(Boolean),\n attributeReasons,\n enumValues,\n ...(enumNumbers === undefined ? {} : { enumNumbers }),\n ...(generationStrategy === undefined ? {} : { generationStrategy }),\n line: index,\n });\n continue;\n }\n\n const typeMatch = trimmed.match(/^type\\s+(\\w+)\\s*$/);\n if (typeMatch) {\n symbols.types.push({\n name: typeMatch[1],\n properties: propertiesIn(lines, collectBody(lines, fences, index, indent), clauseKeywords),\n line: index,\n });\n continue;\n }\n\n const policyMatch = trimmed.match(/^policy\\s+(\\w+)\\s*$/);\n if (policyMatch) {\n const requires = collectBody(lines, fences, index, indent)\n .filter((i) => !fences[i])\n .map((i) => lines[i].trim());\n symbols.policies.push({ name: policyMatch[1], requires, line: index });\n continue;\n }\n\n const eventMatch = eventLines[index].trim().match(/^(?:(?:produces|(?<public>public))\\s+)?event\\s+(?<name>\\w+)(?:\\s+generation\\s+(?<generation>\\d+))?(?:\\s+from\\s+(?<origin>\"(?:[^\"\\\\]|\\\\.)*\"))?\\s*$/);\n if (eventMatch) {\n const inline = trimmed.startsWith('produces ');\n const body = directBody(eventLines, eventFences, index, indent);\n // Standalone events distinguish file metadata from properties by path shape.\n const propertyBody = inline ? body : body.filter(line => fileReferenceOn(eventLines[line], line) === undefined);\n symbols.events.push({\n name: eventMatch.groups!.name,\n ...(eventMatch.groups!.generation ? { generation: Number(eventMatch.groups!.generation) } : {}),\n ...(eventMatch.groups!.public || eventMatch.groups!.origin ? { visibility: EventVisibility.Public } : {}),\n ...(eventMatch.groups!.origin ? { origin: unescapeString(eventMatch.groups!.origin.slice(1, -1)) } : {}),\n inline,\n properties: propertiesIn(inline ? eventPropertyLines : eventLines,\n propertyBody, inline ? inlineEventReserved : eventReserved),\n line: index,\n });\n continue;\n }\n\n const command = analysis.commands.get(index);\n if (command) {\n // A command property is a leaf, not an indentation owner. Share the parser-shaped\n // body with properties, productions, advice and destination hints.\n const body = directBody(lines, fences, index, indent);\n const productionHeaders = body.filter(line => /^\\s*produces\\b/.test(lines[line]) && !analysis.operationProductionLines?.has(line));\n symbols.commands.push({\n name: command.name,\n properties: command.properties.map(property => ({\n name: property.name,\n type: `${property.type.name}${property.type.isCollection ? '[]' : ''}${property.type.isOptional ? ' optional' : ''}`,\n typeReference: { name: property.type.name, isCollection: property.type.isCollection, isOptional: property.type.isOptional },\n sourceType: sourceTypeAt(lines[property.type.location.line - 1], property.type.location.column),\n isIdentifier: property.isIdentifier || /\\sidentifier\\s*$/.test(lines[property.location.line - 1]),\n ...(property.isGenerated ? { isGenerated: true } : {}),\n line: property.location.line - 1,\n })),\n response: command.response,\n productionHeaders,\n produces: productionHeaders.flatMap(line => {\n const header = eventLines[line].trim();\n const inline = /^produces\\s+event\\b/.test(header);\n const conditional = /^produces\\s+when\\b/.test(header);\n const eventLine = conditional ? directBody(eventLines, eventFences, line, indentOf(eventLines[line]))[0] : line;\n if (eventLine === undefined) return [];\n const name = conditional ? eventLines[eventLine].trim() : header.match(inline ? /^produces\\s+event\\s+([A-Za-z_]\\w*)(?:\\s+generation\\s+\\d+)?\\s*$/ : /^produces\\s+([A-Z]\\w*)\\s*$/)?.[1];\n if (name === undefined || !/^[A-Za-z_]\\w*$/.test(name)) return [];\n const children = directBody(eventLines, eventFences, eventLine, indentOf(eventLines[eventLine]));\n const targets = children.map(index => eventLines[index].trim().match(/^for(?:\\s+(.*))?$/)).filter(match => match !== null);\n // Empty or repeated targets are uncertain, not implicit destinations.\n const target = targets.length === 0 ? undefined : targets.length === 1 ? targets[0][1] ?? '' : '';\n const mappings = children.flatMap(index => {\n const match = eventLines[index].trim().match(inline ? /^(@?[a-z_]\\w*)\\s+[\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?\\s*=(?!=|>)\\s*(.+)$/ : /^(@?[\\w.]+)\\s*=(?!=|>)\\s*(.+)$/);\n return match === null ? [] : [{ name: match[1].replace(/^@/, ''), source: match[2], line: index }];\n });\n return [{ name, inline, conditional, line, target, mappings }];\n }),\n reads: body.filter((line) => !fences[line])\n .map((line) => ({ line, match: lines[line].match(readPattern) }))\n .filter((entry): entry is { line: number; match: RegExpMatchArray } => entry.match !== null)\n .map(({ line, match }) => ({\n view: match[1],\n ...(match[2] ? { alias: match[2] } : {}),\n ...(match[3] ? { by: match[3] } : {}),\n line,\n })),\n line: index,\n });\n continue;\n }\n\n // The return type shape is the compiler's, dots and all - QueryParser's\n // ^query\\s+([A-Za-z_]\\w*)\\s*=>\\s*(observable\\s+)?([\\w.]+(?:\\[\\])?\\??)$. A narrower one here\n // silently drops the query from the symbol table, and with it every check and completion that\n // reads from it.\n const queryMatch = trimmed.match(/^query\\s+(\\w+)\\s*=>\\s*(?:observable\\s+)?([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)\\s*$/);\n if (queryMatch) {\n // The return type names a read model, which no construct declares — only the\n // 'by' and 'filter' parameters resolve against the document's own types.\n const parameters = collectBody(lines, fences, index, indent)\n .map((i) => ({ index: i, match: lines[i].match(queryParameterPattern) }))\n .filter(\n (entry): entry is { index: number; match: RegExpMatchArray } =>\n entry.match !== null,\n )\n .map(({ index: line, match }) => ({\n name: match[1],\n type: match[2],\n typeReference: typeReferenceSymbol(match[2]),\n sourceType: sourceTypeAt(lines[line], lines[line].match(/^\\s*(?:by|filter)\\s+\\S+\\s+/)![0].length + 1),\n isIdentifier: false,\n line,\n }));\n symbols.queries.push({\n name: queryMatch[1],\n returnType: queryMatch[2],\n returnTypeReference: typeReferenceSymbol(queryMatch[2]),\n parameters,\n line: index,\n });\n continue;\n }\n\n const screenMatch = trimmed.match(/^screen\\s+(\\w+)\\s*$/);\n if (screenMatch) {\n symbols.screens.push({ name: screenMatch[1], line: index });\n continue;\n }\n\n const triggerMatch = trimmed.match(/^trigger\\s+(\\w+)\\s*$/);\n if (triggerMatch && indent === 0) {\n symbols.triggers.push({ name: triggerMatch[1], line: index });\n }\n }\n\n if (symbolRevisions.size >= 16) symbolRevisions.delete(symbolRevisions.keys().next().value!);\n symbolRevisions.set(source, symbols);\n return symbols;\n}\n\n// The symbols of several documents as one - what an application spread over files declares. Lines refer to\n// the document each symbol came from, so the result names things; it does not locate them.\nexport function mergeSymbols(...documents: DocumentSymbols[]): DocumentSymbols {\n return {\n ...(documents.some(document => document.identityDetails?.length) ? { identityDetails: documents.flatMap(document => document.identityDetails ?? []) } : {}),\n authoringSources: documents.flatMap(document => document.authoringSources ?? []),\n ...(documents.some(document => document.authoringDocuments) ? { authoringDocuments: documents.flatMap(document => document.authoringDocuments ?? []) } : {}),\n eventSources: documents.flatMap(document => document.eventSources ?? []),\n imports: documents.flatMap((document) => document.imports),\n concepts: documents.flatMap((document) => document.concepts),\n types: documents.flatMap((document) => document.types),\n policies: documents.flatMap((document) => document.policies),\n events: documents.flatMap((document) => document.events),\n commands: documents.flatMap((document) => document.commands),\n queries: documents.flatMap((document) => document.queries),\n screens: documents.flatMap((document) => document.screens),\n triggers: documents.flatMap((document) => document.triggers),\n };\n}\n\n// Name scans are not physical input documents. Keep the host's authoritative paths separate,\n// and let responseAnalysis replace the current document with this buffer exactly once.\nexport function symbolsForBuffer(lines: string[], application?: DocumentSymbols): DocumentSymbols {\n const path = application?.authoringPath ?? 'current.play';\n const current = application?.authoringDocuments?.find(document => document.path === path);\n return { ...mergeSymbols(scanDocument(lines), application ?? mergeSymbols()),\n authoringDocuments: application?.authoringDocuments,\n authoringPath: path,\n authoringPlacement: application?.authoringPlacement ?? current?.placement,\n authoringPlacementResolved: application?.authoringPlacementResolved ?? current?.isPlacementResolved,\n };\n}\n\nexport function knownEventNames(symbols: DocumentSymbols): string[] {\n return [\n ...symbols.events.map((event) => event.name),\n ...symbols.imports.map((imported) => imported.shortName),\n ];\n}\n\n// The built-in host signals, which have no declaration to scan for because every application has them.\nexport const builtInTriggerNames = ['Startup', 'Shutdown'];\n\n// What a reaction's `when` may name: an event, a declared trigger, or a host signal. The compiler resolves\n// the three in that order, and the editor offers them the same way rather than guessing which was meant.\nexport function knownTriggerNames(symbols: DocumentSymbols): string[] {\n return [\n ...knownEventNames(symbols),\n ...symbols.triggers.map((trigger) => trigger.name),\n ...builtInTriggerNames,\n ];\n}\n\n// Everything a property type reference can resolve to — the primitives, the declared\n// concepts and types, and the short names of the imports.\nexport function knownTypeNames(symbols: DocumentSymbols, primitives: readonly string[]): string[] {\n return [\n ...primitives,\n ...symbols.concepts.map((concept) => concept.name),\n ...symbols.types.map((type) => type.name),\n ...symbols.imports.map((imported) => imported.shortName),\n ];\n}\n"],"mappings":"qnBAgHA,MAAMA,EAAiB,kDACjBC,EAA+B,OAAO,cAAcC,EAAkB,qDAAqD,EAC3HC,EAAkB,2GAClBC,EAAyB,kDACzBC,EAAc,6EACdC,EAAkB,CAAC,YAAa,WAAY,OAAO,EAEnDC,EAA4B,gEAE5BC,EAAgBC,EAChBC,EAAsB,CAAC,MAAO,MAAO,aAAc,SAAU,YAAa,WAAY,cAAe,YAAa,WAAY,UAAU,EACxIC,EACF,8FAKJ,SAAgB,sBAAsB,EAA+C,CACjF,OAAOC,EAAS,eAAiBC,EAAoBD,EAAS,IAAI,CACtE,CAEA,SAAS,aAAa,EAAc,EAAgE,CAChG,IAAME,EAAOC,EAAK,MAAMC,EAAc,CAAC,CAAC,CAAC,MAAM,6DAA6D,CAAC,GAAG,IAAM,GACtH,MAAO,CAAE,OAAM,cAAa,UAAWA,EAAcF,EAAK,MAAO,CACrE,CAEA,SAAS,aAAa,EAAiB,EAAgB,EAA+C,CAClG,OAAOG,EACF,IAAK,IAAW,CAAE,QAAO,MAAOC,EAAMC,EAAM,CAAC,MAAMhB,CAAe,CAAE,EAAE,CAAC,CACvE,OAAQ,GAA+DiB,EAAM,QAAU,IAAI,CAAC,CAC5F,QAAQ,CAAE,WAAYC,EAAM,EAAE,CAAC,WAAW,GAAG,GAAKA,EAAM,KAAO,MAAQ,CAACC,EAAS,SAASD,EAAM,EAAE,CAAC,CAAC,CACpG,KAAK,CAAE,QAAO,YAAa,CACxB,KAAMA,EAAM,EAAE,CAAC,QAAQ,KAAM,EAAE,EAC/B,KAAMA,EAAM,GACZ,cAAeR,EAAoBQ,EAAM,EAAE,EAC3C,WAAY,aAAaH,EAAMC,GAAQD,EAAMC,EAAM,CAAC,MAAM,YAAY,CAAC,CAAE,EAAE,CAAC,OAAS,CAAC,EACtF,aAAcE,EAAM,KAAO,IAAA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AGA,MAAaC,EAAsB,CAAC,UAAW,UAAU,EAIzD,SAAgB,kBAAkB,EAAoC,CAClE,MAAO,CACH,GAAG,gBAAgBlD,CAAO,EAC1B,GAAGA,EAAQ,SAAS,IAAK,GAAYmD,EAAQ,IAAI,EACjD,GAAGD,CACP,CACJ,CAIA,SAAgB,eAAe,EAA0B,EAAyC,CAC9F,MAAO,CACH,GAAGE,EACH,GAAGpD,EAAQ,SAAS,IAAK,GAAYqD,EAAQ,IAAI,EACjD,GAAGrD,EAAQ,MAAM,IAAK,GAASsD,EAAK,IAAI,EACxC,GAAGtD,EAAQ,QAAQ,IAAK,GAAaiD,EAAS,SAAS,CAC3D,CACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/screenplay-language",
3
- "version": "4.249.2",
3
+ "version": "4.250.1",
4
4
  "description": "Monaco language service for the Cratis Screenplay DSL — syntax highlighting, IntelliSense, hover and diagnostics for .play files",
5
5
  "keywords": [
6
6
  "cratis",