@cratis/screenplay-language 4.147.2 → 4.149.0

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.
Files changed (41) hide show
  1. package/dist/ContinuationResponseField.d.ts +7 -0
  2. package/dist/ContinuationResponseField.d.ts.map +1 -0
  3. package/dist/ResponseAnalysis.d.ts +2 -0
  4. package/dist/ResponseAnalysis.d.ts.map +1 -1
  5. package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +1 -1
  6. package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -1
  7. package/dist/bundles/compiler/Files/PlayApplicationAssembly.js +1 -1
  8. package/dist/bundles/compiler/Files/PlayApplicationAssembly.js.map +1 -1
  9. package/dist/bundles/compiler/Parsing/ContinuationValues.js +2 -0
  10. package/dist/bundles/compiler/Parsing/ContinuationValues.js.map +1 -0
  11. package/dist/bundles/compiler/Parsing/InputUses.js +1 -1
  12. package/dist/bundles/compiler/Parsing/InputUses.js.map +1 -1
  13. package/dist/bundles/compiler/Parsing/ParserContext.js +1 -1
  14. package/dist/bundles/compiler/Parsing/ParserContext.js.map +1 -1
  15. package/dist/bundles/compiler/Parsing/ResponseCommandResolver.js +2 -0
  16. package/dist/bundles/compiler/Parsing/ResponseCommandResolver.js.map +1 -0
  17. package/dist/bundles/compiler/Parsing/ResponseValidator.js +1 -1
  18. package/dist/bundles/compiler/Parsing/ResponseValidator.js.map +1 -1
  19. package/dist/bundles/compiler/ScreenplayCompiler.js +1 -1
  20. package/dist/bundles/compiler/ScreenplayCompiler.js.map +1 -1
  21. package/dist/bundles/compiler/index.js +1 -1
  22. package/dist/bundles/completion-planner.js +2 -2
  23. package/dist/bundles/completion-planner.js.map +1 -1
  24. package/dist/bundles/continuation-responses.js +2 -0
  25. package/dist/bundles/continuation-responses.js.map +1 -0
  26. package/dist/bundles/diagnostic-codes.js +1 -1
  27. package/dist/bundles/diagnostic-codes.js.map +1 -1
  28. package/dist/bundles/hover-content.js +5 -5
  29. package/dist/bundles/hover-content.js.map +1 -1
  30. package/dist/bundles/response-analysis.js +6 -6
  31. package/dist/bundles/response-analysis.js.map +1 -1
  32. package/dist/bundles/validation.js +1 -1
  33. package/dist/bundles/validation.js.map +1 -1
  34. package/dist/completion-planner.d.ts.map +1 -1
  35. package/dist/continuation-responses.d.ts +5 -0
  36. package/dist/continuation-responses.d.ts.map +1 -0
  37. package/dist/diagnostic-codes.d.ts +1 -0
  38. package/dist/diagnostic-codes.d.ts.map +1 -1
  39. package/dist/hover-content.d.ts.map +1 -1
  40. package/dist/response-analysis.d.ts.map +1 -1
  41. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostic-codes.js","names":["diagnosticCodes"],"sources":["../../diagnostic-codes.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// The PLAY codes the editor reports. Every one of them mirrors a condition the compiler checks and\n// carries the compiler's own code for it, so the same problem is called the same thing whether it was\n// found by the CLI or by a squiggle - see Documentation/screenplay/diagnostics.md for the catalogue.\n//\n// A code is only ever added here for a condition the compiler can also report. The editor makes a few\n// structural checks the compiler does not - the capture and projection validators are where they live -\n// and those stay codeless deliberately: minting a PLAY number for something no compiler run can emit\n// would make the catalogue describe two different tools.\nexport const diagnosticCodes = {\n repeatedSingularDeclarationAcrossFiles: 'PLAY0172',\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 mixedEnumerationNumbering: 'PLAY0667',\n duplicateEnumerationNumber: 'PLAY0668',\n enumerationNumberOutsideInt32: 'PLAY0669',\n malformedEnumerationNumber: 'PLAY0670',\n unpinnedStoredEnumeration: 'PLAY0671',\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 // Preserve supplied C# whole-model diagnostics; these checks are not yet run by the editor.\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 invalidReadModelKey: 'PLAY0660',\n incompleteReadModelKey: 'PLAY0661',\n invalidReadModelKeyLookup: 'PLAY0662',\n productionRouteOutsideCommand: 'PLAY0663',\n redundantProductionRoute: 'PLAY0664',\n invalidObserverFilter: 'PLAY0665',\n observerFilterExcludesEveryProducer: 'PLAY0666',\n invalidDescription: 'PLAY0145',\n emptyDescription: 'PLAY0146',\n duplicateDescription: 'PLAY0147',\n unknownConceptDirective: 'PLAY0010',\n attributeReasonWithoutAttribute: 'PLAY0012',\n duplicateAttributeReason: 'PLAY0013',\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 duplicateEventSubject: 'PLAY0590',\n invalidSubjectType: 'PLAY0591',\n protectedSubjectType: 'PLAY0592',\n invalidSubjectOwner: 'PLAY0593',\n readModelSubjectNotSupported: 'PLAY0594',\n invalidSubjectModifierOrder: 'PLAY0595',\n // Supplied compiler diagnostics are preserved, even for checks only the C# tool can run.\n // See Documentation/screenplay/editor-diagnostics.md for the validation boundary.\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 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 invalidActionAlternative: 'PLAY0341',\n guardedActionWithoutAlternatives: 'PLAY0342',\n misplacedActionOtherwise: 'PLAY0343',\n unsupportedActionConditionOperand: 'PLAY0344',\n unknownActionSubjectField: 'PLAY0345',\n unresolvedActionSubject: 'PLAY0346',\n unreachableActionAlternative: 'PLAY0347',\n unknownActionArgumentProperty: 'PLAY0348',\n invalidRefusalBranch: 'PLAY0538',\n invalidRefusalBranchBody: 'PLAY0539',\n unreachableRefusalBranch: 'PLAY0540',\n invalidRefusalValue: 'PLAY0541',\n unknownRefusalConstraint: 'PLAY0542',\n unmatchedRedeliveredOccurrence: 'PLAY0543',\n unknownRedeliveryReaction: 'PLAY0544',\n invalidNoEventsExpectation: 'PLAY0545',\n indeterminateNegatedClaimTarget: 'PLAY0546',\n invalidAbsentReadModelStep: 'PLAY0453',\n unknownConstraintProperty: 'PLAY0391',\n invalidSpecificationExample: 'PLAY0518',\n duplicateSpecificationAssignment: 'PLAY0519',\n unknownReadModelProperty: 'PLAY0514',\n piiNotSupportedOnIdentifier: 'PLAY0515',\n invalidEventSourceDeclaration: 'PLAY0503',\n invalidCommandStream: 'PLAY0504',\n invalidSpecificationStream: 'PLAY0547',\n specificationStreamOnCommand: 'PLAY0548',\n invalidSpecificationStreamRoute: 'PLAY0549',\n invalidSpecificationStreamEventSource: 'PLAY0550',\n specificationStreamContradictsCommand: 'PLAY0551',\n ambiguousCommandStream: 'PLAY0505',\n unsupportedStreamIdType: 'PLAY0506',\n redundantSourceStreamId: 'PLAY0507',\n eventFromLaterSlice: 'PLAY0516',\n timelineCycleGroup: 'PLAY0517',\n invalidSpecificationExampleBody: 'PLAY0526',\n undeclaredDependency: 'PLAY0552',\n unusedDependencyDeclaration: 'PLAY0553',\n invalidDependencyTarget: 'PLAY0554',\n repeatedDependencyDeclaration: 'PLAY0555',\n mutualDependencyDeclarations: 'PLAY0556',\n authorizationRefusalWithoutIdentity: 'PLAY0557',\n invalidDocumentation: 'PLAY0558',\n conflictingDocumentationAcrossFiles: 'PLAY0559',\n unsupportedInteractionAlternatives: 'PLAY0560',\n mixedInteractionAlternatives: 'PLAY0561',\n interactionAlternativeWithoutActions: 'PLAY0562',\n inlineInteractionAlternative: 'PLAY0563',\n legacyInteractionWhere: 'PLAY0564',\n ambiguousReference: 'PLAY0198',\n invalidImplementationBlock: 'PLAY0492',\n invalidImplementationHint: 'PLAY0493',\n conflictingImplementationSources: 'PLAY0494',\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 tabIndentation: 'PLAY0006',\n unknownPrimitiveType: 'PLAY0008',\n unknownSliceType: 'PLAY0028',\n duplicateCommandIdentifier: 'PLAY0036',\n unknownContextPath: 'PLAY0153',\n unknownContextCausedByProperty: 'PLAY0154',\n unknownContextIdentityProperty: 'PLAY0155',\n unclosedCodeBlock: 'PLAY0164',\n unknownType: 'PLAY0165',\n unknownEvent: 'PLAY0166',\n unknownPolicy: 'PLAY0167',\n duplicateDeclaration: 'PLAY0168',\n unknownEventContextMember: 'PLAY0295',\n unknownEventContextPath: 'PLAY0296',\n eventContextPathBelowCollection: 'PLAY0297',\n missingEventContextPath: 'PLAY0298',\n unresolvedDynamicKeySource: 'PLAY0299',\n invalidFileImport: 'PLAY0454',\n omittedProductionDestination: 'PLAY0478',\n legacyOptionalSuffix: 'PLAY0479',\n invalidOptionalModifierOrder: 'PLAY0480',\n optionalReadsNotSupported: 'PLAY0481',\n unavailableResponseExecution: 'PLAY0268',\n generatedPropertyOutsideCommand: 'PLAY0482',\n invalidGeneratedType: 'PLAY0483',\n invalidGeneratedModifierOrder: 'PLAY0484',\n generatedPropertyInput: 'PLAY0485',\n invalidCommandResponse: 'PLAY0486',\n invalidResponseSource: 'PLAY0487',\n duplicateResponseField: 'PLAY0488',\n invalidResponseShape: 'PLAY0489',\n invalidGeneratedFixture: 'PLAY0490',\n invalidReturnExpectation: 'PLAY0491',\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} as const;\n\nexport type DiagnosticCode = (typeof diagnosticCodes)[keyof typeof diagnosticCodes];\n"],"mappings":"AAWA,MAAaA,EAAkB,CAC3B,uCAAwC,WACxC,2BAA4B,WAC5B,qBAAsB,WACtB,gBAAiB,WACjB,iBAAkB,WAClB,4BAA6B,WAC7B,4BAA6B,WAC7B,uBAA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BAAwB,WACxB,gCAAiC,WACjC,iBAAkB,WAClB,eAAgB,WAChB,qBAAsB,WACtB,0BAA2B,WAC3B,sBAAuB,WACvB,2BAA4B,WAC5B,0BAA2B,WAC3B,eAAgB,WAChB,qBAAsB,WACtB,iBAAkB,WAClB,2BAA4B,WAC5B,mBAAoB,WACpB,+BAAgC,WAChC,+BAAgC,WAChC,kBAAmB,WACnB,YAAa,WACb,aAAc,WACd,cAAe,WACf,qBAAsB,WACtB,0BAA2B,WAC3B,wBAAyB,WACzB,gCAAiC,WACjC,wBAAyB,WACzB,2BAA4B,WAC5B,kBAAmB,WACnB,6BAA8B,WAC9B,qBAAsB,WACtB,6BAA8B,WAC9B,0BAA2B,WAC3B,6BAA8B,WAC9B,gCAAiC,WACjC,qBAAsB,WACtB,8BAA+B,WAC/B,uBAAwB,WACxB,uBAAwB,WACxB,sBAAuB,WACvB,uBAAwB,WACxB,qBAAsB,WACtB,wBAAyB,WACzB,yBAA0B,WAC1B,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,UACnC"}
1
+ {"version":3,"file":"diagnostic-codes.js","names":["diagnosticCodes"],"sources":["../../diagnostic-codes.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// The PLAY codes the editor reports. Every one of them mirrors a condition the compiler checks and\n// carries the compiler's own code for it, so the same problem is called the same thing whether it was\n// found by the CLI or by a squiggle - see Documentation/screenplay/diagnostics.md for the catalogue.\n//\n// A code is only ever added here for a condition the compiler can also report. The editor makes a few\n// structural checks the compiler does not - the capture and projection validators are where they live -\n// and those stay codeless deliberately: minting a PLAY number for something no compiler run can emit\n// would make the catalogue describe two different tools.\nexport const diagnosticCodes = {\n repeatedSingularDeclarationAcrossFiles: 'PLAY0172',\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 mixedEnumerationNumbering: 'PLAY0667',\n duplicateEnumerationNumber: 'PLAY0668',\n enumerationNumberOutsideInt32: 'PLAY0669',\n malformedEnumerationNumber: 'PLAY0670',\n unpinnedStoredEnumeration: 'PLAY0671',\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 // Preserve supplied C# whole-model diagnostics; these checks are not yet run by the editor.\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 invalidReadModelKey: 'PLAY0660',\n incompleteReadModelKey: 'PLAY0661',\n invalidReadModelKeyLookup: 'PLAY0662',\n productionRouteOutsideCommand: 'PLAY0663',\n redundantProductionRoute: 'PLAY0664',\n invalidObserverFilter: 'PLAY0665',\n observerFilterExcludesEveryProducer: 'PLAY0666',\n invalidDescription: 'PLAY0145',\n emptyDescription: 'PLAY0146',\n duplicateDescription: 'PLAY0147',\n unknownConceptDirective: 'PLAY0010',\n attributeReasonWithoutAttribute: 'PLAY0012',\n duplicateAttributeReason: 'PLAY0013',\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 duplicateEventSubject: 'PLAY0590',\n invalidSubjectType: 'PLAY0591',\n protectedSubjectType: 'PLAY0592',\n invalidSubjectOwner: 'PLAY0593',\n readModelSubjectNotSupported: 'PLAY0594',\n invalidSubjectModifierOrder: 'PLAY0595',\n // Supplied compiler diagnostics are preserved, even for checks only the C# tool can run.\n // See Documentation/screenplay/editor-diagnostics.md for the validation boundary.\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 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 invalidActionAlternative: 'PLAY0341',\n guardedActionWithoutAlternatives: 'PLAY0342',\n misplacedActionOtherwise: 'PLAY0343',\n unsupportedActionConditionOperand: 'PLAY0344',\n unknownActionSubjectField: 'PLAY0345',\n unresolvedActionSubject: 'PLAY0346',\n unreachableActionAlternative: 'PLAY0347',\n unknownActionArgumentProperty: 'PLAY0348',\n invalidRefusalBranch: 'PLAY0538',\n invalidRefusalBranchBody: 'PLAY0539',\n unreachableRefusalBranch: 'PLAY0540',\n invalidRefusalValue: 'PLAY0541',\n unknownRefusalConstraint: 'PLAY0542',\n unmatchedRedeliveredOccurrence: 'PLAY0543',\n unknownRedeliveryReaction: 'PLAY0544',\n invalidNoEventsExpectation: 'PLAY0545',\n indeterminateNegatedClaimTarget: 'PLAY0546',\n invalidAbsentReadModelStep: 'PLAY0453',\n unknownConstraintProperty: 'PLAY0391',\n invalidSpecificationExample: 'PLAY0518',\n duplicateSpecificationAssignment: 'PLAY0519',\n unknownReadModelProperty: 'PLAY0514',\n piiNotSupportedOnIdentifier: 'PLAY0515',\n invalidEventSourceDeclaration: 'PLAY0503',\n invalidCommandStream: 'PLAY0504',\n invalidSpecificationStream: 'PLAY0547',\n specificationStreamOnCommand: 'PLAY0548',\n invalidSpecificationStreamRoute: 'PLAY0549',\n invalidSpecificationStreamEventSource: 'PLAY0550',\n specificationStreamContradictsCommand: 'PLAY0551',\n ambiguousCommandStream: 'PLAY0505',\n unsupportedStreamIdType: 'PLAY0506',\n redundantSourceStreamId: 'PLAY0507',\n eventFromLaterSlice: 'PLAY0516',\n timelineCycleGroup: 'PLAY0517',\n invalidSpecificationExampleBody: 'PLAY0526',\n undeclaredDependency: 'PLAY0552',\n unusedDependencyDeclaration: 'PLAY0553',\n invalidDependencyTarget: 'PLAY0554',\n repeatedDependencyDeclaration: 'PLAY0555',\n mutualDependencyDeclarations: 'PLAY0556',\n authorizationRefusalWithoutIdentity: 'PLAY0557',\n invalidDocumentation: 'PLAY0558',\n conflictingDocumentationAcrossFiles: 'PLAY0559',\n unsupportedInteractionAlternatives: 'PLAY0560',\n mixedInteractionAlternatives: 'PLAY0561',\n interactionAlternativeWithoutActions: 'PLAY0562',\n inlineInteractionAlternative: 'PLAY0563',\n legacyInteractionWhere: 'PLAY0564',\n ambiguousReference: 'PLAY0198',\n invalidImplementationBlock: 'PLAY0492',\n invalidImplementationHint: 'PLAY0493',\n conflictingImplementationSources: 'PLAY0494',\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 tabIndentation: 'PLAY0006',\n unknownPrimitiveType: 'PLAY0008',\n unknownSliceType: 'PLAY0028',\n duplicateCommandIdentifier: 'PLAY0036',\n unknownContextPath: 'PLAY0153',\n unknownContextCausedByProperty: 'PLAY0154',\n unknownContextIdentityProperty: 'PLAY0155',\n unclosedCodeBlock: 'PLAY0164',\n unknownType: 'PLAY0165',\n unknownEvent: 'PLAY0166',\n unknownPolicy: 'PLAY0167',\n duplicateDeclaration: 'PLAY0168',\n unknownEventContextMember: 'PLAY0295',\n unknownEventContextPath: 'PLAY0296',\n eventContextPathBelowCollection: 'PLAY0297',\n missingEventContextPath: 'PLAY0298',\n unresolvedDynamicKeySource: 'PLAY0299',\n invalidFileImport: 'PLAY0454',\n omittedProductionDestination: 'PLAY0478',\n legacyOptionalSuffix: 'PLAY0479',\n invalidOptionalModifierOrder: 'PLAY0480',\n optionalReadsNotSupported: 'PLAY0481',\n unavailableResponseExecution: 'PLAY0268',\n generatedPropertyOutsideCommand: 'PLAY0482',\n invalidGeneratedType: 'PLAY0483',\n invalidGeneratedModifierOrder: 'PLAY0484',\n generatedPropertyInput: 'PLAY0485',\n invalidCommandResponse: 'PLAY0486',\n invalidResponseSource: 'PLAY0487',\n duplicateResponseField: 'PLAY0488',\n invalidResponseShape: 'PLAY0489',\n invalidGeneratedFixture: 'PLAY0490',\n invalidReturnExpectation: 'PLAY0491',\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} as const;\n\nexport type DiagnosticCode = (typeof diagnosticCodes)[keyof typeof diagnosticCodes];\n"],"mappings":"AAWA,MAAaA,EAAkB,CAC3B,uCAAwC,WACxC,2BAA4B,WAC5B,qBAAsB,WACtB,gBAAiB,WACjB,iBAAkB,WAClB,4BAA6B,WAC7B,4BAA6B,WAC7B,uBAAwB,WACxB,yBAA0B,WAC1B,2BAA4B,WAC5B,wBAAyB,WACzB,sBAAuB,WACvB,6BAA8B,WAC9B,6BAA8B,WAC9B,+BAAgC,WAChC,qBAAsB,WACtB,0BAA2B,WAC3B,2BAA4B,WAC5B,8BAA+B,WAC/B,2BAA4B,WAC5B,0BAA2B,WAC3B,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,+BAAgC,WAChC,uBAAwB,WACxB,mBAAoB,WACpB,4BAA6B,WAC7B,4BAA6B,WAE7B,2BAA4B,WAC5B,uCAAwC,WACxC,yBAA0B,WAC1B,2BAA4B,WAC5B,yBAA0B,WAC1B,yBAA0B,WAC1B,2BAA4B,WAC5B,mCAAoC,WACpC,8BAA+B,WAC/B,wBAAyB,WACzB,0BAA2B,WAC3B,sCAAuC,WACvC,sCAAuC,WACvC,2BAA4B,WAC5B,oBAAqB,WACrB,uBAAwB,WACxB,0BAA2B,WAC3B,8BAA+B,WAC/B,yBAA0B,WAC1B,sBAAuB,WACvB,o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AA2B,UAC/B"}
@@ -1,6 +1,6 @@
1
- import"./_virtual/_virtual/_rolldown/runtime.js";import{typeReferenceText as e}from"./TypeReferenceSymbol.js";import{enclosingChain as t,enclosingHeaders as n,fenceMap as r,indentOf as i,withoutComment as a}from"./document-context.js";import{eventAnalysisSource as o}from"./event-analysis-source.js";import{responseAnalysis as s,responseAvailability as c}from"./response-analysis.js";import{directBody as l,propertyTypeReference as u,scanDocument as d,symbolsForBuffer as ee}from"./symbols.js";import{exampleHover as te}from"./example-authoring.js";import{operationHover as f}from"./operation-authoring.js";import{eventSourceHover as ne}from"./event-source-authoring.js";import{refusalContext as p}from"./refusal-context.js";import{namedRuleContext as m}from"./named-rule-context.js";import{getSubLanguage as h}from"./sub-language-registry.js";import{reactionReferenceAt as g}from"./reaction-authoring.js";import{attributeDocs as _,contextVariableDocs as v,handlerIntentDocs as y,keywordDocs as b,specialCategoryDocs as x,specificationKeywordDocs as S}from"./keyword-docs.js";function hoverContent(C,w,T,E,D,O){let k=r(C);if(k[w])return null;let A=C[w]??``;if(D-1>a(A).length)return null;let j=!1,M=!1;for(let e=0;e<E-1;e++)A[e]===`\\`&&j?e++:A[e]===`"`&&!M?j=!j:A[e]==="`"&&!j&&(M=!M);if(j||M)return null;let N=g(C,w,E,D,O);if(N)return N.content;let P=te(C,w,E,D,O);if(P)return P;let F=ne(C,w,E,D,O);if(F)return F;let I=f(C,w,E,D,O);if(I)return I;let tokenAt=(e,t)=>{let n=e+ +(A[e-1]===`@`);return T===t&&E===n&&D===n+t.length&&A.slice(n-1,D-1)===t},L=A.charAt(E-2);if(T===`authorization`&&t(C,k,w,i(A))[0]===`purpose`)return`A quoted authorization in law for criminal-offence data (Art. 10).`;if(t(C,k,w,i(A))[0]===`concept`&&/^\s*generate\b/.test(A)){let e={generate:`The concept declares how; a command property declares generated. ESM v15 checks fixture shape and guards generated event sources against existing facts.`,uuid:`Random UUID v4, 122 random bits; about 3.27 × 10^17 values at 1% collision probability.`,uuidv7:`Time-ordered UUID v7, 74 random bits; about 1.95 × 10^10 values at 1% collision probability. Exposes time; not monotonic within a millisecond.`,ulid:`26 Crockford base32 characters (uppercase by default), 80 random bits; about 1.56 × 10^11 values at 1% collision probability.`,typeid:`TypeID 0.3: lowercase UUIDv7 base32 with a 0..63-character prefix. 74 random bits; empty prefix has no separator.`,nanoid:`Default 21 characters over 64 symbols: 126 random bits. Custom entropy = size × log2(alphabet size).`,bytes:`8 × count random bits; base64url, hex or base32 without padding. RFC 4648 unused trailing bits must be zero.`,prefix:`Printable ASCII prefix, at most 32 characters. UUID prefixes require a String concept; TypeID uses its own argument.`,alphabet:`NanoID only: 2..256 distinct printable ASCII characters.`,case:`lower or upper for String UUIDs, ULID, hex/base32 bytes. Never base64url, NanoID or TypeID.`,pattern:`Parsed, not yet executable (#616 phase 3).`,random:`Parsed, not yet executable (#616 phase 3).`,rule:`Parsed, not yet executable (#616 phase 3).`,sequence:`Reserved; binding refuses it until #619 is admitted.`};if(e[T])return e[T]}let R=/^\s*concept\s+[^\s:]+\s*:\s*\w+\s+/.exec(A),z=t(C,k,w,i(A))[0]===`concept`&&/^\s*(?:@?pii|personal|@?sensitive|secret)\s+(?:reason|scope|special|criminal)\b/.test(A);if(R!==null&&E-1>=R[0].length-1||z){let e=_[T];if(e)return e;if(Object.hasOwn(x,T)&&/^\s*(?:@?pii|personal)\s+special\s+/.test(A))return`**${T}** — ${x[T]}`;if(T===`special`)return`GDPR Art. 9(1) special category; requires pii. At most one category per concept.`;if(T===`criminal`)return`Personal data relating to criminal convictions and offenses (GDPR Art. 10); requires pii.`;if(/^\s*(?:secret|sensitive|@sensitive)\s+scope\s+/.test(A)&&[`subject`,`namespace`,`global`].includes(T))return`**${T}** — Secret encryption scope${T===`subject`?` per data subject`:T===`namespace`?` per tenant namespace`:` shared globally`}. Not an event-property subject role.`;if(T===`scope`)return`Secret encryption scope: subject, namespace or global. Omitted scope keeps Chronicle’s Subject default; pii secret renders only [PII].`}if(L===`$`||L===`.`){let e=A.substring(0,D-1).match(/\$[\w.]*$/)?.[0];if(e){if(e.startsWith(`$refusal`)){let t=p(C,w,i(A)),n=e.substring(9),r={reason:`Refusal kind as a String: validation, constraint or authorization.`,message:`Rejection details verbatim, including unresolved $strings keys.`,constraint:`Violated constraint name as a String, only in a by constraint branch.`};return t!==void 0&&r[n]!==void 0?`**${e}** — ${r[n]} Syntax-only, not yet executable (PLAY0268).`:null}if(e.startsWith(`$identity.`)){let t=e.substring(10).split(`.`)[0],n=ee(C,O).identityDetails?.find(e=>e.name===t);if(n)return`**$identity.${n.name}** — ${n.type}. Declared caller detail; authoring metadata only, not executable until admitted (#600).`}let t=v[e]??(e.startsWith(`$env`)?v.$env:void 0);if(t)return t}}let B=A.slice(0,E-1),V=/^\s*(?:by|filter)\s+/.test(B)?/^\s*(?:by|filter)\s+[a-z_]\w*\s+[\w.]+(?:\[\])?\s+$/.test(B):/^\s*@?[a-z_]\w*\s+[\w.]+(?:\[\])?\s+$/.test(B),re=/^\s*query\s+\w+\s*=>\s*(?:observable\s+)?[\w.]+(?:\[\])?\s+$/.test(B)&&!/^\s*query\s+\w+\s*=>\s*observable\s+$/.test(B);if(T===`subject`){let e=o(C),r=/^\s*@?[a-z_]\w*\s+[\w.]+(?:\[\])?(?:\?|\s+optional)?(?:\s+generated)?(?:\s+identifier)?\s+$/.test(B),a=t(e,k,w,i(A));return r&&(a[0]===`event`||/^produces\s+event\s+/.test(n(e,k,w,i(A))[0]??``))?`**subject** — This event property identifies its one data subject instead of the event source (decision 0008). Required scalar String, Uuid or their concepts, or an Int-backed concept; never pii or secret. Report-only lineage metadata (PLAY0270); no ESM bytes or provider output yet.`:/\bclaim\s+"(?:[^"\\]|\\.)*"\s+matches\s+$/.test(B)&&a.includes(`policy`)?`**subject** — ${b.subject}`:null}if(T===`optional`&&(V||re))return`**optional** — ${b.optional}`;if(T===`implementation`||T===`hint`){let e=t(C,k,w,i(A)),n=m(C,w,i(A));if(T===`implementation`&&n===`rule`&&/^\s*implementation\s*$/.test(a(A))||T===`hint`&&n===`implementation`&&/^\s*hint\s+"/.test(A))return`**${T}** — Command named-rule guidance with at most one file or tagged fence. No payload means pending and fails binding (PLAY0268). Attached predicates keep their existing pure RuleContext contract; reference execution is unsupported, never confirmation.`;if(T===`implementation`&&e[0]===`handler`&&/^\s*implementation\s*$/.test(a(A)))return`**implementation** — ${y.implementation}`;if(T===`hint`&&e[0]===`implementation`&&e[1]===`handler`&&/^\s*hint\s+"/.test(A))return`**hint** — ${y.hint}`}let H=d(C),U=H.commands.filter(e=>e.line<w).at(-1),W=U?.properties.find(e=>e.name===T&&e.line===w);if(W?.isGenerated||T===`generated`&&U?.properties.some(e=>e.isGenerated&&e.line===w)&&V)return`**${W?.name??`generated`}** — ${W?e(u(W))+`. `:``}Generated value, not a request or form input. ${c}`;let G=U?.response;if(G?.location.line===w+1&&(tokenAt(G.location.column,`returns`)||G.kind===`ScalarCommandResponseSyntax`&&tokenAt(G.source.location.column,G.source.property))){let t=G.kind===`ScalarCommandResponseSyntax`?U?.properties.find(e=>e.name===G.source.property):void 0;return`**returns**${t?` — ${e(u(t))}`:` — unnamed record response`}. ${c}`}if(G?.kind===`RecordCommandResponseSyntax`){let t=G.fields.find(e=>e.location.line===w+1&&(tokenAt(e.location.column,e.name)||tokenAt(e.source.location.column,e.source.property)));if(t){let n=U?.properties.find(e=>e.name===t.source.property),r=t.type?e(t.type):n?e(u(n)):`Unresolved type`;return`**${t.name}** — ${r}${t.type?` (explicit)`:` (inferred)`} = ${t.source.property}. ${n?.isGenerated?`Generated source, not request input. `:``}${c}`}}for(let e of s(C).specifications.values())if(T===`returns`&&e.thenReturns?.location.line===w+1||T===`generated`&&e.when?.generatedValues?.some(e=>e.location.line===w+1))return c;let K=H.concepts.find(e=>e.name===T);if(K){let e=K.attributes.length?` ${K.attributes.join(` `)}`:``,t=K.enumValues.length?`\n\nValues: ${K.enumValues.map((e,t)=>K.enumNumbers===void 0?e:`${e} = ${K.enumNumbers[t]}`).join(`, `)}`:``,n=Object.entries(K.attributeReasons).map(([e,t])=>`\n\n**@${e}** — ${t}`).join(``);return`\`\`\`screenplay\nconcept ${K.name} : ${K.primitive}${e}\n\`\`\`${n}${t}`}let q=H.types.find(e=>e.name===T);if(q){let t=q.properties.map(t=>`${t.name} ${e(u(t))}`).join(`
2
- `);return`\`\`\`screenplay\ntype ${q.name}\n${t}\n\`\`\``}let J=H.policies.find(e=>e.name===T);if(J){let e=J.requires.length?J.requires.join(`
3
- `):`(custom C#)`;return`\`\`\`screenplay\npolicy ${J.name}\n${e}\n\`\`\``}let Y=H.events.find(e=>e.name===T&&e.line===w)??H.events.filter(e=>e.name===T).sort((e,t)=>(t.generation??1)-(e.generation??1))[0];if(Y){let t=Y.properties.map(t=>`${t.name} ${e(u(t))}${t.isSubject?` subject`:``}`).join(`
4
- `);return`\`\`\`screenplay\n${Y.visibility===`Public`?`public `:``}event ${Y.name}${Y.generation===void 0?``:` generation ${Y.generation}`}${Y.origin===void 0?``:` from ${JSON.stringify(Y.origin)}`}\n${t}\n\`\`\``}let X=H.commands.find(e=>e.name===T);if(X&&X.properties.length>0){let t=X.properties.map(t=>`${t.name} ${e(u(t))}${t.isGenerated?` generated`:``}${t.isIdentifier?` identifier`:``}`).join(`
5
- `);return`\`\`\`screenplay\ncommand ${X.name}\n${t}\n\`\`\`${X.response||X.properties.some(e=>e.isGenerated)?`\n\n${c}`:``}`}let Z=t(C,k,w,i(A));for(let e of[A.trim().split(/\s+/)[0],...Z]){let t=h(e??``)?.hovers?.[T];if(t)return t}if(T===`reads`&&(Z[0]===`every`||Z[0]===`at`)&&Z.includes(`reaction`))return"**reads** — Declares a whole view this clock trigger consults: `reads <View>`. Clock triggers take no values, so `by` is unavailable.";let Q=A.trim().match(/^(given|when|then)\s+(?:no\s+)?(\w+)/);if(Q&&Q[2]===T&&Z[0]===`specification`&&S[T])return`**${T}** — ${S[T]}`;if(T===`id`||T===`documentation`){let e=o(C),t=H.events.some(t=>l(e,k,t.line,i(e[t.line])).includes(w)),n=T===`id`?/^\s*id\s+"/.test(e[w]):/^\s*documentation\s*$/.test(e[w]);if(!(t||T===`documentation`&&[`module`,`feature`,`slice`,`command`,`readmodel`,`reaction`].includes(Z[0]))||!n||E!==i(A)+1)return null}if(T===`optional`||T===`generated`||T===`returns`)return null;let $=b[T];return $?`**${T}** — ${$}`:null}export{hoverContent};
1
+ import"./_virtual/_virtual/_rolldown/runtime.js";import{typeReferenceText as e}from"./TypeReferenceSymbol.js";import{enclosingChain as t,enclosingHeaders as n,fenceMap as r,indentOf as i,withoutComment as a}from"./document-context.js";import{eventAnalysisSource as o}from"./event-analysis-source.js";import{responseAnalysis as ee,responseAvailability as s}from"./response-analysis.js";import{directBody as c,propertyTypeReference as l,scanDocument as te,symbolsForBuffer as u}from"./symbols.js";import{exampleHover as d}from"./example-authoring.js";import{operationHover as f}from"./operation-authoring.js";import{eventSourceHover as p}from"./event-source-authoring.js";import{refusalContext as m}from"./refusal-context.js";import{namedRuleContext as h}from"./named-rule-context.js";import{continuationResponseHover as ne}from"./continuation-responses.js";import{getSubLanguage as re}from"./sub-language-registry.js";import{reactionReferenceAt as ie}from"./reaction-authoring.js";import{attributeDocs as ae,contextVariableDocs as g,handlerIntentDocs as _,keywordDocs as v,specialCategoryDocs as y,specificationKeywordDocs as b}from"./keyword-docs.js";function hoverContent(x,S,C,w,T,E){let D=r(x);if(D[S])return null;let O=x[S]??``;if(T-1>a(O).length)return null;let k=!1,A=!1;for(let e=0;e<w-1;e++)O[e]===`\\`&&k?e++:O[e]===`"`&&!A?k=!k:O[e]==="`"&&!k&&(A=!A);if(k||A)return null;let j=ne(x,S,C,w,T,E);if(j)return j;let M=ie(x,S,w,T,E);if(M)return M.content;let N=d(x,S,w,T,E);if(N)return N;let P=p(x,S,w,T,E);if(P)return P;let F=f(x,S,w,T,E);if(F)return F;let tokenAt=(e,t)=>{let n=e+ +(O[e-1]===`@`);return C===t&&w===n&&T===n+t.length&&O.slice(n-1,T-1)===t},I=O.charAt(w-2);if(C===`authorization`&&t(x,D,S,i(O))[0]===`purpose`)return`A quoted authorization in law for criminal-offence data (Art. 10).`;if(t(x,D,S,i(O))[0]===`concept`&&/^\s*generate\b/.test(O)){let e={generate:`The concept declares how; a command property declares generated. ESM v15 checks fixture shape and guards generated event sources against existing facts.`,uuid:`Random UUID v4, 122 random bits; about 3.27 × 10^17 values at 1% collision probability.`,uuidv7:`Time-ordered UUID v7, 74 random bits; about 1.95 × 10^10 values at 1% collision probability. Exposes time; not monotonic within a millisecond.`,ulid:`26 Crockford base32 characters (uppercase by default), 80 random bits; about 1.56 × 10^11 values at 1% collision probability.`,typeid:`TypeID 0.3: lowercase UUIDv7 base32 with a 0..63-character prefix. 74 random bits; empty prefix has no separator.`,nanoid:`Default 21 characters over 64 symbols: 126 random bits. Custom entropy = size × log2(alphabet size).`,bytes:`8 × count random bits; base64url, hex or base32 without padding. RFC 4648 unused trailing bits must be zero.`,prefix:`Printable ASCII prefix, at most 32 characters. UUID prefixes require a String concept; TypeID uses its own argument.`,alphabet:`NanoID only: 2..256 distinct printable ASCII characters.`,case:`lower or upper for String UUIDs, ULID, hex/base32 bytes. Never base64url, NanoID or TypeID.`,pattern:`Parsed, not yet executable (#616 phase 3).`,random:`Parsed, not yet executable (#616 phase 3).`,rule:`Parsed, not yet executable (#616 phase 3).`,sequence:`Reserved; binding refuses it until #619 is admitted.`};if(e[C])return e[C]}let L=/^\s*concept\s+[^\s:]+\s*:\s*\w+\s+/.exec(O),R=t(x,D,S,i(O))[0]===`concept`&&/^\s*(?:@?pii|personal|@?sensitive|secret)\s+(?:reason|scope|special|criminal)\b/.test(O);if(L!==null&&w-1>=L[0].length-1||R){let e=ae[C];if(e)return e;if(Object.hasOwn(y,C)&&/^\s*(?:@?pii|personal)\s+special\s+/.test(O))return`**${C}** — ${y[C]}`;if(C===`special`)return`GDPR Art. 9(1) special category; requires pii. At most one category per concept.`;if(C===`criminal`)return`Personal data relating to criminal convictions and offenses (GDPR Art. 10); requires pii.`;if(/^\s*(?:secret|sensitive|@sensitive)\s+scope\s+/.test(O)&&[`subject`,`namespace`,`global`].includes(C))return`**${C}** — Secret encryption scope${C===`subject`?` per data subject`:C===`namespace`?` per tenant namespace`:` shared globally`}. Not an event-property subject role.`;if(C===`scope`)return`Secret encryption scope: subject, namespace or global. Omitted scope keeps Chronicle’s Subject default; pii secret renders only [PII].`}if(I===`$`||I===`.`){let e=O.substring(0,T-1).match(/\$[\w.]*$/)?.[0];if(e){if(e.startsWith(`$refusal`)){let t=m(x,S,i(O)),n=e.substring(9),r={reason:`Refusal kind as a String: validation, constraint or authorization.`,message:`Rejection details verbatim, including unresolved $strings keys.`,constraint:`Violated constraint name as a String, only in a by constraint branch.`};return t!==void 0&&r[n]!==void 0?`**${e}** — ${r[n]} Syntax-only, not yet executable (PLAY0268).`:null}if(e.startsWith(`$identity.`)){let t=e.substring(10).split(`.`)[0],n=u(x,E).identityDetails?.find(e=>e.name===t);if(n)return`**$identity.${n.name}** — ${n.type}. Declared caller detail; authoring metadata only, not executable until admitted (#600).`}let t=g[e]??(e.startsWith(`$env`)?g.$env:void 0);if(t)return t}}let z=O.slice(0,w-1),B=/^\s*(?:by|filter)\s+/.test(z)?/^\s*(?:by|filter)\s+[a-z_]\w*\s+[\w.]+(?:\[\])?\s+$/.test(z):/^\s*@?[a-z_]\w*\s+[\w.]+(?:\[\])?\s+$/.test(z),V=/^\s*query\s+\w+\s*=>\s*(?:observable\s+)?[\w.]+(?:\[\])?\s+$/.test(z)&&!/^\s*query\s+\w+\s*=>\s*observable\s+$/.test(z);if(C===`subject`){let e=o(x),r=/^\s*@?[a-z_]\w*\s+[\w.]+(?:\[\])?(?:\?|\s+optional)?(?:\s+generated)?(?:\s+identifier)?\s+$/.test(z),a=t(e,D,S,i(O));return r&&(a[0]===`event`||/^produces\s+event\s+/.test(n(e,D,S,i(O))[0]??``))?`**subject** — This event property identifies its one data subject instead of the event source (decision 0008). Required scalar String, Uuid or their concepts, or an Int-backed concept; never pii or secret. Report-only lineage metadata (PLAY0270); no ESM bytes or provider output yet.`:/\bclaim\s+"(?:[^"\\]|\\.)*"\s+matches\s+$/.test(z)&&a.includes(`policy`)?`**subject** — ${v.subject}`:null}if(C===`optional`&&(B||V))return`**optional** — ${v.optional}`;if(C===`implementation`||C===`hint`){let e=t(x,D,S,i(O)),n=h(x,S,i(O));if(C===`implementation`&&n===`rule`&&/^\s*implementation\s*$/.test(a(O))||C===`hint`&&n===`implementation`&&/^\s*hint\s+"/.test(O))return`**${C}** — Command named-rule guidance with at most one file or tagged fence. No payload means pending and fails binding (PLAY0268). Attached predicates keep their existing pure RuleContext contract; reference execution is unsupported, never confirmation.`;if(C===`implementation`&&e[0]===`handler`&&/^\s*implementation\s*$/.test(a(O)))return`**implementation** — ${_.implementation}`;if(C===`hint`&&e[0]===`implementation`&&e[1]===`handler`&&/^\s*hint\s+"/.test(O))return`**hint** — ${_.hint}`}let H=te(x),U=H.commands.filter(e=>e.line<S).at(-1),W=U?.properties.find(e=>e.name===C&&e.line===S);if(W?.isGenerated||C===`generated`&&U?.properties.some(e=>e.isGenerated&&e.line===S)&&B)return`**${W?.name??`generated`}** — ${W?e(l(W))+`. `:``}Generated value, not a request or form input. ${s}`;let G=U?.response;if(G?.location.line===S+1&&(tokenAt(G.location.column,`returns`)||G.kind===`ScalarCommandResponseSyntax`&&tokenAt(G.source.location.column,G.source.property))){let t=G.kind===`ScalarCommandResponseSyntax`?U?.properties.find(e=>e.name===G.source.property):void 0;return`**returns**${t?` — ${e(l(t))}`:` — unnamed record response`}. ${s}`}if(G?.kind===`RecordCommandResponseSyntax`){let t=G.fields.find(e=>e.location.line===S+1&&(tokenAt(e.location.column,e.name)||tokenAt(e.source.location.column,e.source.property)));if(t){let n=U?.properties.find(e=>e.name===t.source.property),r=t.type?e(t.type):n?e(l(n)):`Unresolved type`;return`**${t.name}** — ${r}${t.type?` (explicit)`:` (inferred)`} = ${t.source.property}. ${n?.isGenerated?`Generated source, not request input. `:``}${s}`}}for(let e of ee(x).specifications.values())if(C===`returns`&&e.thenReturns?.location.line===S+1||C===`generated`&&e.when?.generatedValues?.some(e=>e.location.line===S+1))return s;let K=H.concepts.find(e=>e.name===C);if(K){let e=K.attributes.length?` ${K.attributes.join(` `)}`:``,t=K.enumValues.length?`\n\nValues: ${K.enumValues.map((e,t)=>K.enumNumbers===void 0?e:`${e} = ${K.enumNumbers[t]}`).join(`, `)}`:``,n=Object.entries(K.attributeReasons).map(([e,t])=>`\n\n**@${e}** — ${t}`).join(``);return`\`\`\`screenplay\nconcept ${K.name} : ${K.primitive}${e}\n\`\`\`${n}${t}`}let q=H.types.find(e=>e.name===C);if(q){let t=q.properties.map(t=>`${t.name} ${e(l(t))}`).join(`
2
+ `);return`\`\`\`screenplay\ntype ${q.name}\n${t}\n\`\`\``}let J=H.policies.find(e=>e.name===C);if(J){let e=J.requires.length?J.requires.join(`
3
+ `):`(custom C#)`;return`\`\`\`screenplay\npolicy ${J.name}\n${e}\n\`\`\``}let Y=H.events.find(e=>e.name===C&&e.line===S)??H.events.filter(e=>e.name===C).sort((e,t)=>(t.generation??1)-(e.generation??1))[0];if(Y){let t=Y.properties.map(t=>`${t.name} ${e(l(t))}${t.isSubject?` subject`:``}`).join(`
4
+ `);return`\`\`\`screenplay\n${Y.visibility===`Public`?`public `:``}event ${Y.name}${Y.generation===void 0?``:` generation ${Y.generation}`}${Y.origin===void 0?``:` from ${JSON.stringify(Y.origin)}`}\n${t}\n\`\`\``}let X=H.commands.find(e=>e.name===C);if(X&&X.properties.length>0){let t=X.properties.map(t=>`${t.name} ${e(l(t))}${t.isGenerated?` generated`:``}${t.isIdentifier?` identifier`:``}`).join(`
5
+ `);return`\`\`\`screenplay\ncommand ${X.name}\n${t}\n\`\`\`${X.response||X.properties.some(e=>e.isGenerated)?`\n\n${s}`:``}`}let Z=t(x,D,S,i(O));for(let e of[O.trim().split(/\s+/)[0],...Z]){let t=re(e??``)?.hovers?.[C];if(t)return t}if(C===`reads`&&(Z[0]===`every`||Z[0]===`at`)&&Z.includes(`reaction`))return"**reads** — Declares a whole view this clock trigger consults: `reads <View>`. Clock triggers take no values, so `by` is unavailable.";let Q=O.trim().match(/^(given|when|then)\s+(?:no\s+)?(\w+)/);if(Q&&Q[2]===C&&Z[0]===`specification`&&b[C])return`**${C}** — ${b[C]}`;if(C===`id`||C===`documentation`){let e=o(x),t=H.events.some(t=>c(e,D,t.line,i(e[t.line])).includes(S)),n=C===`id`?/^\s*id\s+"/.test(e[S]):/^\s*documentation\s*$/.test(e[S]);if(!(t||C===`documentation`&&[`module`,`feature`,`slice`,`command`,`readmodel`,`reaction`].includes(Z[0]))||!n||w!==i(O)+1)return null}if(C===`optional`||C===`generated`||C===`returns`)return null;let $=v[C];return $?`**${C}** — ${$}`:null}export{hoverContent};
6
6
  //# sourceMappingURL=hover-content.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hover-content.js","names":["fences","fenceMap","lines","lineIndex","line","endColumn","withoutComment","inString","inTemplate","index","startColumn","reaction","reactionReferenceAt","application","fixtureHover","exampleHover","sourceHover","eventSourceHover","operation","operationHover","start","column","word","name","before","enclosingChain","indentOf","generationDocs","complianceHeader","complianceBody","doc","attributeDocs","specialCategoryDocs","variable","branch","refusalContext","member","descriptions","detail","symbolsForBuffer","contextVariableDocs","\"$env\"","prefix","followsPropertyType","followsQueryType","source","eventAnalysisSource","subjectPrefix","ownerChain","enclosingHeaders","keywordDocs","chain","ruleContext","namedRuleContext","handlerIntentDocs","symbols","scanDocument","owner","command","property","typeReferenceText","propertyTypeReference","responseAvailability","response","field","type","specification","responseAnalysis","value","concept","candidate","attributes","values","reasons","attribute","reason","properties","policy","body","event","right","left","construct","getSubLanguage","step","specificationKeywordDocs","inEvent","directBody","directive","keywordDoc"],"sources":["../../hover-content.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { reactionReferenceAt } from './reaction-authoring';\nimport { refusalContext } from './refusal-context';\nimport { namedRuleContext } from './named-rule-context';\nimport { eventSourceHover } from './event-source-authoring';\nimport { exampleHover } from './example-authoring';\nimport { operationHover } from './operation-authoring';\nimport { DocumentSymbols, symbolsForBuffer } from './symbols';\nimport { responseAnalysis, responseAvailability } from './response-analysis';\nimport { enclosingChain, enclosingHeaders, fenceMap, indentOf, withoutComment } from './document-context';\nimport { directBody, propertyTypeReference, scanDocument } from './symbols';\nimport { typeReferenceText } from './TypeReferenceSymbol';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { getSubLanguage } from './sub-language-registry';\nimport { attributeDocs, contextVariableDocs, handlerIntentDocs, keywordDocs, specialCategoryDocs, specificationKeywordDocs } from './keyword-docs';\n\n// Produces the hover markdown for a word at a position, without any editor\n// dependency — the Monaco service and the VSCode extension share this content.\n// Columns are 1-based, matching both editors' word-at-position APIs.\nexport function hoverContent(\n lines: string[],\n lineIndex: number,\n word: string,\n startColumn: number,\n endColumn: number,\n application?: DocumentSymbols,\n): string | null {\n const fences = fenceMap(lines);\n if (fences[lineIndex]) return null;\n\n const line = lines[lineIndex] ?? '';\n if (endColumn - 1 > withoutComment(line).length) return null;\n let inString = false;\n let inTemplate = false;\n for (let index = 0; index < startColumn - 1; index++) {\n if (line[index] === '\\\\' && inString) index++;\n else if (line[index] === '\"' && !inTemplate) inString = !inString;\n else if (line[index] === '`' && !inString) inTemplate = !inTemplate;\n }\n if (inString || inTemplate) return null;\n const reaction = reactionReferenceAt(lines, lineIndex, startColumn, endColumn, application);\n if (reaction) return reaction.content;\n const fixtureHover = exampleHover(lines, lineIndex, startColumn, endColumn, application);\n if (fixtureHover) return fixtureHover;\n const sourceHover = eventSourceHover(lines, lineIndex, startColumn, endColumn, application);\n if (sourceHover) return sourceHover;\n const operation = operationHover(lines, lineIndex, startColumn, endColumn, application);\n if (operation) return operation;\n const tokenAt = (column: number, name: string): boolean => {\n const start = column + (line[column - 1] === '@' ? 1 : 0);\n return word === name && startColumn === start && endColumn === start + name.length && line.slice(start - 1, endColumn - 1) === name;\n };\n const before = line.charAt(startColumn - 2);\n if (word === 'authorization' && enclosingChain(lines, fences, lineIndex, indentOf(line))[0] === 'purpose') return 'A quoted authorization in law for criminal-offence data (Art. 10).';\n\n if (enclosingChain(lines, fences, lineIndex, indentOf(line))[0] === 'concept' && /^\\s*generate\\b/.test(line)) {\n const generationDocs: Record<string, string> = {\n generate: 'The concept declares how; a command property declares generated. ESM v15 checks fixture shape and guards generated event sources against existing facts.',\n uuid: 'Random UUID v4, 122 random bits; about 3.27 × 10^17 values at 1% collision probability.',\n uuidv7: 'Time-ordered UUID v7, 74 random bits; about 1.95 × 10^10 values at 1% collision probability. Exposes time; not monotonic within a millisecond.',\n ulid: '26 Crockford base32 characters (uppercase by default), 80 random bits; about 1.56 × 10^11 values at 1% collision probability.',\n typeid: 'TypeID 0.3: lowercase UUIDv7 base32 with a 0..63-character prefix. 74 random bits; empty prefix has no separator.',\n nanoid: 'Default 21 characters over 64 symbols: 126 random bits. Custom entropy = size × log2(alphabet size).',\n bytes: '8 × count random bits; base64url, hex or base32 without padding. RFC 4648 unused trailing bits must be zero.',\n prefix: 'Printable ASCII prefix, at most 32 characters. UUID prefixes require a String concept; TypeID uses its own argument.',\n alphabet: 'NanoID only: 2..256 distinct printable ASCII characters.',\n case: 'lower or upper for String UUIDs, ULID, hex/base32 bytes. Never base64url, NanoID or TypeID.',\n pattern: 'Parsed, not yet executable (#616 phase 3).', random: 'Parsed, not yet executable (#616 phase 3).', rule: 'Parsed, not yet executable (#616 phase 3).', sequence: 'Reserved; binding refuses it until #619 is admitted.',\n };\n if (generationDocs[word]) return generationDocs[word];\n }\n\n const complianceHeader = /^\\s*concept\\s+[^\\s:]+\\s*:\\s*\\w+\\s+/.exec(line);\n const complianceBody = enclosingChain(lines, fences, lineIndex, indentOf(line))[0] === 'concept' && /^\\s*(?:@?pii|personal|@?sensitive|secret)\\s+(?:reason|scope|special|criminal)\\b/.test(line);\n if ((complianceHeader !== null && startColumn - 1 >= complianceHeader[0].length - 1) || complianceBody) {\n const doc = attributeDocs[word];\n if (doc) return doc;\n if (Object.hasOwn(specialCategoryDocs, word) && /^\\s*(?:@?pii|personal)\\s+special\\s+/.test(line)) return `**${word}** — ${specialCategoryDocs[word]}`;\n if (word === 'special') return 'GDPR Art. 9(1) special category; requires pii. At most one category per concept.';\n if (word === 'criminal') return 'Personal data relating to criminal convictions and offenses (GDPR Art. 10); requires pii.';\n if (/^\\s*(?:secret|sensitive|@sensitive)\\s+scope\\s+/.test(line) && ['subject', 'namespace', 'global'].includes(word)) return `**${word}** — Secret encryption scope${word === 'subject' ? ' per data subject' : word === 'namespace' ? ' per tenant namespace' : ' shared globally'}. Not an event-property subject role.`;\n if (word === 'scope') return 'Secret encryption scope: subject, namespace or global. Omitted scope keeps Chronicle’s Subject default; pii secret renders only [PII].';\n }\n if (before === '$' || before === '.') {\n const variable = line.substring(0, endColumn - 1).match(/\\$[\\w.]*$/)?.[0];\n if (variable) {\n if (variable.startsWith('$refusal')) {\n const branch = refusalContext(lines, lineIndex, indentOf(line));\n const member = variable.substring('$refusal.'.length);\n const descriptions: Record<string, string> = { reason: 'Refusal kind as a String: validation, constraint or authorization.', message: 'Rejection details verbatim, including unresolved $strings keys.', constraint: 'Violated constraint name as a String, only in a by constraint branch.' };\n return branch !== undefined && descriptions[member] !== undefined ? `**${variable}** — ${descriptions[member]} Syntax-only, not yet executable (PLAY0268).` : null;\n }\n if (variable.startsWith('$identity.')) {\n const name = variable.substring('$identity.'.length).split('.')[0];\n const detail = symbolsForBuffer(lines, application).identityDetails?.find(detail => detail.name === name);\n if (detail) return `**$identity.${detail.name}** — ${detail.type}. Declared caller detail; authoring metadata only, not executable until admitted (#600).`;\n }\n const doc =\n contextVariableDocs[variable] ??\n (variable.startsWith('$env') ? contextVariableDocs['$env'] : undefined);\n if (doc) return doc;\n }\n }\n\n // Do not mistake a property/type named optional for the contextual modifier.\n const prefix = line.slice(0, startColumn - 1);\n // Commit to query-parameter context before matching the name and type.\n const followsPropertyType = /^\\s*(?:by|filter)\\s+/.test(prefix)\n ? /^\\s*(?:by|filter)\\s+[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+$/.test(prefix)\n : /^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+$/.test(prefix);\n const followsQueryType = /^\\s*query\\s+\\w+\\s*=>\\s*(?:observable\\s+)?[\\w.]+(?:\\[\\])?\\s+$/.test(prefix) &&\n !/^\\s*query\\s+\\w+\\s*=>\\s*observable\\s+$/.test(prefix);\n if (word === 'subject') {\n const source = eventAnalysisSource(lines);\n const subjectPrefix = /^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?(?:\\s+generated)?(?:\\s+identifier)?\\s+$/.test(prefix);\n const ownerChain = enclosingChain(source, fences, lineIndex, indentOf(line));\n if (subjectPrefix && (ownerChain[0] === 'event' || /^produces\\s+event\\s+/.test(enclosingHeaders(source, fences, lineIndex, indentOf(line))[0] ?? ''))) {\n return '**subject** — This event property identifies its one data subject instead of the event source (decision 0008). Required scalar String, Uuid or their concepts, or an Int-backed concept; never pii or secret. Report-only lineage metadata (PLAY0270); no ESM bytes or provider output yet.';\n }\n if (/\\bclaim\\s+\"(?:[^\"\\\\]|\\\\.)*\"\\s+matches\\s+$/.test(prefix) && ownerChain.includes('policy')) return `**subject** — ${keywordDocs.subject}`;\n return null;\n }\n if (word === 'optional' && (followsPropertyType || followsQueryType)) {\n return `**optional** — ${keywordDocs.optional}`;\n }\n\n if (word === 'implementation' || word === 'hint') {\n const chain = enclosingChain(lines, fences, lineIndex, indentOf(line));\n const ruleContext = namedRuleContext(lines, lineIndex, indentOf(line));\n if ((word === 'implementation' && ruleContext === 'rule' && /^\\s*implementation\\s*$/.test(withoutComment(line))) ||\n (word === 'hint' && ruleContext === 'implementation' && /^\\s*hint\\s+\"/.test(line))) {\n return `**${word}** — Command named-rule guidance with at most one file or tagged fence. No payload means pending and fails binding (PLAY0268). Attached predicates keep their existing pure RuleContext contract; reference execution is unsupported, never confirmation.`;\n }\n if (word === 'implementation' && chain[0] === 'handler' && /^\\s*implementation\\s*$/.test(withoutComment(line))) {\n return `**implementation** — ${handlerIntentDocs.implementation}`;\n }\n if (word === 'hint' && chain[0] === 'implementation' && chain[1] === 'handler' && /^\\s*hint\\s+\"/.test(line)) {\n return `**hint** — ${handlerIntentDocs.hint}`;\n }\n }\n\n const symbols = scanDocument(lines);\n const owner = symbols.commands.filter(command => command.line < lineIndex).at(-1);\n const property = owner?.properties.find(property => property.name === word && property.line === lineIndex);\n if (property?.isGenerated || (word === 'generated' && owner?.properties.some(property => property.isGenerated && property.line === lineIndex) && followsPropertyType)) {\n return `**${property?.name ?? 'generated'}** — ${property ? typeReferenceText(propertyTypeReference(property)) + '. ' : ''}Generated value, not a request or form input. ${responseAvailability}`;\n }\n const response = owner?.response;\n if (response?.location.line === lineIndex + 1 && (tokenAt(response.location.column, 'returns') || (response.kind === 'ScalarCommandResponseSyntax' && tokenAt(response.source.location.column, response.source.property)))) {\n const source = response.kind === 'ScalarCommandResponseSyntax' ? owner?.properties.find(property => property.name === response.source.property) : undefined;\n return `**returns**${source ? ` — ${typeReferenceText(propertyTypeReference(source))}` : ' — unnamed record response'}. ${responseAvailability}`;\n }\n if (response?.kind === 'RecordCommandResponseSyntax') {\n const field = response.fields.find(field => field.location.line === lineIndex + 1 && (tokenAt(field.location.column, field.name) || tokenAt(field.source.location.column, field.source.property)));\n if (field) {\n const source = owner?.properties.find(property => property.name === field.source.property);\n const type = field.type ? typeReferenceText(field.type) : source ? typeReferenceText(propertyTypeReference(source)) : 'Unresolved type';\n return `**${field.name}** — ${type}${field.type ? ' (explicit)' : ' (inferred)'} = ${field.source.property}. ${source?.isGenerated ? 'Generated source, not request input. ' : ''}${responseAvailability}`;\n }\n }\n for (const specification of responseAnalysis(lines).specifications.values()) {\n if ((word === 'returns' && specification.thenReturns?.location.line === lineIndex + 1) || (word === 'generated' && specification.when?.generatedValues?.some(value => value.location.line === lineIndex + 1))) return responseAvailability;\n }\n\n const concept = symbols.concepts.find((candidate) => candidate.name === word);\n if (concept) {\n const attributes = concept.attributes.length ? ` ${concept.attributes.join(' ')}` : '';\n const values = concept.enumValues.length\n ? `\\n\\nValues: ${concept.enumValues.map((value, index) => concept.enumNumbers === undefined ? value : `${value} = ${concept.enumNumbers[index]}`).join(', ')}`\n : '';\n const reasons = Object.entries(concept.attributeReasons)\n .map(([attribute, reason]) => `\\n\\n**@${attribute}** — ${reason}`)\n .join('');\n return `\\`\\`\\`screenplay\\nconcept ${concept.name} : ${concept.primitive}${attributes}\\n\\`\\`\\`${reasons}${values}`;\n }\n\n const type = symbols.types.find((candidate) => candidate.name === word);\n if (type) {\n const properties = type.properties\n .map((property) => `${property.name} ${typeReferenceText(propertyTypeReference(property))}`)\n .join('\\n');\n return `\\`\\`\\`screenplay\\ntype ${type.name}\\n${properties}\\n\\`\\`\\``;\n }\n\n const policy = symbols.policies.find((candidate) => candidate.name === word);\n if (policy) {\n const body = policy.requires.length ? policy.requires.join('\\n') : '(custom C#)';\n return `\\`\\`\\`screenplay\\npolicy ${policy.name}\\n${body}\\n\\`\\`\\``;\n }\n\n const event = symbols.events.find((candidate) => candidate.name === word && candidate.line === lineIndex) ??\n symbols.events.filter((candidate) => candidate.name === word)\n .sort((left, right) => (right.generation ?? 1) - (left.generation ?? 1))[0];\n if (event) {\n const properties = event.properties\n .map((property) => `${property.name} ${typeReferenceText(propertyTypeReference(property))}${property.isSubject ? ' subject' : ''}`)\n .join('\\n');\n return `\\`\\`\\`screenplay\\n${event.visibility === 'Public' ? 'public ' : ''}event ${event.name}${event.generation !== undefined ? ` generation ${event.generation}` : ''}${event.origin !== undefined ? ` from ${JSON.stringify(event.origin)}` : ''}\\n${properties}\\n\\`\\`\\``;\n }\n\n const command = symbols.commands.find((candidate) => candidate.name === word);\n if (command && command.properties.length > 0) {\n const properties = command.properties\n .map(\n (property) =>\n `${property.name} ${typeReferenceText(propertyTypeReference(property))}${property.isGenerated ? ' generated' : ''}${property.isIdentifier ? ' identifier' : ''}`,\n )\n .join('\\n');\n return `\\`\\`\\`screenplay\\ncommand ${command.name}\\n${properties}\\n\\`\\`\\`${command.response || command.properties.some(property => property.isGenerated) ? `\\n\\n${responseAvailability}` : ''}`;\n }\n\n // Sub-language keywords take precedence inside their construct.\n const chain = enclosingChain(lines, fences, lineIndex, indentOf(line));\n for (const construct of [line.trim().split(/\\s+/)[0], ...chain]) {\n const subLanguage = getSubLanguage(construct ?? '');\n const doc = subLanguage?.hovers?.[word];\n if (doc) return doc;\n }\n\n if (word === 'reads' && (chain[0] === 'every' || chain[0] === 'at') && chain.includes('reaction')) {\n return '**reads** — Declares a whole view this clock trigger consults: `reads <View>`. Clock triggers take no values, so `by` is unavailable.';\n }\n\n const step = line.trim().match(/^(given|when|then)\\s+(?:no\\s+)?(\\w+)/);\n if (step && step[2] === word && chain[0] === 'specification' && specificationKeywordDocs[word]) {\n return `**${word}** — ${specificationKeywordDocs[word]}`;\n }\n\n if (word === 'id' || word === 'documentation') {\n const source = eventAnalysisSource(lines);\n const inEvent = symbols.events.some(event => directBody(source, fences, event.line, indentOf(source[event.line])).includes(lineIndex));\n const directive = word === 'id' ? /^\\s*id\\s+\"/.test(source[lineIndex]) : /^\\s*documentation\\s*$/.test(source[lineIndex]);\n const supportedOwner = inEvent || (word === 'documentation' && ['module', 'feature', 'slice', 'command', 'readmodel', 'reaction'].includes(chain[0]));\n if (!supportedOwner || !directive || startColumn !== indentOf(line) + 1) return null;\n }\n\n if (word === 'optional' || word === 'generated' || word === 'returns') return null;\n const keywordDoc = keywordDocs[word];\n if (keywordDoc) return `**${word}** — ${keywordDoc}`;\n\n return null;\n}\n"],"mappings":"ojCAqBA,SAAgB,aACZ,EACA,EACA,EACA,EACA,EACA,EACa,CACb,IAAMA,EAASC,EAASC,CAAK,EAC7B,GAAIF,EAAOG,GAAY,OAAO,KAE9B,IAAMC,EAAOF,EAAMC,IAAc,GACjC,G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,EAAM,KAAMrD,EAASmB,EAAOkC,EAAM,KAAK,CAAC,CAAC,CAAC,SAAS5E,CAAS,CAAC,EAC/HqF,EAAYlE,IAAS,KAAO,aAAa,KAAKuB,EAAO1C,EAAU,EAAI,wBAAwB,KAAK0C,EAAO1C,EAAU,EAEvH,GAAI,EADmBmF,GAAYhE,IAAS,iBAAmB,CAAC,SAAU,UAAW,QAAS,UAAW,YAAa,UAAU,CAAC,CAAC,SAAS6B,EAAM,EAAE,IAC5H,CAACqC,GAAa9E,IAAgBgB,EAAStB,CAAI,EAAI,EAAG,OAAO,IACpF,CAEA,GAAIkB,IAAS,YAAcA,IAAS,aAAeA,IAAS,UAAW,OAAO,KAC9E,IAAMmE,EAAavC,EAAY5B,GAG/B,OAFImE,EAAmB,KAAKnE,EAAK,OAAOmE,IAEjC,IACX"}
1
+ {"version":3,"file":"hover-content.js","names":["fences","fenceMap","lines","lineIndex","line","endColumn","withoutComment","inString","inTemplate","index","startColumn","returned","continuationResponseHover","word","application","reaction","reactionReferenceAt","fixtureHover","exampleHover","sourceHover","eventSourceHover","operation","operationHover","start","column","name","before","enclosingChain","indentOf","generationDocs","complianceHeader","complianceBody","doc","attributeDocs","specialCategoryDocs","variable","branch","refusalContext","member","descriptions","detail","symbolsForBuffer","contextVariableDocs","\"$env\"","prefix","followsPropertyType","followsQueryType","source","eventAnalysisSource","subjectPrefix","ownerChain","enclosingHeaders","keywordDocs","chain","ruleContext","namedRuleContext","handlerIntentDocs","symbols","scanDocument","owner","command","property","typeReferenceText","propertyTypeReference","responseAvailability","response","field","type","specification","responseAnalysis","value","concept","candidate","attributes","values","reasons","attribute","reason","properties","policy","body","event","right","left","construct","getSubLanguage","step","specificationKeywordDocs","inEvent","directBody","directive","keywordDoc"],"sources":["../../hover-content.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { continuationResponseHover } from './continuation-responses';\nimport { reactionReferenceAt } from './reaction-authoring';\nimport { refusalContext } from './refusal-context';\nimport { namedRuleContext } from './named-rule-context';\nimport { eventSourceHover } from './event-source-authoring';\nimport { exampleHover } from './example-authoring';\nimport { operationHover } from './operation-authoring';\nimport { DocumentSymbols, symbolsForBuffer } from './symbols';\nimport { responseAnalysis, responseAvailability } from './response-analysis';\nimport { enclosingChain, enclosingHeaders, fenceMap, indentOf, withoutComment } from './document-context';\nimport { directBody, propertyTypeReference, scanDocument } from './symbols';\nimport { typeReferenceText } from './TypeReferenceSymbol';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { getSubLanguage } from './sub-language-registry';\nimport { attributeDocs, contextVariableDocs, handlerIntentDocs, keywordDocs, specialCategoryDocs, specificationKeywordDocs } from './keyword-docs';\n\n// Produces the hover markdown for a word at a position, without any editor\n// dependency — the Monaco service and the VSCode extension share this content.\n// Columns are 1-based, matching both editors' word-at-position APIs.\nexport function hoverContent(\n lines: string[],\n lineIndex: number,\n word: string,\n startColumn: number,\n endColumn: number,\n application?: DocumentSymbols,\n): string | null {\n const fences = fenceMap(lines);\n if (fences[lineIndex]) return null;\n\n const line = lines[lineIndex] ?? '';\n if (endColumn - 1 > withoutComment(line).length) return null;\n let inString = false;\n let inTemplate = false;\n for (let index = 0; index < startColumn - 1; index++) {\n if (line[index] === '\\\\' && inString) index++;\n else if (line[index] === '\"' && !inTemplate) inString = !inString;\n else if (line[index] === '`' && !inString) inTemplate = !inTemplate;\n }\n if (inString || inTemplate) return null;\n const returned = continuationResponseHover(lines, lineIndex, word, startColumn, endColumn, application);\n if (returned) return returned;\n const reaction = reactionReferenceAt(lines, lineIndex, startColumn, endColumn, application);\n if (reaction) return reaction.content;\n const fixtureHover = exampleHover(lines, lineIndex, startColumn, endColumn, application);\n if (fixtureHover) return fixtureHover;\n const sourceHover = eventSourceHover(lines, lineIndex, startColumn, endColumn, application);\n if (sourceHover) return sourceHover;\n const operation = operationHover(lines, lineIndex, startColumn, endColumn, application);\n if (operation) return operation;\n const tokenAt = (column: number, name: string): boolean => {\n const start = column + (line[column - 1] === '@' ? 1 : 0);\n return word === name && startColumn === start && endColumn === start + name.length && line.slice(start - 1, endColumn - 1) === name;\n };\n const before = line.charAt(startColumn - 2);\n if (word === 'authorization' && enclosingChain(lines, fences, lineIndex, indentOf(line))[0] === 'purpose') return 'A quoted authorization in law for criminal-offence data (Art. 10).';\n\n if (enclosingChain(lines, fences, lineIndex, indentOf(line))[0] === 'concept' && /^\\s*generate\\b/.test(line)) {\n const generationDocs: Record<string, string> = {\n generate: 'The concept declares how; a command property declares generated. ESM v15 checks fixture shape and guards generated event sources against existing facts.',\n uuid: 'Random UUID v4, 122 random bits; about 3.27 × 10^17 values at 1% collision probability.',\n uuidv7: 'Time-ordered UUID v7, 74 random bits; about 1.95 × 10^10 values at 1% collision probability. Exposes time; not monotonic within a millisecond.',\n ulid: '26 Crockford base32 characters (uppercase by default), 80 random bits; about 1.56 × 10^11 values at 1% collision probability.',\n typeid: 'TypeID 0.3: lowercase UUIDv7 base32 with a 0..63-character prefix. 74 random bits; empty prefix has no separator.',\n nanoid: 'Default 21 characters over 64 symbols: 126 random bits. Custom entropy = size × log2(alphabet size).',\n bytes: '8 × count random bits; base64url, hex or base32 without padding. RFC 4648 unused trailing bits must be zero.',\n prefix: 'Printable ASCII prefix, at most 32 characters. UUID prefixes require a String concept; TypeID uses its own argument.',\n alphabet: 'NanoID only: 2..256 distinct printable ASCII characters.',\n case: 'lower or upper for String UUIDs, ULID, hex/base32 bytes. Never base64url, NanoID or TypeID.',\n pattern: 'Parsed, not yet executable (#616 phase 3).', random: 'Parsed, not yet executable (#616 phase 3).', rule: 'Parsed, not yet executable (#616 phase 3).', sequence: 'Reserved; binding refuses it until #619 is admitted.',\n };\n if (generationDocs[word]) return generationDocs[word];\n }\n\n const complianceHeader = /^\\s*concept\\s+[^\\s:]+\\s*:\\s*\\w+\\s+/.exec(line);\n const complianceBody = enclosingChain(lines, fences, lineIndex, indentOf(line))[0] === 'concept' && /^\\s*(?:@?pii|personal|@?sensitive|secret)\\s+(?:reason|scope|special|criminal)\\b/.test(line);\n if ((complianceHeader !== null && startColumn - 1 >= complianceHeader[0].length - 1) || complianceBody) {\n const doc = attributeDocs[word];\n if (doc) return doc;\n if (Object.hasOwn(specialCategoryDocs, word) && /^\\s*(?:@?pii|personal)\\s+special\\s+/.test(line)) return `**${word}** — ${specialCategoryDocs[word]}`;\n if (word === 'special') return 'GDPR Art. 9(1) special category; requires pii. At most one category per concept.';\n if (word === 'criminal') return 'Personal data relating to criminal convictions and offenses (GDPR Art. 10); requires pii.';\n if (/^\\s*(?:secret|sensitive|@sensitive)\\s+scope\\s+/.test(line) && ['subject', 'namespace', 'global'].includes(word)) return `**${word}** — Secret encryption scope${word === 'subject' ? ' per data subject' : word === 'namespace' ? ' per tenant namespace' : ' shared globally'}. Not an event-property subject role.`;\n if (word === 'scope') return 'Secret encryption scope: subject, namespace or global. Omitted scope keeps Chronicle’s Subject default; pii secret renders only [PII].';\n }\n if (before === '$' || before === '.') {\n const variable = line.substring(0, endColumn - 1).match(/\\$[\\w.]*$/)?.[0];\n if (variable) {\n if (variable.startsWith('$refusal')) {\n const branch = refusalContext(lines, lineIndex, indentOf(line));\n const member = variable.substring('$refusal.'.length);\n const descriptions: Record<string, string> = { reason: 'Refusal kind as a String: validation, constraint or authorization.', message: 'Rejection details verbatim, including unresolved $strings keys.', constraint: 'Violated constraint name as a String, only in a by constraint branch.' };\n return branch !== undefined && descriptions[member] !== undefined ? `**${variable}** — ${descriptions[member]} Syntax-only, not yet executable (PLAY0268).` : null;\n }\n if (variable.startsWith('$identity.')) {\n const name = variable.substring('$identity.'.length).split('.')[0];\n const detail = symbolsForBuffer(lines, application).identityDetails?.find(detail => detail.name === name);\n if (detail) return `**$identity.${detail.name}** — ${detail.type}. Declared caller detail; authoring metadata only, not executable until admitted (#600).`;\n }\n const doc =\n contextVariableDocs[variable] ??\n (variable.startsWith('$env') ? contextVariableDocs['$env'] : undefined);\n if (doc) return doc;\n }\n }\n\n // Do not mistake a property/type named optional for the contextual modifier.\n const prefix = line.slice(0, startColumn - 1);\n // Commit to query-parameter context before matching the name and type.\n const followsPropertyType = /^\\s*(?:by|filter)\\s+/.test(prefix)\n ? /^\\s*(?:by|filter)\\s+[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+$/.test(prefix)\n : /^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+$/.test(prefix);\n const followsQueryType = /^\\s*query\\s+\\w+\\s*=>\\s*(?:observable\\s+)?[\\w.]+(?:\\[\\])?\\s+$/.test(prefix) &&\n !/^\\s*query\\s+\\w+\\s*=>\\s*observable\\s+$/.test(prefix);\n if (word === 'subject') {\n const source = eventAnalysisSource(lines);\n const subjectPrefix = /^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?(?:\\s+generated)?(?:\\s+identifier)?\\s+$/.test(prefix);\n const ownerChain = enclosingChain(source, fences, lineIndex, indentOf(line));\n if (subjectPrefix && (ownerChain[0] === 'event' || /^produces\\s+event\\s+/.test(enclosingHeaders(source, fences, lineIndex, indentOf(line))[0] ?? ''))) {\n return '**subject** — This event property identifies its one data subject instead of the event source (decision 0008). Required scalar String, Uuid or their concepts, or an Int-backed concept; never pii or secret. Report-only lineage metadata (PLAY0270); no ESM bytes or provider output yet.';\n }\n if (/\\bclaim\\s+\"(?:[^\"\\\\]|\\\\.)*\"\\s+matches\\s+$/.test(prefix) && ownerChain.includes('policy')) return `**subject** — ${keywordDocs.subject}`;\n return null;\n }\n if (word === 'optional' && (followsPropertyType || followsQueryType)) {\n return `**optional** — ${keywordDocs.optional}`;\n }\n\n if (word === 'implementation' || word === 'hint') {\n const chain = enclosingChain(lines, fences, lineIndex, indentOf(line));\n const ruleContext = namedRuleContext(lines, lineIndex, indentOf(line));\n if ((word === 'implementation' && ruleContext === 'rule' && /^\\s*implementation\\s*$/.test(withoutComment(line))) ||\n (word === 'hint' && ruleContext === 'implementation' && /^\\s*hint\\s+\"/.test(line))) {\n return `**${word}** — Command named-rule guidance with at most one file or tagged fence. No payload means pending and fails binding (PLAY0268). Attached predicates keep their existing pure RuleContext contract; reference execution is unsupported, never confirmation.`;\n }\n if (word === 'implementation' && chain[0] === 'handler' && /^\\s*implementation\\s*$/.test(withoutComment(line))) {\n return `**implementation** — ${handlerIntentDocs.implementation}`;\n }\n if (word === 'hint' && chain[0] === 'implementation' && chain[1] === 'handler' && /^\\s*hint\\s+\"/.test(line)) {\n return `**hint** — ${handlerIntentDocs.hint}`;\n }\n }\n\n const symbols = scanDocument(lines);\n const owner = symbols.commands.filter(command => command.line < lineIndex).at(-1);\n const property = owner?.properties.find(property => property.name === word && property.line === lineIndex);\n if (property?.isGenerated || (word === 'generated' && owner?.properties.some(property => property.isGenerated && property.line === lineIndex) && followsPropertyType)) {\n return `**${property?.name ?? 'generated'}** — ${property ? typeReferenceText(propertyTypeReference(property)) + '. ' : ''}Generated value, not a request or form input. ${responseAvailability}`;\n }\n const response = owner?.response;\n if (response?.location.line === lineIndex + 1 && (tokenAt(response.location.column, 'returns') || (response.kind === 'ScalarCommandResponseSyntax' && tokenAt(response.source.location.column, response.source.property)))) {\n const source = response.kind === 'ScalarCommandResponseSyntax' ? owner?.properties.find(property => property.name === response.source.property) : undefined;\n return `**returns**${source ? ` — ${typeReferenceText(propertyTypeReference(source))}` : ' — unnamed record response'}. ${responseAvailability}`;\n }\n if (response?.kind === 'RecordCommandResponseSyntax') {\n const field = response.fields.find(field => field.location.line === lineIndex + 1 && (tokenAt(field.location.column, field.name) || tokenAt(field.source.location.column, field.source.property)));\n if (field) {\n const source = owner?.properties.find(property => property.name === field.source.property);\n const type = field.type ? typeReferenceText(field.type) : source ? typeReferenceText(propertyTypeReference(source)) : 'Unresolved type';\n return `**${field.name}** — ${type}${field.type ? ' (explicit)' : ' (inferred)'} = ${field.source.property}. ${source?.isGenerated ? 'Generated source, not request input. ' : ''}${responseAvailability}`;\n }\n }\n for (const specification of responseAnalysis(lines).specifications.values()) {\n if ((word === 'returns' && specification.thenReturns?.location.line === lineIndex + 1) || (word === 'generated' && specification.when?.generatedValues?.some(value => value.location.line === lineIndex + 1))) return responseAvailability;\n }\n\n const concept = symbols.concepts.find((candidate) => candidate.name === word);\n if (concept) {\n const attributes = concept.attributes.length ? ` ${concept.attributes.join(' ')}` : '';\n const values = concept.enumValues.length\n ? `\\n\\nValues: ${concept.enumValues.map((value, index) => concept.enumNumbers === undefined ? value : `${value} = ${concept.enumNumbers[index]}`).join(', ')}`\n : '';\n const reasons = Object.entries(concept.attributeReasons)\n .map(([attribute, reason]) => `\\n\\n**@${attribute}** — ${reason}`)\n .join('');\n return `\\`\\`\\`screenplay\\nconcept ${concept.name} : ${concept.primitive}${attributes}\\n\\`\\`\\`${reasons}${values}`;\n }\n\n const type = symbols.types.find((candidate) => candidate.name === word);\n if (type) {\n const properties = type.properties\n .map((property) => `${property.name} ${typeReferenceText(propertyTypeReference(property))}`)\n .join('\\n');\n return `\\`\\`\\`screenplay\\ntype ${type.name}\\n${properties}\\n\\`\\`\\``;\n }\n\n const policy = symbols.policies.find((candidate) => candidate.name === word);\n if (policy) {\n const body = policy.requires.length ? policy.requires.join('\\n') : '(custom C#)';\n return `\\`\\`\\`screenplay\\npolicy ${policy.name}\\n${body}\\n\\`\\`\\``;\n }\n\n const event = symbols.events.find((candidate) => candidate.name === word && candidate.line === lineIndex) ??\n symbols.events.filter((candidate) => candidate.name === word)\n .sort((left, right) => (right.generation ?? 1) - (left.generation ?? 1))[0];\n if (event) {\n const properties = event.properties\n .map((property) => `${property.name} ${typeReferenceText(propertyTypeReference(property))}${property.isSubject ? ' subject' : ''}`)\n .join('\\n');\n return `\\`\\`\\`screenplay\\n${event.visibility === 'Public' ? 'public ' : ''}event ${event.name}${event.generation !== undefined ? ` generation ${event.generation}` : ''}${event.origin !== undefined ? ` from ${JSON.stringify(event.origin)}` : ''}\\n${properties}\\n\\`\\`\\``;\n }\n\n const command = symbols.commands.find((candidate) => candidate.name === word);\n if (command && command.properties.length > 0) {\n const properties = command.properties\n .map(\n (property) =>\n `${property.name} ${typeReferenceText(propertyTypeReference(property))}${property.isGenerated ? ' generated' : ''}${property.isIdentifier ? ' identifier' : ''}`,\n )\n .join('\\n');\n return `\\`\\`\\`screenplay\\ncommand ${command.name}\\n${properties}\\n\\`\\`\\`${command.response || command.properties.some(property => property.isGenerated) ? `\\n\\n${responseAvailability}` : ''}`;\n }\n\n // Sub-language keywords take precedence inside their construct.\n const chain = enclosingChain(lines, fences, lineIndex, indentOf(line));\n for (const construct of [line.trim().split(/\\s+/)[0], ...chain]) {\n const subLanguage = getSubLanguage(construct ?? '');\n const doc = subLanguage?.hovers?.[word];\n if (doc) return doc;\n }\n\n if (word === 'reads' && (chain[0] === 'every' || chain[0] === 'at') && chain.includes('reaction')) {\n return '**reads** — Declares a whole view this clock trigger consults: `reads <View>`. Clock triggers take no values, so `by` is unavailable.';\n }\n\n const step = line.trim().match(/^(given|when|then)\\s+(?:no\\s+)?(\\w+)/);\n if (step && step[2] === word && chain[0] === 'specification' && specificationKeywordDocs[word]) {\n return `**${word}** — ${specificationKeywordDocs[word]}`;\n }\n\n if (word === 'id' || word === 'documentation') {\n const source = eventAnalysisSource(lines);\n const inEvent = symbols.events.some(event => directBody(source, fences, event.line, indentOf(source[event.line])).includes(lineIndex));\n const directive = word === 'id' ? /^\\s*id\\s+\"/.test(source[lineIndex]) : /^\\s*documentation\\s*$/.test(source[lineIndex]);\n const supportedOwner = inEvent || (word === 'documentation' && ['module', 'feature', 'slice', 'command', 'readmodel', 'reaction'].includes(chain[0]));\n if (!supportedOwner || !directive || startColumn !== indentOf(line) + 1) return null;\n }\n\n if (word === 'optional' || word === 'generated' || word === 'returns') return null;\n const keywordDoc = keywordDocs[word];\n if (keywordDoc) return `**${word}** — ${keywordDoc}`;\n\n return null;\n}\n"],"mappings":"+nCAsBA,SAAgB,aACZ,EACA,EACA,EACA,EACA,EACA,EACa,CACb,IAAMA,EAASC,EAAS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,KAAKA,EAAK,OAAO0E,EAAyB1E,KAGrD,GAAIA,IAAS,MAAQA,IAAS,gBAAiB,CAC3C,IAAMkC,EAASC,EAAoB9C,CAAK,EAClCsF,EAAU/B,EAAQ,OAAO,KAAK,GAASgC,EAAW1C,EAAQ/C,EAAQiF,EAAM,KAAMrD,EAASmB,EAAOkC,EAAM,KAAK,CAAC,CAAC,CAAC,SAAS9E,CAAS,CAAC,EAC/HuF,EAAY7E,IAAS,KAAO,aAAa,KAAKkC,EAAO5C,EAAU,EAAI,wBAAwB,KAAK4C,EAAO5C,EAAU,EAEvH,GAAI,EADmBqF,GAAY3E,IAAS,iBAAmB,CAAC,SAAU,UAAW,QAAS,UAAW,YAAa,UAAU,CAAC,CAAC,SAASwC,EAAM,EAAE,IAC5H,CAACqC,GAAahF,IAAgBkB,EAASxB,CAAI,EAAI,EAAG,OAAO,IACpF,CAEA,GAAIS,IAAS,YAAcA,IAAS,aAAeA,IAAS,UAAW,OAAO,KAC9E,IAAM8E,EAAavC,EAAYvC,GAG/B,OAFI8E,EAAmB,KAAK9E,EAAK,OAAO8E,IAEjC,IACX"}
@@ -1,7 +1,7 @@
1
- import"./_virtual/_virtual/_rolldown/runtime.js";import{AuthoringProductionResolver as e}from"./compiler/Syntax/AuthoringProductionResolver.js";import{dependencySourcesOf as t}from"./compiler/Syntax/DependencySources.js";import{parseForAuthoring as n}from"./compiler/ScreenplayCompiler.js";import{EventSourceReadConfidence as r}from"./compiler/Syntax/EventSourceReadConfidence.js";import{parsePlacedDocuments as i}from"./compiler/Files/PlayApplicationAssembly.js";import"./compiler/index.js";import{fenceMap as a,indentOf as o,withoutComment as s}from"./document-context.js";import{exampleAnalysis as c}from"./example-analysis.js";import{personaAnalysis as l}from"./persona-analysis.js";import{dependencyTargetAnalysis as u}from"./dependency-target-analysis.js";const d=`Executable as ESM v7. Generated values require fixtures in reference execution; other unadmitted constructs still prevent binding.`,f=/* @__PURE__ */ new Map;function authoringSource(e,t){let n=a(e),r=e.flatMap((e,t)=>!n[t]&&o(e)===0&&/^\w/.test(e)?[e.split(/\s+/)[0]]:[]);if(r.includes(`module`)||!r.some(e=>[`feature`,`slice`,`command`,`event`,`operation`,`reaction`,`specification`].includes(e)))return{source:e.join(`
2
- `),locations:e.map((e,t)=>({line:t+1,column:0}))};let i=[],s=[],c=!1;e.forEach((e,t)=>{!n[t]&&o(e)===0&&/^\w/.test(e)&&(c=/^(?:concept|type|import|domain|system|eventsource|policy|persona|identity)\b/.test(e)),(c?i:s).push(t)});let l=r.includes(`feature`)?1:r.includes(`slice`)?2:3,u=t.slice(0,l);return{source:[...i.map(t=>e[t]),...u,...s.map(t=>` `.repeat(l*2)+e[t])].join(`
3
- `),locations:[...i.map(e=>({line:e+1,column:0})),...u.map(()=>({line:0,column:0})),...s.map(e=>({line:e+1,column:l*2}))]}}function analyze(d,f,p,m=`current.play`,h=!0){let g=f.map((e,t)=>typeof e==`string`?{path:`other-${t}.play`,source:e}:e).filter(e=>e.path!==m),_=[{path:m,source:d.join(`
4
- `),placement:p,isPlacementResolved:h},...g],v=new Set(_.flatMap(e=>[...e.source.matchAll(/\w+/g)].map(e=>e[0]).concat(e.placement??[]))),fresh=e=>{let t=e;for(let n=1;v.has(t);n++)t=`${e}${n}`;return v.add(t),t},y=fresh(`EditorAuthoring`),b=fresh(`FragmentFeature`),x=/* @__PURE__ */ new Set([y,b]),S=_.map((e,t)=>{let n=t===0?d:e.source.split(`
5
- `),r=fresh(`Fragment${t}`);x.add(r);let i=e.placement?.length?{source:e.source,locations:n.map((e,t)=>({line:t+1,column:0}))}:authoringSource(n,[`module ${y}`,` feature ${b}`,` slice StateChange ${r}`]);return{...e,...i,placement:e.placement??[]}}),C=S[0],w=new Map(S.map(e=>[e.path,e.locations])),T=i([...S.slice(1),C],void 0,!0),E=/* @__PURE__ */ new Map,D=/* @__PURE__ */ new Map,O=/* @__PURE__ */ new WeakSet,walk=e=>{if(typeof e!=`object`||!e||O.has(e))return;if(O.add(e),Array.isArray(e)){e.forEach(walk);return}let t=e;if(typeof t.path==`string`&&typeof t.line==`number`&&typeof t.column==`number`){let e=w.get(t.path)?.[t.line-1];e&&(t.line=e.line,t.column=Math.max(1,t.column-e.column))}else{for(let e of Object.values(t))walk(e);t.location?.path===m&&(t.kind===`CommandSyntax`&&E.set(t.location.line-1,e),t.kind===`SpecificationSyntax`&&D.set(t.location.line-1,e))}};walk(T.value),walk(T.physicalEventSources);for(let e of T.diagnostics)walk(e.location);let k=T.diagnostics.some(e=>{if(![`PLAY0022`,`PLAY0024`,`PLAY0029`].includes(e.code))return!1;let t=S.find(t=>t.path===e.location.path),n=_.find(t=>t.path===e.location.path)?.source.split(`
6
- `)[e.location.line-1];return t?.locations.some(e=>e.line===0)&&n!==void 0&&o(n)===0}),A=T.diagnostics.filter(e=>e.location.path===m).flatMap(e=>(walk(e.location),e.location.line>0?[e]:[])),j=new e(T.value);for(let{slice:e}of j.slices)for(let n of t(e).reducers??[])walk(n);let M=new Set(j.slices.flatMap(({slice:e})=>[...e.commands.flatMap(e=>e.produces),...e.reactions.flatMap(e=>e.triggers).flatMap(e=>e.produces)].filter(t=>t.location.path===m&&!j.isEventProduction(t,e)).map(e=>e.location.line-1)));for(let e of A)e.code===`PLAY0499`&&M.add(e.location.line-1);let N=j.declarations.filter(e=>e.kind===`operation`).map(e=>({...e.node,scope:e.scope.filter(e=>!x.has(e))})),P=/* @__PURE__ */ new Map,F=a(d),range=e=>{let t=[],n=o(d[e]);for(let r=e;r<d.length&&!(r>e&&!F[r]&&s(d[r]).trim()&&o(d[r])<=n);r++)t.push(r);return t};for(let{slice:e,scope:t}of j.slices){if(e.location.path===m&&e.location.line>0)for(let n of range(e.location.line-1))P.set(n,{scope:t});for(let n of e.specifications.filter(e=>e.location.path===m&&e.location.line>0))for(let e of range(n.location.line-1))P.set(e,{scope:t});for(let n of e.commands.filter(e=>e.location.path===m&&e.location.line>0))for(let e of range(n.location.line-1))P.set(e,{scope:t,commandLine:n.location.line-1})}let I=new Map(j.declarations.map(e=>[e.node.location,e.scope]));for(let e of N.filter(e=>e.location.path===m)){let t=I.get(e.location);for(let n of range(e.location.line-1))P.set(n,{...P.get(n),scope:t,operation:e})}let L=new Map(N.map(e=>[e.location,e])),referenceLocation=(e,t)=>{let n=s(d[e.line-1]??``),r=n.slice(e.column-1).match(/^(?:given\s+operation|then\s+(?:operation|compensated))\s+/)?.[0];return r&&n.slice(e.column-1+r.length,e.column-1+r.length+t.length)===t?{...e,column:e.column+r.length}:e},R=[];for(let{slice:e}of j.slices){for(let t of e.commands)for(let n of t.produces){if(n.location.path!==m)continue;let t=j.resolve(n.event,e),r=t.declaration?L.get(t.declaration.node.location)??null:null,i={name:n.event,location:n.location,targetLocation:n.targetLocation??n.location,kind:t.kind,declaration:r,mappings:n.mappings};if(R.push(i),t.kind===`operation`)for(let e of range(n.location.line-1)){let t=P.get(e);t&&P.set(e,{...t,production:i})}}for(let t of e.specifications)for(let n of[...t.givenOperationFailures??[],...t.thenOperations??[],...t.thenCompensated??[]]){if(n.location.path!==m)continue;let t=j.resolve(n.operation,e);R.push({name:n.operation,location:n.location,targetLocation:referenceLocation(n.location,n.operation),kind:t.kind,declaration:t.declaration?L.get(t.declaration.node.location)??null:null,mappings:[]})}}let z={declarations:N,systems:T.value.systems??[],references:R,contexts:P,types:T.value.types,concepts:T.value.concepts,targets:e=>{let t=j.slices.find(t=>t.scope.length===e.length&&t.scope.every((t,n)=>t===e[n]))?.slice;return t?N.flatMap(e=>{let n=j.resolve(e.name,t).declaration?.node.location===e.location?e.name:[...e.scope,e.name].join(`.`);return j.resolve(n,t).kind===`operation`&&j.resolve(n,t).declaration?.node.location===e.location?[{name:n,declaration:e}]:[]}):[]}},B=T.physicalEventSources.map(e=>e.source),V=new r(T.physicalEventSources,T.sourceInventoryComplete&&!k),H=/* @__PURE__ */ new Map,resolve=(e,t)=>{let n=JSON.stringify([e,t]),r=H.get(n);return r||(r=V.resolve(e,t),H.set(n,r)),{...r,source:r.state===`unique`?r.sources[0]:void 0,stream:r.state===`unique`?r.streams[0]:void 0}},U=new Set(T.value.imports.map(e=>e.qualifiedName)),W=B.flatMap(e=>e.streams.filter(t=>resolve(e.name,t.name).state===`unique`&&!U.has(`${e.name}.${t.name}`)).map(t=>({name:`${e.name}.${t.name}`,source:e,stream:t}))),G=/* @__PURE__ */ new Map,K=[];for(let e of E.values()){for(let t of range(e.location.line-1))G.set(t,{command:e});for(let t of[...e.produces,...e.validations,...e.handler?[e.handler]:[]])for(let e of range(t.location.line-1))G.delete(e);if(e.stream){K.push(e.stream);for(let t of range(e.stream.location.line-1))G.set(t,{command:e,route:e.stream})}}let q=new Map(j.slices.flatMap(({slice:e})=>e.commands.map(t=>[t,e])));for(let e of E.values()){let t=q.get(e);if(t){for(let n of e.produces)if(j.isEventProduction(n,t)){for(let t of range(n.location.line-1))G.set(t,{command:e,production:!0});if(n.stream){K.push(n.stream);for(let t of range(n.stream.location.line-1))G.set(t,{command:e,production:!0,route:n.stream})}}}}for(let{slice:e}of j.slices)for(let n of[...e.reactions,...t(e).reducers??[]].filter(e=>e.location.path===m&&e.location.line>0))for(let e of range(n.location.line-1))G.set(e,{observer:n});let J=c(T.value,m,d,range,x,T.diagnostics),Y=[...[...D.values()].flatMap(e=>[...e.given.map(e=>({event:e,expectation:!1})),...e.whenAppended?[{event:e.whenAppended,expectation:!1}]:[],...e.thenEvents.map(e=>({event:e,expectation:!0})),...e.whenRedelivered?[{event:e.whenRedelivered,expectation:!0}]:[]]),...(J.eventExamples??[]).map(e=>({event:e,expectation:!0}))];for(let e of Y){let t=e.event;for(let n of range(t.location.line-1))G.set(n,e);if(t.stream){K.push(t.stream);for(let n of range(t.stream.location.line-1))G.set(n,{...e,route:t.stream})}}for(let e of B.filter(e=>e.location.path===m)){for(let t of range(e.location.line-1))G.set(t,{source:e});for(let t of e.streams)for(let n of range(t.location.line-1))G.set(n,{source:e,stream:t})}let X={declarations:B,routes:K,ambiguousCandidates:[...E.values()].flatMap(e=>e.streamCandidates??[]).filter(e=>e.propertyCandidate!==null),contexts:G,targets:W,resolve},Z;return{identityDetails:(T.value.identity?.details??[]).map(e=>({name:e.name,type:`${e.type.name}${e.type.isCollection?`[]`:``}${e.type.isOptional?` optional`:``}`,line:e.location.line-1})),commands:E,specifications:D,diagnostics:A,operationProductionLines:M,operations:z,eventSources:X,readModels:j.slices.flatMap(({slice:e,scope:t})=>(e.readModels??[]).map(e=>({model:e,scope:t.filter(e=>!x.has(e))}))),examples:J,personas:l(T.value,d),dependencies:{completions(e,t,r){if(Z===void 0){let e=n(C.source,m,C.placement,!1).value,remapDependencyHeaders=e=>{walk(e.location),e.features.forEach(remapDependencyHeaders)};e.modules.forEach(remapDependencyHeaders),Z=u(T.value,e,m,range,x)}return Z.completions(e,t,r)}}}}function responseAnalysis(e,t=[],n,r=`current.play`,i=!0){let a=JSON.stringify([e,t,n,r,i]),o=f.get(a);return o===void 0&&(o=analyze(e,t,n,r,i),f.size>=16&&f.delete(f.keys().next().value),f.set(a,o)),o}export{responseAnalysis,d as responseAvailability};
1
+ import"./_virtual/_virtual/_rolldown/runtime.js";import{AuthoringProductionResolver as e}from"./compiler/Syntax/AuthoringProductionResolver.js";import{dependencySourcesOf as t}from"./compiler/Syntax/DependencySources.js";import{responseCommandResolver as n}from"./compiler/Parsing/ResponseCommandResolver.js";import{parseForAuthoring as r}from"./compiler/ScreenplayCompiler.js";import{EventSourceReadConfidence as i}from"./compiler/Syntax/EventSourceReadConfidence.js";import{parsePlacedDocuments as a}from"./compiler/Files/PlayApplicationAssembly.js";import"./compiler/index.js";import{fenceMap as o,indentOf as s,withoutComment as c}from"./document-context.js";import{exampleAnalysis as l}from"./example-analysis.js";import{personaAnalysis as u}from"./persona-analysis.js";import{dependencyTargetAnalysis as d}from"./dependency-target-analysis.js";const f=`Executable as ESM v7. Generated values require fixtures in reference execution; other unadmitted constructs still prevent binding.`,p=/* @__PURE__ */ new Map;function authoringSource(e,t){let n=o(e),r=e.flatMap((e,t)=>!n[t]&&s(e)===0&&/^\w/.test(e)?[e.split(/\s+/)[0]]:[]);if(r.includes(`module`)||!r.some(e=>[`feature`,`slice`,`command`,`event`,`operation`,`reaction`,`specification`].includes(e)))return{source:e.join(`
2
+ `),locations:e.map((e,t)=>({line:t+1,column:0}))};let i=[],a=[],c=!1;e.forEach((e,t)=>{!n[t]&&s(e)===0&&/^\w/.test(e)&&(c=/^(?:concept|type|import|domain|system|eventsource|policy|persona|identity)\b/.test(e)),(c?i:a).push(t)});let l=r.includes(`feature`)?1:r.includes(`slice`)?2:3,u=t.slice(0,l);return{source:[...i.map(t=>e[t]),...u,...a.map(t=>` `.repeat(l*2)+e[t])].join(`
3
+ `),locations:[...i.map(e=>({line:e+1,column:0})),...u.map(()=>({line:0,column:0})),...a.map(e=>({line:e+1,column:l*2}))]}}function analyze(f,p,m,h=`current.play`,g=!0){let _=p.map((e,t)=>typeof e==`string`?{path:`other-${t}.play`,source:e}:e).filter(e=>e.path!==h),v=[{path:h,source:f.join(`
4
+ `),placement:m,isPlacementResolved:g},..._],y=new Set(v.flatMap(e=>[...e.source.matchAll(/\w+/g)].map(e=>e[0]).concat(e.placement??[]))),fresh=e=>{let t=e;for(let n=1;y.has(t);n++)t=`${e}${n}`;return y.add(t),t},b=fresh(`EditorAuthoring`),x=fresh(`FragmentFeature`),S=/* @__PURE__ */ new Set([b,x]),C=v.map((e,t)=>{let n=t===0?f:e.source.split(`
5
+ `),r=fresh(`Fragment${t}`);S.add(r);let i=e.placement?.length?{source:e.source,locations:n.map((e,t)=>({line:t+1,column:0}))}:authoringSource(n,[`module ${b}`,` feature ${x}`,` slice StateChange ${r}`]);return{...e,...i,placement:e.placement??[]}}),w=C[0],ee=new Map(C.map(e=>[e.path,e.locations])),T=a([...C.slice(1),w],void 0,!0),E=/* @__PURE__ */ new Map,D=/* @__PURE__ */ new Map,O=/* @__PURE__ */ new WeakSet,walk=e=>{if(typeof e!=`object`||!e||O.has(e))return;if(O.add(e),Array.isArray(e)){e.forEach(walk);return}let t=e;if(typeof t.path==`string`&&typeof t.line==`number`&&typeof t.column==`number`){let e=ee.get(t.path)?.[t.line-1];e&&(t.line=e.line,t.column=Math.max(1,t.column-e.column))}else{for(let e of Object.values(t))walk(e);t.location?.path===h&&(t.kind===`CommandSyntax`&&E.set(t.location.line-1,e),t.kind===`SpecificationSyntax`&&D.set(t.location.line-1,e))}};walk(T.value),walk(T.physicalEventSources),walk(T.continuationValues);for(let e of T.diagnostics)walk(e.location);let k=T.diagnostics.some(e=>{if(![`PLAY0022`,`PLAY0024`,`PLAY0029`].includes(e.code))return!1;let t=C.find(t=>t.path===e.location.path),n=v.find(t=>t.path===e.location.path)?.source.split(`
6
+ `)[e.location.line-1];return t?.locations.some(e=>e.line===0)&&n!==void 0&&s(n)===0}),A=T.diagnostics.filter(e=>e.location.path===h).flatMap(e=>(walk(e.location),e.location.line>0?[e]:[])),j=new e(T.value);for(let{slice:e}of j.slices)for(let n of t(e).reducers??[])walk(n);let M=new Set(j.slices.flatMap(({slice:e})=>[...e.commands.flatMap(e=>e.produces),...e.reactions.flatMap(e=>e.triggers).flatMap(e=>e.produces)].filter(t=>t.location.path===h&&!j.isEventProduction(t,e)).map(e=>e.location.line-1)));for(let e of A)e.code===`PLAY0499`&&M.add(e.location.line-1);let N=j.declarations.filter(e=>e.kind===`operation`).map(e=>({...e.node,scope:e.scope.filter(e=>!S.has(e))})),P=/* @__PURE__ */ new Map,F=o(f),range=e=>{let t=[],n=s(f[e]);for(let r=e;r<f.length&&!(r>e&&!F[r]&&c(f[r]).trim()&&s(f[r])<=n);r++)t.push(r);return t};for(let{slice:e,scope:t}of j.slices){if(e.location.path===h&&e.location.line>0)for(let n of range(e.location.line-1))P.set(n,{scope:t});for(let n of e.specifications.filter(e=>e.location.path===h&&e.location.line>0))for(let e of range(n.location.line-1))P.set(e,{scope:t});for(let n of e.commands.filter(e=>e.location.path===h&&e.location.line>0))for(let e of range(n.location.line-1))P.set(e,{scope:t,commandLine:n.location.line-1})}let I=new Map(j.declarations.map(e=>[e.node.location,e.scope]));for(let e of N.filter(e=>e.location.path===h)){let t=I.get(e.location);for(let n of range(e.location.line-1))P.set(n,{...P.get(n),scope:t,operation:e})}let L=new Map(N.map(e=>[e.location,e])),referenceLocation=(e,t)=>{let n=c(f[e.line-1]??``),r=n.slice(e.column-1).match(/^(?:given\s+operation|then\s+(?:operation|compensated))\s+/)?.[0];return r&&n.slice(e.column-1+r.length,e.column-1+r.length+t.length)===t?{...e,column:e.column+r.length}:e},R=[];for(let{slice:e}of j.slices){for(let t of e.commands)for(let n of t.produces){if(n.location.path!==h)continue;let t=j.resolve(n.event,e),r=t.declaration?L.get(t.declaration.node.location)??null:null,i={name:n.event,location:n.location,targetLocation:n.targetLocation??n.location,kind:t.kind,declaration:r,mappings:n.mappings};if(R.push(i),t.kind===`operation`)for(let e of range(n.location.line-1)){let t=P.get(e);t&&P.set(e,{...t,production:i})}}for(let t of e.specifications)for(let n of[...t.givenOperationFailures??[],...t.thenOperations??[],...t.thenCompensated??[]]){if(n.location.path!==h)continue;let t=j.resolve(n.operation,e);R.push({name:n.operation,location:n.location,targetLocation:referenceLocation(n.location,n.operation),kind:t.kind,declaration:t.declaration?L.get(t.declaration.node.location)??null:null,mappings:[]})}}let z={declarations:N,systems:T.value.systems??[],references:R,contexts:P,types:T.value.types,concepts:T.value.concepts,targets:e=>{let t=j.slices.find(t=>t.scope.length===e.length&&t.scope.every((t,n)=>t===e[n]))?.slice;return t?N.flatMap(e=>{let n=j.resolve(e.name,t).declaration?.node.location===e.location?e.name:[...e.scope,e.name].join(`.`);return j.resolve(n,t).kind===`operation`&&j.resolve(n,t).declaration?.node.location===e.location?[{name:n,declaration:e}]:[]}):[]}},B=T.physicalEventSources.map(e=>e.source),V=new i(T.physicalEventSources,T.sourceInventoryComplete&&!k),H=/* @__PURE__ */ new Map,resolve=(e,t)=>{let n=JSON.stringify([e,t]),r=H.get(n);return r||(r=V.resolve(e,t),H.set(n,r)),{...r,source:r.state===`unique`?r.sources[0]:void 0,stream:r.state===`unique`?r.streams[0]:void 0}},U=new Set(T.value.imports.map(e=>e.qualifiedName)),W=B.flatMap(e=>e.streams.filter(t=>resolve(e.name,t.name).state===`unique`&&!U.has(`${e.name}.${t.name}`)).map(t=>({name:`${e.name}.${t.name}`,source:e,stream:t}))),G=/* @__PURE__ */ new Map,K=[];for(let e of E.values()){for(let t of range(e.location.line-1))G.set(t,{command:e});for(let t of[...e.produces,...e.validations,...e.handler?[e.handler]:[]])for(let e of range(t.location.line-1))G.delete(e);if(e.stream){K.push(e.stream);for(let t of range(e.stream.location.line-1))G.set(t,{command:e,route:e.stream})}}let q=new Map(j.slices.flatMap(({slice:e})=>e.commands.map(t=>[t,e])));for(let e of E.values()){let t=q.get(e);if(t){for(let n of e.produces)if(j.isEventProduction(n,t)){for(let t of range(n.location.line-1))G.set(t,{command:e,production:!0});if(n.stream){K.push(n.stream);for(let t of range(n.stream.location.line-1))G.set(t,{command:e,production:!0,route:n.stream})}}}}for(let{slice:e}of j.slices)for(let n of[...e.reactions,...t(e).reducers??[]].filter(e=>e.location.path===h&&e.location.line>0))for(let e of range(n.location.line-1))G.set(e,{observer:n});let J=l(T.value,h,f,range,S,T.diagnostics),Y=[...[...D.values()].flatMap(e=>[...e.given.map(e=>({event:e,expectation:!1})),...e.whenAppended?[{event:e.whenAppended,expectation:!1}]:[],...e.thenEvents.map(e=>({event:e,expectation:!0})),...e.whenRedelivered?[{event:e.whenRedelivered,expectation:!0}]:[]]),...(J.eventExamples??[]).map(e=>({event:e,expectation:!0}))];for(let e of Y){let t=e.event;for(let n of range(t.location.line-1))G.set(n,e);if(t.stream){K.push(t.stream);for(let n of range(t.stream.location.line-1))G.set(n,{...e,route:t.stream})}}for(let e of B.filter(e=>e.location.path===h)){for(let t of range(e.location.line-1))G.set(t,{source:e});for(let t of e.streams)for(let n of range(t.location.line-1))G.set(n,{source:e,stream:t})}let X={declarations:B,routes:K,ambiguousCandidates:[...E.values()].flatMap(e=>e.streamCandidates??[]).filter(e=>e.propertyCandidate!==null),contexts:G,targets:W,resolve},Z,Q={completions(e,t,n){if(Z===void 0){let e=r(w.source,h,w.placement,!1).value,remapDependencyHeaders=e=>{walk(e.location),e.features.forEach(remapDependencyHeaders)};e.modules.forEach(remapDependencyHeaders),Z=d(T.value,e,h,range,S)}return Z.completions(e,t,n)}},te=n(j.slices.flatMap(({slice:e,scope:t})=>e.commands.map(e=>({command:e,scope:t}))),T.value.imports),$=/* @__PURE__ */ new Map;for(let e of T.continuationValues.filter(e=>e.location.path===h)){let t=/* @__PURE__ */ new Map;for(let n of[...e.success].reverse().filter(t=>!e.parameters.includes(t))){let r=te(n,e.scope);if(!r?.response)continue;let i=new Map(r.properties.map(e=>[e.name,e.type])),a=r.response,o=a.kind===`ScalarCommandResponseSyntax`?[{name:a.source.property,source:a.source,type:null}]:a.fields;for(let n of o){let a=n.type??i.get(n.source.property);a&&!e.locals.includes(n.name)&&!t.has(n.name)&&t.set(n.name,{name:n.name,type:a,command:r.name})}}$.set(e.location.line-1,[...t.values()])}return{identityDetails:(T.value.identity?.details??[]).map(e=>({name:e.name,type:`${e.type.name}${e.type.isCollection?`[]`:``}${e.type.isOptional?` optional`:``}`,line:e.location.line-1})),continuationResponses:$,commands:E,specifications:D,diagnostics:A,operationProductionLines:M,operations:z,eventSources:X,readModels:j.slices.flatMap(({slice:e,scope:t})=>(e.readModels??[]).map(e=>({model:e,scope:t.filter(e=>!S.has(e))}))),examples:J,personas:u(T.value,f),dependencies:Q}}function responseAnalysis(e,t=[],n,r=`current.play`,i=!0){let a=JSON.stringify([e,t,n,r,i]),o=p.get(a);return o===void 0&&(o=analyze(e,t,n,r,i),p.size>=16&&p.delete(p.keys().next().value),p.set(a,o)),o}export{responseAnalysis,f as responseAvailability};
7
7
  //# sourceMappingURL=response-analysis.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"response-analysis.js","names":["responseAvailability","revisions","fences","fenceMap","lines","roots","index","indentOf","line","root","globals","body","global","depth","wrappers","headers","others","otherSources","document","path","documents","names","match","name","prefix","suffix","module","feature","syntheticScopes","preparedDocuments","sourceLines","fragment","prepared","locations","parsed","parsePlacedDocuments","commands","specifications","visited","value","node","original","child","diagnostic","unknownFragmentExtent","location","diagnostics","productions","AuthoringProductionResolver","reducer","dependencySourcesOf","slice","operationProductionLines","command","reaction","trigger","production","declarations","declaration","segment","contexts","result","indent","start","withoutComment","specification","declarationScopes","operation","scope","declarationsByLocation","source","references","resolved","reference","context","step","operations","entry","part","sourceDeclarations","sourceCatalog","EventSourceReadConfidence","resolutions","key","stream","importedTypeReferences","imported","targets","sourceContexts","routes","member","commandSlices","observer","examples","exampleAnalysis","routeOwners","event","eventSources","candidate","dependencyAnalysis","detail","personaAnalysis","localDependencies","parseForAuthoring","dependencyTargetAnalysis","qualifier","placement","isPlacementResolved","analysis"],"sources":["../../response-analysis.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { AuthoringProductionKind, AuthoringProductionResolver, CommandSyntax, dependencySourcesOf, Diagnostic, EventSourceReadConfidence, FeatureSyntax, OperationSyntax, parseForAuthoring, parsePlacedDocuments, SpecificationSyntax } from '@cratis/screenplay-compiler';\nimport { fenceMap, indentOf, withoutComment } from './document-context';\nimport { ResponseAnalysis } from './ResponseAnalysis';\nimport { ExampleAnalysis } from './ExampleAnalysis';\nimport { exampleAnalysis } from './example-analysis';\nimport { personaAnalysis } from './persona-analysis';\nimport { dependencyTargetAnalysis } from './dependency-target-analysis';\nimport { EventSourceAnalysis } from './EventSourceAnalysis';\nimport { AuthoredCommandRoute } from './AuthoredCommandRoute';\nimport { AuthoredReadModelKeys } from './AuthoredReadModelKeys';\nimport { AuthoringDocument } from './AuthoringDocument';\nimport { OperationAnalysis, OperationDeclaration, OperationReference } from './OperationAnalysis';\n\n// Public editor shapes are structural: packed declarations never expose the private compiler.\nexport type { AuthoringDocument } from './AuthoringDocument';\nexport type { AnalysisLocation } from './AnalysisLocation';\nexport type { AnalysisDiagnostic } from './AnalysisDiagnostic';\nexport type { AnalysisType } from './AnalysisType';\nexport type { AnalysisCommand } from './AnalysisCommand';\nexport type { AnalysisSpecification } from './AnalysisSpecification';\nexport type { CommandResponseSymbol } from './CommandResponseSymbol';\nexport type { ResponseFieldSymbol } from './ResponseFieldSymbol';\nexport type { ResponseSourceSymbol } from './ResponseSourceSymbol';\nexport type { ResponseAnalysis } from './ResponseAnalysis';\n\nexport const responseAvailability = 'Executable as ESM v7. Generated values require fixtures in reference execution; other unadmitted constructs still prevent binding.';\n\n// A bounded revision cache shared by symbols, validation, completion and hover. Index typed nodes\n// once, not by reparsing the document for each command or response field.\nconst revisions = new Map<string, ReturnType<typeof analyze>>();\n\nfunction authoringSource(lines: string[], headers: readonly string[]) {\n const fences = fenceMap(lines);\n const roots = lines.flatMap((line, index) => !fences[index] && indentOf(line) === 0 && /^\\w/.test(line) ? [line.split(/\\s+/)[0]] : []);\n if (roots.includes('module') || !roots.some(root => ['feature', 'slice', 'command', 'event', 'operation', 'reaction', 'specification'].includes(root))) {\n return { source: lines.join('\\n'), locations: lines.map((_, index) => ({ line: index + 1, column: 0 })) };\n }\n // Isolated slice/command fragments are a supported editor input. Global declarations stay global.\n const globals: number[] = [];\n const body: number[] = [];\n let global = false;\n lines.forEach((line, index) => {\n if (!fences[index] && indentOf(line) === 0 && /^\\w/.test(line)) global = /^(?:concept|type|import|domain|system|eventsource|policy|persona|identity)\\b/.test(line);\n (global ? globals : body).push(index);\n });\n const depth = roots.includes('feature') ? 1 : roots.includes('slice') ? 2 : 3;\n const wrappers = headers.slice(0, depth);\n const source = [...globals.map(index => lines[index]), ...wrappers, ...body.map(index => ' '.repeat(depth * 2) + lines[index])].join('\\n');\n const locations = [...globals.map(index => ({ line: index + 1, column: 0 })), ...wrappers.map(() => ({ line: 0, column: 0 })), ...body.map(index => ({ line: index + 1, column: depth * 2 }))];\n return { source, locations };\n}\n\nfunction analyze(lines: string[], otherSources: readonly (string | AuthoringDocument)[], placement?: readonly string[], path = 'current.play', isPlacementResolved = true): ResponseAnalysis & { readonly operations: OperationAnalysis; readonly eventSources: EventSourceAnalysis; readonly readModels: readonly AuthoredReadModelKeys[]; readonly examples: ExampleAnalysis; readonly personas: ReturnType<typeof personaAnalysis>; readonly dependencies: ReturnType<typeof dependencyTargetAnalysis> } {\n const others = otherSources.map((document, index) => typeof document === 'string' ? { path: `other-${index}.play`, source: document } : document).filter(document => document.path !== path);\n const documents: AuthoringDocument[] = [{ path, source: lines.join('\\n'), placement, isPlacementResolved }, ...others];\n // Modules/features merge, but slices are real declarations: equal slice names discard later\n // documents. Share only fresh synthetic module/feature names, with a distinct synthetic slice\n // per fragment. This retains all commands for normal (including ambiguous) scope resolution,\n // without combining source texts or renaming real declarations/explicit placements. Reserve\n // source/placement names once so even a real Editor.Authoring.Fragment cannot collide.\n const names = new Set(documents.flatMap(document => [...document.source.matchAll(/\\w+/g)].map(match => match[0]).concat(document.placement ?? [])));\n const fresh = (prefix: string): string => {\n let name = prefix;\n for (let suffix = 1; names.has(name); suffix++) name = `${prefix}${suffix}`;\n names.add(name);\n return name;\n };\n const module = fresh('EditorAuthoring');\n const feature = fresh('FragmentFeature');\n const syntheticScopes = new Set([module, feature]);\n const preparedDocuments = documents.map((document, index) => {\n const sourceLines = index === 0 ? lines : document.source.split('\\n');\n const fragment = fresh(`Fragment${index}`);\n syntheticScopes.add(fragment);\n const prepared = document.placement?.length ? { source: document.source, locations: sourceLines.map((_, line) => ({ line: line + 1, column: 0 })) }\n : authoringSource(sourceLines, [`module ${module}`, ` feature ${feature}`, ` slice StateChange ${fragment}`]);\n return { ...document, ...prepared, placement: document.placement ?? [] };\n });\n const prepared = preparedDocuments[0];\n const locations = new Map(preparedDocuments.map(document => [document.path, document.locations]));\n // Put the buffer after its supplied context so duplicate real declarations are reported at\n // the current source, not silently dropped from its source-local diagnostic view.\n // Editor context can omit imported declarations. Defer only those missing types; imports whose\n // targets are present in the merged inventory still receive declaration-dependent validation.\n const parsed = parsePlacedDocuments([...preparedDocuments.slice(1), prepared], undefined, true);\n const commands = new Map<number, CommandSyntax>();\n const specifications = new Map<number, SpecificationSyntax>();\n const visited = new WeakSet<object>();\n const walk = (value: unknown): void => {\n if (value === null || typeof value !== 'object' || visited.has(value)) return;\n visited.add(value);\n if (Array.isArray(value)) { value.forEach(walk); return; }\n const node = value as Record<string, unknown>;\n // Source locations also occur as standalone members (usesLocation, targetLocation).\n // Mutate each original identity once: shared locations must not be shifted twice.\n if (typeof node.path === 'string' && typeof node.line === 'number' && typeof node.column === 'number') {\n const original = locations.get(node.path)?.[node.line - 1];\n if (original) { node.line = original.line; node.column = Math.max(1, node.column - original.column); }\n return;\n }\n for (const child of Object.values(node)) walk(child);\n if ((node.location as { path?: string; line: number } | undefined)?.path === path) {\n if (node.kind === 'CommandSyntax') commands.set((node.location as { line: number }).line - 1, value as CommandSyntax);\n if (node.kind === 'SpecificationSyntax') specifications.set((node.location as { line: number }).line - 1, value as SpecificationSyntax);\n }\n };\n walk(parsed.value);\n walk(parsed.physicalEventSources);\n // Fragment wrappers must not turn an unread original root into confidence evidence.\n // Retain the parser's unknown-owner diagnostic at its original physical root location.\n for (const diagnostic of parsed.diagnostics) walk(diagnostic.location);\n const unknownFragmentExtent = parsed.diagnostics.some(diagnostic => {\n if (!['PLAY0022', 'PLAY0024', 'PLAY0029'].includes(diagnostic.code)) return false;\n const document = preparedDocuments.find(document => document.path === diagnostic.location.path);\n const original = documents.find(document => document.path === diagnostic.location.path)?.source.split('\\n')[diagnostic.location.line - 1];\n return document?.locations.some(location => location.line === 0) && original !== undefined && indentOf(original) === 0;\n });\n const diagnostics: Diagnostic[] = parsed.diagnostics.filter(diagnostic => diagnostic.location.path === path).flatMap(diagnostic => {\n walk(diagnostic.location);\n return diagnostic.location.line > 0 ? [diagnostic] : [];\n });\n const productions = new AuthoringProductionResolver(parsed.value);\n for (const { slice } of productions.slices) for (const reducer of dependencySourcesOf(slice).reducers ?? []) walk(reducer);\n const operationProductionLines = new Set(productions.slices.flatMap(({ slice }) => [...slice.commands.flatMap(command => command.produces), ...slice.reactions.flatMap(reaction => reaction.triggers).flatMap(trigger => trigger.produces)]\n .filter(production => production.location.path === path && !productions.isEventProduction(production, slice))\n .map(production => production.location.line - 1)));\n // Rejected inline operation declarations have no syntax node, but the core parser still owns\n // the command-only kind fact. Retain it rather than suggesting an event declaration repair.\n for (const diagnostic of diagnostics) if (diagnostic.code === 'PLAY0499') operationProductionLines.add(diagnostic.location.line - 1);\n const declarations: OperationDeclaration[] = productions.declarations.filter(declaration => declaration.kind === AuthoringProductionKind.Operation)\n .map(declaration => ({ ...declaration.node as OperationSyntax, scope: declaration.scope.filter(segment => !syntheticScopes.has(segment)) }));\n const contexts = new Map<number, { scope: readonly string[]; commandLine?: number; operation?: OperationDeclaration; production?: OperationReference }>();\n // Index source ownership once per revision. Typed headers, not keyword-shaped properties,\n // define the ranges; greater-indented legacy properties remain leaves.\n const fences = fenceMap(lines);\n const range = (start: number): number[] => {\n const result: number[] = [];\n const indent = indentOf(lines[start]);\n for (let line = start; line < lines.length; line++) {\n if (line > start && !fences[line] && withoutComment(lines[line]).trim() && indentOf(lines[line]) <= indent) break;\n result.push(line);\n }\n return result;\n };\n for (const { slice, scope } of productions.slices) {\n if (slice.location.path === path && slice.location.line > 0) for (const line of range(slice.location.line - 1)) contexts.set(line, { scope });\n for (const specification of slice.specifications.filter(specification => specification.location.path === path && specification.location.line > 0)) {\n for (const line of range(specification.location.line - 1)) contexts.set(line, { scope });\n }\n for (const command of slice.commands.filter(command => command.location.path === path && command.location.line > 0)) {\n for (const line of range(command.location.line - 1)) contexts.set(line, { scope, commandLine: command.location.line - 1 });\n }\n }\n const declarationScopes = new Map(productions.declarations.map(declaration => [declaration.node.location, declaration.scope]));\n for (const operation of declarations.filter(operation => operation.location.path === path)) {\n const scope = declarationScopes.get(operation.location)!;\n for (const line of range(operation.location.line - 1)) contexts.set(line, { ...contexts.get(line), scope, operation });\n }\n const declarationsByLocation = new Map(declarations.map(declaration => [declaration.location, declaration]));\n const referenceLocation = (location: { path?: string; line: number; column: number }, name: string) => {\n const source = withoutComment(lines[location.line - 1] ?? '');\n const prefix = source.slice(location.column - 1).match(/^(?:given\\s+operation|then\\s+(?:operation|compensated))\\s+/)?.[0];\n return prefix && source.slice(location.column - 1 + prefix.length, location.column - 1 + prefix.length + name.length) === name\n ? { ...location, column: location.column + prefix.length } : location;\n };\n const references: OperationReference[] = [];\n for (const { slice } of productions.slices) {\n for (const command of slice.commands) for (const production of command.produces) {\n if (production.location.path !== path) continue;\n const resolved = productions.resolve(production.event, slice);\n const declaration = resolved.declaration ? declarationsByLocation.get(resolved.declaration.node.location) ?? null : null;\n const reference = { name: production.event, location: production.location, targetLocation: production.targetLocation ?? production.location, kind: resolved.kind, declaration, mappings: production.mappings };\n references.push(reference);\n if (resolved.kind === AuthoringProductionKind.Operation) {\n for (const line of range(production.location.line - 1)) {\n const context = contexts.get(line);\n if (context) contexts.set(line, { ...context, production: reference });\n }\n }\n }\n for (const specification of slice.specifications) {\n for (const step of [...specification.givenOperationFailures ?? [], ...specification.thenOperations ?? [], ...specification.thenCompensated ?? []]) {\n if (step.location.path !== path) continue;\n const resolved = productions.resolve(step.operation, slice);\n references.push({ name: step.operation, location: step.location, targetLocation: referenceLocation(step.location, step.operation), kind: resolved.kind,\n declaration: resolved.declaration ? declarationsByLocation.get(resolved.declaration.node.location) ?? null : null,\n mappings: [] });\n }\n }\n }\n const operations: OperationAnalysis = { declarations, systems: parsed.value.systems ?? [], references, contexts, types: parsed.value.types, concepts: parsed.value.concepts,\n targets: scope => {\n const slice = productions.slices.find(entry => entry.scope.length === scope.length && entry.scope.every((part, index) => part === scope[index]))?.slice;\n if (!slice) return [];\n return declarations.flatMap(declaration => {\n const name = productions.resolve(declaration.name, slice).declaration?.node.location === declaration.location\n ? declaration.name : [...declaration.scope, declaration.name].join('.');\n return productions.resolve(name, slice).kind === AuthoringProductionKind.Operation &&\n productions.resolve(name, slice).declaration?.node.location === declaration.location ? [{ name, declaration }] : [];\n });\n }\n };\n const sourceDeclarations = parsed.physicalEventSources.map(entry => entry.source);\n const sourceCatalog = new EventSourceReadConfidence(parsed.physicalEventSources, parsed.sourceInventoryComplete && !unknownFragmentExtent);\n const resolutions = new Map<string, ReturnType<EventSourceReadConfidence['resolve']>>();\n const resolve = (source: string, stream?: string) => {\n const key = JSON.stringify([source, stream]);\n let result = resolutions.get(key);\n if (!result) { result = sourceCatalog.resolve(source, stream); resolutions.set(key, result); }\n return { ...result, source: result.state === 'unique' ? result.sources[0] : undefined, stream: result.state === 'unique' ? result.streams[0] : undefined };\n };\n const importedTypeReferences = new Set(parsed.value.imports.map(imported => imported.qualifiedName));\n const targets = sourceDeclarations.flatMap(source => {\n return source.streams.filter(stream => resolve(source.name, stream.name).state === 'unique' && !importedTypeReferences.has(`${source.name}.${stream.name}`)).map(stream => ({ name: `${source.name}.${stream.name}`, source, stream }));\n });\n const sourceContexts = new Map<number, EventSourceAnalysis['contexts'] extends ReadonlyMap<number, infer Context> ? Context : never>();\n const routes: AuthoredCommandRoute[] = [];\n for (const command of commands.values()) {\n for (const line of range(command.location.line - 1)) sourceContexts.set(line, { command });\n for (const member of [...command.produces, ...command.validations, ...(command.handler ? [command.handler] : [])])\n for (const line of range(member.location.line - 1)) sourceContexts.delete(line);\n // Retained ambiguity candidates are not selected authored routes.\n if (command.stream) {\n routes.push(command.stream);\n for (const line of range(command.stream.location.line - 1)) sourceContexts.set(line, { command, route: command.stream });\n }\n }\n const commandSlices = new Map(productions.slices.flatMap(({ slice }) => slice.commands.map(command => [command, slice] as const)));\n for (const command of commands.values()) {\n const slice = commandSlices.get(command);\n if (!slice) continue;\n for (const production of command.produces) {\n if (!productions.isEventProduction(production, slice)) continue;\n for (const line of range(production.location.line - 1)) sourceContexts.set(line, { command, production: true });\n if (production.stream) {\n routes.push(production.stream);\n for (const line of range(production.stream.location.line - 1)) sourceContexts.set(line, { command, production: true, route: production.stream });\n }\n }\n }\n for (const { slice } of productions.slices) {\n for (const observer of [...slice.reactions, ...dependencySourcesOf(slice).reducers ?? []].filter(observer => observer.location.path === path && observer.location.line > 0)) {\n for (const line of range(observer.location.line - 1)) sourceContexts.set(line, { observer });\n }\n }\n const examples = exampleAnalysis(parsed.value, path, lines, range, syntheticScopes, parsed.diagnostics);\n const routeOwners = [\n ...[...specifications.values()].flatMap(specification => [\n ...specification.given.map(event => ({ event, expectation: false })),\n ...(specification.whenAppended ? [{ event: specification.whenAppended, expectation: false }] : []),\n ...specification.thenEvents.map(event => ({ event, expectation: true })),\n ...(specification.whenRedelivered ? [{ event: specification.whenRedelivered, expectation: true }] : [])\n ]),\n ...(examples.eventExamples ?? []).map(event => ({ event, expectation: true }))\n ];\n for (const context of routeOwners) {\n const event = context.event;\n for (const line of range(event.location.line - 1)) sourceContexts.set(line, context);\n if (event.stream) {\n routes.push(event.stream);\n for (const line of range(event.stream.location.line - 1)) sourceContexts.set(line, { ...context, route: event.stream });\n }\n }\n for (const source of sourceDeclarations.filter(source => source.location.path === path)) {\n for (const line of range(source.location.line - 1)) sourceContexts.set(line, { source });\n for (const stream of source.streams) for (const line of range(stream.location.line - 1)) sourceContexts.set(line, { source, stream });\n }\n const ambiguousCandidates = [...commands.values()].flatMap(command => command.streamCandidates ?? []).filter(candidate => candidate.propertyCandidate !== null);\n const eventSources: EventSourceAnalysis = { declarations: sourceDeclarations, routes, ambiguousCandidates, contexts: sourceContexts, targets, resolve };\n let dependencyAnalysis: ReturnType<typeof dependencyTargetAnalysis> | undefined;\n const dependencies: ReturnType<typeof dependencyTargetAnalysis> = {\n completions(line, qualifier, placement) {\n if (dependencyAnalysis === undefined) {\n // Merging restated headers retains the first header's location. Index physical typed\n // headers only when needed, so later fragments still own their incomplete lines.\n const localDependencies = parseForAuthoring(prepared.source, path, prepared.placement, false).value;\n const remapDependencyHeaders = (node: typeof localDependencies.modules[number] | FeatureSyntax): void => {\n walk(node.location);\n node.features.forEach(remapDependencyHeaders);\n };\n localDependencies.modules.forEach(remapDependencyHeaders);\n dependencyAnalysis = dependencyTargetAnalysis(parsed.value, localDependencies, path, range, syntheticScopes);\n }\n return dependencyAnalysis.completions(line, qualifier, placement);\n },\n };\n const identityDetails = (parsed.value.identity?.details ?? []).map(detail => ({ name: detail.name, type: `${detail.type.name}${detail.type.isCollection ? '[]' : ''}${detail.type.isOptional ? ' optional' : ''}`, line: detail.location.line - 1 }));\n return { identityDetails, commands, specifications, diagnostics, operationProductionLines, operations, eventSources, readModels: productions.slices.flatMap(({ slice, scope }) => (slice.readModels ?? []).map(model => ({ model, scope: scope.filter(segment => !syntheticScopes.has(segment)) }))), examples, personas: personaAnalysis(parsed.value, lines), dependencies };\n}\n\nexport function responseAnalysis(lines: string[], otherSources: readonly (string | AuthoringDocument)[] = [], placement?: readonly string[], path = 'current.play', isPlacementResolved = true): ResponseAnalysis & { readonly operations: OperationAnalysis; readonly eventSources: EventSourceAnalysis; readonly readModels: readonly AuthoredReadModelKeys[]; readonly examples: ExampleAnalysis; readonly personas: ReturnType<typeof personaAnalysis>; readonly dependencies: ReturnType<typeof dependencyTargetAnalysis> } {\n const key = JSON.stringify([lines, otherSources, placement, path, isPlacementResolved]);\n let analysis = revisions.get(key);\n if (analysis === undefined) {\n analysis = analyze(lines, otherSources, placement, path, isPlacementResolved);\n if (revisions.size >= 16) revisions.delete(revisions.keys().next().value!);\n revisions.set(key, analysis);\n }\n return analysis;\n}\n"],"mappings":"0vBA4BA,MAAaA,EAAuB,qIAI9BC,kBAAY,IAAI,IAEtB,SAAS,gBAAgB,EAAiB,EAA4B,CAClE,IAAMC,EAASC,EAASC,CAAK,EACvBC,EAAQD,EAAM,SAAS,EAAM,IAAU,CAACF,EAAOI,IAAUC,EAASC,CAAI,IAAM,GAAK,MAAM,KAAKA,CAAI,EAAI,CAACA,EAAK,MAAM,KAAK,CAAC,CAAC,EAAE,EAAI,CAAC,CAAC,EACrI,GAAIH,EAAM,SAAS,QAAQ,GAAK,CAACA,E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EACA8D,EAAkB,QAAQ,QAAQ,sBAAsB,EACxD,EAAqBE,EAAyBtE,EAAO,MAAOoE,EAAmBnF,EAAM,MAAOS,CAAe,CAC/G,CACA,OAAOuE,EAAmB,YAAY3F,EAAMiG,EAAWC,CAAS,CACpE,CAGuW,CAAE,CACjX,CAEA,SAAgB,iBAAiB,EAAiB,EAAwD,CAAC,EAAG,EAA+B,EAAO,eAAgB,EAAsB,GAAuU,CAC7f,IAAMvB,EAAM,KAAK,UAAU,CAAC/E,EAAOa,EAAcyF,EAAWvF,EAAMwF,CAAmB,CAAC,EAClFC,EAAW3G,EAAU,IAAIkF,CAAG,EAMhC,OALIyB,IAAa,IAAA,KACb,EAAW,QAAQxG,EAAOa,EAAcyF,EAAWvF,EAAMwF,CAAmB,EACxE1G,EAAU,MAAQ,IAAIA,EAAU,OAAOA,EAAU,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAM,EACzEA,EAAU,IAAIkF,EAAKyB,CAAQ,GAExBA,CACX"}
1
+ {"version":3,"file":"response-analysis.js","names":["responseAvailability","revisions","fences","fenceMap","lines","roots","index","indentOf","line","root","globals","body","global","depth","wrappers","headers","others","otherSources","document","path","documents","names","match","name","prefix","suffix","module","feature","syntheticScopes","preparedDocuments","sourceLines","fragment","prepared","locations","parsed","parsePlacedDocuments","commands","specifications","visited","value","node","original","child","diagnostic","unknownFragmentExtent","location","diagnostics","productions","AuthoringProductionResolver","reducer","dependencySourcesOf","slice","operationProductionLines","command","reaction","trigger","production","declarations","declaration","segment","contexts","result","indent","start","withoutComment","specification","declarationScopes","operation","scope","declarationsByLocation","source","references","resolved","reference","context","step","operations","entry","part","sourceDeclarations","sourceCatalog","EventSourceReadConfidence","resolutions","key","stream","importedTypeReferences","imported","targets","sourceContexts","routes","member","commandSlices","observer","examples","exampleAnalysis","routeOwners","event","eventSources","candidate","dependencyAnalysis","dependencies","localDependencies","parseForAuthoring","dependencyTargetAnalysis","qualifier","placement","resolveCommand","responseCommandResolver","continuationResponses","use","fields","properties","property","response","returned","field","type","detail","personaAnalysis","isPlacementResolved","analysis"],"sources":["../../response-analysis.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { AuthoringProductionKind, AuthoringProductionResolver, CommandSyntax, dependencySourcesOf, Diagnostic, EventSourceReadConfidence, FeatureSyntax, OperationSyntax, parseForAuthoring, parsePlacedDocuments, responseCommandResolver, SpecificationSyntax } from '@cratis/screenplay-compiler';\nimport { fenceMap, indentOf, withoutComment } from './document-context';\nimport { ResponseAnalysis } from './ResponseAnalysis';\nimport { ContinuationResponseField } from './ContinuationResponseField';\nimport { ExampleAnalysis } from './ExampleAnalysis';\nimport { exampleAnalysis } from './example-analysis';\nimport { personaAnalysis } from './persona-analysis';\nimport { dependencyTargetAnalysis } from './dependency-target-analysis';\nimport { EventSourceAnalysis } from './EventSourceAnalysis';\nimport { AuthoredCommandRoute } from './AuthoredCommandRoute';\nimport { AuthoredReadModelKeys } from './AuthoredReadModelKeys';\nimport { AuthoringDocument } from './AuthoringDocument';\nimport { OperationAnalysis, OperationDeclaration, OperationReference } from './OperationAnalysis';\n\n// Public editor shapes are structural: packed declarations never expose the private compiler.\nexport type { AuthoringDocument } from './AuthoringDocument';\nexport type { AnalysisLocation } from './AnalysisLocation';\nexport type { AnalysisDiagnostic } from './AnalysisDiagnostic';\nexport type { AnalysisType } from './AnalysisType';\nexport type { AnalysisCommand } from './AnalysisCommand';\nexport type { AnalysisSpecification } from './AnalysisSpecification';\nexport type { CommandResponseSymbol } from './CommandResponseSymbol';\nexport type { ResponseFieldSymbol } from './ResponseFieldSymbol';\nexport type { ResponseSourceSymbol } from './ResponseSourceSymbol';\nexport type { ResponseAnalysis } from './ResponseAnalysis';\n\nexport const responseAvailability = 'Executable as ESM v7. Generated values require fixtures in reference execution; other unadmitted constructs still prevent binding.';\n\n// A bounded revision cache shared by symbols, validation, completion and hover. Index typed nodes\n// once, not by reparsing the document for each command or response field.\nconst revisions = new Map<string, ReturnType<typeof analyze>>();\n\nfunction authoringSource(lines: string[], headers: readonly string[]) {\n const fences = fenceMap(lines);\n const roots = lines.flatMap((line, index) => !fences[index] && indentOf(line) === 0 && /^\\w/.test(line) ? [line.split(/\\s+/)[0]] : []);\n if (roots.includes('module') || !roots.some(root => ['feature', 'slice', 'command', 'event', 'operation', 'reaction', 'specification'].includes(root))) {\n return { source: lines.join('\\n'), locations: lines.map((_, index) => ({ line: index + 1, column: 0 })) };\n }\n // Isolated slice/command fragments are a supported editor input. Global declarations stay global.\n const globals: number[] = [];\n const body: number[] = [];\n let global = false;\n lines.forEach((line, index) => {\n if (!fences[index] && indentOf(line) === 0 && /^\\w/.test(line)) global = /^(?:concept|type|import|domain|system|eventsource|policy|persona|identity)\\b/.test(line);\n (global ? globals : body).push(index);\n });\n const depth = roots.includes('feature') ? 1 : roots.includes('slice') ? 2 : 3;\n const wrappers = headers.slice(0, depth);\n const source = [...globals.map(index => lines[index]), ...wrappers, ...body.map(index => ' '.repeat(depth * 2) + lines[index])].join('\\n');\n const locations = [...globals.map(index => ({ line: index + 1, column: 0 })), ...wrappers.map(() => ({ line: 0, column: 0 })), ...body.map(index => ({ line: index + 1, column: depth * 2 }))];\n return { source, locations };\n}\n\nfunction analyze(lines: string[], otherSources: readonly (string | AuthoringDocument)[], placement?: readonly string[], path = 'current.play', isPlacementResolved = true): ResponseAnalysis & { readonly operations: OperationAnalysis; readonly eventSources: EventSourceAnalysis; readonly readModels: readonly AuthoredReadModelKeys[]; readonly examples: ExampleAnalysis; readonly personas: ReturnType<typeof personaAnalysis>; readonly dependencies: ReturnType<typeof dependencyTargetAnalysis> } {\n const others = otherSources.map((document, index) => typeof document === 'string' ? { path: `other-${index}.play`, source: document } : document).filter(document => document.path !== path);\n const documents: AuthoringDocument[] = [{ path, source: lines.join('\\n'), placement, isPlacementResolved }, ...others];\n // Modules/features merge, but slices are real declarations: equal slice names discard later\n // documents. Share only fresh synthetic module/feature names, with a distinct synthetic slice\n // per fragment. This retains all commands for normal (including ambiguous) scope resolution,\n // without combining source texts or renaming real declarations/explicit placements. Reserve\n // source/placement names once so even a real Editor.Authoring.Fragment cannot collide.\n const names = new Set(documents.flatMap(document => [...document.source.matchAll(/\\w+/g)].map(match => match[0]).concat(document.placement ?? [])));\n const fresh = (prefix: string): string => {\n let name = prefix;\n for (let suffix = 1; names.has(name); suffix++) name = `${prefix}${suffix}`;\n names.add(name);\n return name;\n };\n const module = fresh('EditorAuthoring');\n const feature = fresh('FragmentFeature');\n const syntheticScopes = new Set([module, feature]);\n const preparedDocuments = documents.map((document, index) => {\n const sourceLines = index === 0 ? lines : document.source.split('\\n');\n const fragment = fresh(`Fragment${index}`);\n syntheticScopes.add(fragment);\n const prepared = document.placement?.length ? { source: document.source, locations: sourceLines.map((_, line) => ({ line: line + 1, column: 0 })) }\n : authoringSource(sourceLines, [`module ${module}`, ` feature ${feature}`, ` slice StateChange ${fragment}`]);\n return { ...document, ...prepared, placement: document.placement ?? [] };\n });\n const prepared = preparedDocuments[0];\n const locations = new Map(preparedDocuments.map(document => [document.path, document.locations]));\n // Put the buffer after its supplied context so duplicate real declarations are reported at\n // the current source, not silently dropped from its source-local diagnostic view.\n // Editor context can omit imported declarations. Defer only those missing types; imports whose\n // targets are present in the merged inventory still receive declaration-dependent validation.\n const parsed = parsePlacedDocuments([...preparedDocuments.slice(1), prepared], undefined, true);\n const commands = new Map<number, CommandSyntax>();\n const specifications = new Map<number, SpecificationSyntax>();\n const visited = new WeakSet<object>();\n const walk = (value: unknown): void => {\n if (value === null || typeof value !== 'object' || visited.has(value)) return;\n visited.add(value);\n if (Array.isArray(value)) { value.forEach(walk); return; }\n const node = value as Record<string, unknown>;\n // Source locations also occur as standalone members (usesLocation, targetLocation).\n // Mutate each original identity once: shared locations must not be shifted twice.\n if (typeof node.path === 'string' && typeof node.line === 'number' && typeof node.column === 'number') {\n const original = locations.get(node.path)?.[node.line - 1];\n if (original) { node.line = original.line; node.column = Math.max(1, node.column - original.column); }\n return;\n }\n for (const child of Object.values(node)) walk(child);\n if ((node.location as { path?: string; line: number } | undefined)?.path === path) {\n if (node.kind === 'CommandSyntax') commands.set((node.location as { line: number }).line - 1, value as CommandSyntax);\n if (node.kind === 'SpecificationSyntax') specifications.set((node.location as { line: number }).line - 1, value as SpecificationSyntax);\n }\n };\n walk(parsed.value);\n walk(parsed.physicalEventSources);\n walk(parsed.continuationValues);\n // Fragment wrappers must not turn an unread original root into confidence evidence.\n // Retain the parser's unknown-owner diagnostic at its original physical root location.\n for (const diagnostic of parsed.diagnostics) walk(diagnostic.location);\n const unknownFragmentExtent = parsed.diagnostics.some(diagnostic => {\n if (!['PLAY0022', 'PLAY0024', 'PLAY0029'].includes(diagnostic.code)) return false;\n const document = preparedDocuments.find(document => document.path === diagnostic.location.path);\n const original = documents.find(document => document.path === diagnostic.location.path)?.source.split('\\n')[diagnostic.location.line - 1];\n return document?.locations.some(location => location.line === 0) && original !== undefined && indentOf(original) === 0;\n });\n const diagnostics: Diagnostic[] = parsed.diagnostics.filter(diagnostic => diagnostic.location.path === path).flatMap(diagnostic => {\n walk(diagnostic.location);\n return diagnostic.location.line > 0 ? [diagnostic] : [];\n });\n const productions = new AuthoringProductionResolver(parsed.value);\n for (const { slice } of productions.slices) for (const reducer of dependencySourcesOf(slice).reducers ?? []) walk(reducer);\n const operationProductionLines = new Set(productions.slices.flatMap(({ slice }) => [...slice.commands.flatMap(command => command.produces), ...slice.reactions.flatMap(reaction => reaction.triggers).flatMap(trigger => trigger.produces)]\n .filter(production => production.location.path === path && !productions.isEventProduction(production, slice))\n .map(production => production.location.line - 1)));\n // Rejected inline operation declarations have no syntax node, but the core parser still owns\n // the command-only kind fact. Retain it rather than suggesting an event declaration repair.\n for (const diagnostic of diagnostics) if (diagnostic.code === 'PLAY0499') operationProductionLines.add(diagnostic.location.line - 1);\n const declarations: OperationDeclaration[] = productions.declarations.filter(declaration => declaration.kind === AuthoringProductionKind.Operation)\n .map(declaration => ({ ...declaration.node as OperationSyntax, scope: declaration.scope.filter(segment => !syntheticScopes.has(segment)) }));\n const contexts = new Map<number, { scope: readonly string[]; commandLine?: number; operation?: OperationDeclaration; production?: OperationReference }>();\n // Index source ownership once per revision. Typed headers, not keyword-shaped properties,\n // define the ranges; greater-indented legacy properties remain leaves.\n const fences = fenceMap(lines);\n const range = (start: number): number[] => {\n const result: number[] = [];\n const indent = indentOf(lines[start]);\n for (let line = start; line < lines.length; line++) {\n if (line > start && !fences[line] && withoutComment(lines[line]).trim() && indentOf(lines[line]) <= indent) break;\n result.push(line);\n }\n return result;\n };\n for (const { slice, scope } of productions.slices) {\n if (slice.location.path === path && slice.location.line > 0) for (const line of range(slice.location.line - 1)) contexts.set(line, { scope });\n for (const specification of slice.specifications.filter(specification => specification.location.path === path && specification.location.line > 0)) {\n for (const line of range(specification.location.line - 1)) contexts.set(line, { scope });\n }\n for (const command of slice.commands.filter(command => command.location.path === path && command.location.line > 0)) {\n for (const line of range(command.location.line - 1)) contexts.set(line, { scope, commandLine: command.location.line - 1 });\n }\n }\n const declarationScopes = new Map(productions.declarations.map(declaration => [declaration.node.location, declaration.scope]));\n for (const operation of declarations.filter(operation => operation.location.path === path)) {\n const scope = declarationScopes.get(operation.location)!;\n for (const line of range(operation.location.line - 1)) contexts.set(line, { ...contexts.get(line), scope, operation });\n }\n const declarationsByLocation = new Map(declarations.map(declaration => [declaration.location, declaration]));\n const referenceLocation = (location: { path?: string; line: number; column: number }, name: string) => {\n const source = withoutComment(lines[location.line - 1] ?? '');\n const prefix = source.slice(location.column - 1).match(/^(?:given\\s+operation|then\\s+(?:operation|compensated))\\s+/)?.[0];\n return prefix && source.slice(location.column - 1 + prefix.length, location.column - 1 + prefix.length + name.length) === name\n ? { ...location, column: location.column + prefix.length } : location;\n };\n const references: OperationReference[] = [];\n for (const { slice } of productions.slices) {\n for (const command of slice.commands) for (const production of command.produces) {\n if (production.location.path !== path) continue;\n const resolved = productions.resolve(production.event, slice);\n const declaration = resolved.declaration ? declarationsByLocation.get(resolved.declaration.node.location) ?? null : null;\n const reference = { name: production.event, location: production.location, targetLocation: production.targetLocation ?? production.location, kind: resolved.kind, declaration, mappings: production.mappings };\n references.push(reference);\n if (resolved.kind === AuthoringProductionKind.Operation) {\n for (const line of range(production.location.line - 1)) {\n const context = contexts.get(line);\n if (context) contexts.set(line, { ...context, production: reference });\n }\n }\n }\n for (const specification of slice.specifications) {\n for (const step of [...specification.givenOperationFailures ?? [], ...specification.thenOperations ?? [], ...specification.thenCompensated ?? []]) {\n if (step.location.path !== path) continue;\n const resolved = productions.resolve(step.operation, slice);\n references.push({ name: step.operation, location: step.location, targetLocation: referenceLocation(step.location, step.operation), kind: resolved.kind,\n declaration: resolved.declaration ? declarationsByLocation.get(resolved.declaration.node.location) ?? null : null,\n mappings: [] });\n }\n }\n }\n const operations: OperationAnalysis = { declarations, systems: parsed.value.systems ?? [], references, contexts, types: parsed.value.types, concepts: parsed.value.concepts,\n targets: scope => {\n const slice = productions.slices.find(entry => entry.scope.length === scope.length && entry.scope.every((part, index) => part === scope[index]))?.slice;\n if (!slice) return [];\n return declarations.flatMap(declaration => {\n const name = productions.resolve(declaration.name, slice).declaration?.node.location === declaration.location\n ? declaration.name : [...declaration.scope, declaration.name].join('.');\n return productions.resolve(name, slice).kind === AuthoringProductionKind.Operation &&\n productions.resolve(name, slice).declaration?.node.location === declaration.location ? [{ name, declaration }] : [];\n });\n }\n };\n const sourceDeclarations = parsed.physicalEventSources.map(entry => entry.source);\n const sourceCatalog = new EventSourceReadConfidence(parsed.physicalEventSources, parsed.sourceInventoryComplete && !unknownFragmentExtent);\n const resolutions = new Map<string, ReturnType<EventSourceReadConfidence['resolve']>>();\n const resolve = (source: string, stream?: string) => {\n const key = JSON.stringify([source, stream]);\n let result = resolutions.get(key);\n if (!result) { result = sourceCatalog.resolve(source, stream); resolutions.set(key, result); }\n return { ...result, source: result.state === 'unique' ? result.sources[0] : undefined, stream: result.state === 'unique' ? result.streams[0] : undefined };\n };\n const importedTypeReferences = new Set(parsed.value.imports.map(imported => imported.qualifiedName));\n const targets = sourceDeclarations.flatMap(source => {\n return source.streams.filter(stream => resolve(source.name, stream.name).state === 'unique' && !importedTypeReferences.has(`${source.name}.${stream.name}`)).map(stream => ({ name: `${source.name}.${stream.name}`, source, stream }));\n });\n const sourceContexts = new Map<number, EventSourceAnalysis['contexts'] extends ReadonlyMap<number, infer Context> ? Context : never>();\n const routes: AuthoredCommandRoute[] = [];\n for (const command of commands.values()) {\n for (const line of range(command.location.line - 1)) sourceContexts.set(line, { command });\n for (const member of [...command.produces, ...command.validations, ...(command.handler ? [command.handler] : [])])\n for (const line of range(member.location.line - 1)) sourceContexts.delete(line);\n // Retained ambiguity candidates are not selected authored routes.\n if (command.stream) {\n routes.push(command.stream);\n for (const line of range(command.stream.location.line - 1)) sourceContexts.set(line, { command, route: command.stream });\n }\n }\n const commandSlices = new Map(productions.slices.flatMap(({ slice }) => slice.commands.map(command => [command, slice] as const)));\n for (const command of commands.values()) {\n const slice = commandSlices.get(command);\n if (!slice) continue;\n for (const production of command.produces) {\n if (!productions.isEventProduction(production, slice)) continue;\n for (const line of range(production.location.line - 1)) sourceContexts.set(line, { command, production: true });\n if (production.stream) {\n routes.push(production.stream);\n for (const line of range(production.stream.location.line - 1)) sourceContexts.set(line, { command, production: true, route: production.stream });\n }\n }\n }\n for (const { slice } of productions.slices) {\n for (const observer of [...slice.reactions, ...dependencySourcesOf(slice).reducers ?? []].filter(observer => observer.location.path === path && observer.location.line > 0)) {\n for (const line of range(observer.location.line - 1)) sourceContexts.set(line, { observer });\n }\n }\n const examples = exampleAnalysis(parsed.value, path, lines, range, syntheticScopes, parsed.diagnostics);\n const routeOwners = [\n ...[...specifications.values()].flatMap(specification => [\n ...specification.given.map(event => ({ event, expectation: false })),\n ...(specification.whenAppended ? [{ event: specification.whenAppended, expectation: false }] : []),\n ...specification.thenEvents.map(event => ({ event, expectation: true })),\n ...(specification.whenRedelivered ? [{ event: specification.whenRedelivered, expectation: true }] : [])\n ]),\n ...(examples.eventExamples ?? []).map(event => ({ event, expectation: true }))\n ];\n for (const context of routeOwners) {\n const event = context.event;\n for (const line of range(event.location.line - 1)) sourceContexts.set(line, context);\n if (event.stream) {\n routes.push(event.stream);\n for (const line of range(event.stream.location.line - 1)) sourceContexts.set(line, { ...context, route: event.stream });\n }\n }\n for (const source of sourceDeclarations.filter(source => source.location.path === path)) {\n for (const line of range(source.location.line - 1)) sourceContexts.set(line, { source });\n for (const stream of source.streams) for (const line of range(stream.location.line - 1)) sourceContexts.set(line, { source, stream });\n }\n const ambiguousCandidates = [...commands.values()].flatMap(command => command.streamCandidates ?? []).filter(candidate => candidate.propertyCandidate !== null);\n const eventSources: EventSourceAnalysis = { declarations: sourceDeclarations, routes, ambiguousCandidates, contexts: sourceContexts, targets, resolve };\n let dependencyAnalysis: ReturnType<typeof dependencyTargetAnalysis> | undefined;\n const dependencies: ReturnType<typeof dependencyTargetAnalysis> = {\n completions(line, qualifier, placement) {\n if (dependencyAnalysis === undefined) {\n // Merging restated headers retains the first header's location. Index physical typed\n // headers only when needed, so later fragments still own their incomplete lines.\n const localDependencies = parseForAuthoring(prepared.source, path, prepared.placement, false).value;\n const remapDependencyHeaders = (node: typeof localDependencies.modules[number] | FeatureSyntax): void => {\n walk(node.location);\n node.features.forEach(remapDependencyHeaders);\n };\n localDependencies.modules.forEach(remapDependencyHeaders);\n dependencyAnalysis = dependencyTargetAnalysis(parsed.value, localDependencies, path, range, syntheticScopes);\n }\n return dependencyAnalysis.completions(line, qualifier, placement);\n },\n };\n const resolveCommand = responseCommandResolver(productions.slices.flatMap(({ slice, scope }) => slice.commands.map(command => ({ command, scope }))), parsed.value.imports);\n const continuationResponses = new Map<number, readonly ContinuationResponseField[]>();\n for (const use of parsed.continuationValues.filter(use => use.location.path === path)) {\n const fields = new Map<string, ContinuationResponseField>();\n for (const name of [...use.success].reverse().filter(name => !use.parameters.includes(name))) {\n const command = resolveCommand(name, use.scope);\n if (!command?.response) continue;\n const properties = new Map(command.properties.map(property => [property.name, property.type]));\n const response = command.response;\n const returned = response.kind === 'ScalarCommandResponseSyntax' ? [{ name: response.source.property, source: response.source, type: null }] : response.fields;\n for (const field of returned) {\n const type = field.type ?? properties.get(field.source.property);\n if (type && !use.locals.includes(field.name) && !fields.has(field.name)) fields.set(field.name, { name: field.name, type, command: command.name });\n }\n }\n continuationResponses.set(use.location.line - 1, [...fields.values()]);\n }\n const identityDetails = (parsed.value.identity?.details ?? []).map(detail => ({ name: detail.name, type: `${detail.type.name}${detail.type.isCollection ? '[]' : ''}${detail.type.isOptional ? ' optional' : ''}`, line: detail.location.line - 1 }));\n return { identityDetails, continuationResponses, commands, specifications, diagnostics, operationProductionLines, operations, eventSources, readModels: productions.slices.flatMap(({ slice, scope }) => (slice.readModels ?? []).map(model => ({ model, scope: scope.filter(segment => !syntheticScopes.has(segment)) }))), examples, personas: personaAnalysis(parsed.value, lines), dependencies };\n}\n\nexport function responseAnalysis(lines: string[], otherSources: readonly (string | AuthoringDocument)[] = [], placement?: readonly string[], path = 'current.play', isPlacementResolved = true): ResponseAnalysis & { readonly operations: OperationAnalysis; readonly eventSources: EventSourceAnalysis; readonly readModels: readonly AuthoredReadModelKeys[]; readonly examples: ExampleAnalysis; readonly personas: ReturnType<typeof personaAnalysis>; readonly dependencies: ReturnType<typeof dependencyTargetAnalysis> } {\n const key = JSON.stringify([lines, otherSources, placement, path, isPlacementResolved]);\n let analysis = revisions.get(key);\n if (analysis === undefined) {\n analysis = analyze(lines, otherSources, placement, path, isPlacementResolved);\n if (revisions.size >= 16) revisions.delete(revisions.keys().next().value!);\n revisions.set(key, analysis);\n }\n return analysis;\n}\n"],"mappings":"k1BA6BA,MAAaA,EAAuB,qIAI9BC,kBAAY,IAAI,IAEtB,SAAS,gBAAgB,EAAiB,EAA4B,CAClE,IAAMC,EAASC,EAASC,CAAK,EACvBC,EAAQD,EAAM,SAAS,EAAM,IAAU,CAACF,EAAOI,IAAUC,EAAS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