@cratis/screenplay-language 5.3.0 → 5.3.2

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 (395) hide show
  1. package/dist/bundles/TypeReferenceSymbol.js.map +1 -1
  2. package/dist/bundles/action-subject-authoring.js.map +1 -1
  3. package/dist/bundles/bmp-word-characters.js.map +1 -1
  4. package/dist/bundles/case-authoring.js +1 -1
  5. package/dist/bundles/case-authoring.js.map +1 -1
  6. package/dist/bundles/code-actions.js.map +1 -1
  7. package/dist/bundles/command-read-completions.js.map +1 -1
  8. package/dist/bundles/compiler/Authoring/ActionSubjectQuickFixes.js +3 -3
  9. package/dist/bundles/compiler/Authoring/ActionSubjectQuickFixes.js.map +1 -1
  10. package/dist/bundles/compiler/Authoring/QuickFixes.js +4 -4
  11. package/dist/bundles/compiler/Authoring/QuickFixes.js.map +1 -1
  12. package/dist/bundles/compiler/Authoring/StructuredValueQuickFix.js +1 -1
  13. package/dist/bundles/compiler/Authoring/StructuredValueQuickFix.js.map +1 -1
  14. package/dist/bundles/compiler/Authoring/TimelineQuickFixContext.js +4 -4
  15. package/dist/bundles/compiler/Authoring/TimelineQuickFixContext.js.map +1 -1
  16. package/dist/bundles/compiler/Authoring/TimelineQuickFixImports.js +2 -2
  17. package/dist/bundles/compiler/Authoring/TimelineQuickFixImports.js.map +1 -1
  18. package/dist/bundles/compiler/Authoring/TimelineQuickFixes.js +1 -1
  19. package/dist/bundles/compiler/Authoring/TimelineQuickFixes.js.map +1 -1
  20. package/dist/bundles/compiler/Dependencies/DeclaredDependencies.js.map +1 -1
  21. package/dist/bundles/compiler/Dependencies/DeclaredDependencyTargets.js.map +1 -1
  22. package/dist/bundles/compiler/Dependencies/DependencyGraph.js +1 -1
  23. package/dist/bundles/compiler/Dependencies/DependencyGraph.js.map +1 -1
  24. package/dist/bundles/compiler/Dependencies/DependencyKind.js.map +1 -1
  25. package/dist/bundles/compiler/Dependencies/InvalidDependencyQuery.js.map +1 -1
  26. package/dist/bundles/compiler/Dependencies/SliceReferences.js.map +1 -1
  27. package/dist/bundles/compiler/Dependencies/StronglyConnectedGroups.js.map +1 -1
  28. package/dist/bundles/compiler/Diagnostics/DiagnosticArgument.js.map +1 -1
  29. package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +1 -1
  30. package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -1
  31. package/dist/bundles/compiler/Diagnostics/ProductionDestinationDiagnostics.js +1 -1
  32. package/dist/bundles/compiler/Diagnostics/ProductionDestinationDiagnostics.js.map +1 -1
  33. package/dist/bundles/compiler/Diagnostics/SourceLocation.js.map +1 -1
  34. package/dist/bundles/compiler/Files/AuthoredOrder.js +1 -1
  35. package/dist/bundles/compiler/Files/AuthoredOrder.js.map +1 -1
  36. package/dist/bundles/compiler/Files/OrderingRoot.js +1 -1
  37. package/dist/bundles/compiler/Files/OrderingRoot.js.map +1 -1
  38. package/dist/bundles/compiler/Files/PlayApplicationAssembly.js +1 -1
  39. package/dist/bundles/compiler/Files/PlayApplicationAssembly.js.map +1 -1
  40. package/dist/bundles/compiler/Files/PlayDocumentSource.js.map +1 -1
  41. package/dist/bundles/compiler/Files/PlayFolderMerge.js +1 -1
  42. package/dist/bundles/compiler/Files/PlayFolderMerge.js.map +1 -1
  43. package/dist/bundles/compiler/Files/PlayGlob.js +2 -1
  44. package/dist/bundles/compiler/Files/PlayGlob.js.map +1 -1
  45. package/dist/bundles/compiler/Files/PlayImports.js +1 -1
  46. package/dist/bundles/compiler/Files/PlayImports.js.map +1 -1
  47. package/dist/bundles/compiler/Files/PlayPlacement.js.map +1 -1
  48. package/dist/bundles/compiler/Files/TimelineOrder.js +1 -1
  49. package/dist/bundles/compiler/Files/TimelineOrder.js.map +1 -1
  50. package/dist/bundles/compiler/Generation/FiniteGenerationRules.js +1 -1
  51. package/dist/bundles/compiler/Generation/GenerationAssessmentCache.js.map +1 -1
  52. package/dist/bundles/compiler/Generation/GenerationChecksum.js.map +1 -1
  53. package/dist/bundles/compiler/Generation/GenerationPattern.js +1 -1
  54. package/dist/bundles/compiler/Generation/GenerationPattern.js.map +1 -1
  55. package/dist/bundles/compiler/Generation/GenerationPatternAssessment.js.map +1 -1
  56. package/dist/bundles/compiler/Generation/GenerationPatternParser.js.map +1 -1
  57. package/dist/bundles/compiler/Generation/GenerationPatternToken.js.map +1 -1
  58. package/dist/bundles/compiler/Generation/GenerationRuleProof.js +1 -1
  59. package/dist/bundles/compiler/Generation/InvalidGenerationPattern.js.map +1 -1
  60. package/dist/bundles/compiler/Generation/RegexCharacters.js.map +1 -1
  61. package/dist/bundles/compiler/Generation/RegexExpression.js.map +1 -1
  62. package/dist/bundles/compiler/Generation/RuleConsistency.js +1 -1
  63. package/dist/bundles/compiler/Parsing/ActionSubjectClause.js.map +1 -1
  64. package/dist/bundles/compiler/Parsing/ActionSubjectInputs.js.map +1 -1
  65. package/dist/bundles/compiler/Parsing/ActionSubjectResolution.js.map +1 -1
  66. package/dist/bundles/compiler/Parsing/ApplicationContextParser.js +1 -1
  67. package/dist/bundles/compiler/Parsing/ApplicationContextParser.js.map +1 -1
  68. package/dist/bundles/compiler/Parsing/AuthorizeParser.js +1 -1
  69. package/dist/bundles/compiler/Parsing/AuthorizeParser.js.map +1 -1
  70. package/dist/bundles/compiler/Parsing/CanvasPlacement.js.map +1 -1
  71. package/dist/bundles/compiler/Parsing/CaptureEventFixturesValidator.js.map +1 -1
  72. package/dist/bundles/compiler/Parsing/CaptureParser.js +1 -1
  73. package/dist/bundles/compiler/Parsing/CaptureParser.js.map +1 -1
  74. package/dist/bundles/compiler/Parsing/ClockOperandParser.js.map +1 -1
  75. package/dist/bundles/compiler/Parsing/CodeBlockParser.js.map +1 -1
  76. package/dist/bundles/compiler/Parsing/CommandDestinationTypes.js.map +1 -1
  77. package/dist/bundles/compiler/Parsing/CommandHandlerValidator.js.map +1 -1
  78. package/dist/bundles/compiler/Parsing/CommandParser.js +1 -1
  79. package/dist/bundles/compiler/Parsing/CommandParser.js.map +1 -1
  80. package/dist/bundles/compiler/Parsing/CommandReadSources.js.map +1 -1
  81. package/dist/bundles/compiler/Parsing/CommandResponseParser.js +1 -1
  82. package/dist/bundles/compiler/Parsing/CommandResponseParser.js.map +1 -1
  83. package/dist/bundles/compiler/Parsing/CommandStreamCandidates.js.map +1 -1
  84. package/dist/bundles/compiler/Parsing/CompositeStreamIdValidator.js.map +1 -1
  85. package/dist/bundles/compiler/Parsing/CompositionParser.js +1 -1
  86. package/dist/bundles/compiler/Parsing/CompositionParser.js.map +1 -1
  87. package/dist/bundles/compiler/Parsing/ConceptComplianceParser.js +1 -1
  88. package/dist/bundles/compiler/Parsing/ConceptComplianceParser.js.map +1 -1
  89. package/dist/bundles/compiler/Parsing/ConditionDepthBudget.js +2 -0
  90. package/dist/bundles/compiler/Parsing/ConditionDepthBudget.js.map +1 -0
  91. package/dist/bundles/compiler/Parsing/ConditionParser.js +1 -1
  92. package/dist/bundles/compiler/Parsing/ConditionParser.js.map +1 -1
  93. package/dist/bundles/compiler/Parsing/ConstraintParser.js +1 -1
  94. package/dist/bundles/compiler/Parsing/ConstraintParser.js.map +1 -1
  95. package/dist/bundles/compiler/Parsing/ConstraintPropertyValidator.js +1 -1
  96. package/dist/bundles/compiler/Parsing/ConstraintPropertyValidator.js.map +1 -1
  97. package/dist/bundles/compiler/Parsing/ContinuationValues.js.map +1 -1
  98. package/dist/bundles/compiler/Parsing/DeclarationParsers.js +1 -1
  99. package/dist/bundles/compiler/Parsing/DeclarationParsers.js.map +1 -1
  100. package/dist/bundles/compiler/Parsing/DependencySourceParser.js +1 -1
  101. package/dist/bundles/compiler/Parsing/DependencySourceParser.js.map +1 -1
  102. package/dist/bundles/compiler/Parsing/DependsOnParser.js.map +1 -1
  103. package/dist/bundles/compiler/Parsing/DescriptionParser.js +1 -1
  104. package/dist/bundles/compiler/Parsing/DescriptionParser.js.map +1 -1
  105. package/dist/bundles/compiler/Parsing/DocumentationParser.js +1 -1
  106. package/dist/bundles/compiler/Parsing/DocumentationParser.js.map +1 -1
  107. package/dist/bundles/compiler/Parsing/EnumerationMembers.js +1 -1
  108. package/dist/bundles/compiler/Parsing/EnumerationMembers.js.map +1 -1
  109. package/dist/bundles/compiler/Parsing/EventMetadataParser.js +1 -1
  110. package/dist/bundles/compiler/Parsing/EventMetadataParser.js.map +1 -1
  111. package/dist/bundles/compiler/Parsing/EventSourceParser.js +1 -1
  112. package/dist/bundles/compiler/Parsing/EventSourceParser.js.map +1 -1
  113. package/dist/bundles/compiler/Parsing/EventSourceValidator.js +1 -1
  114. package/dist/bundles/compiler/Parsing/EventSourceValidator.js.map +1 -1
  115. package/dist/bundles/compiler/Parsing/EventSubjectValidator.js +1 -1
  116. package/dist/bundles/compiler/Parsing/EventSubjectValidator.js.map +1 -1
  117. package/dist/bundles/compiler/Parsing/ExpressionParser.js +1 -1
  118. package/dist/bundles/compiler/Parsing/ExpressionParser.js.map +1 -1
  119. package/dist/bundles/compiler/Parsing/FeatureBody.js +1 -1
  120. package/dist/bundles/compiler/Parsing/FeatureBody.js.map +1 -1
  121. package/dist/bundles/compiler/Parsing/FileImportParser.js.map +1 -1
  122. package/dist/bundles/compiler/Parsing/FileReferences.js.map +1 -1
  123. package/dist/bundles/compiler/Parsing/FoldedEventSources.js.map +1 -1
  124. package/dist/bundles/compiler/Parsing/GenerationBodyParser.js +1 -1
  125. package/dist/bundles/compiler/Parsing/GenerationBodyParser.js.map +1 -1
  126. package/dist/bundles/compiler/Parsing/GenerationParser.js +1 -1
  127. package/dist/bundles/compiler/Parsing/GenerationParser.js.map +1 -1
  128. package/dist/bundles/compiler/Parsing/GuardedActionInputs.js.map +1 -1
  129. package/dist/bundles/compiler/Parsing/GuardedActionParser.js +1 -1
  130. package/dist/bundles/compiler/Parsing/GuardedActionParser.js.map +1 -1
  131. package/dist/bundles/compiler/Parsing/GuardedActionShadowing.js.map +1 -1
  132. package/dist/bundles/compiler/Parsing/GuardedActionValidator.js +1 -1
  133. package/dist/bundles/compiler/Parsing/GuardedActionValidator.js.map +1 -1
  134. package/dist/bundles/compiler/Parsing/GuardedInteractions.js +1 -1
  135. package/dist/bundles/compiler/Parsing/GuardedInteractions.js.map +1 -1
  136. package/dist/bundles/compiler/Parsing/IdentifierComplianceValidator.js +1 -1
  137. package/dist/bundles/compiler/Parsing/IdentifierComplianceValidator.js.map +1 -1
  138. package/dist/bundles/compiler/Parsing/IdentityParser.js +1 -1
  139. package/dist/bundles/compiler/Parsing/IdentityParser.js.map +1 -1
  140. package/dist/bundles/compiler/Parsing/IdentityValidator.js.map +1 -1
  141. package/dist/bundles/compiler/Parsing/ImplementationParser.js +2 -2
  142. package/dist/bundles/compiler/Parsing/ImplementationParser.js.map +1 -1
  143. package/dist/bundles/compiler/Parsing/ImportDiscovery.js +1 -1
  144. package/dist/bundles/compiler/Parsing/ImportDiscovery.js.map +1 -1
  145. package/dist/bundles/compiler/Parsing/InlineEventValidator.js.map +1 -1
  146. package/dist/bundles/compiler/Parsing/InputUses.js +1 -1
  147. package/dist/bundles/compiler/Parsing/InputUses.js.map +1 -1
  148. package/dist/bundles/compiler/Parsing/InteractionAlternatives.js +1 -1
  149. package/dist/bundles/compiler/Parsing/InteractionAlternatives.js.map +1 -1
  150. package/dist/bundles/compiler/Parsing/InteractionExecutions.js +1 -1
  151. package/dist/bundles/compiler/Parsing/InteractionExecutions.js.map +1 -1
  152. package/dist/bundles/compiler/Parsing/LegacyTextRulePatterns.js.map +1 -1
  153. package/dist/bundles/compiler/Parsing/LineReader.js.map +1 -1
  154. package/dist/bundles/compiler/Parsing/LineText.js.map +1 -1
  155. package/dist/bundles/compiler/Parsing/MatchAmbiguity.js +1 -1
  156. package/dist/bundles/compiler/Parsing/MatchAmbiguity.js.map +1 -1
  157. package/dist/bundles/compiler/Parsing/MatchAmbiguityCharacters.js.map +1 -1
  158. package/dist/bundles/compiler/Parsing/MatchAmbiguityGraph.js.map +1 -1
  159. package/dist/bundles/compiler/Parsing/MatchAmbiguityParser.js.map +1 -1
  160. package/dist/bundles/compiler/Parsing/MatchOperandValidation.js +1 -1
  161. package/dist/bundles/compiler/Parsing/MatchOperandValidation.js.map +1 -1
  162. package/dist/bundles/compiler/Parsing/ModuleBody.js +1 -1
  163. package/dist/bundles/compiler/Parsing/ModuleBody.js.map +1 -1
  164. package/dist/bundles/compiler/Parsing/ObserverFilterParser.js +1 -1
  165. package/dist/bundles/compiler/Parsing/ObserverFilterParser.js.map +1 -1
  166. package/dist/bundles/compiler/Parsing/ObserverFilterValidator.js.map +1 -1
  167. package/dist/bundles/compiler/Parsing/OperationParser.js +1 -1
  168. package/dist/bundles/compiler/Parsing/OperationParser.js.map +1 -1
  169. package/dist/bundles/compiler/Parsing/OperationValidator.js +1 -1
  170. package/dist/bundles/compiler/Parsing/OperationValidator.js.map +1 -1
  171. package/dist/bundles/compiler/Parsing/ParserContext.js.map +1 -1
  172. package/dist/bundles/compiler/Parsing/PersonaCallerValidator.js.map +1 -1
  173. package/dist/bundles/compiler/Parsing/PolicyParser.js +1 -1
  174. package/dist/bundles/compiler/Parsing/PolicyParser.js.map +1 -1
  175. package/dist/bundles/compiler/Parsing/PortableMatchGroupName.js.map +1 -1
  176. package/dist/bundles/compiler/Parsing/PortableMatchPattern.js.map +1 -1
  177. package/dist/bundles/compiler/Parsing/PortableMatchSuggestions.js.map +1 -1
  178. package/dist/bundles/compiler/Parsing/PossibleEventsParser.js +1 -1
  179. package/dist/bundles/compiler/Parsing/PossibleEventsParser.js.map +1 -1
  180. package/dist/bundles/compiler/Parsing/ProducesParser.js +1 -1
  181. package/dist/bundles/compiler/Parsing/ProducesParser.js.map +1 -1
  182. package/dist/bundles/compiler/Parsing/ProjectionEventScopeValidator.js.map +1 -1
  183. package/dist/bundles/compiler/Parsing/ProjectionExpressionParser.js +1 -1
  184. package/dist/bundles/compiler/Parsing/ProjectionExpressionParser.js.map +1 -1
  185. package/dist/bundles/compiler/Parsing/ProjectionParser.js +1 -1
  186. package/dist/bundles/compiler/Parsing/ProjectionParser.js.map +1 -1
  187. package/dist/bundles/compiler/Parsing/ProjectionTargetValidator.js +1 -1
  188. package/dist/bundles/compiler/Parsing/ProjectionTargetValidator.js.map +1 -1
  189. package/dist/bundles/compiler/Parsing/PropertyLineParser.js +1 -1
  190. package/dist/bundles/compiler/Parsing/PropertyLineParser.js.map +1 -1
  191. package/dist/bundles/compiler/Parsing/PublicEventMetadataValidator.js +1 -1
  192. package/dist/bundles/compiler/Parsing/PublicEventMetadataValidator.js.map +1 -1
  193. package/dist/bundles/compiler/Parsing/PublicEventUsageCollector.js +1 -1
  194. package/dist/bundles/compiler/Parsing/PublicEventUsageCollector.js.map +1 -1
  195. package/dist/bundles/compiler/Parsing/PublicEventUsageValidator.js +1 -1
  196. package/dist/bundles/compiler/Parsing/PublicEventUsageValidator.js.map +1 -1
  197. package/dist/bundles/compiler/Parsing/PurposeParser.js +1 -1
  198. package/dist/bundles/compiler/Parsing/PurposeParser.js.map +1 -1
  199. package/dist/bundles/compiler/Parsing/PurposeValidator.js.map +1 -1
  200. package/dist/bundles/compiler/Parsing/QueryParser.js +1 -1
  201. package/dist/bundles/compiler/Parsing/QueryParser.js.map +1 -1
  202. package/dist/bundles/compiler/Parsing/ReactionIdentityParser.js +1 -1
  203. package/dist/bundles/compiler/Parsing/ReactionIdentityParser.js.map +1 -1
  204. package/dist/bundles/compiler/Parsing/ReactionParser.js +1 -1
  205. package/dist/bundles/compiler/Parsing/ReactionParser.js.map +1 -1
  206. package/dist/bundles/compiler/Parsing/ReactionRefusalValidator.js +1 -1
  207. package/dist/bundles/compiler/Parsing/ReactionRefusalValidator.js.map +1 -1
  208. package/dist/bundles/compiler/Parsing/ReadModelKeyValidator.js.map +1 -1
  209. package/dist/bundles/compiler/Parsing/ReadModelMemberTypeValidator.js.map +1 -1
  210. package/dist/bundles/compiler/Parsing/ReadsParser.js +1 -1
  211. package/dist/bundles/compiler/Parsing/ReadsParser.js.map +1 -1
  212. package/dist/bundles/compiler/Parsing/RedeliveryValues.js.map +1 -1
  213. package/dist/bundles/compiler/Parsing/RefusalDeclarations.js +1 -1
  214. package/dist/bundles/compiler/Parsing/RefusalDeclarations.js.map +1 -1
  215. package/dist/bundles/compiler/Parsing/RefusalValueWalker.js.map +1 -1
  216. package/dist/bundles/compiler/Parsing/ResponseCommandResolver.js.map +1 -1
  217. package/dist/bundles/compiler/Parsing/ResponseDateValues.js.map +1 -1
  218. package/dist/bundles/compiler/Parsing/ResponseValidator.js +1 -1
  219. package/dist/bundles/compiler/Parsing/ResponseValidator.js.map +1 -1
  220. package/dist/bundles/compiler/Parsing/ScreenParser.js +1 -1
  221. package/dist/bundles/compiler/Parsing/ScreenParser.js.map +1 -1
  222. package/dist/bundles/compiler/Parsing/ScreenplayParser.js +1 -1
  223. package/dist/bundles/compiler/Parsing/ScreenplayParser.js.map +1 -1
  224. package/dist/bundles/compiler/Parsing/SeedParser.js +1 -1
  225. package/dist/bundles/compiler/Parsing/SeedParser.js.map +1 -1
  226. package/dist/bundles/compiler/Parsing/SliceParser.js +1 -1
  227. package/dist/bundles/compiler/Parsing/SliceParser.js.map +1 -1
  228. package/dist/bundles/compiler/Parsing/SourceLine.js.map +1 -1
  229. package/dist/bundles/compiler/Parsing/SourceLineSplitter.js.map +1 -1
  230. package/dist/bundles/compiler/Parsing/SourceOptionsParser.js +1 -1
  231. package/dist/bundles/compiler/Parsing/SourceOptionsParser.js.map +1 -1
  232. package/dist/bundles/compiler/Parsing/SpecificationCaseParser.js +1 -1
  233. package/dist/bundles/compiler/Parsing/SpecificationCaseParser.js.map +1 -1
  234. package/dist/bundles/compiler/Parsing/SpecificationCaseValidator.js +1 -1
  235. package/dist/bundles/compiler/Parsing/SpecificationCaseValidator.js.map +1 -1
  236. package/dist/bundles/compiler/Parsing/SpecificationCommandExamples.js +1 -1
  237. package/dist/bundles/compiler/Parsing/SpecificationCommandExamples.js.map +1 -1
  238. package/dist/bundles/compiler/Parsing/SpecificationExampleParser.js +1 -1
  239. package/dist/bundles/compiler/Parsing/SpecificationExampleParser.js.map +1 -1
  240. package/dist/bundles/compiler/Parsing/SpecificationParser.js +1 -1
  241. package/dist/bundles/compiler/Parsing/SpecificationParser.js.map +1 -1
  242. package/dist/bundles/compiler/Parsing/SpecificationRedeliveryValidator.js +1 -1
  243. package/dist/bundles/compiler/Parsing/SpecificationRedeliveryValidator.js.map +1 -1
  244. package/dist/bundles/compiler/Parsing/SpecificationResponseParser.js +1 -1
  245. package/dist/bundles/compiler/Parsing/SpecificationResponseParser.js.map +1 -1
  246. package/dist/bundles/compiler/Parsing/SpecificationRouteComparison.js +1 -1
  247. package/dist/bundles/compiler/Parsing/SpecificationRouteComparison.js.map +1 -1
  248. package/dist/bundles/compiler/Parsing/SpecificationStreamValidator.js +1 -1
  249. package/dist/bundles/compiler/Parsing/SpecificationStreamValidator.js.map +1 -1
  250. package/dist/bundles/compiler/Parsing/StateMachineParser.js +1 -1
  251. package/dist/bundles/compiler/Parsing/StateMachineParser.js.map +1 -1
  252. package/dist/bundles/compiler/Parsing/StructuralInteractionSites.js.map +1 -1
  253. package/dist/bundles/compiler/Parsing/StructuredBlockParser.js +1 -1
  254. package/dist/bundles/compiler/Parsing/StructuredBlockParser.js.map +1 -1
  255. package/dist/bundles/compiler/Parsing/StructuredValueParser.js.map +1 -1
  256. package/dist/bundles/compiler/Parsing/TemplateReferenceText.js +1 -1
  257. package/dist/bundles/compiler/Parsing/TemplateReferenceText.js.map +1 -1
  258. package/dist/bundles/compiler/Parsing/TriggerDataParser.js +1 -1
  259. package/dist/bundles/compiler/Parsing/TriggerDataParser.js.map +1 -1
  260. package/dist/bundles/compiler/Parsing/UiBindingParser.js +1 -1
  261. package/dist/bundles/compiler/Parsing/UiBindingParser.js.map +1 -1
  262. package/dist/bundles/compiler/Parsing/UiProfileLegacyLayout.js +1 -1
  263. package/dist/bundles/compiler/Parsing/UiProfileLegacyLayout.js.map +1 -1
  264. package/dist/bundles/compiler/Parsing/WorkflowParser.js +1 -1
  265. package/dist/bundles/compiler/Parsing/WorkflowParser.js.map +1 -1
  266. package/dist/bundles/compiler/Parsing/checkPortableMatchPattern.js.map +1 -1
  267. package/dist/bundles/compiler/Parsing/hasExponentialMatchAmbiguity.js.map +1 -1
  268. package/dist/bundles/compiler/Parsing/trimMatchAmbiguityGraph.js.map +1 -1
  269. package/dist/bundles/compiler/ScreenActionSubjects.js.map +1 -1
  270. package/dist/bundles/compiler/ScreenplayCompiler.js +1 -1
  271. package/dist/bundles/compiler/ScreenplayCompiler.js.map +1 -1
  272. package/dist/bundles/compiler/Syntax/ActionSubjectInvariants.js.map +1 -1
  273. package/dist/bundles/compiler/Syntax/AuthoringProductionResolver.js.map +1 -1
  274. package/dist/bundles/compiler/Syntax/CaptureEventsSource.js.map +1 -1
  275. package/dist/bundles/compiler/Syntax/DependencySources.js.map +1 -1
  276. package/dist/bundles/compiler/Syntax/EventDeclarations.js.map +1 -1
  277. package/dist/bundles/compiler/Syntax/EventSourceCatalog.js.map +1 -1
  278. package/dist/bundles/compiler/Syntax/EventSourceReadConfidence.js.map +1 -1
  279. package/dist/bundles/compiler/Syntax/ExactMathFacts.js.map +1 -1
  280. package/dist/bundles/compiler/Syntax/ExactNumber.js.map +1 -1
  281. package/dist/bundles/compiler/Syntax/InvalidSyntaxJson.js.map +1 -1
  282. package/dist/bundles/compiler/Syntax/LegacyWireProjection.js.map +1 -1
  283. package/dist/bundles/compiler/Syntax/Operations.js.map +1 -1
  284. package/dist/bundles/compiler/Syntax/PersonaCallers.js.map +1 -1
  285. package/dist/bundles/compiler/Syntax/ProductionDestinations.js.map +1 -1
  286. package/dist/bundles/compiler/Syntax/PublicEventInvariants.js.map +1 -1
  287. package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js.map +1 -1
  288. package/dist/bundles/compiler/Syntax/SourceOptions.js.map +1 -1
  289. package/dist/bundles/compiler/Syntax/SpecificationCaseOrigin.js.map +1 -1
  290. package/dist/bundles/compiler/Syntax/StreamIdFormatter.js.map +1 -1
  291. package/dist/bundles/compiler/Syntax/StrictSyntaxJson.js +1 -1
  292. package/dist/bundles/compiler/Syntax/Structure.js.map +1 -1
  293. package/dist/bundles/compiler/Syntax/SyntaxCollections.js.map +1 -1
  294. package/dist/bundles/compiler/Syntax/SyntaxInvariants.js +1 -1
  295. package/dist/bundles/compiler/Syntax/SyntaxInvariants.js.map +1 -1
  296. package/dist/bundles/compiler/Syntax/SyntaxJson.js +1 -1
  297. package/dist/bundles/compiler/Syntax/SyntaxJson.js.map +1 -1
  298. package/dist/bundles/compiler/Syntax/SyntaxMemberContracts.js.map +1 -1
  299. package/dist/bundles/compiler/Syntax/index.js +1 -1
  300. package/dist/bundles/compiler/Text/ImplementationHintText.js.map +1 -1
  301. package/dist/bundles/compiler/Text/ReservedWords.js.map +1 -1
  302. package/dist/bundles/compiler/Text/SourceStreamNames.js.map +1 -1
  303. package/dist/bundles/compiler/Text/StringLiteral.js.map +1 -1
  304. package/dist/bundles/compiler/Text/ordinalIgnoreCaseKey.js.map +1 -1
  305. package/dist/bundles/compiler/Text/patterns.js.map +1 -1
  306. package/dist/bundles/compiler/index.js +1 -1
  307. package/dist/bundles/completion-items.js +4 -4
  308. package/dist/bundles/completion-items.js.map +1 -1
  309. package/dist/bundles/completion-planner.js +2 -2
  310. package/dist/bundles/completion-planner.js.map +1 -1
  311. package/dist/bundles/completions.js +1 -1
  312. package/dist/bundles/completions.js.map +1 -1
  313. package/dist/bundles/continuation-responses.js +1 -1
  314. package/dist/bundles/continuation-responses.js.map +1 -1
  315. package/dist/bundles/declarations.js.map +1 -1
  316. package/dist/bundles/dependency-completions.js.map +1 -1
  317. package/dist/bundles/dependency-target-analysis.js.map +1 -1
  318. package/dist/bundles/diagnostic-codes.js +1 -1
  319. package/dist/bundles/diagnostic-codes.js.map +1 -1
  320. package/dist/bundles/diagnostics.js +1 -1
  321. package/dist/bundles/diagnostics.js.map +1 -1
  322. package/dist/bundles/document-context.js.map +1 -1
  323. package/dist/bundles/documentation-item.js.map +1 -1
  324. package/dist/bundles/event-analysis-source.js.map +1 -1
  325. package/dist/bundles/event-context-catalog.js.map +1 -1
  326. package/dist/bundles/event-context.js.map +1 -1
  327. package/dist/bundles/event-source-authoring.js +11 -11
  328. package/dist/bundles/event-source-authoring.js.map +1 -1
  329. package/dist/bundles/example-analysis.js +2 -2
  330. package/dist/bundles/example-analysis.js.map +1 -1
  331. package/dist/bundles/example-authoring.js +2 -2
  332. package/dist/bundles/example-authoring.js.map +1 -1
  333. package/dist/bundles/example-declaration-items.js.map +1 -1
  334. package/dist/bundles/example-values.js.map +1 -1
  335. package/dist/bundles/file-imports.js.map +1 -1
  336. package/dist/bundles/file-references.js.map +1 -1
  337. package/dist/bundles/generation-completions.js.map +1 -1
  338. package/dist/bundles/hover-content.js +5 -5
  339. package/dist/bundles/hover-content.js.map +1 -1
  340. package/dist/bundles/hover.js.map +1 -1
  341. package/dist/bundles/index.js +1 -1
  342. package/dist/bundles/index.js.map +1 -1
  343. package/dist/bundles/inlay-hints.js.map +1 -1
  344. package/dist/bundles/inline-completions.js +1 -1
  345. package/dist/bundles/inline-completions.js.map +1 -1
  346. package/dist/bundles/inline-event-validation.js +1 -1
  347. package/dist/bundles/inline-event-validation.js.map +1 -1
  348. package/dist/bundles/keyword-docs.js.map +1 -1
  349. package/dist/bundles/language.js.map +1 -1
  350. package/dist/bundles/named-rule-context.js.map +1 -1
  351. package/dist/bundles/operation-authoring.js +6 -6
  352. package/dist/bundles/operation-authoring.js.map +1 -1
  353. package/dist/bundles/persona-analysis.js +1 -1
  354. package/dist/bundles/persona-analysis.js.map +1 -1
  355. package/dist/bundles/production-destinations.js +1 -1
  356. package/dist/bundles/production-destinations.js.map +1 -1
  357. package/dist/bundles/purpose-items.js.map +1 -1
  358. package/dist/bundles/reaction-authoring.js +3 -3
  359. package/dist/bundles/reaction-authoring.js.map +1 -1
  360. package/dist/bundles/read-model-key-completions.js +1 -1
  361. package/dist/bundles/read-model-key-completions.js.map +1 -1
  362. package/dist/bundles/refusal-context.js.map +1 -1
  363. package/dist/bundles/response-analysis.js.map +1 -1
  364. package/dist/bundles/response-completions.js +1 -1
  365. package/dist/bundles/response-completions.js.map +1 -1
  366. package/dist/bundles/response-tokens.js +2 -2
  367. package/dist/bundles/response-tokens.js.map +1 -1
  368. package/dist/bundles/scope-items.js +3 -3
  369. package/dist/bundles/scope-items.js.map +1 -1
  370. package/dist/bundles/structure-completions.js.map +1 -1
  371. package/dist/bundles/sub-language-registry.js.map +1 -1
  372. package/dist/bundles/sub-languages/capture/CompletionProvider.js.map +1 -1
  373. package/dist/bundles/sub-languages/capture/HoverProvider.js.map +1 -1
  374. package/dist/bundles/sub-languages/capture/Validator.js.map +1 -1
  375. package/dist/bundles/sub-languages/capture/index.js.map +1 -1
  376. package/dist/bundles/sub-languages/capture/language.js.map +1 -1
  377. package/dist/bundles/sub-languages/cdl.js.map +1 -1
  378. package/dist/bundles/sub-languages/pdl.js.map +1 -1
  379. package/dist/bundles/sub-languages/projection/CodeActionProvider.js.map +1 -1
  380. package/dist/bundles/sub-languages/projection/CompletionProvider.js +1 -1
  381. package/dist/bundles/sub-languages/projection/CompletionProvider.js.map +1 -1
  382. package/dist/bundles/sub-languages/projection/HoverProvider.js.map +1 -1
  383. package/dist/bundles/sub-languages/projection/Validator.js.map +1 -1
  384. package/dist/bundles/sub-languages/projection/index.js.map +1 -1
  385. package/dist/bundles/sub-languages/projection/language.js.map +1 -1
  386. package/dist/bundles/symbols.js +2 -2
  387. package/dist/bundles/symbols.js.map +1 -1
  388. package/dist/bundles/themes/screenplay-dark.js.map +1 -1
  389. package/dist/bundles/themes/screenplay-light.js.map +1 -1
  390. package/dist/bundles/tokens.js.map +1 -1
  391. package/dist/bundles/validation.js +2 -2
  392. package/dist/bundles/validation.js.map +1 -1
  393. package/dist/diagnostic-codes.d.ts +1 -0
  394. package/dist/diagnostic-codes.d.ts.map +1 -1
  395. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"symbols.js","names":["conceptPattern","enumerationMemberPattern","bmpWordCharacters","propertyPattern","attributeReasonPattern","readPattern","commandReserved","authorizationContinuation","eventReserved","eventBodyReservedWords","inlineEventReserved","queryParameterPattern","property","typeReferenceSymbol","text","line","startColumn","body","lines","index","entry","match","reserved","start","fences","indentOf","indent","blockIndent","authorization","childIndent","symbolRevisions","source","cached","analysis","responseAnalysis","symbols","eventAnalysisSource","fenceMap","eventLines","eventFences","eventPropertyLines","trimmed","importMatch","qualifiedName","shortName","conceptMatch","bodyLines","i","directIndent","generationLine","generationStrategy","attributeReasons","reason","members","enumValues","member","enumNumbers","typeMatch","clauseKeywords","policyMatch","requires","eventMatch","inline","propertyBody","fileReferenceOn","unescapeString","command","productionHeaders","header","conditional","eventLine","name","children","targets","queryMatch","parameters","screenMatch","triggerMatch","documents","document","path","application","current","event","imported","builtInTriggerNames","trigger","primitives","concept","type"],"sources":["../../symbols.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { EventVisibility, eventBodyReservedWords, unescapeString } from '@cratis/screenplay-compiler';\nimport { fenceMap, indentOf } from './document-context';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { CommandResponseSymbol, responseAnalysis } from './response-analysis';\nimport { fileReferenceOn } from './file-references';\nimport { clauseKeywords } from './language';\nimport { bmpWordCharacters } from './bmp-word-characters';\nimport { AuthoringDocument } from './AuthoringDocument';\nimport { AuthoredEventSource } from './AuthoredEventSource';\nimport { ProductionSymbol } from './ProductionSymbol';\nimport { TypeReferenceSymbol, typeReferenceSymbol } from './TypeReferenceSymbol';\n\nexport interface PropertySymbol {\n name: string;\n type: string;\n typeReference?: TypeReferenceSymbol;\n // Exact spelling and UTF-16 columns in the authoring source, independent of normalization.\n sourceType?: { text: string; startColumn: number; endColumn: number };\n isIdentifier: boolean;\n isGenerated?: boolean;\n isSubject?: boolean;\n line: number;\n}\n\nexport interface ConceptSymbol {\n name: string;\n primitive: string;\n attributes: string[];\n attributeReasons: Record<string, string>;\n enumValues: string[];\n enumNumbers?: number[];\n generationStrategy?: string;\n line: number;\n}\n\nexport interface TypeSymbol {\n name: string;\n properties: PropertySymbol[];\n line: number;\n}\n\nexport interface PolicySymbol {\n name: string;\n requires: string[];\n line: number;\n}\n\nexport interface EventSymbol {\n // Public editor declarations stay structural; the compiler is privately bundled.\n visibility?: 'Private' | 'Public';\n origin?: string;\n name: string;\n generation?: number;\n inline?: boolean;\n properties: PropertySymbol[];\n line: number;\n}\n\nexport interface CommandSymbol extends NamedSymbol {\n properties: PropertySymbol[];\n reads?: ReadSymbol[];\n produces?: ProductionSymbol[];\n productionHeaders?: number[];\n response?: CommandResponseSymbol | null;\n}\n\nexport interface ReadSymbol {\n view: string;\n alias?: string;\n by?: string;\n line: number;\n}\n\nexport interface NamedSymbol {\n name: string;\n line: number;\n}\n\nexport interface QuerySymbol extends NamedSymbol {\n returnType: string;\n returnTypeReference?: TypeReferenceSymbol;\n parameters: PropertySymbol[];\n}\n\nexport interface ImportSymbol {\n qualifiedName: string;\n shortName: string;\n line: number;\n}\n\nexport interface DocumentSymbols {\n identityDetails?: readonly { readonly name: string; readonly type: string; readonly line: number }[];\n authoringSources?: readonly string[];\n authoringPath?: string;\n authoringPlacement?: readonly string[];\n authoringPlacementResolved?: boolean;\n authoringDocuments?: readonly AuthoringDocument[];\n eventSources?: readonly AuthoredEventSource[];\n imports: ImportSymbol[];\n concepts: ConceptSymbol[];\n types: TypeSymbol[];\n policies: PolicySymbol[];\n events: EventSymbol[];\n commands: CommandSymbol[];\n queries: QuerySymbol[];\n screens: NamedSymbol[];\n triggers: NamedSymbol[];\n}\n\nconst conceptPattern = /^concept\\s+(\\w+)\\s*:\\s*(\\w+)((?:\\s+@?\\w+)*)\\s*$/;\nconst enumerationMemberPattern = new RegExp(`^@?([a-z_][${bmpWordCharacters}]*)(?:\\\\s*=\\\\s*(-?(?:0|[1-9][0-9]*)))?(?:\\\\s*//.*)?$`);\nconst propertyPattern = /^\\s*(@?[a-z_]\\w*)\\s+([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(\\s+generated)?(\\s+identifier)?(\\s+subject)?\\s*$/;\nconst attributeReasonPattern = /^([a-z_]\\w*)\\s+reason\\s+\"((?:[^\"\\\\]|\\\\.)*)\"\\s*$/;\nconst readPattern = /^\\s*reads\\s+([A-Z]\\w*)(?:\\s+as\\s+([a-z_]\\w*))?(?:\\s+by\\s+([a-z_]\\w*))?\\s*$/;\nconst commandReserved = ['authorize', 'produces', 'reads'];\n// AuthorizeParser's continuation pattern, including the compiler's Unicode word characters.\nconst authorizationContinuation = /^(?:(?:or|and)\\s+)?[A-Za-z_(][\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}\\s()]*$/u;\n// Use the compiler's contextual inventory, not the global completion vocabulary.\nconst eventReserved = eventBodyReservedWords;\nconst inlineEventReserved = ['tag', 'for', 'generation', 'origin', 'namespace', 'sequence', 'correlation', 'causation', 'causedBy', 'occurred'];\nconst queryParameterPattern =\n /^\\s*(?:by|filter)\\s+([a-z_]\\w*)\\s+([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(?:\\s+from\\s+.+)?\\s*$/;\n\n// Property-shaped clauses depend on their owner. Commands reserve only authorize,\n// produces and reads; bare directives such as description and handler can be properties.\n// The @ escape always denotes a property, and 'as' keeps its established property meaning.\nexport function propertyTypeReference(property: PropertySymbol): TypeReferenceSymbol {\n return property.typeReference ?? typeReferenceSymbol(property.type);\n}\n\nfunction sourceTypeAt(line: string, startColumn: number): NonNullable<PropertySymbol['sourceType']> {\n const text = line.slice(startColumn - 1).match(/^[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}.]+(?:\\[\\])?(?:\\?|\\s+optional\\b)?/u)?.[0] ?? '';\n return { text, startColumn, endColumn: startColumn + text.length };\n}\n\nfunction propertiesIn(lines: string[], body: number[], reserved: readonly string[]): PropertySymbol[] {\n return body\n .map((index) => ({ index, match: lines[index].match(propertyPattern) }))\n .filter((entry): entry is { index: number; match: RegExpMatchArray } => entry.match !== null)\n .filter(({ match }) => match[1].startsWith('@') || match[1] === 'as' || !reserved.includes(match[1]))\n .map(({ index, match }) => ({\n name: match[1].replace(/^@/, ''),\n type: match[2],\n typeReference: typeReferenceSymbol(match[2]),\n sourceType: sourceTypeAt(lines[index], lines[index].match(/^\\s*\\S+\\s+/)![0].length + 1),\n isIdentifier: match[4] !== undefined,\n ...(match[3] !== undefined ? { isGenerated: true } : {}),\n ...(match[5] !== undefined ? { isSubject: true } : {}),\n line: index,\n }));\n}\n\nfunction collectBody(lines: string[], fences: boolean[], start: number, indent: number): number[] {\n const body: number[] = [];\n for (let index = start + 1; index < lines.length; index++) {\n if (fences[index]) {\n continue;\n }\n const line = lines[index];\n if (line.trim().length === 0) continue;\n if (indentOf(line) <= indent) break;\n body.push(index);\n }\n return body;\n}\n\n// Event/production parsers accept every greater indent, not just the smallest child indent.\n// Command block directives own their nested lines; properties do not. Fenced prose is never syntax.\nexport function directBody(lines: string[], fences: boolean[], start: number, indent: number): number[] {\n const body = collectBody(lines, fences, start, indent).filter(index => !fences[index] && !/^\\s*(?:\\/\\/|#)/.test(lines[index]));\n if (!/^\\s*command\\b/.test(lines[start])) return body;\n let blockIndent: number | undefined;\n let authorization = false;\n return body.filter(index => {\n const childIndent = indentOf(lines[index]);\n const text = lines[index].trim();\n // AuthorizeParser owns only consecutive deeper lines with requirement shape.\n // Unlike opaque blocks, a nonmatching line returns control to CommandParser.\n if (blockIndent !== undefined && childIndent > blockIndent &&\n (!authorization || authorizationContinuation.test(text))) return false;\n const property = text !== 'validate csharp' && propertiesIn(lines, [index], commandReserved).length > 0;\n // Description consumes only a quoted value or a fence (already excluded above).\n const leaf = property || /^description(?:\\s|$)/.test(text);\n blockIndent = leaf ? undefined : childIndent;\n authorization = /^authorize(?:\\s|$)/.test(text);\n return true;\n });\n}\n\nconst symbolRevisions = new Map<string, DocumentSymbols>();\n\nexport function scanDocument(lines: string[]): DocumentSymbols {\n const source = lines.join('\\n');\n const cached = symbolRevisions.get(source);\n if (cached) return cached;\n const analysis = responseAnalysis(lines);\n const symbols: DocumentSymbols = {\n ...(analysis.identityDetails?.length ? { identityDetails: analysis.identityDetails } : {}),\n authoringSources: [source],\n eventSources: analysis.eventSources.declarations,\n imports: [],\n concepts: [],\n types: [],\n policies: [],\n events: [],\n commands: [],\n queries: [],\n screens: [],\n triggers: [],\n };\n // One normalization pass for every declaration, including comments on fence openers.\n lines = eventAnalysisSource(lines);\n const fences = fenceMap(lines);\n const eventLines = lines;\n const eventFences = fences;\n // Typed inline mappings share property syntax once their source expression is removed.\n // Do this once, never once per inline event.\n const eventPropertyLines = lines.map(line => line.replace(/\\s*=(?!=|>).*/, ''));\n\n for (let index = 0; index < lines.length; index++) {\n if (fences[index]) continue;\n const line = lines[index];\n const trimmed = line.trim();\n const indent = indentOf(line);\n\n const importMatch = eventLines[index].trim().match(/^import\\s+([\\w.]+)(?:\\s+from\\s+\"(?:[^\"\\\\]|\\\\.)*\")?\\s*$/);\n if (importMatch && indent === 0) {\n const qualifiedName = importMatch[1];\n const shortName = qualifiedName.split('.').pop() ?? qualifiedName;\n symbols.imports.push({ qualifiedName, shortName, line: index });\n continue;\n }\n\n const conceptMatch = trimmed.match(conceptPattern);\n if (conceptMatch) {\n const bodyLines = collectBody(lines, fences, index, indent);\n const body = bodyLines.map((i) => lines[i].trim());\n const directIndent = Math.min(...bodyLines.filter(i => !fences[i] && lines[i].trim() !== '').map(i => indentOf(lines[i])));\n const generationLine = bodyLines.find(i => !fences[i] && indentOf(lines[i]) === directIndent && /^\\s*generate\\s+\\w+/.test(lines[i]));\n const generationStrategy = generationLine === undefined ? undefined : lines[generationLine].match(/^\\s*generate\\s+(\\w+)/)?.[1];\n const attributeReasons: Record<string, string> = {};\n for (const line of body) {\n const reason = line.match(attributeReasonPattern);\n if (reason && attributeReasons[reason[1]] === undefined) {\n attributeReasons[reason[1]] = reason[2];\n }\n }\n const members = conceptMatch[2] === 'Enum'\n ? body.filter(line => line !== 'validate').map(line => enumerationMemberPattern.exec(line)).filter(match => match !== null)\n : [];\n const enumValues = members.map(member => member[1]);\n const enumNumbers = members.length > 0 && members.every(member => member[2] !== undefined) ? members.map(member => Number(member[2])) : undefined;\n symbols.concepts.push({\n name: conceptMatch[1],\n primitive: conceptMatch[2],\n attributes: conceptMatch[3].trim().split(/\\s+/).filter(Boolean),\n attributeReasons,\n enumValues,\n ...(enumNumbers === undefined ? {} : { enumNumbers }),\n ...(generationStrategy === undefined ? {} : { generationStrategy }),\n line: index,\n });\n continue;\n }\n\n const typeMatch = trimmed.match(/^type\\s+(\\w+)\\s*$/);\n if (typeMatch) {\n symbols.types.push({\n name: typeMatch[1],\n properties: propertiesIn(lines, collectBody(lines, fences, index, indent), clauseKeywords),\n line: index,\n });\n continue;\n }\n\n const policyMatch = trimmed.match(/^policy\\s+(\\w+)\\s*$/);\n if (policyMatch) {\n const requires = collectBody(lines, fences, index, indent)\n .filter((i) => !fences[i])\n .map((i) => lines[i].trim());\n symbols.policies.push({ name: policyMatch[1], requires, line: index });\n continue;\n }\n\n const eventMatch = eventLines[index].trim().match(/^(?:(?:produces|(?<public>public))\\s+)?event\\s+(?<name>\\w+)(?:\\s+generation\\s+(?<generation>\\d+))?(?:\\s+from\\s+(?<origin>\"(?:[^\"\\\\]|\\\\.)*\"))?\\s*$/);\n if (eventMatch) {\n const inline = trimmed.startsWith('produces ');\n const body = directBody(eventLines, eventFences, index, indent);\n // Standalone events distinguish file metadata from properties by path shape.\n const propertyBody = inline ? body : body.filter(line => fileReferenceOn(eventLines[line], line) === undefined);\n symbols.events.push({\n name: eventMatch.groups!.name,\n ...(eventMatch.groups!.generation ? { generation: Number(eventMatch.groups!.generation) } : {}),\n ...(eventMatch.groups!.public || eventMatch.groups!.origin ? { visibility: EventVisibility.Public } : {}),\n ...(eventMatch.groups!.origin ? { origin: unescapeString(eventMatch.groups!.origin.slice(1, -1)) } : {}),\n inline,\n properties: propertiesIn(inline ? eventPropertyLines : eventLines,\n propertyBody, inline ? inlineEventReserved : eventReserved),\n line: index,\n });\n continue;\n }\n\n const command = analysis.commands.get(index);\n if (command) {\n // A command property is a leaf, not an indentation owner. Share the parser-shaped\n // body with properties, productions, advice and destination hints.\n const body = directBody(lines, fences, index, indent);\n const productionHeaders = body.filter(line => /^\\s*produces\\b/.test(lines[line]) && !analysis.operationProductionLines?.has(line));\n symbols.commands.push({\n name: command.name,\n properties: command.properties.map(property => ({\n name: property.name,\n type: `${property.type.name}${property.type.isCollection ? '[]' : ''}${property.type.isOptional ? ' optional' : ''}`,\n typeReference: { name: property.type.name, isCollection: property.type.isCollection, isOptional: property.type.isOptional },\n sourceType: sourceTypeAt(lines[property.type.location.line - 1], property.type.location.column),\n isIdentifier: property.isIdentifier || /\\sidentifier\\s*$/.test(lines[property.location.line - 1]),\n ...(property.isGenerated ? { isGenerated: true } : {}),\n line: property.location.line - 1,\n })),\n response: command.response,\n productionHeaders,\n produces: productionHeaders.flatMap(line => {\n const header = eventLines[line].trim();\n const inline = /^produces\\s+event\\b/.test(header);\n const conditional = /^produces\\s+when\\b/.test(header);\n const eventLine = conditional ? directBody(eventLines, eventFences, line, indentOf(eventLines[line]))[0] : line;\n if (eventLine === undefined) return [];\n const name = conditional ? eventLines[eventLine].trim() : header.match(inline ? /^produces\\s+event\\s+([A-Za-z_]\\w*)(?:\\s+generation\\s+\\d+)?\\s*$/ : /^produces\\s+([A-Z]\\w*)\\s*$/)?.[1];\n if (name === undefined || !/^[A-Za-z_]\\w*$/.test(name)) return [];\n const children = directBody(eventLines, eventFences, eventLine, indentOf(eventLines[eventLine]));\n const targets = children.map(index => eventLines[index].trim().match(/^for(?:\\s+(.*))?$/)).filter(match => match !== null);\n // Empty or repeated targets are uncertain, not implicit destinations.\n const target = targets.length === 0 ? undefined : targets.length === 1 ? targets[0][1] ?? '' : '';\n const mappings = children.flatMap(index => {\n const match = eventLines[index].trim().match(inline ? /^(@?[a-z_]\\w*)\\s+[\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?\\s*=(?!=|>)\\s*(.+)$/ : /^(@?[\\w.]+)\\s*=(?!=|>)\\s*(.+)$/);\n return match === null ? [] : [{ name: match[1].replace(/^@/, ''), source: match[2], line: index }];\n });\n return [{ name, inline, conditional, line, target, mappings }];\n }),\n reads: body.filter((line) => !fences[line])\n .map((line) => ({ line, match: lines[line].match(readPattern) }))\n .filter((entry): entry is { line: number; match: RegExpMatchArray } => entry.match !== null)\n .map(({ line, match }) => ({\n view: match[1],\n ...(match[2] ? { alias: match[2] } : {}),\n ...(match[3] ? { by: match[3] } : {}),\n line,\n })),\n line: index,\n });\n continue;\n }\n\n // The return type shape is the compiler's, dots and all - QueryParser's\n // ^query\\s+([A-Za-z_]\\w*)\\s*=>\\s*(observable\\s+)?([\\w.]+(?:\\[\\])?\\??)$. A narrower one here\n // silently drops the query from the symbol table, and with it every check and completion that\n // reads from it.\n const queryMatch = trimmed.match(/^query\\s+(\\w+)\\s*=>\\s*(?:observable\\s+)?([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)\\s*$/);\n if (queryMatch) {\n // The return type names a read model, which no construct declares — only the\n // 'by' and 'filter' parameters resolve against the document's own types.\n const parameters = collectBody(lines, fences, index, indent)\n .map((i) => ({ index: i, match: lines[i].match(queryParameterPattern) }))\n .filter(\n (entry): entry is { index: number; match: RegExpMatchArray } =>\n entry.match !== null,\n )\n .map(({ index: line, match }) => ({\n name: match[1],\n type: match[2],\n typeReference: typeReferenceSymbol(match[2]),\n sourceType: sourceTypeAt(lines[line], lines[line].match(/^\\s*(?:by|filter)\\s+\\S+\\s+/)![0].length + 1),\n isIdentifier: false,\n line,\n }));\n symbols.queries.push({\n name: queryMatch[1],\n returnType: queryMatch[2],\n returnTypeReference: typeReferenceSymbol(queryMatch[2]),\n parameters,\n line: index,\n });\n continue;\n }\n\n const screenMatch = trimmed.match(/^screen\\s+(\\w+)\\s*$/);\n if (screenMatch) {\n symbols.screens.push({ name: screenMatch[1], line: index });\n continue;\n }\n\n const triggerMatch = trimmed.match(/^trigger\\s+(\\w+)\\s*$/);\n if (triggerMatch && indent === 0) {\n symbols.triggers.push({ name: triggerMatch[1], line: index });\n }\n }\n\n if (symbolRevisions.size >= 16) symbolRevisions.delete(symbolRevisions.keys().next().value!);\n symbolRevisions.set(source, symbols);\n return symbols;\n}\n\n// The symbols of several documents as one - what an application spread over files declares. Lines refer to\n// the document each symbol came from, so the result names things; it does not locate them.\nexport function mergeSymbols(...documents: DocumentSymbols[]): DocumentSymbols {\n return {\n ...(documents.some(document => document.identityDetails?.length) ? { identityDetails: documents.flatMap(document => document.identityDetails ?? []) } : {}),\n authoringSources: documents.flatMap(document => document.authoringSources ?? []),\n ...(documents.some(document => document.authoringDocuments) ? { authoringDocuments: documents.flatMap(document => document.authoringDocuments ?? []) } : {}),\n eventSources: documents.flatMap(document => document.eventSources ?? []),\n imports: documents.flatMap((document) => document.imports),\n concepts: documents.flatMap((document) => document.concepts),\n types: documents.flatMap((document) => document.types),\n policies: documents.flatMap((document) => document.policies),\n events: documents.flatMap((document) => document.events),\n commands: documents.flatMap((document) => document.commands),\n queries: documents.flatMap((document) => document.queries),\n screens: documents.flatMap((document) => document.screens),\n triggers: documents.flatMap((document) => document.triggers),\n };\n}\n\n// Name scans are not physical input documents. Keep the host's authoritative paths separate,\n// and let responseAnalysis replace the current document with this buffer exactly once.\nexport function symbolsForBuffer(lines: string[], application?: DocumentSymbols): DocumentSymbols {\n const path = application?.authoringPath ?? 'current.play';\n const current = application?.authoringDocuments?.find(document => document.path === path);\n return { ...mergeSymbols(scanDocument(lines), application ?? mergeSymbols()),\n authoringDocuments: application?.authoringDocuments,\n authoringPath: path,\n authoringPlacement: application?.authoringPlacement ?? current?.placement,\n authoringPlacementResolved: application?.authoringPlacementResolved ?? current?.isPlacementResolved,\n };\n}\n\nexport function knownEventNames(symbols: DocumentSymbols): string[] {\n return [\n ...symbols.events.map((event) => event.name),\n ...symbols.imports.map((imported) => imported.shortName),\n ];\n}\n\n// The built-in host signals, which have no declaration to scan for because every application has them.\nexport const builtInTriggerNames = ['Startup', 'Shutdown'];\n\n// What a reaction's `when` may name: an event, a declared trigger, or a host signal. The compiler resolves\n// the three in that order, and the editor offers them the same way rather than guessing which was meant.\nexport function knownTriggerNames(symbols: DocumentSymbols): string[] {\n return [\n ...knownEventNames(symbols),\n ...symbols.triggers.map((trigger) => trigger.name),\n ...builtInTriggerNames,\n ];\n}\n\n// Everything a property type reference can resolve to — the primitives, the declared\n// concepts and types, and the short names of the imports.\nexport function knownTypeNames(symbols: DocumentSymbols, primitives: readonly string[]): string[] {\n return [\n ...primitives,\n ...symbols.concepts.map((concept) => concept.name),\n ...symbols.types.map((type) => type.name),\n ...symbols.imports.map((imported) => imported.shortName),\n ];\n}\n"],"mappings":"qnBAgHA,MAAMA,EAAiB,kDACjBC,EAA+B,OAAO,cAAcC,EAAkB,qDAAqD,EAC3HC,EAAkB,2GAClBC,EAAyB,kDACzBC,EAAc,6EACdC,EAAkB,CAAC,YAAa,WAAY,OAAO,EAEnDC,EAA4B,gEAE5BC,EAAgBC,EAChBC,EAAsB,CAAC,MAAO,MAAO,aAAc,SAAU,YAAa,WAAY,cAAe,YAAa,WAAY,UAAU,EACxIC,EACF,8FAKJ,SAAgB,sBAAsB,EAA+C,CACjF,OAAOC,EAAS,eAAiBC,EAAoBD,EAAS,IAAI,CACtE,CAEA,SAAS,aAAa,EAAc,EAAgE,CAChG,IAAME,EAAOC,EAAK,MAAMC,EAAc,CAAC,CAAC,CAAC,MAAM,6DAA6D,CAAC,GAAG,IAAM,GACtH,MAAO,CAAE,OAAM,cAAa,UAAWA,EAAcF,EAAK,MAAO,CACrE,CAEA,SAAS,aAAa,EAAiB,EAAgB,EAA+C,CAClG,OAAOG,EACF,IAAK,IAAW,CAAE,QAAO,MAAOC,EAAMC,EAAM,CAAC,MAAMhB,CAAe,CAAE,EAAE,CAAC,CACvE,OAAQ,GAA+DiB,EAAM,QAAU,IAAI,CAAC,CAC5F,QAAQ,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YF,EAAS,OAASC,CAAI,EACxF,MAAO,CAAE,GAAG,aAAa,aAAa9D,CAAK,EAAG+D,GAAe,aAAa,CAAC,EACvE,mBAAoBA,GAAa,mBACjC,cAAeD,EACf,mBAAoBC,GAAa,oBAAsBC,GAAS,UAChE,2BAA4BD,GAAa,4BAA8BC,GAAS,mBACpF,CACJ,CAEA,SAAgB,gBAAgB,EAAoC,CAChE,MAAO,CACH,GAAG/C,EAAQ,OAAO,IAAK,GAAUgD,EAAM,IAAI,EAC3C,GAAGhD,EAAQ,QAAQ,IAAK,GAAaiD,EAAS,SAAS,CAC3D,CACJ,CAGA,MAAaC,EAAsB,CAAC,UAAW,UAAU,EAIzD,SAAgB,kBAAkB,EAAoC,CAClE,MAAO,CACH,GAAG,gBAAgBlD,CAAO,EAC1B,GAAGA,EAAQ,SAAS,IAAK,GAAYmD,EAAQ,IAAI,EACjD,GAAGD,CACP,CACJ,CAIA,SAAgB,eAAe,EAA0B,EAAyC,CAC9F,MAAO,CACH,GAAGE,EACH,GAAGpD,EAAQ,SAAS,IAAK,GAAYqD,EAAQ,IAAI,EACjD,GAAGrD,EAAQ,MAAM,IAAK,GAASsD,EAAK,IAAI,EACxC,GAAGtD,EAAQ,QAAQ,IAAK,GAAaiD,EAAS,SAAS,CAC3D,CACJ"}
1
+ {"version":3,"file":"symbols.js","names":["conceptPattern","enumerationMemberPattern","bmpWordCharacters","propertyPattern","attributeReasonPattern","readPattern","commandReserved","authorizationContinuation","eventReserved","eventBodyReservedWords","inlineEventReserved","queryParameterPattern","property","typeReferenceSymbol","text","line","startColumn","body","lines","index","entry","match","reserved","start","fences","indentOf","indent","blockIndent","authorization","childIndent","symbolRevisions","source","cached","analysis","responseAnalysis","symbols","eventAnalysisSource","fenceMap","eventLines","eventFences","eventPropertyLines","trimmed","importMatch","qualifiedName","shortName","conceptMatch","bodyLines","i","directIndent","generationLine","generationStrategy","attributeReasons","reason","members","enumValues","member","enumNumbers","typeMatch","clauseKeywords","policyMatch","requires","eventMatch","inline","propertyBody","fileReferenceOn","unescapeString","command","productionHeaders","header","conditional","eventLine","name","children","targets","queryMatch","parameters","screenMatch","triggerMatch","documents","document","path","application","current","event","imported","builtInTriggerNames","trigger","primitives","concept","type"],"sources":["../../symbols.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { EventVisibility, eventBodyReservedWords, unescapeString } from '@cratis/screenplay-compiler';\nimport { fenceMap, indentOf } from './document-context';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { CommandResponseSymbol, responseAnalysis } from './response-analysis';\nimport { fileReferenceOn } from './file-references';\nimport { clauseKeywords } from './language';\nimport { bmpWordCharacters } from './bmp-word-characters';\nimport { AuthoringDocument } from './AuthoringDocument';\nimport { AuthoredEventSource } from './AuthoredEventSource';\nimport { ProductionSymbol } from './ProductionSymbol';\nimport { TypeReferenceSymbol, typeReferenceSymbol } from './TypeReferenceSymbol';\n\nexport interface PropertySymbol {\n name: string;\n type: string;\n typeReference?: TypeReferenceSymbol;\n // Exact spelling and UTF-16 columns in the authoring source, independent of normalization.\n sourceType?: { text: string; startColumn: number; endColumn: number };\n isIdentifier: boolean;\n isGenerated?: boolean;\n isSubject?: boolean;\n line: number;\n}\n\nexport interface ConceptSymbol {\n name: string;\n primitive: string;\n attributes: string[];\n attributeReasons: Record<string, string>;\n enumValues: string[];\n enumNumbers?: number[];\n generationStrategy?: string;\n line: number;\n}\n\nexport interface TypeSymbol {\n name: string;\n properties: PropertySymbol[];\n line: number;\n}\n\nexport interface PolicySymbol {\n name: string;\n requires: string[];\n line: number;\n}\n\nexport interface EventSymbol {\n // Public editor declarations stay structural; the compiler is privately bundled.\n visibility?: 'Private' | 'Public';\n origin?: string;\n name: string;\n generation?: number;\n inline?: boolean;\n properties: PropertySymbol[];\n line: number;\n}\n\nexport interface CommandSymbol extends NamedSymbol {\n properties: PropertySymbol[];\n reads?: ReadSymbol[];\n produces?: ProductionSymbol[];\n productionHeaders?: number[];\n response?: CommandResponseSymbol | null;\n}\n\nexport interface ReadSymbol {\n view: string;\n alias?: string;\n by?: string;\n line: number;\n}\n\nexport interface NamedSymbol {\n name: string;\n line: number;\n}\n\nexport interface QuerySymbol extends NamedSymbol {\n returnType: string;\n returnTypeReference?: TypeReferenceSymbol;\n parameters: PropertySymbol[];\n}\n\nexport interface ImportSymbol {\n qualifiedName: string;\n shortName: string;\n line: number;\n}\n\nexport interface DocumentSymbols {\n identityDetails?: readonly { readonly name: string; readonly type: string; readonly line: number }[];\n authoringSources?: readonly string[];\n authoringPath?: string;\n authoringPlacement?: readonly string[];\n authoringPlacementResolved?: boolean;\n authoringDocuments?: readonly AuthoringDocument[];\n eventSources?: readonly AuthoredEventSource[];\n imports: ImportSymbol[];\n concepts: ConceptSymbol[];\n types: TypeSymbol[];\n policies: PolicySymbol[];\n events: EventSymbol[];\n commands: CommandSymbol[];\n queries: QuerySymbol[];\n screens: NamedSymbol[];\n triggers: NamedSymbol[];\n}\n\nconst conceptPattern = /^concept\\s+(\\w+)\\s*:\\s*(\\w+)((?:\\s+@?\\w+)*)\\s*$/;\nconst enumerationMemberPattern = new RegExp(`^@?([a-z_][${bmpWordCharacters}]*)(?:\\\\s*=\\\\s*(-?(?:0|[1-9][0-9]*)))?(?:\\\\s*//.*)?$`);\nconst propertyPattern = /^\\s*(@?[a-z_]\\w*)\\s+([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(\\s+generated)?(\\s+identifier)?(\\s+subject)?\\s*$/;\nconst attributeReasonPattern = /^([a-z_]\\w*)\\s+reason\\s+\"((?:[^\"\\\\]|\\\\.)*)\"\\s*$/;\nconst readPattern = /^\\s*reads\\s+([A-Z]\\w*)(?:\\s+as\\s+([a-z_]\\w*))?(?:\\s+by\\s+([a-z_]\\w*))?\\s*$/;\nconst commandReserved = ['authorize', 'produces', 'reads'];\n// AuthorizeParser's continuation pattern, including the compiler's Unicode word characters.\nconst authorizationContinuation = /^(?:(?:or|and)\\s+)?[A-Za-z_(][\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}\\s()]*$/u;\n// Use the compiler's contextual inventory, not the global completion vocabulary.\nconst eventReserved = eventBodyReservedWords;\nconst inlineEventReserved = ['tag', 'for', 'generation', 'origin', 'namespace', 'sequence', 'correlation', 'causation', 'causedBy', 'occurred'];\nconst queryParameterPattern =\n /^\\s*(?:by|filter)\\s+([a-z_]\\w*)\\s+([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(?:\\s+from\\s+.+)?\\s*$/;\n\n// Property-shaped clauses depend on their owner. Commands reserve only authorize,\n// produces and reads; bare directives such as description and handler can be properties.\n// The @ escape always denotes a property, and 'as' keeps its established property meaning.\nexport function propertyTypeReference(property: PropertySymbol): TypeReferenceSymbol {\n return property.typeReference ?? typeReferenceSymbol(property.type);\n}\n\nfunction sourceTypeAt(line: string, startColumn: number): NonNullable<PropertySymbol['sourceType']> {\n const text = line.slice(startColumn - 1).match(/^[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}.]+(?:\\[\\])?(?:\\?|\\s+optional\\b)?/u)?.[0] ?? '';\n return { text, startColumn, endColumn: startColumn + text.length };\n}\n\nfunction propertiesIn(lines: string[], body: number[], reserved: readonly string[]): PropertySymbol[] {\n return body\n .map((index) => ({ index, match: lines[index].match(propertyPattern) }))\n .filter((entry): entry is { index: number; match: RegExpMatchArray } => entry.match !== null)\n .filter(({ match }) => match[1].startsWith('@') || match[1] === 'as' || !reserved.includes(match[1]))\n .map(({ index, match }) => ({\n name: match[1].replace(/^@/, ''),\n type: match[2],\n typeReference: typeReferenceSymbol(match[2]),\n sourceType: sourceTypeAt(lines[index], lines[index].match(/^\\s*\\S+\\s+/)![0].length + 1),\n isIdentifier: match[4] !== undefined,\n ...(match[3] !== undefined ? { isGenerated: true } : {}),\n ...(match[5] !== undefined ? { isSubject: true } : {}),\n line: index,\n }));\n}\n\nfunction collectBody(lines: string[], fences: boolean[], start: number, indent: number): number[] {\n const body: number[] = [];\n for (let index = start + 1; index < lines.length; index++) {\n if (fences[index]) {\n continue;\n }\n const line = lines[index];\n if (line.trim().length === 0) continue;\n if (indentOf(line) <= indent) break;\n body.push(index);\n }\n return body;\n}\n\n// Event/production parsers accept every greater indent, not just the smallest child indent.\n// Command block directives own their nested lines; properties do not. Fenced prose is never syntax.\nexport function directBody(lines: string[], fences: boolean[], start: number, indent: number): number[] {\n const body = collectBody(lines, fences, start, indent).filter(index => !fences[index] && !/^\\s*(?:\\/\\/|#)/.test(lines[index]));\n if (!/^\\s*command\\b/.test(lines[start])) return body;\n let blockIndent: number | undefined;\n let authorization = false;\n return body.filter(index => {\n const childIndent = indentOf(lines[index]);\n const text = lines[index].trim();\n // AuthorizeParser owns only consecutive deeper lines with requirement shape.\n // Unlike opaque blocks, a nonmatching line returns control to CommandParser.\n if (blockIndent !== undefined && childIndent > blockIndent &&\n (!authorization || authorizationContinuation.test(text))) return false;\n const property = text !== 'validate csharp' && propertiesIn(lines, [index], commandReserved).length > 0;\n // Description consumes only a quoted value or a fence (already excluded above).\n const leaf = property || /^description(?:\\s|$)/.test(text);\n blockIndent = leaf ? undefined : childIndent;\n authorization = /^authorize(?:\\s|$)/.test(text);\n return true;\n });\n}\n\nconst symbolRevisions = new Map<string, DocumentSymbols>();\n\nexport function scanDocument(lines: string[]): DocumentSymbols {\n const source = lines.join('\\n');\n const cached = symbolRevisions.get(source);\n if (cached) return cached;\n const analysis = responseAnalysis(lines);\n const symbols: DocumentSymbols = {\n ...(analysis.identityDetails?.length ? { identityDetails: analysis.identityDetails } : {}),\n authoringSources: [source],\n eventSources: analysis.eventSources.declarations,\n imports: [],\n concepts: [],\n types: [],\n policies: [],\n events: [],\n commands: [],\n queries: [],\n screens: [],\n triggers: [],\n };\n // One normalization pass for every declaration, including comments on fence openers.\n lines = eventAnalysisSource(lines);\n const fences = fenceMap(lines);\n const eventLines = lines;\n const eventFences = fences;\n // Typed inline mappings share property syntax once their source expression is removed.\n // Do this once, never once per inline event.\n const eventPropertyLines = lines.map(line => line.replace(/\\s*=(?!=|>).*/, ''));\n\n for (let index = 0; index < lines.length; index++) {\n if (fences[index]) continue;\n const line = lines[index];\n const trimmed = line.trim();\n const indent = indentOf(line);\n\n const importMatch = eventLines[index].trim().match(/^import\\s+([\\w.]+)(?:\\s+from\\s+\"(?:[^\"\\\\]|\\\\.)*\")?\\s*$/);\n if (importMatch && indent === 0) {\n const qualifiedName = importMatch[1];\n const shortName = qualifiedName.split('.').pop() ?? qualifiedName;\n symbols.imports.push({ qualifiedName, shortName, line: index });\n continue;\n }\n\n const conceptMatch = trimmed.match(conceptPattern);\n if (conceptMatch) {\n const bodyLines = collectBody(lines, fences, index, indent);\n const body = bodyLines.map((i) => lines[i].trim());\n const directIndent = Math.min(...bodyLines.filter(i => !fences[i] && lines[i].trim() !== '').map(i => indentOf(lines[i])));\n const generationLine = bodyLines.find(i => !fences[i] && indentOf(lines[i]) === directIndent && /^\\s*generate\\s+\\w+/.test(lines[i]));\n const generationStrategy = generationLine === undefined ? undefined : lines[generationLine].match(/^\\s*generate\\s+(\\w+)/)?.[1];\n const attributeReasons: Record<string, string> = {};\n for (const line of body) {\n const reason = line.match(attributeReasonPattern);\n if (reason && attributeReasons[reason[1]] === undefined) {\n attributeReasons[reason[1]] = reason[2];\n }\n }\n const members = conceptMatch[2] === 'Enum'\n ? body.filter(line => line !== 'validate').map(line => enumerationMemberPattern.exec(line)).filter(match => match !== null)\n : [];\n const enumValues = members.map(member => member[1]);\n const enumNumbers = members.length > 0 && members.every(member => member[2] !== undefined) ? members.map(member => Number(member[2])) : undefined;\n symbols.concepts.push({\n name: conceptMatch[1],\n primitive: conceptMatch[2],\n attributes: conceptMatch[3].trim().split(/\\s+/).filter(Boolean),\n attributeReasons,\n enumValues,\n ...(enumNumbers === undefined ? {} : { enumNumbers }),\n ...(generationStrategy === undefined ? {} : { generationStrategy }),\n line: index,\n });\n continue;\n }\n\n const typeMatch = trimmed.match(/^type\\s+(\\w+)\\s*$/);\n if (typeMatch) {\n symbols.types.push({\n name: typeMatch[1],\n properties: propertiesIn(lines, collectBody(lines, fences, index, indent), clauseKeywords),\n line: index,\n });\n continue;\n }\n\n const policyMatch = trimmed.match(/^policy\\s+(\\w+)\\s*$/);\n if (policyMatch) {\n const requires = collectBody(lines, fences, index, indent)\n .filter((i) => !fences[i])\n .map((i) => lines[i].trim());\n symbols.policies.push({ name: policyMatch[1], requires, line: index });\n continue;\n }\n\n const eventMatch = eventLines[index].trim().match(/^(?:(?:produces|(?<public>public))\\s+)?event\\s+(?<name>\\w+)(?:\\s+generation\\s+(?<generation>\\d+))?(?:\\s+from\\s+(?<origin>\"(?:[^\"\\\\]|\\\\.)*\"))?\\s*$/);\n if (eventMatch) {\n const inline = trimmed.startsWith('produces ');\n const body = directBody(eventLines, eventFences, index, indent);\n // Standalone events distinguish file metadata from properties by path shape.\n const propertyBody = inline ? body : body.filter(line => fileReferenceOn(eventLines[line], line) === undefined);\n symbols.events.push({\n name: eventMatch.groups!.name,\n ...(eventMatch.groups!.generation ? { generation: Number(eventMatch.groups!.generation) } : {}),\n ...(eventMatch.groups!.public || eventMatch.groups!.origin ? { visibility: EventVisibility.Public } : {}),\n ...(eventMatch.groups!.origin ? { origin: unescapeString(eventMatch.groups!.origin.slice(1, -1)) } : {}),\n inline,\n properties: propertiesIn(inline ? eventPropertyLines : eventLines,\n propertyBody, inline ? inlineEventReserved : eventReserved),\n line: index,\n });\n continue;\n }\n\n const command = analysis.commands.get(index);\n if (command) {\n // A command property is a leaf, not an indentation owner. Share the parser-shaped\n // body with properties, productions, advice and destination hints.\n const body = directBody(lines, fences, index, indent);\n const productionHeaders = body.filter(line => /^\\s*produces\\b/.test(lines[line]) && !analysis.operationProductionLines?.has(line));\n symbols.commands.push({\n name: command.name,\n properties: command.properties.map(property => ({\n name: property.name,\n type: `${property.type.name}${property.type.isCollection ? '[]' : ''}${property.type.isOptional ? ' optional' : ''}`,\n typeReference: { name: property.type.name, isCollection: property.type.isCollection, isOptional: property.type.isOptional },\n sourceType: sourceTypeAt(lines[property.type.location.line - 1], property.type.location.column),\n isIdentifier: property.isIdentifier || /\\sidentifier\\s*$/.test(lines[property.location.line - 1]),\n ...(property.isGenerated ? { isGenerated: true } : {}),\n line: property.location.line - 1,\n })),\n response: command.response,\n productionHeaders,\n produces: productionHeaders.flatMap(line => {\n const header = eventLines[line].trim();\n const inline = /^produces\\s+event\\b/.test(header);\n const conditional = /^produces\\s+when\\b/.test(header);\n const eventLine = conditional ? directBody(eventLines, eventFences, line, indentOf(eventLines[line]))[0] : line;\n if (eventLine === undefined) return [];\n const name = conditional ? eventLines[eventLine].trim() : header.match(inline ? /^produces\\s+event\\s+([A-Za-z_]\\w*)(?:\\s+generation\\s+\\d+)?\\s*$/ : /^produces\\s+([A-Z]\\w*)\\s*$/)?.[1];\n if (name === undefined || !/^[A-Za-z_]\\w*$/.test(name)) return [];\n const children = directBody(eventLines, eventFences, eventLine, indentOf(eventLines[eventLine]));\n const targets = children.map(index => eventLines[index].trim().match(/^for(?:\\s+(.*))?$/)).filter(match => match !== null);\n // Empty or repeated targets are uncertain, not implicit destinations.\n const target = targets.length === 0 ? undefined : targets.length === 1 ? targets[0][1] ?? '' : '';\n const mappings = children.flatMap(index => {\n const match = eventLines[index].trim().match(inline ? /^(@?[a-z_]\\w*)\\s+[\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?\\s*=(?!=|>)\\s*(.+)$/ : /^(@?[\\w.]+)\\s*=(?!=|>)\\s*(.+)$/);\n return match === null ? [] : [{ name: match[1].replace(/^@/, ''), source: match[2], line: index }];\n });\n return [{ name, inline, conditional, line, target, mappings }];\n }),\n reads: body.filter((line) => !fences[line])\n .map((line) => ({ line, match: lines[line].match(readPattern) }))\n .filter((entry): entry is { line: number; match: RegExpMatchArray } => entry.match !== null)\n .map(({ line, match }) => ({\n view: match[1],\n ...(match[2] ? { alias: match[2] } : {}),\n ...(match[3] ? { by: match[3] } : {}),\n line,\n })),\n line: index,\n });\n continue;\n }\n\n // The return type shape is the compiler's, dots and all - QueryParser's\n // ^query\\s+([A-Za-z_]\\w*)\\s*=>\\s*(observable\\s+)?([\\w.]+(?:\\[\\])?\\??)$. A narrower one here\n // silently drops the query from the symbol table, and with it every check and completion that\n // reads from it.\n const queryMatch = trimmed.match(/^query\\s+(\\w+)\\s*=>\\s*(?:observable\\s+)?([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)\\s*$/);\n if (queryMatch) {\n // The return type names a read model, which no construct declares — only the\n // 'by' and 'filter' parameters resolve against the document's own types.\n const parameters = collectBody(lines, fences, index, indent)\n .map((i) => ({ index: i, match: lines[i].match(queryParameterPattern) }))\n .filter(\n (entry): entry is { index: number; match: RegExpMatchArray } =>\n entry.match !== null,\n )\n .map(({ index: line, match }) => ({\n name: match[1],\n type: match[2],\n typeReference: typeReferenceSymbol(match[2]),\n sourceType: sourceTypeAt(lines[line], lines[line].match(/^\\s*(?:by|filter)\\s+\\S+\\s+/)![0].length + 1),\n isIdentifier: false,\n line,\n }));\n symbols.queries.push({\n name: queryMatch[1],\n returnType: queryMatch[2],\n returnTypeReference: typeReferenceSymbol(queryMatch[2]),\n parameters,\n line: index,\n });\n continue;\n }\n\n const screenMatch = trimmed.match(/^screen\\s+(\\w+)\\s*$/);\n if (screenMatch) {\n symbols.screens.push({ name: screenMatch[1], line: index });\n continue;\n }\n\n const triggerMatch = trimmed.match(/^trigger\\s+(\\w+)\\s*$/);\n if (triggerMatch && indent === 0) {\n symbols.triggers.push({ name: triggerMatch[1], line: index });\n }\n }\n\n if (symbolRevisions.size >= 16) symbolRevisions.delete(symbolRevisions.keys().next().value!);\n symbolRevisions.set(source, symbols);\n return symbols;\n}\n\n// The symbols of several documents as one - what an application spread over files declares. Lines refer to\n// the document each symbol came from, so the result names things; it does not locate them.\nexport function mergeSymbols(...documents: DocumentSymbols[]): DocumentSymbols {\n return {\n ...(documents.some(document => document.identityDetails?.length) ? { identityDetails: documents.flatMap(document => document.identityDetails ?? []) } : {}),\n authoringSources: documents.flatMap(document => document.authoringSources ?? []),\n ...(documents.some(document => document.authoringDocuments) ? { authoringDocuments: documents.flatMap(document => document.authoringDocuments ?? []) } : {}),\n eventSources: documents.flatMap(document => document.eventSources ?? []),\n imports: documents.flatMap((document) => document.imports),\n concepts: documents.flatMap((document) => document.concepts),\n types: documents.flatMap((document) => document.types),\n policies: documents.flatMap((document) => document.policies),\n events: documents.flatMap((document) => document.events),\n commands: documents.flatMap((document) => document.commands),\n queries: documents.flatMap((document) => document.queries),\n screens: documents.flatMap((document) => document.screens),\n triggers: documents.flatMap((document) => document.triggers),\n };\n}\n\n// Name scans are not physical input documents. Keep the host's authoritative paths separate,\n// and let responseAnalysis replace the current document with this buffer exactly once.\nexport function symbolsForBuffer(lines: string[], application?: DocumentSymbols): DocumentSymbols {\n const path = application?.authoringPath ?? 'current.play';\n const current = application?.authoringDocuments?.find(document => document.path === path);\n return { ...mergeSymbols(scanDocument(lines), application ?? mergeSymbols()),\n authoringDocuments: application?.authoringDocuments,\n authoringPath: path,\n authoringPlacement: application?.authoringPlacement ?? current?.placement,\n authoringPlacementResolved: application?.authoringPlacementResolved ?? current?.isPlacementResolved,\n };\n}\n\nexport function knownEventNames(symbols: DocumentSymbols): string[] {\n return [\n ...symbols.events.map((event) => event.name),\n ...symbols.imports.map((imported) => imported.shortName),\n ];\n}\n\n// The built-in host signals, which have no declaration to scan for because every application has them.\nexport const builtInTriggerNames = ['Startup', 'Shutdown'];\n\n// What a reaction's `when` may name: an event, a declared trigger, or a host signal. The compiler resolves\n// the three in that order, and the editor offers them the same way rather than guessing which was meant.\nexport function knownTriggerNames(symbols: DocumentSymbols): string[] {\n return [\n ...knownEventNames(symbols),\n ...symbols.triggers.map((trigger) => trigger.name),\n ...builtInTriggerNames,\n ];\n}\n\n// Everything a property type reference can resolve to — the primitives, the declared\n// concepts and types, and the short names of the imports.\nexport function knownTypeNames(symbols: DocumentSymbols, primitives: readonly string[]): string[] {\n return [\n ...primitives,\n ...symbols.concepts.map((concept) => concept.name),\n ...symbols.types.map((type) => type.name),\n ...symbols.imports.map((imported) => imported.shortName),\n ];\n}\n"],"mappings":"A,qnBAgHA,MAAMA,EAAiB,kDACjBC,EAA+B,OAAO,cAAcC,EAAkB,qDAAqD,EAC3HC,EAAkB,2GAClBC,EAAyB,kDACzBC,EAAc,6EACdC,EAAkB,CAAC,YAAa,WAAY,OAAO,EAEnDC,EAA4B,gEAE5BC,EAAgBC,EAChBC,EAAsB,CAAC,MAAO,MAAO,aAAc,SAAU,YAAa,WAAY,cAAe,YAAa,WAAY,UAAU,EACxIC,EACF,8FAKJ,SAAgB,sBAAsB,EAA+C,CACjF,OAAOC,EAAS,eAAiBC,EAAoBD,EAAS,IAAI,CACtE,CAEA,SAAS,aAAa,EAAc,EAAgE,CAChG,IAAME,EAAOC,EAAK,MAAMC,EAAc,CAAC,CAAC,CAAC,MAAM,6DAA6D,CAAC,GAAG,IAAM,GACtH,MAAO,CAAE,OAAM,cAAa,UAAWA,EAAcF,EAAK,MAAO,CACrE,CAEA,SAAS,aAAa,EAAiB,EAAgB,EAA+C,CAClG,OAAOG,EACF,IAAK,IAAW,CAAE,QAAO,MAAOC,EAAMC,EAAM,CAAC,MAAMhB,CAAe,CAAE,EAAE,CAAC,CACvE,OAAQ,GAA+DiB,EAAM,QAAU,IAAI,CAAC,CAC5F,QAAQ,CAAE,WAAYC,EAAM,EAAE,CAAC,WAAW,GAAG,GAAKA,EAAM,KAAO,MAAQ,CAACC,EAAS,SAASD,EAAM,EAAE,CAAC,CAAC,CACpG,KAAK,CAAE,QAAO,YAAa,CACxB,KAAMA,EAAM,EAAE,CAAC,QAAQ,KAAM,EAAE,EAC/B,KAAMA,EAAM,GACZ,cAAeR,EAAoBQ,EAAM,EAAE,EAC3C,WAAY,aAAaH,EAAMC,GAAQD,EAAMC,EAAM,CAAC,MAAM,YAAY,CAAC,CAAE,EAAE,CAAC,OAAS,CAAC,EACtF,aAAcE,EAAM,KAAO,IAAA,GAC3B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AaC,EAAsB,CAAC,UAAW,UAAU,EAIzD,SAAgB,kBAAkB,EAAoC,CAClE,MAAO,CACH,GAAG,gBAAgBlD,CAAO,EAC1B,GAAGA,EAAQ,SAAS,IAAK,GAAYmD,EAAQ,IAAI,EACjD,GAAGD,CACP,CACJ,CAIA,SAAgB,eAAe,EAA0B,EAAyC,CAC9F,MAAO,CACH,GAAGE,EACH,GAAGpD,EAAQ,SAAS,IAAK,GAAYqD,EAAQ,IAAI,EACjD,GAAGrD,EAAQ,MAAM,IAAK,GAASsD,EAAK,IAAI,EACxC,GAAGtD,EAAQ,QAAQ,IAAK,GAAaiD,EAAS,SAAS,CAC3D,CACJ,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"screenplay-dark.js","names":["screenplayDarkThemeName","screenplayDark"],"sources":["../../../themes/screenplay-dark.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { editor } from 'monaco-editor';\n\nexport const screenplayDarkThemeName = 'screenplay-dark';\n\nexport const screenplayDark: editor.IStandaloneThemeData = {\n base: 'vs-dark',\n inherit: true,\n rules: [\n { token: 'keyword.play', foreground: 'C586C0' },\n { token: 'keyword.tag.play', foreground: '569CD6', fontStyle: 'italic' },\n { token: 'keyword.type.play', foreground: '4FC1FF', fontStyle: 'bold' },\n { token: 'type.play', foreground: '4EC9B0' },\n { token: 'type.identifier.play', foreground: '4EC9B0' },\n { token: 'identifier.play', foreground: '9CDCFE' },\n { token: 'annotation.play', foreground: 'DCDCAA' },\n { token: 'variable.predefined.play', foreground: 'D7BA7D' },\n { token: 'string.play', foreground: 'CE9178' },\n { token: 'string.link.play', foreground: 'CE9178', fontStyle: 'underline' },\n { token: 'string.invalid.play', foreground: 'F44747' },\n { token: 'string.quote.play', foreground: '6A9955' },\n { token: 'number.play', foreground: 'B5CEA8' },\n { token: 'number.float.play', foreground: 'B5CEA8' },\n { token: 'comment.play', foreground: '6A9955', fontStyle: 'italic' },\n { token: 'operator.play', foreground: 'D4D4D4' },\n { token: 'delimiter.play', foreground: 'CCCCCC' },\n ],\n colors: {\n 'editor.background': '#1E1E1E',\n },\n};\n"],"mappings":"AAKA,MAAaA,EAA0B,kBAE1BC,EAA8C,CACvD,KAAM,UACN,QAAS,GACT,MAAO,CACH,CAAE,MAAO,eAAgB,WAAY,QAAS,EAC9C,CAAE,MAAO,mBAAoB,WAAY,SAAU,UAAW,QAAS,EACvE,CAAE,MAAO,oBAAqB,WAAY,SAAU,UAAW,MAAO,EACtE,CAAE,MAAO,YAAa,WAAY,QAAS,EAC3C,CAAE,MAAO,uBAAwB,WAAY,QAAS,EACtD,CAAE,MAAO,kBAAmB,WAAY,QAAS,EACjD,CAAE,MAAO,kBAAmB,WAAY,QAAS,EACjD,CAAE,MAAO,2BAA4B,WAAY,QAAS,EAC1D,CAAE,MAAO,cAAe,WAAY,QAAS,EAC7C,CAAE,MAAO,mBAAoB,WAAY,SAAU,UAAW,WAAY,EAC1E,CAAE,MAAO,sBAAuB,WAAY,QAAS,EACrD,CAAE,MAAO,oBAAqB,WAAY,QAAS,EACnD,CAAE,MAAO,cAAe,WAAY,QAAS,EAC7C,CAAE,MAAO,oBAAqB,WAAY,QAAS,EACnD,CAAE,MAAO,eAAgB,WAAY,SAAU,UAAW,QAAS,EACnE,CAAE,MAAO,gBAAiB,WAAY,QAAS,EAC/C,CAAE,MAAO,iBAAkB,WAAY,QAAS,CACpD,EACA,OAAQ,CACJ,oBAAqB,SACzB,CACJ"}
1
+ {"version":3,"file":"screenplay-dark.js","names":["screenplayDarkThemeName","screenplayDark"],"sources":["../../../themes/screenplay-dark.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { editor } from 'monaco-editor';\n\nexport const screenplayDarkThemeName = 'screenplay-dark';\n\nexport const screenplayDark: editor.IStandaloneThemeData = {\n base: 'vs-dark',\n inherit: true,\n rules: [\n { token: 'keyword.play', foreground: 'C586C0' },\n { token: 'keyword.tag.play', foreground: '569CD6', fontStyle: 'italic' },\n { token: 'keyword.type.play', foreground: '4FC1FF', fontStyle: 'bold' },\n { token: 'type.play', foreground: '4EC9B0' },\n { token: 'type.identifier.play', foreground: '4EC9B0' },\n { token: 'identifier.play', foreground: '9CDCFE' },\n { token: 'annotation.play', foreground: 'DCDCAA' },\n { token: 'variable.predefined.play', foreground: 'D7BA7D' },\n { token: 'string.play', foreground: 'CE9178' },\n { token: 'string.link.play', foreground: 'CE9178', fontStyle: 'underline' },\n { token: 'string.invalid.play', foreground: 'F44747' },\n { token: 'string.quote.play', foreground: '6A9955' },\n { token: 'number.play', foreground: 'B5CEA8' },\n { token: 'number.float.play', foreground: 'B5CEA8' },\n { token: 'comment.play', foreground: '6A9955', fontStyle: 'italic' },\n { token: 'operator.play', foreground: 'D4D4D4' },\n { token: 'delimiter.play', foreground: 'CCCCCC' },\n ],\n colors: {\n 'editor.background': '#1E1E1E',\n },\n};\n"],"mappings":"AAKA,MAAaA,EAA0B,kBAE1BC,EAA8C,CACvD,KAAM,UACN,QAAS,GACT,MAAO,CACH,CAAE,MAAO,eAAgB,WAAY,QAAS,EAC9C,CAAE,MAAO,mBAAoB,WAAY,SAAU,UAAW,QAAS,EACvE,CAAE,MAAO,oBAAqB,WAAY,SAAU,UAAW,MAAO,EACtE,CAAE,MAAO,YAAa,WAAY,QAAS,EAC3C,CAAE,MAAO,uBAAwB,WAAY,QAAS,EACtD,CAAE,MAAO,kBAAmB,WAAY,QAAS,EACjD,CAAE,MAAO,kBAAmB,WAAY,QAAS,EACjD,CAAE,MAAO,2BAA4B,WAAY,QAAS,EAC1D,CAAE,MAAO,cAAe,WAAY,QAAS,EAC7C,CAAE,MAAO,mBAAoB,WAAY,SAAU,UAAW,WAAY,EAC1E,CAAE,MAAO,sBAAuB,WAAY,QAAS,EACrD,CAAE,MAAO,oBAAqB,WAAY,QAAS,EACnD,CAAE,MAAO,cAAe,WAAY,QAAS,EAC7C,CAAE,MAAO,oBAAqB,WAAY,QAAS,EACnD,CAAE,MAAO,eAAgB,WAAY,SAAU,UAAW,QAAS,EACnE,CAAE,MAAO,gBAAiB,WAAY,QAAS,EAC/C,CAAE,MAAO,iBAAkB,WAAY,QAAS,CACpD,EACA,OAAQ,CACJ,oBAAqB,SACzB,CACJ,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"screenplay-light.js","names":["screenplayLightThemeName","screenplayLight"],"sources":["../../../themes/screenplay-light.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { editor } from 'monaco-editor';\n\nexport const screenplayLightThemeName = 'screenplay-light';\n\nexport const screenplayLight: editor.IStandaloneThemeData = {\n base: 'vs',\n inherit: true,\n rules: [\n { token: 'keyword.play', foreground: 'AF00DB' },\n { token: 'keyword.tag.play', foreground: '0000FF', fontStyle: 'italic' },\n { token: 'keyword.type.play', foreground: '0070C1', fontStyle: 'bold' },\n { token: 'type.play', foreground: '267F99' },\n { token: 'type.identifier.play', foreground: '267F99' },\n { token: 'identifier.play', foreground: '001080' },\n { token: 'annotation.play', foreground: '795E26' },\n { token: 'variable.predefined.play', foreground: 'B45309' },\n { token: 'string.play', foreground: 'A31515' },\n { token: 'string.link.play', foreground: 'A31515', fontStyle: 'underline' },\n { token: 'string.invalid.play', foreground: 'CD3131' },\n { token: 'string.quote.play', foreground: '008000' },\n { token: 'number.play', foreground: '098658' },\n { token: 'number.float.play', foreground: '098658' },\n { token: 'comment.play', foreground: '008000', fontStyle: 'italic' },\n { token: 'operator.play', foreground: '000000' },\n { token: 'delimiter.play', foreground: '000000' },\n ],\n colors: {\n 'editor.background': '#FFFFFF',\n },\n};\n"],"mappings":"AAKA,MAAaA,EAA2B,mBAE3BC,EAA+C,CACxD,KAAM,KACN,QAAS,GACT,MAAO,CACH,CAAE,MAAO,eAAgB,WAAY,QAAS,EAC9C,CAAE,MAAO,mBAAoB,WAAY,SAAU,UAAW,QAAS,EACvE,CAAE,MAAO,oBAAqB,WAAY,SAAU,UAAW,MAAO,EACtE,CAAE,MAAO,YAAa,WAAY,QAAS,EAC3C,CAAE,MAAO,uBAAwB,WAAY,QAAS,EACtD,CAAE,MAAO,kBAAmB,WAAY,QAAS,EACjD,CAAE,MAAO,kBAAmB,WAAY,QAAS,EACjD,CAAE,MAAO,2BAA4B,WAAY,QAAS,EAC1D,CAAE,MAAO,cAAe,WAAY,QAAS,EAC7C,CAAE,MAAO,mBAAoB,WAAY,SAAU,UAAW,WAAY,EAC1E,CAAE,MAAO,sBAAuB,WAAY,QAAS,EACrD,CAAE,MAAO,oBAAqB,WAAY,QAAS,EACnD,CAAE,MAAO,cAAe,WAAY,QAAS,EAC7C,CAAE,MAAO,oBAAqB,WAAY,QAAS,EACnD,CAAE,MAAO,eAAgB,WAAY,SAAU,UAAW,QAAS,EACnE,CAAE,MAAO,gBAAiB,WAAY,QAAS,EAC/C,CAAE,MAAO,iBAAkB,WAAY,QAAS,CACpD,EACA,OAAQ,CACJ,oBAAqB,SACzB,CACJ"}
1
+ {"version":3,"file":"screenplay-light.js","names":["screenplayLightThemeName","screenplayLight"],"sources":["../../../themes/screenplay-light.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { editor } from 'monaco-editor';\n\nexport const screenplayLightThemeName = 'screenplay-light';\n\nexport const screenplayLight: editor.IStandaloneThemeData = {\n base: 'vs',\n inherit: true,\n rules: [\n { token: 'keyword.play', foreground: 'AF00DB' },\n { token: 'keyword.tag.play', foreground: '0000FF', fontStyle: 'italic' },\n { token: 'keyword.type.play', foreground: '0070C1', fontStyle: 'bold' },\n { token: 'type.play', foreground: '267F99' },\n { token: 'type.identifier.play', foreground: '267F99' },\n { token: 'identifier.play', foreground: '001080' },\n { token: 'annotation.play', foreground: '795E26' },\n { token: 'variable.predefined.play', foreground: 'B45309' },\n { token: 'string.play', foreground: 'A31515' },\n { token: 'string.link.play', foreground: 'A31515', fontStyle: 'underline' },\n { token: 'string.invalid.play', foreground: 'CD3131' },\n { token: 'string.quote.play', foreground: '008000' },\n { token: 'number.play', foreground: '098658' },\n { token: 'number.float.play', foreground: '098658' },\n { token: 'comment.play', foreground: '008000', fontStyle: 'italic' },\n { token: 'operator.play', foreground: '000000' },\n { token: 'delimiter.play', foreground: '000000' },\n ],\n colors: {\n 'editor.background': '#FFFFFF',\n },\n};\n"],"mappings":"AAKA,MAAaA,EAA2B,mBAE3BC,EAA+C,CACxD,KAAM,KACN,QAAS,GACT,MAAO,CACH,CAAE,MAAO,eAAgB,WAAY,QAAS,EAC9C,CAAE,MAAO,mBAAoB,WAAY,SAAU,UAAW,QAAS,EACvE,CAAE,MAAO,oBAAqB,WAAY,SAAU,UAAW,MAAO,EACtE,CAAE,MAAO,YAAa,WAAY,QAAS,EAC3C,CAAE,MAAO,uBAAwB,WAAY,QAAS,EACtD,CAAE,MAAO,kBAAmB,WAAY,QAAS,EACjD,CAAE,MAAO,kBAAmB,WAAY,QAAS,EACjD,CAAE,MAAO,2BAA4B,WAAY,QAAS,EAC1D,CAAE,MAAO,cAAe,WAAY,QAAS,EAC7C,CAAE,MAAO,mBAAoB,WAAY,SAAU,UAAW,WAAY,EAC1E,CAAE,MAAO,sBAAuB,WAAY,QAAS,EACrD,CAAE,MAAO,oBAAqB,WAAY,QAAS,EACnD,CAAE,MAAO,cAAe,WAAY,QAAS,EAC7C,CAAE,MAAO,oBAAqB,WAAY,QAAS,EACnD,CAAE,MAAO,eAAgB,WAAY,SAAU,UAAW,QAAS,EACnE,CAAE,MAAO,gBAAiB,WAAY,QAAS,EAC/C,CAAE,MAAO,iBAAkB,WAAY,QAAS,CACpD,EACA,OAAQ,CACJ,oBAAqB,SACzB,CACJ,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","names":["contextualConstructs","embeddedLanguages","keyword","exitKeywords","constructKeywords","subLanguages","subLanguage","commonTokenRules","tokenizer","bmpWordCharacters","codeBlockTags","tag","clauseKeywords"],"sources":["../../tokens.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { languages } from 'monaco-editor';\nimport {\n clauseKeywords,\n codeBlockTags,\n constructKeywords,\n primitiveTypes,\n sliceTypes,\n} from './language';\nimport { MonarchTokenRules, SubLanguage } from './sub-language-registry';\nimport { bmpWordCharacters } from './bmp-word-characters';\n\n// Maps a Screenplay inline code tag to the Monaco language id used for embedded highlighting.\n// Declaration registration must not globally reserve existing property names.\n// Ambiguous standalone operation headers are supplied by typed semantic tokens.\nconst contextualConstructs = new Set(['operation', 'system', 'eventsource', 'purpose', 'context', 'runs', 'time', 'statemachine', 'workflow']);\n\nconst embeddedLanguages: Record<string, string> = {\n csharp: 'csharp',\n java: 'java',\n typescript: 'typescript',\n react: 'typescript',\n html: 'html',\n sql: 'sql',\n};\n\nfunction subLanguageState(keyword: string): string {\n return `subLanguage_${keyword}`;\n}\n\n// A construct keyword at the start of a line ends any indented sub-language block.\nfunction subLanguageExitRule(subLanguages: SubLanguage[]): MonarchTokenRules[number] {\n const exitKeywords = [...constructKeywords.filter(keyword => !contextualConstructs.has(keyword)), ...subLanguages.map((subLanguage) => subLanguage.keyword)];\n return [\n new RegExp(`^\\\\s*(?:${exitKeywords.join('|')})\\\\b`),\n { token: '@rematch', next: '@pop' },\n ];\n}\n\n// Shared across the composite `.play` tokenizer and every standalone sub-language tokenizer\n// (comments, `$`-prefixed context variables, strings, numbers, operators, delimiters, whitespace).\nexport const commonTokenRules: MonarchTokenRules = [\n [/\\/\\/.*$/, 'comment'],\n [/\\$(?:context|identity|eventContext|eventSourceId|causedBy|refusal)(?:\\.\\w+)*/, 'variable.predefined'],\n [/\\$(?:env|secrets|strings)\\.[\\w.]+/, 'variable.predefined'],\n [/\\$\\.[\\w.]*/, 'variable.predefined'],\n [/\"(?:[^\"\\\\]|\\\\.)*\"/, 'string'],\n [/\"(?:[^\"\\\\]|\\\\.)*$/, 'string.invalid'],\n [/\\d+(?:ms|s|m|h|d)\\b/, 'number'],\n [/-?\\d+\\.\\d+/, 'number.float'],\n [/-?\\d+/, 'number'],\n [/=>|==|!=|>=|<=|[><=:?]/, 'operator'],\n [/[[\\](),.]/, 'delimiter'],\n [/\\s+/, 'white'],\n];\n\nexport function createTokensProvider(subLanguages: SubLanguage[]): languages.IMonarchLanguage {\n const tokenizer: Record<string, MonarchTokenRules> = {\n root: [\n [new RegExp(`^(\\\\s*)(example)(\\\\s+)([A-Z][${bmpWordCharacters}]*)(\\\\s*)(:)(\\\\s*)([A-Z][${bmpWordCharacters}.]*)(?=\\\\s*(?://.*)?$)`),\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'operator', 'white', 'type.identifier']],\n [/^(time)(\\s+)(zone)(\\s+)(configurable\\s+default\\s+)?(?=\")/, ['keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(calendar)(\\s+)(?=\"|from\\s+\\$context\\.)/, ['white', 'keyword', 'white']],\n [/^(\\s*)(given)(\\s+)(time)(\\s+)(zone)(?=\\s+\")/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(direction)(\\s+)(inbound|outbound)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword']],\n [new RegExp(`^()(purpose)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?://.*)?$)`), ['white', 'keyword', 'white', { token: 'type.identifier', next: '@purposeBody.$1' }]],\n [/^(\\s*)(parameter)(\\s+)([a-z_]\\w*)(\\s+)([\\w.]+(?:\\[\\])?(?:\\s+optional)?)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'identifier', 'white', 'type.identifier']],\n [/^(\\s*)(case)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:[a-z_]\\w*\\s*=|\\/\\/|$))/, ['white', 'keyword', 'white', 'type.identifier']],\n [/\\b(case)(\\.)([a-z_]\\w*)\\b/, ['keyword', 'delimiter', 'identifier']],\n [/^(\\s*)(concept)(\\s+)([^\\s:]+)(\\s*:\\s*)(\\w+)((?:\\s+(?:@?pii|personal|@?sensitive|secret))*)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'type.identifier', 'operator', { token: 'type.identifier', next: '@conceptBody.$1' }, 'keyword']],\n [/^()(context)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@applicationContextBody.$1' }]],\n [/^(\\s*)(context)(\\s+)(from)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(command)(\\s+)(reads)(\\s+)(protected)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(reaction)(\\s+)(batches)(\\s+)(atomic)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(numbers)([ \\t]+)(exact)(?=[ \\t]*(?:(?:\\/\\/|#).*)?$)/, ['keyword', 'white', 'keyword']],\n [/^(eventsource)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'type.identifier']],\n [/^(system)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'type.identifier']],\n // 'runs' is contextual: only a reaction's identity line is a keyword; a property called runs keeps its name.\n [/^(\\s*)(runs)(\\s+)(as)(\\s+)(system)\\b/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(produces\\s+operation)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@operationBody.$1' }]],\n [/^(\\s*)(given\\s+operation)(\\s+)([\\w.]+)(\\s+)(fails)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword']],\n [/^(\\s*)(then\\s+(?:operation|compensated|invokes))(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier']],\n [new RegExp(`^(\\\\s*)(command)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?://.*)?$)`), ['white', 'keyword', 'white', { token: 'type.identifier', next: '@commandBody.$1' }]],\n [/^(\\s*)(handler)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@handlerBody.$1' }]],\n [/^(\\s*@?[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(\\s+)(generated)(\\s+identifier|)(?=\\s*(?:\\/\\/.*)?$)/,\n ['identifier', 'type.identifier', 'white', 'keyword', 'keyword']],\n [/^(\\s*)(generated)(\\s+)([a-z_]\\w*)(\\s*=(?!=|>))/, ['white', 'keyword', 'white', 'identifier', 'operator']],\n [/^(\\s*)(then)(\\s+)(returns)\\b/, ['white', 'keyword', 'white', 'keyword']],\n // Only unambiguous response headers: two-token property declarations keep their names.\n [/^(\\s*)(returns)(?=\\s*(?:\\/\\/.*)?$|\\s+@\\w+\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword']],\n [/^(\\s*@?[a-z_]\\w*\\s+)([\\w.]+)(\\s+)(key)(?=\\s*(?:\\/\\/.*)?$)/, ['identifier', 'type.identifier', 'white', 'keyword']],\n // A modifier only after a complete type; names called optional remain ordinary names.\n [/^(\\s*(?:by|filter)\\s+[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:from\\b|\\/\\/|$))/,\n ['identifier', 'type.identifier', 'white', 'keyword']],\n // Query prefixes cannot fall back to being property names.\n [/^(?!\\s*(?:by|filter)\\s+)(\\s*@?[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:identifier\\b|from\\b|=(?!=|>)|\\/\\/|$))/,\n ['identifier', 'type.identifier', 'white', 'keyword']],\n [/^(\\s*query\\s+[A-Za-z_]\\w*\\s*=>\\s*(?!observable\\s+optional\\s*(?:\\/\\/.*)?$)(?:observable\\s+)?)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:\\/\\/.*)?$)/,\n ['keyword', 'type.identifier', 'white', 'keyword']],\n [new RegExp(`^(\\\\s*)(given)(\\\\s+)(caller)(\\\\s+)(as)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?://.*)?$)`),\n ['white', 'keyword', 'white', 'keyword', 'white', 'keyword', 'white', 'type.identifier']],\n // A specification's clock, trigger, capture and query steps - matched before a sub-language keyword\n // can claim 'capture' and read the rest of the specification as change data capture.\n [/^(\\s*)(given|when)(\\s+)(clock|capture|trigger|query)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(then)(\\s+)(result|no\\s+(?:result|events))\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(then)(\\s+)(events)(\\s+)(in any order)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(when)(\\s+)(redelivered)(\\s+)([\\w.]+)(\\s+)(to)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', 'type.identifier']],\n // Action subjects are header clauses, not new reserved property names.\n [/^(\\s*)(action)(\\s+)(\"(?:[^\"\\\\]|\\\\.)*\"|\\$strings\\.[\\w.]+)(\\s+)(for)(\\s+)(item|screen)\\b/,\n ['white', 'keyword', 'white', 'string', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(action)(\\s+)([\\w.]+)(\\s+)(for)(\\s+)(item|screen)\\b/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(item)(\\s+)(\\w+)(\\s+)(action)(\\s+)([\\w.]+)(\\s+)(for)(\\s+)(item|screen)\\b/,\n ['white', 'keyword', 'white', 'identifier', 'white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', 'keyword']],\n // Guarded-action words are contextual; property names keep their ordinary meaning.\n [/^(\\s*)(otherwise)(\\s+)(hidden)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(otherwise)(\\s+)(execute)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'keyword', 'white', 'type.identifier']],\n [/^(\\s*)(when)(\\s+)(?=.+\\s+execute\\s+[\\w.]+\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', { token: 'white', next: '@guardedActionCondition' }]],\n [/^(\\s*)(behavior)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@behaviorBody.$1' }]],\n [/^(\\s*)(on)(\\s+)(refused)(\\s+)(by)(\\s+)(validation|constraint|authorization)\\b/,\n ['white', 'keyword', 'white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(on)(\\s+)(refused)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(on)(\\s+)([\\w-]+)\\b/, ['white', 'keyword', 'white', { token: 'keyword', next: '@interactionBody.$1' }]],\n [/^(\\s*)(acknowledge)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword']],\n // A quoted import names .play files rather than a qualified name - the path reads as a link.\n [/^(\\s*)(import)(\\s+)(\"[^\"\\\\]*\")/, ['white', 'keyword', 'white', 'string.link']],\n // Retain the header indent so event metadata stops at the enclosing block boundary.\n [/^(\\s*)((?:(?:produces|public)\\s+)?event)(\\s+)([A-Za-z_]\\w*)(\\s+)(generation)(\\s+)(\\d+)(?=\\s*(?:from\\s+\"(?:[^\"\\\\]|\\\\.)*\"\\s*)?(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', { token: 'number', next: '@eventBody.$1' }]],\n [/^(\\s*)((?:(?:produces|public)\\s+)?event)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:from\\s+\"(?:[^\"\\\\]|\\\\.)*\"\\s*)?(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@eventBody.$1' }]],\n // A tagged opening fence carries the embedded language; legacy tag lines still highlight.\n ...codeBlockTags.map(\n (tag): MonarchTokenRules[number] => [\n new RegExp(`^\\\\s*\\\\x60\\\\x60\\\\x60${tag}\\\\s*$`),\n { token: 'string.quote', next: `@codeBlock.${embeddedLanguages[tag]}`, nextEmbedded: embeddedLanguages[tag] },\n ],\n ),\n // Inline code block tags at end of line open an embedded code block.\n ...codeBlockTags.map(\n (tag): MonarchTokenRules[number] => [\n new RegExp(`\\\\b${tag}\\\\b(?=\\\\s*$)`),\n { token: 'keyword.tag', next: `@codeBlockPending.${embeddedLanguages[tag]}` },\n ],\n ),\n // Sub-language constructs switch to the registered sub-language's token rules.\n ...subLanguages.map(\n (subLanguage): MonarchTokenRules[number] => [\n new RegExp(`\\\\b${subLanguage.keyword}\\\\b`),\n { token: 'keyword', next: `@${subLanguageState(subLanguage.keyword)}` },\n ],\n ),\n // Typed documentation names are properties, not metadata directives.\n [/^(\\s*)(documentation)(?=\\s+[\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?\\s*(?:identifier\\b|generated\\b|=(?!=|>)|\\/\\/|$))/,\n ['white', 'identifier']],\n // A bare description or documentation keyword opens a fenced prose block.\n [/\\b(?:description|documentation)\\b(?=\\s*(?:\\/\\/.*)?$)/, { token: 'keyword', next: '@descriptionBlockPending' }],\n [/\\brow-click\\b/, 'keyword'],\n // A leading @ escapes a name that collides with a directive keyword - it is a name, not an attribute.\n [/^\\s*@[a-z_]\\w*/, 'identifier'],\n [/@\\w+/, 'annotation'],\n [\n /[A-Z]\\w*/,\n {\n cases: {\n '@sliceTypes': 'keyword.type',\n '@primitiveTypes': 'type',\n '@default': 'type.identifier',\n },\n },\n ],\n [\n /[a-z_]\\w*/,\n {\n cases: {\n '@keywords': 'keyword',\n '@default': 'identifier',\n },\n },\n ],\n { include: '@common' },\n ],\n\n guardedActionCondition: [\n [/(execute)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', { token: 'type.identifier', next: '@pop' }]],\n { include: '@root' },\n ],\n\n behaviorBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n { include: '@root' },\n ],\n\n interactionBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(otherwise)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword']],\n [/^(\\s*)(when)(\\s+)(?=item\\.|\\()/, ['white', 'keyword', 'white']],\n [/^(\\s*)(execute)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'type.identifier']],\n { include: '@root' },\n ],\n\n applicationContextBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(@?[a-z_]\\w*)(\\s+)(time)(\\s+)(zone)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'identifier', 'white', 'type.identifier', 'white', 'type.identifier']],\n { include: '@root' },\n ],\n\n purposeBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(basis|interest|condition|authorization|subjects|retention|recipient|transfer|erasure)(\\s+)/, ['white', 'keyword', 'white']],\n [/\\b(safeguard|exception)\\b/, 'keyword'],\n { include: '@root' },\n ],\n\n generationLine: [\n [/^/, { token: '@rematch', next: '@pop' }],\n [/\\b(prefix|case|alphabet|checksum|base64url|hex|base32|lower|upper|luhn|mod11|mod97)\\b/, 'keyword'],\n { include: '@common' },\n ],\n\n conceptBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(validate)(\\s+)(checksum)(\\s+)(luhn|mod11|mod97)\\b/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(checksum)(\\s+)(luhn|mod11|mod97)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [new RegExp(`^(\\\\s*)(@?[a-z_][${bmpWordCharacters}]*)(\\\\s*)(=)(\\\\s*)(-?(?:0|[1-9][0-9]*))(?=\\\\s*(?://.*)?$)`), ['white', 'identifier', 'white', 'operator', 'white', 'number']],\n [/^(\\s*)(@?pii|personal|@?sensitive|secret)(\\s+)(reason|scope|special|criminal)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(generate)(\\s+)(uuidv7|uuid|ulid|typeid|nanoid|bytes|pattern|random|rule|sequence)\\b/, ['white', 'keyword', 'white', { token: 'keyword', next: '@generationLine' }]],\n { include: '@root' },\n ],\n\n commandBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(validate)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@commandValidation.$1' }]],\n { include: '@root' },\n ],\n\n commandValidation: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [new RegExp(`^(\\\\s*)([${bmpWordCharacters}.]+)(\\\\s+)(rule)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?:severity\\\\s+\\\\w+|message\\\\s+.*|//.*|$))`),\n ['white', 'identifier', 'white', 'keyword', 'white', { token: 'type.identifier', next: '@namedRuleBody.$1' }]],\n { include: '@root' },\n ],\n\n namedRuleBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n operationBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(execute|compensate)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@operationPhase.$1' }]],\n [/^(\\s*)(uses)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'type.identifier']],\n [/^(\\s*)(@?[a-z_]\\w*)(\\s+)([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(?=\\s*(?:=(?!=|>)|\\/\\/|$))/,\n ['white', 'identifier', 'white', 'type.identifier']],\n { include: '@root' },\n ],\n\n operationPhase: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n handlerBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n implementationBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(hint)(?=\\s+\")/, ['white', 'keyword']],\n { include: '@root' },\n ],\n\n eventBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(id)(?=\\s+\")/, ['white', 'keyword']],\n [/^(\\s*)(documentation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@descriptionBlockPending' }]],\n { include: '@root' },\n ],\n\n common: commonTokenRules,\n\n // After a code tag, the only thing allowed before the opening fence is whitespace.\n codeBlockPending: [\n [\n /^\\s*```\\s*$/,\n { token: 'string.quote', switchTo: '@codeBlock.$S2', nextEmbedded: '$S2' },\n ],\n [/^\\s*[^\\s`].*$/, { token: '@rematch', next: '@pop' }],\n [/\\s+/, 'white'],\n ],\n\n codeBlock: [\n [/^\\s*```\\s*$/, { token: 'string.quote', next: '@pop', nextEmbedded: '@pop' }],\n [/[^`]+/, ''],\n [/`/, ''],\n ],\n\n // After a bare description, the only thing allowed before the opening fence is whitespace.\n descriptionBlockPending: [\n [/\\/\\/.*$/, 'comment'],\n [/^\\s*```(?:text|markdown)?\\s*$/, { token: 'string.quote', switchTo: '@descriptionBlock' }],\n [/^\\s*[^\\s`].*$/, { token: '@rematch', next: '@pop' }],\n [/\\s+/, 'white'],\n ],\n\n descriptionBlock: [\n [/^\\s*```\\s*$/, { token: 'string.quote', next: '@pop' }],\n [/.+/, 'string'],\n ],\n };\n\n for (const subLanguage of subLanguages) {\n tokenizer[subLanguageState(subLanguage.keyword)] = [\n subLanguageExitRule(subLanguages),\n ...subLanguage.tokens,\n { include: '@common' },\n [/[A-Z]\\w*/, 'type.identifier'],\n [/[a-z_]\\w*/, 'identifier'],\n ];\n }\n\n return {\n defaultToken: '',\n tokenPostfix: '.play',\n ignoreCase: false,\n keywords: [...constructKeywords.filter(keyword => !contextualConstructs.has(keyword)), ...clauseKeywords.filter(keyword => keyword !== 'context'), ...codeBlockTags],\n sliceTypes,\n primitiveTypes,\n tokenizer,\n } as languages.IMonarchLanguage;\n}\n"],"mappings":"2OAiBA,MAAMA,kBAAuB,IAAI,IAAI,CAAC,YAAa,SAAU,cAAe,UAAW,UAAW,OAAQ,OAAQ,eAAgB,UAAU,CAAC,EAEvIC,EAA4C,CAC9C,OAAQ,SACR,KAAM,OACN,WAAY,aACZ,MAAO,aACP,KAAM,OACN,IAAK,KACT,EAEA,SAAS,iBAAiB,EAAyB,CAC/C,MAAO,eAAeC,GAC1B,CAGA,SAAS,oBAAoB,EAAwD,CACjF,IAAMC,EAAe,CAAC,GAAGC,EAAkB,OAAO,GAAW,CAACJ,EAAqB,IAAIE,CAAO,CAAC,E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AAO,CAAC,EACvD,CAAC,KAAM,QAAQ,CACnB,CACJ,EAEA,IAAK,IAAMD,KAAeD,EACtB,EAAU,iBAAiBC,EAAY,OAAO,GAAK,CAC/C,oBAAoBD,CAAY,EAChC,GAAGC,EAAY,OACf,CAAE,QAAS,SAAU,EACrB,CAAC,WAAY,iBAAiB,EAC9B,CAAC,YAAa,YAAY,CAC9B,EAGJ,MAAO,CACH,aAAc,GACd,aAAc,QACd,WAAY,GACZ,SAAU,CAAC,GAAGF,EAAkB,OAAO,GAAW,CAACJ,EAAqB,IAAIE,CAAO,CAAC,EAAG,GAAGU,EAAe,OAAO,GAAWV,IAAY,SAAS,EAAG,GAAGQ,CAAa,EACnK,aACA,iBACA,WACJ,CACJ"}
1
+ {"version":3,"file":"tokens.js","names":["contextualConstructs","embeddedLanguages","keyword","exitKeywords","constructKeywords","subLanguages","subLanguage","commonTokenRules","tokenizer","bmpWordCharacters","codeBlockTags","tag","clauseKeywords"],"sources":["../../tokens.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { languages } from 'monaco-editor';\nimport {\n clauseKeywords,\n codeBlockTags,\n constructKeywords,\n primitiveTypes,\n sliceTypes,\n} from './language';\nimport { MonarchTokenRules, SubLanguage } from './sub-language-registry';\nimport { bmpWordCharacters } from './bmp-word-characters';\n\n// Maps a Screenplay inline code tag to the Monaco language id used for embedded highlighting.\n// Declaration registration must not globally reserve existing property names.\n// Ambiguous standalone operation headers are supplied by typed semantic tokens.\nconst contextualConstructs = new Set(['operation', 'system', 'eventsource', 'purpose', 'context', 'runs', 'time', 'statemachine', 'workflow']);\n\nconst embeddedLanguages: Record<string, string> = {\n csharp: 'csharp',\n java: 'java',\n typescript: 'typescript',\n react: 'typescript',\n html: 'html',\n sql: 'sql',\n};\n\nfunction subLanguageState(keyword: string): string {\n return `subLanguage_${keyword}`;\n}\n\n// A construct keyword at the start of a line ends any indented sub-language block.\nfunction subLanguageExitRule(subLanguages: SubLanguage[]): MonarchTokenRules[number] {\n const exitKeywords = [...constructKeywords.filter(keyword => !contextualConstructs.has(keyword)), ...subLanguages.map((subLanguage) => subLanguage.keyword)];\n return [\n new RegExp(`^\\\\s*(?:${exitKeywords.join('|')})\\\\b`),\n { token: '@rematch', next: '@pop' },\n ];\n}\n\n// Shared across the composite `.play` tokenizer and every standalone sub-language tokenizer\n// (comments, `$`-prefixed context variables, strings, numbers, operators, delimiters, whitespace).\nexport const commonTokenRules: MonarchTokenRules = [\n [/\\/\\/.*$/, 'comment'],\n [/\\$(?:context|identity|eventContext|eventSourceId|causedBy|refusal)(?:\\.\\w+)*/, 'variable.predefined'],\n [/\\$(?:env|secrets|strings)\\.[\\w.]+/, 'variable.predefined'],\n [/\\$\\.[\\w.]*/, 'variable.predefined'],\n [/\"(?:[^\"\\\\]|\\\\.)*\"/, 'string'],\n [/\"(?:[^\"\\\\]|\\\\.)*$/, 'string.invalid'],\n [/\\d+(?:ms|s|m|h|d)\\b/, 'number'],\n [/-?\\d+\\.\\d+/, 'number.float'],\n [/-?\\d+/, 'number'],\n [/=>|==|!=|>=|<=|[><=:?]/, 'operator'],\n [/[[\\](),.]/, 'delimiter'],\n [/\\s+/, 'white'],\n];\n\nexport function createTokensProvider(subLanguages: SubLanguage[]): languages.IMonarchLanguage {\n const tokenizer: Record<string, MonarchTokenRules> = {\n root: [\n [new RegExp(`^(\\\\s*)(example)(\\\\s+)([A-Z][${bmpWordCharacters}]*)(\\\\s*)(:)(\\\\s*)([A-Z][${bmpWordCharacters}.]*)(?=\\\\s*(?://.*)?$)`),\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'operator', 'white', 'type.identifier']],\n [/^(time)(\\s+)(zone)(\\s+)(configurable\\s+default\\s+)?(?=\")/, ['keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(calendar)(\\s+)(?=\"|from\\s+\\$context\\.)/, ['white', 'keyword', 'white']],\n [/^(\\s*)(given)(\\s+)(time)(\\s+)(zone)(?=\\s+\")/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(direction)(\\s+)(inbound|outbound)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword']],\n [new RegExp(`^()(purpose)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?://.*)?$)`), ['white', 'keyword', 'white', { token: 'type.identifier', next: '@purposeBody.$1' }]],\n [/^(\\s*)(parameter)(\\s+)([a-z_]\\w*)(\\s+)([\\w.]+(?:\\[\\])?(?:\\s+optional)?)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'identifier', 'white', 'type.identifier']],\n [/^(\\s*)(case)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:[a-z_]\\w*\\s*=|\\/\\/|$))/, ['white', 'keyword', 'white', 'type.identifier']],\n [/\\b(case)(\\.)([a-z_]\\w*)\\b/, ['keyword', 'delimiter', 'identifier']],\n [/^(\\s*)(concept)(\\s+)([^\\s:]+)(\\s*:\\s*)(\\w+)((?:\\s+(?:@?pii|personal|@?sensitive|secret))*)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'type.identifier', 'operator', { token: 'type.identifier', next: '@conceptBody.$1' }, 'keyword']],\n [/^()(context)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@applicationContextBody.$1' }]],\n [/^(\\s*)(context)(\\s+)(from)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(command)(\\s+)(reads)(\\s+)(protected)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(reaction)(\\s+)(batches)(\\s+)(atomic)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(numbers)([ \\t]+)(exact)(?=[ \\t]*(?:(?:\\/\\/|#).*)?$)/, ['keyword', 'white', 'keyword']],\n [/^(eventsource)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'type.identifier']],\n [/^(system)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'type.identifier']],\n // 'runs' is contextual: only a reaction's identity line is a keyword; a property called runs keeps its name.\n [/^(\\s*)(runs)(\\s+)(as)(\\s+)(system)\\b/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(produces\\s+operation)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@operationBody.$1' }]],\n [/^(\\s*)(given\\s+operation)(\\s+)([\\w.]+)(\\s+)(fails)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword']],\n [/^(\\s*)(then\\s+(?:operation|compensated|invokes))(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier']],\n [new RegExp(`^(\\\\s*)(command)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?://.*)?$)`), ['white', 'keyword', 'white', { token: 'type.identifier', next: '@commandBody.$1' }]],\n [/^(\\s*)(handler)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@handlerBody.$1' }]],\n [/^(\\s*@?[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(\\s+)(generated)(\\s+identifier|)(?=\\s*(?:\\/\\/.*)?$)/,\n ['identifier', 'type.identifier', 'white', 'keyword', 'keyword']],\n [/^(\\s*)(generated)(\\s+)([a-z_]\\w*)(\\s*=(?!=|>))/, ['white', 'keyword', 'white', 'identifier', 'operator']],\n [/^(\\s*)(then)(\\s+)(returns)\\b/, ['white', 'keyword', 'white', 'keyword']],\n // Only unambiguous response headers: two-token property declarations keep their names.\n [/^(\\s*)(returns)(?=\\s*(?:\\/\\/.*)?$|\\s+@\\w+\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword']],\n [/^(\\s*@?[a-z_]\\w*\\s+)([\\w.]+)(\\s+)(key)(?=\\s*(?:\\/\\/.*)?$)/, ['identifier', 'type.identifier', 'white', 'keyword']],\n // A modifier only after a complete type; names called optional remain ordinary names.\n [/^(\\s*(?:by|filter)\\s+[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:from\\b|\\/\\/|$))/,\n ['identifier', 'type.identifier', 'white', 'keyword']],\n // Query prefixes cannot fall back to being property names.\n [/^(?!\\s*(?:by|filter)\\s+)(\\s*@?[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:identifier\\b|from\\b|=(?!=|>)|\\/\\/|$))/,\n ['identifier', 'type.identifier', 'white', 'keyword']],\n [/^(\\s*query\\s+[A-Za-z_]\\w*\\s*=>\\s*(?!observable\\s+optional\\s*(?:\\/\\/.*)?$)(?:observable\\s+)?)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:\\/\\/.*)?$)/,\n ['keyword', 'type.identifier', 'white', 'keyword']],\n [new RegExp(`^(\\\\s*)(given)(\\\\s+)(caller)(\\\\s+)(as)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?://.*)?$)`),\n ['white', 'keyword', 'white', 'keyword', 'white', 'keyword', 'white', 'type.identifier']],\n // A specification's clock, trigger, capture and query steps - matched before a sub-language keyword\n // can claim 'capture' and read the rest of the specification as change data capture.\n [/^(\\s*)(given|when)(\\s+)(clock|capture|trigger|query)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(then)(\\s+)(result|no\\s+(?:result|events))\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(then)(\\s+)(events)(\\s+)(in any order)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(when)(\\s+)(redelivered)(\\s+)([\\w.]+)(\\s+)(to)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', 'type.identifier']],\n // Action subjects are header clauses, not new reserved property names.\n [/^(\\s*)(action)(\\s+)(\"(?:[^\"\\\\]|\\\\.)*\"|\\$strings\\.[\\w.]+)(\\s+)(for)(\\s+)(item|screen)\\b/,\n ['white', 'keyword', 'white', 'string', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(action)(\\s+)([\\w.]+)(\\s+)(for)(\\s+)(item|screen)\\b/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(item)(\\s+)(\\w+)(\\s+)(action)(\\s+)([\\w.]+)(\\s+)(for)(\\s+)(item|screen)\\b/,\n ['white', 'keyword', 'white', 'identifier', 'white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', 'keyword']],\n // Guarded-action words are contextual; property names keep their ordinary meaning.\n [/^(\\s*)(otherwise)(\\s+)(hidden)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(otherwise)(\\s+)(execute)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'keyword', 'white', 'type.identifier']],\n [/^(\\s*)(when)(\\s+)(?=.+\\s+execute\\s+[\\w.]+\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', { token: 'white', next: '@guardedActionCondition' }]],\n [/^(\\s*)(behavior)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@behaviorBody.$1' }]],\n [/^(\\s*)(on)(\\s+)(refused)(\\s+)(by)(\\s+)(validation|constraint|authorization)\\b/,\n ['white', 'keyword', 'white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(on)(\\s+)(refused)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(on)(\\s+)([\\w-]+)\\b/, ['white', 'keyword', 'white', { token: 'keyword', next: '@interactionBody.$1' }]],\n [/^(\\s*)(acknowledge)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword']],\n // A quoted import names .play files rather than a qualified name - the path reads as a link.\n [/^(\\s*)(import)(\\s+)(\"[^\"\\\\]*\")/, ['white', 'keyword', 'white', 'string.link']],\n // Retain the header indent so event metadata stops at the enclosing block boundary.\n [/^(\\s*)((?:(?:produces|public)\\s+)?event)(\\s+)([A-Za-z_]\\w*)(\\s+)(generation)(\\s+)(\\d+)(?=\\s*(?:from\\s+\"(?:[^\"\\\\]|\\\\.)*\"\\s*)?(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', { token: 'number', next: '@eventBody.$1' }]],\n [/^(\\s*)((?:(?:produces|public)\\s+)?event)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:from\\s+\"(?:[^\"\\\\]|\\\\.)*\"\\s*)?(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@eventBody.$1' }]],\n // A tagged opening fence carries the embedded language; legacy tag lines still highlight.\n ...codeBlockTags.map(\n (tag): MonarchTokenRules[number] => [\n new RegExp(`^\\\\s*\\\\x60\\\\x60\\\\x60${tag}\\\\s*$`),\n { token: 'string.quote', next: `@codeBlock.${embeddedLanguages[tag]}`, nextEmbedded: embeddedLanguages[tag] },\n ],\n ),\n // Inline code block tags at end of line open an embedded code block.\n ...codeBlockTags.map(\n (tag): MonarchTokenRules[number] => [\n new RegExp(`\\\\b${tag}\\\\b(?=\\\\s*$)`),\n { token: 'keyword.tag', next: `@codeBlockPending.${embeddedLanguages[tag]}` },\n ],\n ),\n // Sub-language constructs switch to the registered sub-language's token rules.\n ...subLanguages.map(\n (subLanguage): MonarchTokenRules[number] => [\n new RegExp(`\\\\b${subLanguage.keyword}\\\\b`),\n { token: 'keyword', next: `@${subLanguageState(subLanguage.keyword)}` },\n ],\n ),\n // Typed documentation names are properties, not metadata directives.\n [/^(\\s*)(documentation)(?=\\s+[\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?\\s*(?:identifier\\b|generated\\b|=(?!=|>)|\\/\\/|$))/,\n ['white', 'identifier']],\n // A bare description or documentation keyword opens a fenced prose block.\n [/\\b(?:description|documentation)\\b(?=\\s*(?:\\/\\/.*)?$)/, { token: 'keyword', next: '@descriptionBlockPending' }],\n [/\\brow-click\\b/, 'keyword'],\n // A leading @ escapes a name that collides with a directive keyword - it is a name, not an attribute.\n [/^\\s*@[a-z_]\\w*/, 'identifier'],\n [/@\\w+/, 'annotation'],\n [\n /[A-Z]\\w*/,\n {\n cases: {\n '@sliceTypes': 'keyword.type',\n '@primitiveTypes': 'type',\n '@default': 'type.identifier',\n },\n },\n ],\n [\n /[a-z_]\\w*/,\n {\n cases: {\n '@keywords': 'keyword',\n '@default': 'identifier',\n },\n },\n ],\n { include: '@common' },\n ],\n\n guardedActionCondition: [\n [/(execute)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', { token: 'type.identifier', next: '@pop' }]],\n { include: '@root' },\n ],\n\n behaviorBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n { include: '@root' },\n ],\n\n interactionBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(otherwise)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword']],\n [/^(\\s*)(when)(\\s+)(?=item\\.|\\()/, ['white', 'keyword', 'white']],\n [/^(\\s*)(execute)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'type.identifier']],\n { include: '@root' },\n ],\n\n applicationContextBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(@?[a-z_]\\w*)(\\s+)(time)(\\s+)(zone)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'identifier', 'white', 'type.identifier', 'white', 'type.identifier']],\n { include: '@root' },\n ],\n\n purposeBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(basis|interest|condition|authorization|subjects|retention|recipient|transfer|erasure)(\\s+)/, ['white', 'keyword', 'white']],\n [/\\b(safeguard|exception)\\b/, 'keyword'],\n { include: '@root' },\n ],\n\n generationLine: [\n [/^/, { token: '@rematch', next: '@pop' }],\n [/\\b(prefix|case|alphabet|checksum|base64url|hex|base32|lower|upper|luhn|mod11|mod97)\\b/, 'keyword'],\n { include: '@common' },\n ],\n\n conceptBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(validate)(\\s+)(checksum)(\\s+)(luhn|mod11|mod97)\\b/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(checksum)(\\s+)(luhn|mod11|mod97)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [new RegExp(`^(\\\\s*)(@?[a-z_][${bmpWordCharacters}]*)(\\\\s*)(=)(\\\\s*)(-?(?:0|[1-9][0-9]*))(?=\\\\s*(?://.*)?$)`), ['white', 'identifier', 'white', 'operator', 'white', 'number']],\n [/^(\\s*)(@?pii|personal|@?sensitive|secret)(\\s+)(reason|scope|special|criminal)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(generate)(\\s+)(uuidv7|uuid|ulid|typeid|nanoid|bytes|pattern|random|rule|sequence)\\b/, ['white', 'keyword', 'white', { token: 'keyword', next: '@generationLine' }]],\n { include: '@root' },\n ],\n\n commandBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(validate)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@commandValidation.$1' }]],\n { include: '@root' },\n ],\n\n commandValidation: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [new RegExp(`^(\\\\s*)([${bmpWordCharacters}.]+)(\\\\s+)(rule)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?:severity\\\\s+\\\\w+|message\\\\s+.*|//.*|$))`),\n ['white', 'identifier', 'white', 'keyword', 'white', { token: 'type.identifier', next: '@namedRuleBody.$1' }]],\n { include: '@root' },\n ],\n\n namedRuleBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n operationBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(execute|compensate)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@operationPhase.$1' }]],\n [/^(\\s*)(uses)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'type.identifier']],\n [/^(\\s*)(@?[a-z_]\\w*)(\\s+)([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(?=\\s*(?:=(?!=|>)|\\/\\/|$))/,\n ['white', 'identifier', 'white', 'type.identifier']],\n { include: '@root' },\n ],\n\n operationPhase: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n handlerBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n implementationBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(hint)(?=\\s+\")/, ['white', 'keyword']],\n { include: '@root' },\n ],\n\n eventBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(id)(?=\\s+\")/, ['white', 'keyword']],\n [/^(\\s*)(documentation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@descriptionBlockPending' }]],\n { include: '@root' },\n ],\n\n common: commonTokenRules,\n\n // After a code tag, the only thing allowed before the opening fence is whitespace.\n codeBlockPending: [\n [\n /^\\s*```\\s*$/,\n { token: 'string.quote', switchTo: '@codeBlock.$S2', nextEmbedded: '$S2' },\n ],\n [/^\\s*[^\\s`].*$/, { token: '@rematch', next: '@pop' }],\n [/\\s+/, 'white'],\n ],\n\n codeBlock: [\n [/^\\s*```\\s*$/, { token: 'string.quote', next: '@pop', nextEmbedded: '@pop' }],\n [/[^`]+/, ''],\n [/`/, ''],\n ],\n\n // After a bare description, the only thing allowed before the opening fence is whitespace.\n descriptionBlockPending: [\n [/\\/\\/.*$/, 'comment'],\n [/^\\s*```(?:text|markdown)?\\s*$/, { token: 'string.quote', switchTo: '@descriptionBlock' }],\n [/^\\s*[^\\s`].*$/, { token: '@rematch', next: '@pop' }],\n [/\\s+/, 'white'],\n ],\n\n descriptionBlock: [\n [/^\\s*```\\s*$/, { token: 'string.quote', next: '@pop' }],\n [/.+/, 'string'],\n ],\n };\n\n for (const subLanguage of subLanguages) {\n tokenizer[subLanguageState(subLanguage.keyword)] = [\n subLanguageExitRule(subLanguages),\n ...subLanguage.tokens,\n { include: '@common' },\n [/[A-Z]\\w*/, 'type.identifier'],\n [/[a-z_]\\w*/, 'identifier'],\n ];\n }\n\n return {\n defaultToken: '',\n tokenPostfix: '.play',\n ignoreCase: false,\n keywords: [...constructKeywords.filter(keyword => !contextualConstructs.has(keyword)), ...clauseKeywords.filter(keyword => keyword !== 'context'), ...codeBlockTags],\n sliceTypes,\n primitiveTypes,\n tokenizer,\n } as languages.IMonarchLanguage;\n}\n"],"mappings":"A,2OAiBA,MAAMA,kBAAuB,IAAI,IAAI,CAAC,YAAa,SAAU,cAAe,UAAW,UAAW,OAAQ,OAAQ,eAAgB,UAAU,CAAC,EAEvIC,EAA4C,CAC9C,OAAQ,SACR,KAAM,OACN,WAAY,aACZ,MAAO,aACP,KAAM,OACN,IAAK,KACT,EAEA,SAAS,iBAAiB,EAAyB,CAC/C,MAAO,eAAeC,GAC1B,CAGA,SAAS,oBAAoB,EAAwD,CACjF,IAAMC,EAAe,CAAC,GAAGC,EAAkB,OAAO,GAAW,CAACJ,EAAqB,IAAIE,CAAO,CAAC,EAAG,GAAGG,EAAa,IAAK,GAAgBC,EAAY,OAAO,CAAC,EAC3J,MAAO,CACC,OAAO,WAAWH,EAAa,KAAK,GAAG,EAAE,KAAK,EAClD,CAAE,MAAO,WAAY,KAAM,MAAO,CACtC,CACJ,CAIA,MAAaI,EAAsC,CAC/C,CAAC,UAAW,SAAS,EACrB,CAAC,+EAAgF,qBAAqB,EACtG,CAAC,oCAAqC,qBAAqB,EAC3D,CAAC,aAAc,qBAAqB,EACpC,CAAC,oBAAqB,QAAQ,EAC9B,CAAC,oBAAqB,gBAAgB,EACtC,CAAC,sBAAuB,QAAQ,EAChC,CAAC,aAAc,cAAc,EAC7B,CAAC,QAAS,QAAQ,EAClB,CAAC,yBAA0B,UAAU,EACrC,CAAC,YAAa,WAAW,EACzB,CAAC,MAAO,OAAO,CACnB,EAEA,SAAgB,qBAAqB,EAAyD,CAC1F,IAAMC,EAA+C,CACjD,KAAM,CACF,CAAK,OAAO,gCAAgCC,EAAkB,2BAA2BA,EAAkB,uBAAuB,EAC9H,CAAC,QAAS,UAAW,QAAS,kBAAmB,QAAS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AEA,OAAQF,EAGR,iBAAkB,CACd,CACI,cACA,CAAE,MAAO,eAAgB,SAAU,iBAAkB,aAAc,KAAM,CAC7E,EACA,CAAC,gBAAiB,CAAE,MAAO,WAAY,KAAM,MAAO,CAAC,EACrD,CAAC,MAAO,OAAO,CACnB,EAEA,UAAW,CACP,CAAC,cAAe,CAAE,MAAO,eAAgB,KAAM,OAAQ,aAAc,MAAO,CAAC,EAC7E,CAAC,QAAS,EAAE,EACZ,CAAC,IAAK,EAAE,CACZ,EAGA,wBAAyB,CACrB,CAAC,UAAW,SAAS,EACrB,CAAC,gCAAiC,CAAE,MAAO,eAAgB,SAAU,mBAAoB,CAAC,EAC1F,CAAC,gBAAiB,CAAE,MAAO,WAAY,KAAM,MAAO,CAAC,EACrD,CAAC,MAAO,OAAO,CACnB,EAEA,iBAAkB,CACd,CAAC,cAAe,CAAE,MAAO,eAAgB,KAAM,MAAO,CAAC,EACvD,CAAC,KAAM,QAAQ,CACnB,CACJ,EAEA,IAAK,IAAMD,KAAeD,EACtB,EAAU,iBAAiBC,EAAY,OAAO,GAAK,CAC/C,oBAAoBD,CAAY,EAChC,GAAGC,EAAY,OACf,CAAE,QAAS,SAAU,EACrB,CAAC,WAAY,iBAAiB,EAC9B,CAAC,YAAa,YAAY,CAC9B,EAGJ,MAAO,CACH,aAAc,GACd,aAAc,QACd,WAAY,GACZ,SAAU,CAAC,GAAGF,EAAkB,OAAO,GAAW,CAACJ,EAAqB,IAAIE,CAAO,CAAC,EAAG,GAAGU,EAAe,OAAO,GAAWV,IAAY,SAAS,EAAG,GAAGQ,CAAa,EACnK,aACA,iBACA,WACJ,CACJ,C"}
@@ -1,3 +1,3 @@
1
- import"./_virtual/_virtual/_rolldown/runtime.js";import{causedByProperties as e,contextRoots as t,identityProperties as n,primitiveTypes as r,sliceTypes as i}from"./language.js";import{DiagnosticCodes as a}from"./compiler/Diagnostics/DiagnosticCodes.js";import{legacyOptionalTypeLength as o}from"./compiler/Authoring/QuickFixes.js";import"./compiler/index.js";import{enclosingChain as s,fenceMap as c,indentOf as l}from"./document-context.js";import{eventAnalysisSource as u}from"./event-analysis-source.js";import{resolveEventContextPath as d}from"./event-context.js";import{responseAnalysis as f}from"./response-analysis.js";import{knownEventNames as p,knownTypeNames as m,mergeSymbols as h,propertyTypeReference as g,scanDocument as _,symbolsForBuffer as v}from"./symbols.js";import{diagnosticCodes as y}from"./diagnostic-codes.js";import{validateInlineEvents as b}from"./inline-event-validation.js";import{fileImportOn as x,isFileImportLine as S}from"./file-imports.js";function issue(e,t,n,r,i,a){return{severity:e,message:i,line:t,startColumn:n,endColumn:n+r,code:a}}function tokenIssue(e,t,n,r,i,a){return issue(e,t,n.indexOf(r)+1,r.length,i,a)}function validateDeclarations(e,t,n){let i=[],a=/* @__PURE__ */ new Set([...m(t,r),...m(n,[])]),checkProperties=(e,t)=>{for(let n of e.filter(e=>!a.has(g(e).name))){let e=g(n).name;i.push(issue(`warning`,n.line,n.sourceType.startColumn,n.sourceType.text.length,e===`optional`?`Unknown type 'optional' on '${n.name}' of ${t} — did you forget the type before 'optional'?`:`Unknown type '${e}' on '${n.name}' of ${t} — declare it with 'concept ${e} : <Primitive>' or 'type ${e}'.`,y.unknownType))}};for(let e of t.types)checkProperties(e.properties,`type '${e.name}'`);for(let e of t.events)checkProperties(e.properties,`event '${e.name}'`);for(let e of t.queries)checkProperties(e.parameters,`query '${e.name}'`);for(let n of t.commands){checkProperties(n.properties,`command '${n.name}'`);let t=n.properties.filter(e=>e.isIdentifier);for(let r of t.slice(1))i.push(tokenIssue(`error`,r.line,e[r.line],`identifier`,`Command '${n.name}' already marks '${t[0].name}' as identifier — only one property can be the identifier.`,y.duplicateCommandIdentifier))}let o=/* @__PURE__ */ new Map;for(let n of[...t.concepts,...t.types])o.get(n.name)===void 0?o.set(n.name,n.line):i.push(tokenIssue(`error`,n.line,e[n.line],n.name,`Duplicate declaration of '${n.name}' — concept and type names must be unique.`,y.duplicateDeclaration));return i}const C=/* @__PURE__ */ new Set([`and`,`or`,`not`]),w=/^(?:(?:and|or|not)\s+|\()*[A-Z]\w*\)*(?:\s+(?:(?:and|or|not)\s+|\()*[A-Z]\w*\)*)*$/;function policyNames(e){return(e.match(/[A-Za-z_]\w*/g)??[]).filter(e=>!C.has(e))}function validateLines(s,u={}){let d=c(s),m=_(s),g=u.application??h(),x=v(s,{...g,authoringPath:u.path??g.authoringPath,authoringPlacement:u.placement??g.authoringPlacement}),S=f(s,x.authoringDocuments??x.authoringSources?.filter(e=>e!==s.join(`
2
- `)),x.authoringPlacement,x.authoringPath,x.authoringPlacementResolved),C=new Set(S.eventSources.routes.map(e=>e.location.line-1)),T={...m,commands:m.commands.map(e=>({...e,properties:e.properties.filter(e=>!C.has(e.line)),produces:e.produces?.filter(e=>!S.operationProductionLines?.has(e.line)),productionHeaders:e.productionHeaders?.filter(e=>!S.operationProductionLines?.has(e))}))},E=/* @__PURE__ */ new Set([...p(T),...p(g)]),D=new Set([...T.policies,...g.policies].map(e=>e.name)),O=validateDeclarations(s,T,g);O.push(...validateProductionDestinations(s,T));let k=/* @__PURE__ */ new Set([a.UnknownGenerationStrategy,a.InvalidGenerationArgument,a.InvalidGenerationModifier,a.DuplicateGenerationModifier,a.DuplicateGeneration,a.InvalidGenerationPrimitive,a.InvalidGenerationPrefix,a.InvalidGenerationAlphabet,a.InvalidTypeIdPrefix,a.GenerationSizeOutsideRange,a.ReservedSequenceGeneration,a.LowGenerationEntropy,a.LowGeneratedIdentifierEntropy,a.RefutedGeneratedConceptRule,a.UnprovenGeneratedConceptRule,a.GenerationSupportBudgetExceeded,a.EmptyGenerationSupport]),A=/* @__PURE__ */ new Set([a.MixedEnumerationNumbering,a.DuplicateEnumerationNumber,a.EnumerationNumberOutsideInt32,a.MalformedEnumerationNumber,a.UnpinnedStoredEnumeration]),j=/* @__PURE__ */ new Set([a.LegacyOptionalSuffix,a.InvalidOptionalModifierOrder,a.OptionalReadsNotSupported]),M=/* @__PURE__ */ new Set([a.UnexpectedTokenInPolicyCondition,a.ExpectedPolicyCondition,a.UnclosedPolicyConditionGroup,a.ExpectedRoleName,a.ExpectedClaimName,a.ExpectedClaimMatches,a.ExpectedClaimMatchTarget,a.AnonymousPolicyCombined,a.NegatedAnonymousPolicy]),N=/* @__PURE__ */ new Set([a.UnknownEvent,a.UnknownReadModelProperty,a.PiiNotSupportedOnIdentifier]),P=/* @__PURE__ */ new Set([a.EventFromLaterSlice,a.TimelineCycleGroup]),F=/* @__PURE__ */ new Set([a.UndeclaredDependency,a.UnusedDependencyDeclaration,a.InvalidDependencyTarget,a.RepeatedDependencyDeclaration,a.MutualDependencyDeclarations,a.AmbiguousReference]),I=/* @__PURE__ */ new Set([a.InvalidContextDeclaration,a.UnknownContextMemberType,a.DuplicateContextMember,a.ReservedContextMemberName,a.InvalidSpecificationInvocation,a.InvalidActionSubjectClause,a.InferredActionSubject,a.ChangedActionSubject,a.AmbiguousActionInputBinding,a.UnsupportedActionSubjectContext,a.InvalidTimeZoneDeclaration,a.InvalidCommandCalendar,a.InvalidSpecificationTimeZone,a.InvalidCommandReadsDeclaration,a.UnknownMatchPattern,a.InvalidMatchPattern,a.PatternOutsidePortableMatchDialect,a.AmbiguousMatchPattern,a.DeprecatedStudioTextRulePattern,a.MismatchedSpecificationQueryResult,a.DirectionlessTranslationReactsToOwnCapture,a.CaptureEventsFromSeveralOrigins,a.CaptureEventsKeyNotRequired,a.CaptureEventsRecordFixture,a.CaptureEventSourceKeyOutsideEvents,a.EventIdPinNotCarriedToRenderers,a.ResponseNameUsedOnFailure,a.InvalidEventDeclaration,a.InvalidImportDeclaration,a.InvalidSliceDeclaration,a.InvalidDescription,a.DuplicateDescription,a.EmptyDescription,a.DuplicateEventSubject,a.InvalidSubjectType,a.ProtectedSubjectType,a.InvalidSubjectOwner,a.ReadModelSubjectNotSupported,a.InvalidSubjectModifierOrder,a.UnsupportedInteractionAlternatives,a.MixedInteractionAlternatives,a.InteractionAlternativeWithoutActions,a.InlineInteractionAlternative,a.LegacyInteractionWhere,a.InvalidSpecificationParameter,a.InvalidSpecificationCase,a.DuplicateSpecificationParameter,a.DuplicateSpecificationCase,a.IncompleteSpecificationTable,a.InvalidSpecificationCaseAssignment,a.InvalidSpecificationCaseValue,a.InvalidSpecificationCaseReference,a.OptionalSpecificationParameterTarget,a.SpecificationCaseNameCollision,a.IncompatibleSpecificationParameterType,a.UnusedSpecificationParameter,a.SingularSpecificationTableExpansion,a.InvalidSpecificationCallerPersona,a.UnsynthesizablePersonaCaller,a.PersonaWithoutGate,a.GateWithoutPersona,a.AmbiguousPersonaCaller,a.InvalidDocumentation,a.ConflictingDocumentationAcrossFiles,a.InvalidAbsentReadModelStep,a.UnknownConstraintProperty,a.OmittedProductionDestination,a.InvalidSpecificationExample,a.DuplicateSpecificationAssignment,a.InvalidReactionBatchesDeclaration,a.DescribedCommandNotImplemented,a.DescribedCommandWithoutProductions,a.DescribedCommandCardinalityNotAdmitted,a.CommandHandlerRequiresAttachment,a.PendingIntentWithOtherHandler,a.DuplicateEventInProjectionScope,a.ReservedStoredName,a.ContextSourcedPerformedQueryArgument,a.RedundantCompositeKeyBraces,a.ImplicitAuthorizationConjunction,a.RepeatedPassiveDirective]),L=/* @__PURE__ */ new Set([a.InvalidPurposeDeclaration,a.InvalidPurposeVocabulary,a.DuplicatePurposeField,a.DuplicatePurposeDeclaration,a.UnknownPurpose,a.PurposeInterestMismatch,a.PersonalDataWithoutPurpose,a.SpecialDataWithoutCondition,a.CriminalDataWithoutAuthorization,a.PurposeWithoutBasis,a.UnusedPurpose,a.UnknownConceptDirective,a.AttributeReasonWithoutAttribute,a.DuplicateAttributeReason,a.LegacyComplianceMarker,a.DuplicateComplianceMarker,a.UnknownComplianceMarker,a.InvalidSecretScope,a.DuplicateSecretScope,a.SecretScopeIgnoredForPii,a.InvalidPersonalDataQualifier,a.DuplicateSpecialCategory]),R=/* @__PURE__ */ new Set,z=/* @__PURE__ */ new Set;for(let e of u.compilerDiagnostics??S.diagnostics){let t=e.code===a.UnknownType&&(S.identityDetails??[]).some(t=>t.line===e.location.line-1),n=e.code===a.InvalidSemanticBinding&&e.message.startsWith(`Read model '`)&&e.message.includes(`' references unsupported type '`);n&&z.add(e.location.line-1);let r=e.code===a.RepeatedSingularDeclarationAcrossFiles&&(e.message.includes(`identity block`)||e.message.includes(`context block`));if(!(e.code===a.DuplicateDeclaration&&e.message.startsWith(`Duplicate declaration of policy `))&&!t&&!n&&!r&&!k.has(e.code)&&!A.has(e.code)&&!L.has(e.code)&&!j.has(e.code)&&!M.has(e.code)&&!N.has(e.code)&&!P.has(e.code)&&!F.has(e.code)&&!I.has(e.code)&&e.code!==a.ReducerIdentityMismatch&&e.code!==a.InvalidSpecificationExampleBody&&e.code!==a.UnknownRuleImplementationDirective&&e.code!==a.InvalidValidationRule&&e.code!==a.RepeatedDeclarationAcrossFiles&&!/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$|^PLAY060[7-9]$|^PLAY061[0-9]$|^PLAY0620$|^PLAY062[1-9]$|^PLAY063[0-9]$|^PLAY064[0-9]$|^PLAY065[0-2]$|^PLAY065[4-6]$|^PLAY066[0-6]$|^PLAY072[0-2]$/.test(e.code))continue;let i=e.location.line-1;if(e.code===a.OmittedProductionDestination&&O.some(t=>t.code===e.code&&t.line===i))continue;if(e.code===a.UnknownEvent){if(R.has(i))continue;R.add(i)}let c=o(s[i],e)||s[i].length-e.location.column+1;O.push(issue(e.severity,i,e.location.column,c,e.message,e.code))}let checkEvent=(e,t,n)=>{!E.has(n)&&!R.has(e)&&O.push(tokenIssue(`warning`,e,t,n,`Unknown event type '${n}' — declare it in a slice or import it.`,y.unknownEvent))},B=-1;for(let a=0;a<s.length;a++){let o=s[a],c=o.trim();if(d[a]||c.length===0)continue;let u=o.match(/^[ ]*(\t+)/);if(u&&O.push(issue(`warning`,a,u[0].length-u[1].length+1,u[1].length,`Screenplay is indentation-based — use spaces, not tabs.`,y.tabIndentation)),B>=0){if(l(o)>B&&w.test(c)){for(let e of policyNames(c))D.has(e)||O.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy));continue}B=-1}let f=validateImport(s,d,a);f&&O.push(f);let p=c.match(/^slice\s+(\w+)/);p&&!i.includes(p[1])&&O.push(tokenIssue(`error`,a,o,p[1],`Unknown slice type '${p[1]}' — expected ${i.join(`, `)}.`,y.unknownSliceType));let m=c.match(/^concept\s+\w+\s*:\s*(\w+)/);m&&m[1]!==`Enum`&&!r.includes(m[1])&&O.push(tokenIssue(`error`,a,o,m[1],`Unknown primitive type '${m[1]}' — expected ${r.join(`, `)} or Enum.`,y.unknownPrimitiveType));let h=c.match(/^authorize\s+(.*)$/);if(h){B=l(o);for(let e of policyNames(h[1]))D.has(e)||O.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy))}let g=c.match(/^on\s+([A-Z]\w*)\s*$/);g&&checkEvent(a,o,g[1]);let _=c.match(/^produces\s+([A-Z]\w*)\s*$/);if(_&&!S.operationProductionLines?.has(a)&&checkEvent(a,o,_[1]),/^produces\s+when\b/.test(c)&&!S.operationProductionLines?.has(a))for(let e=a+1;e<s.length;e++){let t=s[e];if(!(d[e]||t.trim().length===0)){if(l(t)>l(o)){let n=t.trim().match(/^([A-Z]\w*)\s*$/);n&&checkEvent(e,t,n[1])}break}}let v=c.match(/^unique\s+event\s+([A-Z]\w*)/);v&&checkEvent(a,o,v[1]);let b=c.match(/^unique\s+[a-z_]\w*\s+on\s+([A-Z]\w*)/);b&&checkEvent(a,o,b[1]);for(let e of o.match(/\$identity\.[\w.]+/g)??[]){let t=e.substring(10).split(`.`)[0],r=[...n,...(S.identityDetails??[]).map(e=>e.name)];r.includes(t)||O.push(tokenIssue(`warning`,a,o,e,`Unknown $identity property '${t}' — expected ${r.join(`, `)}.`,y.unknownContextIdentityProperty))}for(let r of o.match(/\$context\.[\w.]+/g)??[]){let i=r.substring(9).split(`.`);t.includes(i[0])?i[0]===`causedBy`&&i.length>1&&!e.includes(i[1])?O.push(tokenIssue(`warning`,a,o,r,`Unknown $context.causedBy property '${i[1]}' — expected ${e.join(`, `)}.`,y.unknownContextCausedByProperty)):i[0]===`identity`&&i.length>1&&!n.includes(i[1])&&O.push(tokenIssue(`warning`,a,o,r,`Unknown $context.identity property '${i[1]}' — expected ${n.join(`, `)}.`,y.unknownContextIdentityProperty)):O.push(tokenIssue(`warning`,a,o,r,`Unknown $context path '${i.join(`.`)}' — expected one of ${t.join(`, `)}.`,y.unknownContextPath))}}O.push(...validateEventContextPaths(s,d)),O.push(...b(s,T,g,S.operationProductionLines));let V=s.map((e,t)=>({line:e,index:t})).filter(({line:e})=>/^\s*```(?:[a-z]+)?\s*$/.test(e));if(V.length%2==1){let e=V[V.length-1];O.push(issue(`error`,e.index,1,e.line.length+1,"Unclosed inline code block — expected a closing ``` line.",y.unclosedCodeBlock))}return O.filter(e=>e.code!==y.unknownType||!z.has(e.line))}function validateProductionDestinations(e,t){let n=[];e=u(e);for(let r of t.commands){let t=r.properties.filter(e=>e.isIdentifier&&!g(e).isOptional&&!g(e).isCollection);if(t.length===1)for(let i of r.produces??[]){if(i.inline||i.conditional||i.target!==void 0)continue;let r=i.line;n.push(issue(`information`,r,l(e[r])+1,e[r].trim().length,`Plain 'produces ${i.name}' omits its destination — use 'for ${t[0].name}' to explicitly select the command's identifier.`,y.omittedProductionDestination))}}return n}function validateImport(e,t,n){let r=e[n],i=r.trim().replace(/\s*\/\/.*$/,``);if(!/^import\b/.test(i)||x(r,n))return;let a=l(r);if(a>0&&[`module`,`feature`].includes(s(e,t,n,a)[0])||S(r))return issue(`error`,n,a+1,i.length,`Invalid import '${i}' — inside a module or feature, import names files: 'import "<path or glob>"'.`,y.invalidFileImport)}const T=/^(?:(?:increment|decrement|count|clear|add|subtract|set)\s+)?@?([$\w.]+)(?=\s|=|$)/;function validateEventContextPaths(e,t){let n=[],names=e=>e.map(e=>e.name).join(`, `);for(let r=0;r<e.length;r++){let i=e[r];if(t[r])continue;for(let e of i.matchAll(/(\.)?\$eventContext((?:\.(?:\w+(?:\(\))?)?)*)/g)){let t=e[0].substring(e[1]?.length??0),i=e[2];if(i.length===0){e[1]&&n.push(issue(`error`,r,(e.index??0)+2,t.length,`'$eventContext' names no member - expected one of ${names(d(``).expected)}.`,y.missingEventContextPath));continue}let a=i.substring(1),o=d(a),s=(e.index??0)+(e[1]?.length??0)+1;switch(o.status){case`missing`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' names no member - expected one of ${names(o.expected)}.`,y.missingEventContextPath));break;case`unknownMember`:n.push(issue(`warning`,r,s,t.length,`Unknown event context member '${o.segment}' in '$eventContext.${a}' - expected one of ${names(o.expected)}.`,y.unknownEventContextMember));break;case`unknownSubPath`:{let e=o.expected.length===0?`no members to address`:`members ${names(o.expected)}`;n.push(issue(`warning`,r,s,t.length,`Unknown event context path '$eventContext.${a}' - '${o.member?.name}' (${o.member?.type}) has ${e}.`,y.unknownEventContextPath));break}case`belowCollection`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' cannot resolve - '${o.member?.name}' is a collection (${o.member?.type}) and cannot be addressed below.`,y.eventContextPathBelowCollection))}}let a=i.trim().match(T)?.[1],o=a?.match(/\.\$(\w+)/)?.[1];a&&o&&o!==`eventContext`&&n.push(tokenIssue(`warning`,r,i,a,`Dynamic dictionary key '$${o}' in '${a}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${o}' becomes the key.`,y.unresolvedDynamicKeySource))}return n}export{validateEventContextPaths,validateLines};
1
+ import"./_virtual/_virtual/_rolldown/runtime.js";import"./compiler/index.js";import{DiagnosticCodes as e}from"./compiler/Diagnostics/DiagnosticCodes.js";import{legacyOptionalTypeLength as t}from"./compiler/Authoring/QuickFixes.js";import{responseAnalysis as n}from"./response-analysis.js";import{validateInlineEvents as r}from"./inline-event-validation.js";import{causedByProperties as i,contextRoots as a,identityProperties as o,primitiveTypes as s,sliceTypes as c}from"./language.js";import{diagnosticCodes as l}from"./diagnostic-codes.js";import{enclosingChain as u,fenceMap as d,indentOf as f}from"./document-context.js";import{eventAnalysisSource as p}from"./event-analysis-source.js";import{resolveEventContextPath as m}from"./event-context.js";import{knownEventNames as h,knownTypeNames as g,mergeSymbols as _,propertyTypeReference as v,scanDocument as y,symbolsForBuffer as b}from"./symbols.js";import{fileImportOn as x,isFileImportLine as S}from"./file-imports.js";function issue(e,t,n,r,i,a){return{severity:e,message:i,line:t,startColumn:n,endColumn:n+r,code:a}}function tokenIssue(e,t,n,r,i,a){return issue(e,t,n.indexOf(r)+1,r.length,i,a)}function validateDeclarations(e,t,n){let r=[],i=/* @__PURE__ */ new Set([...g(t,s),...g(n,[])]),checkProperties=(e,t)=>{for(let n of e.filter(e=>!i.has(v(e).name))){let e=v(n).name;r.push(issue(`warning`,n.line,n.sourceType.startColumn,n.sourceType.text.length,e===`optional`?`Unknown type 'optional' on '${n.name}' of ${t} — did you forget the type before 'optional'?`:`Unknown type '${e}' on '${n.name}' of ${t} — declare it with 'concept ${e} : <Primitive>' or 'type ${e}'.`,l.unknownType))}};for(let e of t.types)checkProperties(e.properties,`type '${e.name}'`);for(let e of t.events)checkProperties(e.properties,`event '${e.name}'`);for(let e of t.queries)checkProperties(e.parameters,`query '${e.name}'`);for(let n of t.commands){checkProperties(n.properties,`command '${n.name}'`);let t=n.properties.filter(e=>e.isIdentifier);for(let i of t.slice(1))r.push(tokenIssue(`error`,i.line,e[i.line],`identifier`,`Command '${n.name}' already marks '${t[0].name}' as identifier — only one property can be the identifier.`,l.duplicateCommandIdentifier))}let a=/* @__PURE__ */ new Map;for(let n of[...t.concepts,...t.types])a.get(n.name)===void 0?a.set(n.name,n.line):r.push(tokenIssue(`error`,n.line,e[n.line],n.name,`Duplicate declaration of '${n.name}' — concept and type names must be unique.`,l.duplicateDeclaration));return r}const C=/* @__PURE__ */ new Set([`and`,`or`,`not`]),w=/^(?:(?:and|or|not)\s+|\()*[A-Z]\w*\)*(?:\s+(?:(?:and|or|not)\s+|\()*[A-Z]\w*\)*)*$/;function policyNames(e){return(e.match(/[A-Za-z_]\w*/g)??[]).filter(e=>!C.has(e))}function validateLines(u,p={}){let m=d(u),g=y(u),v=p.application??_(),x=b(u,{...v,authoringPath:p.path??v.authoringPath,authoringPlacement:p.placement??v.authoringPlacement}),S=n(u,x.authoringDocuments??x.authoringSources?.filter(e=>e!==u.join(`
2
+ `)),x.authoringPlacement,x.authoringPath,x.authoringPlacementResolved),C=new Set(S.eventSources.routes.map(e=>e.location.line-1)),T={...g,commands:g.commands.map(e=>({...e,properties:e.properties.filter(e=>!C.has(e.line)),produces:e.produces?.filter(e=>!S.operationProductionLines?.has(e.line)),productionHeaders:e.productionHeaders?.filter(e=>!S.operationProductionLines?.has(e))}))},E=/* @__PURE__ */ new Set([...h(T),...h(v)]),D=new Set([...T.policies,...v.policies].map(e=>e.name)),O=validateDeclarations(u,T,v);O.push(...validateProductionDestinations(u,T));let k=/* @__PURE__ */ new Set([e.UnknownGenerationStrategy,e.InvalidGenerationArgument,e.InvalidGenerationModifier,e.DuplicateGenerationModifier,e.DuplicateGeneration,e.InvalidGenerationPrimitive,e.InvalidGenerationPrefix,e.InvalidGenerationAlphabet,e.InvalidTypeIdPrefix,e.GenerationSizeOutsideRange,e.ReservedSequenceGeneration,e.LowGenerationEntropy,e.LowGeneratedIdentifierEntropy,e.RefutedGeneratedConceptRule,e.UnprovenGeneratedConceptRule,e.GenerationSupportBudgetExceeded,e.EmptyGenerationSupport]),A=/* @__PURE__ */ new Set([e.MixedEnumerationNumbering,e.DuplicateEnumerationNumber,e.EnumerationNumberOutsideInt32,e.MalformedEnumerationNumber,e.UnpinnedStoredEnumeration]),j=/* @__PURE__ */ new Set([e.LegacyOptionalSuffix,e.InvalidOptionalModifierOrder,e.OptionalReadsNotSupported]),M=/* @__PURE__ */ new Set([e.ConditionDepthExceeded,e.UnexpectedTokenInPolicyCondition,e.ExpectedPolicyCondition,e.UnclosedPolicyConditionGroup,e.ExpectedRoleName,e.ExpectedClaimName,e.ExpectedClaimMatches,e.ExpectedClaimMatchTarget,e.AnonymousPolicyCombined,e.NegatedAnonymousPolicy]),N=/* @__PURE__ */ new Set([e.UnknownEvent,e.UnknownReadModelProperty,e.PiiNotSupportedOnIdentifier]),P=/* @__PURE__ */ new Set([e.EventFromLaterSlice,e.TimelineCycleGroup]),F=/* @__PURE__ */ new Set([e.UndeclaredDependency,e.UnusedDependencyDeclaration,e.InvalidDependencyTarget,e.RepeatedDependencyDeclaration,e.MutualDependencyDeclarations,e.AmbiguousReference]),I=/* @__PURE__ */ new Set([e.InvalidContextDeclaration,e.UnknownContextMemberType,e.DuplicateContextMember,e.ReservedContextMemberName,e.InvalidSpecificationInvocation,e.InvalidActionSubjectClause,e.InferredActionSubject,e.ChangedActionSubject,e.AmbiguousActionInputBinding,e.UnsupportedActionSubjectContext,e.InvalidTimeZoneDeclaration,e.InvalidCommandCalendar,e.InvalidSpecificationTimeZone,e.InvalidCommandReadsDeclaration,e.UnknownMatchPattern,e.InvalidMatchPattern,e.PatternOutsidePortableMatchDialect,e.AmbiguousMatchPattern,e.DeprecatedStudioTextRulePattern,e.MismatchedSpecificationQueryResult,e.DirectionlessTranslationReactsToOwnCapture,e.CaptureEventsFromSeveralOrigins,e.CaptureEventsKeyNotRequired,e.CaptureEventsRecordFixture,e.CaptureEventSourceKeyOutsideEvents,e.EventIdPinNotCarriedToRenderers,e.ResponseNameUsedOnFailure,e.InvalidEventDeclaration,e.InvalidImportDeclaration,e.InvalidSliceDeclaration,e.InvalidDescription,e.DuplicateDescription,e.EmptyDescription,e.DuplicateEventSubject,e.InvalidSubjectType,e.ProtectedSubjectType,e.InvalidSubjectOwner,e.ReadModelSubjectNotSupported,e.InvalidSubjectModifierOrder,e.UnsupportedInteractionAlternatives,e.MixedInteractionAlternatives,e.InteractionAlternativeWithoutActions,e.InlineInteractionAlternative,e.LegacyInteractionWhere,e.InvalidSpecificationParameter,e.InvalidSpecificationCase,e.DuplicateSpecificationParameter,e.DuplicateSpecificationCase,e.IncompleteSpecificationTable,e.InvalidSpecificationCaseAssignment,e.InvalidSpecificationCaseValue,e.InvalidSpecificationCaseReference,e.OptionalSpecificationParameterTarget,e.SpecificationCaseNameCollision,e.IncompatibleSpecificationParameterType,e.UnusedSpecificationParameter,e.SingularSpecificationTableExpansion,e.InvalidSpecificationCallerPersona,e.UnsynthesizablePersonaCaller,e.PersonaWithoutGate,e.GateWithoutPersona,e.AmbiguousPersonaCaller,e.InvalidDocumentation,e.ConflictingDocumentationAcrossFiles,e.InvalidAbsentReadModelStep,e.UnknownConstraintProperty,e.OmittedProductionDestination,e.InvalidSpecificationExample,e.DuplicateSpecificationAssignment,e.InvalidReactionBatchesDeclaration,e.DescribedCommandNotImplemented,e.DescribedCommandWithoutProductions,e.DescribedCommandCardinalityNotAdmitted,e.CommandHandlerRequiresAttachment,e.PendingIntentWithOtherHandler,e.DuplicateEventInProjectionScope,e.ReservedStoredName,e.ContextSourcedPerformedQueryArgument,e.RedundantCompositeKeyBraces,e.ImplicitAuthorizationConjunction,e.RepeatedPassiveDirective]),L=/* @__PURE__ */ new Set([e.InvalidPurposeDeclaration,e.InvalidPurposeVocabulary,e.DuplicatePurposeField,e.DuplicatePurposeDeclaration,e.UnknownPurpose,e.PurposeInterestMismatch,e.PersonalDataWithoutPurpose,e.SpecialDataWithoutCondition,e.CriminalDataWithoutAuthorization,e.PurposeWithoutBasis,e.UnusedPurpose,e.UnknownConceptDirective,e.AttributeReasonWithoutAttribute,e.DuplicateAttributeReason,e.LegacyComplianceMarker,e.DuplicateComplianceMarker,e.UnknownComplianceMarker,e.InvalidSecretScope,e.DuplicateSecretScope,e.SecretScopeIgnoredForPii,e.InvalidPersonalDataQualifier,e.DuplicateSpecialCategory]),R=/* @__PURE__ */ new Set,z=/* @__PURE__ */ new Set;for(let n of p.compilerDiagnostics??S.diagnostics){let r=n.code===e.UnknownType&&(S.identityDetails??[]).some(e=>e.line===n.location.line-1),i=n.code===e.InvalidSemanticBinding&&n.message.startsWith(`Read model '`)&&n.message.includes(`' references unsupported type '`);i&&z.add(n.location.line-1);let a=n.code===e.RepeatedSingularDeclarationAcrossFiles&&(n.message.includes(`identity block`)||n.message.includes(`context block`));if(!(n.code===e.DuplicateDeclaration&&n.message.startsWith(`Duplicate declaration of policy `))&&!r&&!i&&!a&&!k.has(n.code)&&!A.has(n.code)&&!L.has(n.code)&&!j.has(n.code)&&!M.has(n.code)&&!N.has(n.code)&&!P.has(n.code)&&!F.has(n.code)&&!I.has(n.code)&&n.code!==e.ReducerIdentityMismatch&&n.code!==e.InvalidSpecificationExampleBody&&n.code!==e.UnknownRuleImplementationDirective&&n.code!==e.InvalidValidationRule&&n.code!==e.RepeatedDeclarationAcrossFiles&&!/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$|^PLAY060[7-9]$|^PLAY061[0-9]$|^PLAY0620$|^PLAY062[1-9]$|^PLAY063[0-9]$|^PLAY064[0-9]$|^PLAY065[0-2]$|^PLAY065[4-6]$|^PLAY066[0-6]$|^PLAY072[0-2]$/.test(n.code))continue;let o=n.location.line-1;if(n.code===e.OmittedProductionDestination&&O.some(e=>e.code===n.code&&e.line===o))continue;if(n.code===e.UnknownEvent){if(R.has(o))continue;R.add(o)}let s=t(u[o],n)||u[o].length-n.location.column+1;O.push(issue(n.severity,o,n.location.column,s,n.message,n.code))}let checkEvent=(e,t,n)=>{!E.has(n)&&!R.has(e)&&O.push(tokenIssue(`warning`,e,t,n,`Unknown event type '${n}' — declare it in a slice or import it.`,l.unknownEvent))},B=-1;for(let e=0;e<u.length;e++){let t=u[e],n=t.trim();if(m[e]||n.length===0)continue;let r=t.match(/^[ ]*(\t+)/);if(r&&O.push(issue(`warning`,e,r[0].length-r[1].length+1,r[1].length,`Screenplay is indentation-based — use spaces, not tabs.`,l.tabIndentation)),B>=0){if(f(t)>B&&w.test(n)){for(let r of policyNames(n))D.has(r)||O.push(tokenIssue(`warning`,e,t,r,`Unknown policy '${r}' — declare it with 'policy ${r}'.`,l.unknownPolicy));continue}B=-1}let d=validateImport(u,m,e);d&&O.push(d);let p=n.match(/^slice\s+(\w+)/);p&&!c.includes(p[1])&&O.push(tokenIssue(`error`,e,t,p[1],`Unknown slice type '${p[1]}' — expected ${c.join(`, `)}.`,l.unknownSliceType));let h=n.match(/^concept\s+\w+\s*:\s*(\w+)/);h&&h[1]!==`Enum`&&!s.includes(h[1])&&O.push(tokenIssue(`error`,e,t,h[1],`Unknown primitive type '${h[1]}' — expected ${s.join(`, `)} or Enum.`,l.unknownPrimitiveType));let g=n.match(/^authorize\s+(.*)$/);if(g){B=f(t);for(let n of policyNames(g[1]))D.has(n)||O.push(tokenIssue(`warning`,e,t,n,`Unknown policy '${n}' — declare it with 'policy ${n}'.`,l.unknownPolicy))}let _=n.match(/^on\s+([A-Z]\w*)\s*$/);_&&checkEvent(e,t,_[1]);let v=n.match(/^produces\s+([A-Z]\w*)\s*$/);if(v&&!S.operationProductionLines?.has(e)&&checkEvent(e,t,v[1]),/^produces\s+when\b/.test(n)&&!S.operationProductionLines?.has(e))for(let n=e+1;n<u.length;n++){let e=u[n];if(!(m[n]||e.trim().length===0)){if(f(e)>f(t)){let t=e.trim().match(/^([A-Z]\w*)\s*$/);t&&checkEvent(n,e,t[1])}break}}let y=n.match(/^unique\s+event\s+([A-Z]\w*)/);y&&checkEvent(e,t,y[1]);let b=n.match(/^unique\s+[a-z_]\w*\s+on\s+([A-Z]\w*)/);b&&checkEvent(e,t,b[1]);for(let n of t.match(/\$identity\.[\w.]+/g)??[]){let r=n.substring(10).split(`.`)[0],i=[...o,...(S.identityDetails??[]).map(e=>e.name)];i.includes(r)||O.push(tokenIssue(`warning`,e,t,n,`Unknown $identity property '${r}' — expected ${i.join(`, `)}.`,l.unknownContextIdentityProperty))}for(let n of t.match(/\$context\.[\w.]+/g)??[]){let r=n.substring(9).split(`.`);a.includes(r[0])?r[0]===`causedBy`&&r.length>1&&!i.includes(r[1])?O.push(tokenIssue(`warning`,e,t,n,`Unknown $context.causedBy property '${r[1]}' — expected ${i.join(`, `)}.`,l.unknownContextCausedByProperty)):r[0]===`identity`&&r.length>1&&!o.includes(r[1])&&O.push(tokenIssue(`warning`,e,t,n,`Unknown $context.identity property '${r[1]}' — expected ${o.join(`, `)}.`,l.unknownContextIdentityProperty)):O.push(tokenIssue(`warning`,e,t,n,`Unknown $context path '${r.join(`.`)}' — expected one of ${a.join(`, `)}.`,l.unknownContextPath))}}O.push(...validateEventContextPaths(u,m)),O.push(...r(u,T,v,S.operationProductionLines));let V=u.map((e,t)=>({line:e,index:t})).filter(({line:e})=>/^\s*```(?:[a-z]+)?\s*$/.test(e));if(V.length%2==1){let e=V[V.length-1];O.push(issue(`error`,e.index,1,e.line.length+1,"Unclosed inline code block — expected a closing ``` line.",l.unclosedCodeBlock))}return O.filter(e=>e.code!==l.unknownType||!z.has(e.line))}function validateProductionDestinations(e,t){let n=[];e=p(e);for(let r of t.commands){let t=r.properties.filter(e=>e.isIdentifier&&!v(e).isOptional&&!v(e).isCollection);if(t.length===1)for(let i of r.produces??[]){if(i.inline||i.conditional||i.target!==void 0)continue;let r=i.line;n.push(issue(`information`,r,f(e[r])+1,e[r].trim().length,`Plain 'produces ${i.name}' omits its destination — use 'for ${t[0].name}' to explicitly select the command's identifier.`,l.omittedProductionDestination))}}return n}function validateImport(e,t,n){let r=e[n],i=r.trim().replace(/\s*\/\/.*$/,``);if(!/^import\b/.test(i)||x(r,n))return;let a=f(r);if(a>0&&[`module`,`feature`].includes(u(e,t,n,a)[0])||S(r))return issue(`error`,n,a+1,i.length,`Invalid import '${i}' — inside a module or feature, import names files: 'import "<path or glob>"'.`,l.invalidFileImport)}const T=/^(?:(?:increment|decrement|count|clear|add|subtract|set)\s+)?@?([$\w.]+)(?=\s|=|$)/;function validateEventContextPaths(e,t){let n=[],names=e=>e.map(e=>e.name).join(`, `);for(let r=0;r<e.length;r++){let i=e[r];if(t[r])continue;for(let e of i.matchAll(/(\.)?\$eventContext((?:\.(?:\w+(?:\(\))?)?)*)/g)){let t=e[0].substring(e[1]?.length??0),i=e[2];if(i.length===0){e[1]&&n.push(issue(`error`,r,(e.index??0)+2,t.length,`'$eventContext' names no member - expected one of ${names(m(``).expected)}.`,l.missingEventContextPath));continue}let a=i.substring(1),o=m(a),s=(e.index??0)+(e[1]?.length??0)+1;switch(o.status){case`missing`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' names no member - expected one of ${names(o.expected)}.`,l.missingEventContextPath));break;case`unknownMember`:n.push(issue(`warning`,r,s,t.length,`Unknown event context member '${o.segment}' in '$eventContext.${a}' - expected one of ${names(o.expected)}.`,l.unknownEventContextMember));break;case`unknownSubPath`:{let e=o.expected.length===0?`no members to address`:`members ${names(o.expected)}`;n.push(issue(`warning`,r,s,t.length,`Unknown event context path '$eventContext.${a}' - '${o.member?.name}' (${o.member?.type}) has ${e}.`,l.unknownEventContextPath));break}case`belowCollection`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' cannot resolve - '${o.member?.name}' is a collection (${o.member?.type}) and cannot be addressed below.`,l.eventContextPathBelowCollection))}}let a=i.trim().match(T)?.[1],o=a?.match(/\.\$(\w+)/)?.[1];a&&o&&o!==`eventContext`&&n.push(tokenIssue(`warning`,r,i,a,`Dynamic dictionary key '$${o}' in '${a}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${o}' becomes the key.`,l.unresolvedDynamicKeySource))}return n}export{validateEventContextPaths,validateLines};
3
3
  //# sourceMappingURL=validation.js.map