@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":"response-completions.js","names":["fences","fenceMap","lines","line","withoutComment","before","indent","indentOf","chain","enclosingChain","enclosing","nearestEnclosingLine","matches","symbols","command","name","concept","propertyTypeReference","property","typeReferenceText","responseAvailability","scanDocument","modifier","word","optionalTypeItems","type","primitiveTypes","responseAnalysis","specification","properties","source","field"],"sources":["../../response-completions.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { enclosingChain, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { CompletionEntry, optionalTypeItems } from './completion-items';\nimport { DocumentSymbols, PropertySymbol, propertyTypeReference, scanDocument } from './symbols';\nimport { typeReferenceText } from './TypeReferenceSymbol';\nimport { responseAvailability, responseAnalysis } from './response-analysis';\nimport { primitiveTypes } from './language';\n\nexport function responseCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n const fences = fenceMap(lines);\n if (fences[line] || withoutComment(before).length < before.length) return null;\n const indent = before.trim() === '' ? before.length : indentOf(lines[line]);\n const chain = enclosingChain(lines, fences, line, indent);\n const enclosing = nearestEnclosingLine(lines, fences, line, indent);\n const namedCommand = (name: string | undefined) => {\n const matches = symbols.commands.filter(command => command.name === name);\n return matches.length === 1 ? matches[0] : undefined;\n };\n const fixtureName = (property: PropertySymbol): string => symbols.concepts.find(concept => concept.name === propertyTypeReference(property).name)?.primitive === 'String' ? 'generated-value' : 'uuid';\n const entry = (property: PropertySymbol, insertText = property.name): CompletionEntry => ({\n label: property.name, insertText,\n documentation: `${typeReferenceText(propertyTypeReference(property))}${property.isGenerated ? ' — generated, not request/form input' : ''}. ${responseAvailability}`,\n });\n if (chain.includes('command')) {\n // Merged symbol line offsets belong to different documents. Only the current (possibly\n // unsaved) source can own the cursor; application symbols are for external lookup.\n const command = scanDocument(lines).commands.filter(command => command.line < line).at(-1);\n if (!command) return null;\n if (chain[0] === 'command') {\n if (/^\\s*returns\\s+@?\\w*$/.test(before)) {\n if (!/returns\\s+@/.test(before) && command.properties.some(property => property.name === 'returns' && property.line === line)) return null;\n return command.properties.map(property => entry(property, `${/returns\\s+@/.test(before) ? '' : '@'}${property.name}`));\n }\n const modifier = before.match(/^\\s*@?[a-z_]\\w*\\s+([\\w.]+)\\s+(\\w*)$/);\n if (modifier && ['generated', 'identifier'].some(word => word.startsWith(modifier[2]))) {\n const concept = symbols.concepts.find(concept => concept.name === modifier[1]);\n if (concept?.primitive === 'Uuid' || (concept?.primitive === 'String' && concept.generationStrategy !== undefined)) return [\n ...('optional'.startsWith(modifier[2]) ? optionalTypeItems : []),\n { label: 'generated', insertText: 'generated', documentation: `Required scalar generatable concept; not a request/form input. Concept rules select ESM V20: Proven binds silently, Refuted reports PLAY0688 and Unproven reports PLAY0689. ${responseAvailability}` },\n { label: 'generated identifier', insertText: 'generated identifier', documentation: `Specification fixture uses an indented for value. ${responseAvailability}` },\n { label: 'identifier', insertText: 'identifier', documentation: 'Names the event source identifier.' },\n ];\n }\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.]+\\s+generated\\s+\\w*$/.test(before)) return [{ label: 'identifier', insertText: 'identifier', documentation: responseAvailability }];\n }\n if (chain[0] === 'returns') {\n if (/=\\s*@?\\w*$/.test(before)) return command.properties.map(property => entry(property));\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.]*$/.test(before)) return [...symbols.concepts.map(concept => concept.name), ...symbols.types.map(type => type.name), ...primitiveTypes].map(name => ({ label: name, insertText: name, documentation: `Explicit response type must exactly match the source. ${responseAvailability}` }));\n return command.properties.map(property => entry(property, `${property.name} = ${property.name}`));\n }\n }\n if (chain[0] === 'form' && enclosing && (/^\\s*field\\s+\\w*$/.test(before) || before.trim() === '')) {\n const command = namedCommand(enclosing.match(/\\bfor\\s+([\\w.]+)$/)?.[1]);\n if (command) return command.properties.filter(property => !property.isGenerated).map(property => entry(property, before.trim() === '' ? `field ${property.name}` : property.name));\n }\n if (chain.includes('specification')) {\n if (chain[0] === 'when' && enclosing) {\n const name = enclosing.match(/^when\\s+([\\w.]+)$/)?.[1];\n const command = namedCommand(name);\n if (!command) return null;\n if (/^\\s*generated\\s+\\w*$/.test(before)) return command.properties.filter(property => property.isGenerated && !property.isIdentifier).map(property => entry(property, `${property.name} = \"\\${1:${fixtureName(property)}}\"`));\n if (before.trim() === '') return [\n ...command.properties.filter(property => !property.isGenerated).map(property => entry(property, `${property.name} = \\${1:value}`)),\n ...command.properties.filter(property => property.isGenerated && !property.isIdentifier).map(property => ({ ...entry(property, `generated ${property.name} = \"\\${1:${fixtureName(property)}}\"`), label: `generated ${property.name}` })),\n ...(command.properties.some(property => property.isGenerated && property.isIdentifier) ? [{ label: 'for', insertText: `for \"\\${1:${fixtureName(command.properties.find(property => property.isGenerated && property.isIdentifier)!)}}\"`, documentation: `Generated identifier fixture, not request input. ${responseAvailability}` }] : []),\n ];\n }\n if (chain[0] === 'then' && /^then\\s+returns$/.test(enclosing ?? '')) {\n const specification = [...responseAnalysis(lines).specifications.values()].filter(specification => specification.location.line - 1 < line).at(-1);\n const command = namedCommand(specification?.when?.commandType);\n if (command?.response?.kind === 'RecordCommandResponseSyntax') {\n const properties = new Map(command.properties.map(property => [property.name, property]));\n return command.response.fields.map(field => {\n const source = properties.get(field.source.property);\n const type = field.type ?? (source ? propertyTypeReference(source) : undefined);\n return { label: field.name, insertText: `${field.name} = \\${1:value}`, documentation: `${type ? typeReferenceText(type) : 'Unresolved type'}. ${responseAvailability}` };\n });\n }\n }\n }\n return null;\n}\n"],"mappings":"mfAUA,SAAgB,oBAAoB,EAAiB,EAAc,EAAgB,EAAoD,CACnI,IAAMA,EAASC,EAASC,CAAK,EAC7B,GAAIF,EAAOG,IAASC,EAAeC,CAAM,CAAC,CAAC,OAASA,EAAO,OAAQ,OAAO,KAC1E,IAAMC,EAASD,EAAO,KAAK,IAAM,GAAKA,EAAO,OAASE,EAASL,EAAMC,EAAK,EACpEK,EAAQC,EAAeP,EAAOF,EAAQG,EAAMG,CAAM,EAClDI,EAAYC,EAAqBT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AI,IAAIf,EAAQ,WAAW,IAAI,GAAY,CAACI,EAAS,KAAMA,CAAQ,CAAC,CAAC,EACxF,OAAOJ,EAAQ,SAAS,OAAO,IAAI,GAAS,CACxC,IAAMgB,EAASD,EAAW,IAAIE,EAAM,OAAO,QAAQ,EAC7CN,EAAOM,EAAM,OAASD,EAASb,EAAsBa,CAAM,EAAI,IAAA,IACrE,MAAO,CAAE,MAAOC,EAAM,KAAM,WAAY,GAAGA,EAAM,KAAK,gBAAiB,cAAe,GAAGN,EAAON,EAAkBM,CAAI,EAAI,kBAAkB,IAAIL,GAAuB,CAC3K,CAAC,CACL,CACJ,CACJ,CACA,OAAO,IACX"}
1
+ {"version":3,"file":"response-completions.js","names":["fences","fenceMap","lines","line","withoutComment","before","indent","indentOf","chain","enclosingChain","enclosing","nearestEnclosingLine","matches","symbols","command","name","concept","propertyTypeReference","property","typeReferenceText","responseAvailability","scanDocument","modifier","word","optionalTypeItems","type","primitiveTypes","responseAnalysis","specification","properties","source","field"],"sources":["../../response-completions.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { enclosingChain, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { CompletionEntry, optionalTypeItems } from './completion-items';\nimport { DocumentSymbols, PropertySymbol, propertyTypeReference, scanDocument } from './symbols';\nimport { typeReferenceText } from './TypeReferenceSymbol';\nimport { responseAvailability, responseAnalysis } from './response-analysis';\nimport { primitiveTypes } from './language';\n\nexport function responseCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n const fences = fenceMap(lines);\n if (fences[line] || withoutComment(before).length < before.length) return null;\n const indent = before.trim() === '' ? before.length : indentOf(lines[line]);\n const chain = enclosingChain(lines, fences, line, indent);\n const enclosing = nearestEnclosingLine(lines, fences, line, indent);\n const namedCommand = (name: string | undefined) => {\n const matches = symbols.commands.filter(command => command.name === name);\n return matches.length === 1 ? matches[0] : undefined;\n };\n const fixtureName = (property: PropertySymbol): string => symbols.concepts.find(concept => concept.name === propertyTypeReference(property).name)?.primitive === 'String' ? 'generated-value' : 'uuid';\n const entry = (property: PropertySymbol, insertText = property.name): CompletionEntry => ({\n label: property.name, insertText,\n documentation: `${typeReferenceText(propertyTypeReference(property))}${property.isGenerated ? ' — generated, not request/form input' : ''}. ${responseAvailability}`,\n });\n if (chain.includes('command')) {\n // Merged symbol line offsets belong to different documents. Only the current (possibly\n // unsaved) source can own the cursor; application symbols are for external lookup.\n const command = scanDocument(lines).commands.filter(command => command.line < line).at(-1);\n if (!command) return null;\n if (chain[0] === 'command') {\n if (/^\\s*returns\\s+@?\\w*$/.test(before)) {\n if (!/returns\\s+@/.test(before) && command.properties.some(property => property.name === 'returns' && property.line === line)) return null;\n return command.properties.map(property => entry(property, `${/returns\\s+@/.test(before) ? '' : '@'}${property.name}`));\n }\n const modifier = before.match(/^\\s*@?[a-z_]\\w*\\s+([\\w.]+)\\s+(\\w*)$/);\n if (modifier && ['generated', 'identifier'].some(word => word.startsWith(modifier[2]))) {\n const concept = symbols.concepts.find(concept => concept.name === modifier[1]);\n if (concept?.primitive === 'Uuid' || (concept?.primitive === 'String' && concept.generationStrategy !== undefined)) return [\n ...('optional'.startsWith(modifier[2]) ? optionalTypeItems : []),\n { label: 'generated', insertText: 'generated', documentation: `Required scalar generatable concept; not a request/form input. Concept rules select ESM V20: Proven binds silently, Refuted reports PLAY0688 and Unproven reports PLAY0689. ${responseAvailability}` },\n { label: 'generated identifier', insertText: 'generated identifier', documentation: `Specification fixture uses an indented for value. ${responseAvailability}` },\n { label: 'identifier', insertText: 'identifier', documentation: 'Names the event source identifier.' },\n ];\n }\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.]+\\s+generated\\s+\\w*$/.test(before)) return [{ label: 'identifier', insertText: 'identifier', documentation: responseAvailability }];\n }\n if (chain[0] === 'returns') {\n if (/=\\s*@?\\w*$/.test(before)) return command.properties.map(property => entry(property));\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.]*$/.test(before)) return [...symbols.concepts.map(concept => concept.name), ...symbols.types.map(type => type.name), ...primitiveTypes].map(name => ({ label: name, insertText: name, documentation: `Explicit response type must exactly match the source. ${responseAvailability}` }));\n return command.properties.map(property => entry(property, `${property.name} = ${property.name}`));\n }\n }\n if (chain[0] === 'form' && enclosing && (/^\\s*field\\s+\\w*$/.test(before) || before.trim() === '')) {\n const command = namedCommand(enclosing.match(/\\bfor\\s+([\\w.]+)$/)?.[1]);\n if (command) return command.properties.filter(property => !property.isGenerated).map(property => entry(property, before.trim() === '' ? `field ${property.name}` : property.name));\n }\n if (chain.includes('specification')) {\n if (chain[0] === 'when' && enclosing) {\n const name = enclosing.match(/^when\\s+([\\w.]+)$/)?.[1];\n const command = namedCommand(name);\n if (!command) return null;\n if (/^\\s*generated\\s+\\w*$/.test(before)) return command.properties.filter(property => property.isGenerated && !property.isIdentifier).map(property => entry(property, `${property.name} = \"\\${1:${fixtureName(property)}}\"`));\n if (before.trim() === '') return [\n ...command.properties.filter(property => !property.isGenerated).map(property => entry(property, `${property.name} = \\${1:value}`)),\n ...command.properties.filter(property => property.isGenerated && !property.isIdentifier).map(property => ({ ...entry(property, `generated ${property.name} = \"\\${1:${fixtureName(property)}}\"`), label: `generated ${property.name}` })),\n ...(command.properties.some(property => property.isGenerated && property.isIdentifier) ? [{ label: 'for', insertText: `for \"\\${1:${fixtureName(command.properties.find(property => property.isGenerated && property.isIdentifier)!)}}\"`, documentation: `Generated identifier fixture, not request input. ${responseAvailability}` }] : []),\n ];\n }\n if (chain[0] === 'then' && /^then\\s+returns$/.test(enclosing ?? '')) {\n const specification = [...responseAnalysis(lines).specifications.values()].filter(specification => specification.location.line - 1 < line).at(-1);\n const command = namedCommand(specification?.when?.commandType);\n if (command?.response?.kind === 'RecordCommandResponseSyntax') {\n const properties = new Map(command.properties.map(property => [property.name, property]));\n return command.response.fields.map(field => {\n const source = properties.get(field.source.property);\n const type = field.type ?? (source ? propertyTypeReference(source) : undefined);\n return { label: field.name, insertText: `${field.name} = \\${1:value}`, documentation: `${type ? typeReferenceText(type) : 'Unresolved type'}. ${responseAvailability}` };\n });\n }\n }\n }\n return null;\n}\n"],"mappings":"A,mfAUA,SAAgB,oBAAoB,EAAiB,EAAc,EAAgB,EAAoD,CACnI,IAAMA,EAASC,EAASC,CAAK,EAC7B,GAAIF,EAAOG,IAASC,EAAeC,CAAM,CAAC,CAAC,OAASA,EAAO,OAAQ,OAAO,KAC1E,IAAMC,EAASD,EAAO,KAAK,IAAM,GAAKA,EAAO,OAASE,EAASL,EAAMC,EAAK,EACpEK,EAAQC,EAAeP,EAAOF,EAAQG,EAAMG,CAAM,EAClDI,EAAYC,EAAqBT,EAAOF,EAAQG,EAAMG,CAAM,EAC5D,aAAgB,GAA6B,CAC/C,IAAMM,EAAUC,EAAQ,SAAS,OAAO,GAAWC,EAAQ,OAASC,CAAI,EACxE,OAAOH,EAAQ,SAAW,EAAIA,EAAQ,GAAK,IAAA,EAC/C,EACM,YAAe,GAAqCC,EAAQ,SAAS,KAAK,GAAWG,EAAQ,OAASC,EAAsBC,CAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,YAAc,SAAW,kBAAoB,OAC1L,OAAS,EAA0B,EAAaA,EAAS,QAA2B,CACtF,MAAOA,EAAS,KAAM,aACtB,cAAe,GAAGC,EAAkBF,EAAsBC,CAAQ,CAAC,IAAIA,EAAS,YAAc,uCAAyC,GAAG,IAAIE,GAClJ,GACA,GAAIZ,EAAM,SAAS,SAAS,EAAG,CAG3B,IAAMM,EAAUO,EAAanB,CAAK,CAAC,CAAC,SAAS,OAAO,GAAWY,EAAQ,KAAOX,CAAI,CAAC,CAAC,GAAG,EAAE,EACzF,GAAI,CAACW,EAAS,OAAO,KACrB,GAAIN,EAAM,KAAO,UAAW,CACxB,GAAI,uBAAuB,KAAKH,CAAM,EAElC,MADI,CAAC,cAAc,KAAKA,CAAM,GAAKS,EAAQ,WAAW,KAAK,GAA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a,YAAYJ,EAAQ,WAAW,KAAK,GAAYI,EAAS,aAAeA,EAAS,YAAY,CAAE,EAAE,IAAK,cAAe,oDAAoDE,GAAuB,CAAC,EAAI,CAAC,CAC7U,CACJ,CACA,GAAIZ,EAAM,KAAO,QAAU,mBAAmB,KAAKE,GAAa,EAAE,EAAG,CAEjE,IAAMI,EAAU,aADM,CAAC,GAAGa,EAAiBzB,CAAK,CAAC,CAAC,eAAe,OAAO,CAAC,CAAC,CAAC,OAAO,GAAiB0B,EAAc,SAAS,KAAO,EAAIzB,CAAI,CAAC,CAAC,GAAG,EACrG,CAAC,EAAE,MAAM,WAAW,EAC7D,GAAIW,GAAS,UAAU,OAAS,8BAA+B,CAC3D,IAAMe,EAAa,IAAI,IAAIf,EAAQ,WAAW,IAAI,GAAY,CAACI,EAAS,KAAMA,CAAQ,CAAC,CAAC,EACxF,OAAOJ,EAAQ,SAAS,OAAO,IAAI,GAAS,CACxC,IAAMgB,EAASD,EAAW,IAAIE,EAAM,OAAO,QAAQ,EAC7CN,EAAOM,EAAM,OAASD,EAASb,EAAsBa,CAAM,EAAI,IAAA,IACrE,MAAO,CAAE,MAAOC,EAAM,KAAM,WAAY,GAAGA,EAAM,KAAK,gBAAiB,cAAe,GAAGN,EAAON,EAAkBM,CAAI,EAAI,kBAAkB,IAAIL,GAAuB,CAC3K,CAAC,CACL,CACJ,CACJ,CACA,OAAO,IACX,C"}
@@ -1,3 +1,3 @@
1
- import"./_virtual/_virtual/_rolldown/runtime.js";import{withoutComment as e}from"./document-context.js";import{responseAnalysis as t}from"./response-analysis.js";const n=[`keyword`,`property`,`type`];function responseTokens(n,r){let i=[],add=(e,t,r,a)=>{let o=n[e-1];if(o===void 0||t<1||r<1)return;let s=t-1+ +(o[t-1]===`@`);s+r<=o.length&&i.push({line:e-1,column:s,length:r,type:a})},a=r?.authoringPath??`current.play`,o=t(n,r?.authoringDocuments??r?.authoringSources?.filter(e=>e!==n.join(`
2
- `))??[],r?.authoringPlacement,a,r?.authoringPlacementResolved);for(let e of o.eventSources.declarations.filter(e=>e.location.path===a)){add(e.location.line,e.location.column,11,0),e.identifier&&add(e.identifier.location.line,e.identifier.location.column,e.identifier.name.length,2);for(let t of e.streams){add(t.location.line,t.location.column,6,0),t.streamId&&add(t.streamId.location.line,t.streamId.location.column,t.streamId.name.length,2);let e=t.directiveLocations?.streamId;e&&add(e.line,e.column,8,0);for(let e of t.streamIdParts)add(e.location.line,e.location.column,e.name.length,1),add(e.type.location.line,e.type.location.column,e.type.name.length,2)}}for(let e of o.eventSources.routes){add(e.location.line,e.location.column,6,0),e.referenceLocation&&add(e.referenceLocation.line,e.referenceLocation.column,`${e.eventSource}.${e.stream}`.length,2),e.streamId&&add(e.streamId.location.line,e.streamId.location.column,8,0);let t=e.directiveLocations?.streamId;t&&add(t.line,t.column,8,0);for(let t of e.streamIdParts)add(t.location.line,t.location.column,t.property.length,1)}for(let t of o.commands.values()){for(let r of t.properties){if(!r.isGenerated)continue;let t=e(n[r.location.line-1]??``);add(r.location.line,t.lastIndexOf(`generated`)+1,9,0)}let r=t.response;if(r){if(add(r.location.line,r.location.column,7,0),r.kind===`ScalarCommandResponseSyntax`)add(r.source.location.line,r.source.location.column,r.source.property.length,1);else for(let e of r.fields)add(e.location.line,e.location.column,e.name.length,1),add(e.source.location.line,e.source.location.column,e.source.property.length,1),e.type&&add(e.type.location.line,e.type.location.column,e.type.name.length,2)}}for(let e of o.specifications.values()){for(let t of e.thenEvents??[])t.noStream&&add(t.noStream.location.line,t.noStream.location.column,9,0);for(let t of e.when?.generatedValues??[])add(t.location.line,t.location.column,9,0);e.thenReturns&&add(e.thenReturns.location.line,(n[e.thenReturns.location.line-1]??``).indexOf(`returns`)+1,7,0)}for(let e of o.operations.systems.filter(e=>e.location.path===a))add(e.location.line,e.location.column,6,0);for(let t of o.operations.declarations.filter(e=>e.location.path===a)){let r=e(n[t.location.line-1]??``).indexOf(`operation`,t.location.column-1);r>=0&&add(t.location.line,r+1,9,0);for(let e of t.inputs)add(e.location.line,e.location.column,e.name.length,1),add(e.type.location.line,e.type.location.column,e.type.name.length,2);t.usesLocation&&add(t.usesLocation.line,(n[t.usesLocation.line-1]??``).indexOf(`uses`)+1,4,0);for(let r of[t.execute,t.compensate]){if(!r)continue;let t=e(n[r.location.line-1]??``).trim();add(r.location.line,r.location.column,t.length,0),r.implementation&&add(r.implementation.location.line,r.implementation.location.column,14,0);for(let e of r.implementation?.hints??[])add(e.location.line,e.location.column,4,0)}}let s=i.sort((e,t)=>e.line-t.line||e.column-t.column);return s.filter((e,t)=>t===0||e.line!==s[t-1].line||e.column>=s[t-1].column+s[t-1].length)}export{n as responseTokenTypes,responseTokens};
1
+ import"./_virtual/_virtual/_rolldown/runtime.js";import{responseAnalysis as e}from"./response-analysis.js";import{withoutComment as t}from"./document-context.js";const n=[`keyword`,`property`,`type`];function responseTokens(n,r){let i=[],add=(e,t,r,a)=>{let o=n[e-1];if(o===void 0||t<1||r<1)return;let s=t-1+ +(o[t-1]===`@`);s+r<=o.length&&i.push({line:e-1,column:s,length:r,type:a})},a=r?.authoringPath??`current.play`,o=e(n,r?.authoringDocuments??r?.authoringSources?.filter(e=>e!==n.join(`
2
+ `))??[],r?.authoringPlacement,a,r?.authoringPlacementResolved);for(let e of o.eventSources.declarations.filter(e=>e.location.path===a)){add(e.location.line,e.location.column,11,0),e.identifier&&add(e.identifier.location.line,e.identifier.location.column,e.identifier.name.length,2);for(let t of e.streams){add(t.location.line,t.location.column,6,0),t.streamId&&add(t.streamId.location.line,t.streamId.location.column,t.streamId.name.length,2);let e=t.directiveLocations?.streamId;e&&add(e.line,e.column,8,0);for(let e of t.streamIdParts)add(e.location.line,e.location.column,e.name.length,1),add(e.type.location.line,e.type.location.column,e.type.name.length,2)}}for(let e of o.eventSources.routes){add(e.location.line,e.location.column,6,0),e.referenceLocation&&add(e.referenceLocation.line,e.referenceLocation.column,`${e.eventSource}.${e.stream}`.length,2),e.streamId&&add(e.streamId.location.line,e.streamId.location.column,8,0);let t=e.directiveLocations?.streamId;t&&add(t.line,t.column,8,0);for(let t of e.streamIdParts)add(t.location.line,t.location.column,t.property.length,1)}for(let e of o.commands.values()){for(let r of e.properties){if(!r.isGenerated)continue;let e=t(n[r.location.line-1]??``);add(r.location.line,e.lastIndexOf(`generated`)+1,9,0)}let r=e.response;if(r){if(add(r.location.line,r.location.column,7,0),r.kind===`ScalarCommandResponseSyntax`)add(r.source.location.line,r.source.location.column,r.source.property.length,1);else for(let e of r.fields)add(e.location.line,e.location.column,e.name.length,1),add(e.source.location.line,e.source.location.column,e.source.property.length,1),e.type&&add(e.type.location.line,e.type.location.column,e.type.name.length,2)}}for(let e of o.specifications.values()){for(let t of e.thenEvents??[])t.noStream&&add(t.noStream.location.line,t.noStream.location.column,9,0);for(let t of e.when?.generatedValues??[])add(t.location.line,t.location.column,9,0);e.thenReturns&&add(e.thenReturns.location.line,(n[e.thenReturns.location.line-1]??``).indexOf(`returns`)+1,7,0)}for(let e of o.operations.systems.filter(e=>e.location.path===a))add(e.location.line,e.location.column,6,0);for(let e of o.operations.declarations.filter(e=>e.location.path===a)){let r=t(n[e.location.line-1]??``).indexOf(`operation`,e.location.column-1);r>=0&&add(e.location.line,r+1,9,0);for(let t of e.inputs)add(t.location.line,t.location.column,t.name.length,1),add(t.type.location.line,t.type.location.column,t.type.name.length,2);e.usesLocation&&add(e.usesLocation.line,(n[e.usesLocation.line-1]??``).indexOf(`uses`)+1,4,0);for(let r of[e.execute,e.compensate]){if(!r)continue;let e=t(n[r.location.line-1]??``).trim();add(r.location.line,r.location.column,e.length,0),r.implementation&&add(r.implementation.location.line,r.implementation.location.column,14,0);for(let e of r.implementation?.hints??[])add(e.location.line,e.location.column,4,0)}}let s=i.sort((e,t)=>e.line-t.line||e.column-t.column);return s.filter((e,t)=>t===0||e.line!==s[t-1].line||e.column>=s[t-1].column+s[t-1].length)}export{n as responseTokenTypes,responseTokens};
3
3
  //# sourceMappingURL=response-tokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"response-tokens.js","names":["responseTokenTypes","tokens","source","lines","line","column","length","start","path","symbols","analysis","responseAnalysis","stream","header","part","route","command","property","withoutComment","response","field","specification","event","fixture","system","operation","keyword","input","phase","name","hint","ordered","left","right","index","token"],"sources":["../../response-tokens.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { responseAnalysis } from './response-analysis';\nimport { DocumentSymbols } from './symbols';\nimport { withoutComment } from './document-context';\n\nexport const responseTokenTypes = ['keyword', 'property', 'type'] as const;\n\n// Semantic overlays resolve the local returns ambiguity that a line-based grammar cannot.\nexport function responseTokens(lines: string[], symbols?: DocumentSymbols): { line: number; column: number; length: number; type: number }[] {\n const tokens: { line: number; column: number; length: number; type: number }[] = [];\n const add = (line: number, column: number, length: number, type: number) => {\n const source = lines[line - 1];\n if (source === undefined || column < 1 || length < 1) return;\n const start = column - 1 + (source[column - 1] === '@' ? 1 : 0);\n if (start + length <= source.length) tokens.push({ line: line - 1, column: start, length, type });\n };\n const path = symbols?.authoringPath ?? 'current.play';\n const analysis = responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, path, symbols?.authoringPlacementResolved);\n for (const source of analysis.eventSources.declarations.filter(source => source.location.path === path)) {\n add(source.location.line, source.location.column, 11, 0);\n if (source.identifier) add(source.identifier.location.line, source.identifier.location.column, source.identifier.name.length, 2);\n for (const stream of source.streams) {\n add(stream.location.line, stream.location.column, 6, 0);\n if (stream.streamId) add(stream.streamId.location.line, stream.streamId.location.column, stream.streamId.name.length, 2);\n const header = stream.directiveLocations?.streamId;\n if (header) add(header.line, header.column, 8, 0);\n for (const part of stream.streamIdParts) {\n add(part.location.line, part.location.column, part.name.length, 1);\n add(part.type.location.line, part.type.location.column, part.type.name.length, 2);\n }\n }\n }\n for (const route of analysis.eventSources.routes) {\n add(route.location.line, route.location.column, 6, 0);\n if (route.referenceLocation) add(route.referenceLocation.line, route.referenceLocation.column, `${route.eventSource}.${route.stream}`.length, 2);\n if (route.streamId) add(route.streamId.location.line, route.streamId.location.column, 8, 0);\n const header = route.directiveLocations?.streamId;\n if (header) add(header.line, header.column, 8, 0);\n for (const part of route.streamIdParts) add(part.location.line, part.location.column, part.property.length, 1);\n }\n for (const command of analysis.commands.values()) {\n for (const property of command.properties) {\n if (!property.isGenerated) continue;\n const source = withoutComment(lines[property.location.line - 1] ?? '');\n add(property.location.line, source.lastIndexOf('generated') + 1, 9, 0);\n }\n const response = command.response;\n if (!response) continue;\n add(response.location.line, response.location.column, 7, 0);\n if (response.kind === 'ScalarCommandResponseSyntax') {\n add(response.source.location.line, response.source.location.column, response.source.property.length, 1);\n } else for (const field of response.fields) {\n add(field.location.line, field.location.column, field.name.length, 1);\n add(field.source.location.line, field.source.location.column, field.source.property.length, 1);\n if (field.type) add(field.type.location.line, field.type.location.column, field.type.name.length, 2);\n }\n }\n for (const specification of analysis.specifications.values()) {\n for (const event of specification.thenEvents ?? []) {\n if (event.noStream) add(event.noStream.location.line, event.noStream.location.column, 9, 0);\n }\n for (const fixture of specification.when?.generatedValues ?? []) {\n add(fixture.location.line, fixture.location.column, 9, 0);\n }\n if (specification.thenReturns) add(specification.thenReturns.location.line, (lines[specification.thenReturns.location.line - 1] ?? '').indexOf('returns') + 1, 7, 0);\n }\n for (const system of analysis.operations.systems.filter(system => system.location.path === path)) {\n add(system.location.line, system.location.column, 6, 0);\n }\n for (const operation of analysis.operations.declarations.filter(operation => operation.location.path === path)) {\n const header = withoutComment(lines[operation.location.line - 1] ?? '');\n const keyword = header.indexOf('operation', operation.location.column - 1);\n if (keyword >= 0) add(operation.location.line, keyword + 1, 9, 0);\n for (const input of operation.inputs) {\n add(input.location.line, input.location.column, input.name.length, 1);\n add(input.type.location.line, input.type.location.column, input.type.name.length, 2);\n }\n if (operation.usesLocation) add(operation.usesLocation.line, (lines[operation.usesLocation.line - 1] ?? '').indexOf('uses') + 1, 4, 0);\n for (const phase of [operation.execute, operation.compensate]) {\n if (!phase) continue;\n const name = withoutComment(lines[phase.location.line - 1] ?? '').trim();\n add(phase.location.line, phase.location.column, name.length, 0);\n if (phase.implementation) add(phase.implementation.location.line, phase.implementation.location.column, 14, 0);\n for (const hint of phase.implementation?.hints ?? []) add(hint.location.line, hint.location.column, 4, 0);\n }\n }\n // Overlays never overlap or duplicate a typed token, even with recovered malformed syntax.\n const ordered = tokens.sort((left, right) => left.line - right.line || left.column - right.column);\n return ordered.filter((token, index) => index === 0 || token.line !== ordered[index - 1].line || token.column >= ordered[index - 1].column + ordered[index - 1].length);\n}\n"],"mappings":"kKAOA,MAAaA,EAAqB,CAAC,UAAW,WAAY,MAAM,EAGhE,SAAgB,eAAe,EAAiB,EAA6F,CACzI,IAAMC,EAA2E,CAAC,EAC5E,KAAO,EAAc,EAAgB,EAAgB,IAAiB,CACxE,IAAMC,EAASC,EAAMC,EAAO,GAC5B,GAAIF,IAAW,IAAA,IAAaG,EAAS,GAAKC,EAAS,EAAG,OACtD,IAAMC,EAAQF,EAAS,GAAK,IAAOA,EAAS,KAAO,KAC/CE,EAAQD,GAAUJ,EAAO,QAAQD,EAAO,KAAK,CAAE,KAAMG,EAAO,EAAG,OAAQG,EAAO,SAAQ,MAAK,CAAC,CACpG,EACMC,EAAOC,GAAS,eAAiB,eACjCC,EAAWC,EAAiBR,EAAOM,GAAS,oBAAsBA,GAAS,kBAAkB,OAAO,GAAUP,IAAWC,EAAM,KAAK;CAAI,CAAC,GAAK,CAAC,EAAGM,GAAS,mBAAoBD,EAAMC,GAAS,0BAA0B,EAC9N,IAAK,IAAMP,KAAUQ,EAAS,aAAa,aAAa,OAAO,GAAUR,EAAO,SAAS,OAASM,CAAI,EAAG,CACrG,IAAIN,EAAO,SAAS,KAAMA,EAAO,SAAS,OAAQ,GAAI,CAAC,EACnDA,EAAO,YAAY,IAAIA,EAAO,WAAW,SAAS,KAAMA,EAAO,WAAW,SAAS,OAAQ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AAQ,EAAO,IAAUG,IAAU,GAAKC,EAAM,OAASJ,EAAQG,EAAQ,EAAE,CAAC,MAAQC,EAAM,QAAUJ,EAAQG,EAAQ,EAAE,CAAC,OAASH,EAAQG,EAAQ,EAAE,CAAC,MAAM,CAC1K"}
1
+ {"version":3,"file":"response-tokens.js","names":["responseTokenTypes","tokens","source","lines","line","column","length","start","path","symbols","analysis","responseAnalysis","stream","header","part","route","command","property","withoutComment","response","field","specification","event","fixture","system","operation","keyword","input","phase","name","hint","ordered","left","right","index","token"],"sources":["../../response-tokens.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { responseAnalysis } from './response-analysis';\nimport { DocumentSymbols } from './symbols';\nimport { withoutComment } from './document-context';\n\nexport const responseTokenTypes = ['keyword', 'property', 'type'] as const;\n\n// Semantic overlays resolve the local returns ambiguity that a line-based grammar cannot.\nexport function responseTokens(lines: string[], symbols?: DocumentSymbols): { line: number; column: number; length: number; type: number }[] {\n const tokens: { line: number; column: number; length: number; type: number }[] = [];\n const add = (line: number, column: number, length: number, type: number) => {\n const source = lines[line - 1];\n if (source === undefined || column < 1 || length < 1) return;\n const start = column - 1 + (source[column - 1] === '@' ? 1 : 0);\n if (start + length <= source.length) tokens.push({ line: line - 1, column: start, length, type });\n };\n const path = symbols?.authoringPath ?? 'current.play';\n const analysis = responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, path, symbols?.authoringPlacementResolved);\n for (const source of analysis.eventSources.declarations.filter(source => source.location.path === path)) {\n add(source.location.line, source.location.column, 11, 0);\n if (source.identifier) add(source.identifier.location.line, source.identifier.location.column, source.identifier.name.length, 2);\n for (const stream of source.streams) {\n add(stream.location.line, stream.location.column, 6, 0);\n if (stream.streamId) add(stream.streamId.location.line, stream.streamId.location.column, stream.streamId.name.length, 2);\n const header = stream.directiveLocations?.streamId;\n if (header) add(header.line, header.column, 8, 0);\n for (const part of stream.streamIdParts) {\n add(part.location.line, part.location.column, part.name.length, 1);\n add(part.type.location.line, part.type.location.column, part.type.name.length, 2);\n }\n }\n }\n for (const route of analysis.eventSources.routes) {\n add(route.location.line, route.location.column, 6, 0);\n if (route.referenceLocation) add(route.referenceLocation.line, route.referenceLocation.column, `${route.eventSource}.${route.stream}`.length, 2);\n if (route.streamId) add(route.streamId.location.line, route.streamId.location.column, 8, 0);\n const header = route.directiveLocations?.streamId;\n if (header) add(header.line, header.column, 8, 0);\n for (const part of route.streamIdParts) add(part.location.line, part.location.column, part.property.length, 1);\n }\n for (const command of analysis.commands.values()) {\n for (const property of command.properties) {\n if (!property.isGenerated) continue;\n const source = withoutComment(lines[property.location.line - 1] ?? '');\n add(property.location.line, source.lastIndexOf('generated') + 1, 9, 0);\n }\n const response = command.response;\n if (!response) continue;\n add(response.location.line, response.location.column, 7, 0);\n if (response.kind === 'ScalarCommandResponseSyntax') {\n add(response.source.location.line, response.source.location.column, response.source.property.length, 1);\n } else for (const field of response.fields) {\n add(field.location.line, field.location.column, field.name.length, 1);\n add(field.source.location.line, field.source.location.column, field.source.property.length, 1);\n if (field.type) add(field.type.location.line, field.type.location.column, field.type.name.length, 2);\n }\n }\n for (const specification of analysis.specifications.values()) {\n for (const event of specification.thenEvents ?? []) {\n if (event.noStream) add(event.noStream.location.line, event.noStream.location.column, 9, 0);\n }\n for (const fixture of specification.when?.generatedValues ?? []) {\n add(fixture.location.line, fixture.location.column, 9, 0);\n }\n if (specification.thenReturns) add(specification.thenReturns.location.line, (lines[specification.thenReturns.location.line - 1] ?? '').indexOf('returns') + 1, 7, 0);\n }\n for (const system of analysis.operations.systems.filter(system => system.location.path === path)) {\n add(system.location.line, system.location.column, 6, 0);\n }\n for (const operation of analysis.operations.declarations.filter(operation => operation.location.path === path)) {\n const header = withoutComment(lines[operation.location.line - 1] ?? '');\n const keyword = header.indexOf('operation', operation.location.column - 1);\n if (keyword >= 0) add(operation.location.line, keyword + 1, 9, 0);\n for (const input of operation.inputs) {\n add(input.location.line, input.location.column, input.name.length, 1);\n add(input.type.location.line, input.type.location.column, input.type.name.length, 2);\n }\n if (operation.usesLocation) add(operation.usesLocation.line, (lines[operation.usesLocation.line - 1] ?? '').indexOf('uses') + 1, 4, 0);\n for (const phase of [operation.execute, operation.compensate]) {\n if (!phase) continue;\n const name = withoutComment(lines[phase.location.line - 1] ?? '').trim();\n add(phase.location.line, phase.location.column, name.length, 0);\n if (phase.implementation) add(phase.implementation.location.line, phase.implementation.location.column, 14, 0);\n for (const hint of phase.implementation?.hints ?? []) add(hint.location.line, hint.location.column, 4, 0);\n }\n }\n // Overlays never overlap or duplicate a typed token, even with recovered malformed syntax.\n const ordered = tokens.sort((left, right) => left.line - right.line || left.column - right.column);\n return ordered.filter((token, index) => index === 0 || token.line !== ordered[index - 1].line || token.column >= ordered[index - 1].column + ordered[index - 1].length);\n}\n"],"mappings":"A,kKAOA,MAAaA,EAAqB,CAAC,UAAW,WAAY,MAAM,EAGhE,SAAgB,eAAe,EAAiB,EAA6F,CACzI,IAAMC,EAA2E,CAAC,EAC5E,KAAO,EAAc,EAAgB,EAAgB,IAAiB,CACxE,IAAMC,EAASC,EAAMC,EAAO,GAC5B,GAAIF,IAAW,IAAA,IAAaG,EAAS,GAAKC,EAAS,EAAG,OACtD,IAAMC,EAAQF,EAAS,GAAK,IAAOA,EAAS,KAAO,KAC/CE,EAAQD,GAAUJ,EAAO,QAAQD,EAAO,KAAK,CAAE,KAAMG,EAAO,EAAG,OAAQG,EAAO,SAAQ,MAAK,CAAC,CACpG,EACMC,EAAOC,GAAS,eAAiB,eACjCC,EAAWC,EAAiBR,EAAOM,GAAS,oBAAsBA,GAAS,kBAAkB,OAAO,GAAUP,IAAWC,EAAM,KAAK;CAAI,CAAC,GAAK,CAAC,EAAGM,GAAS,mBAAoBD,EAAMC,GAAS,0BAA0B,EAC9N,IAAK,IAAMP,KAAUQ,EAAS,aAAa,aAAa,OA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,SAAS,KAAMA,EAAK,SAAS,OAAQ,EAAG,CAAC,CAC5G,CACJ,CAEA,IAAMC,EAAU9B,EAAO,MAAM,EAAM,IAAU+B,EAAK,KAAOC,EAAM,MAAQD,EAAK,OAASC,EAAM,MAAM,EACjG,OAAOF,EAAQ,QAAQ,EAAO,IAAUG,IAAU,GAAKC,EAAM,OAASJ,EAAQG,EAAQ,EAAE,CAAC,MAAQC,EAAM,QAAUJ,EAAQG,EAAQ,EAAE,CAAC,OAASH,EAAQG,EAAQ,EAAE,CAAC,MAAM,CAC1K,C"}
@@ -1,13 +1,13 @@
1
- import"./_virtual/_virtual/_rolldown/runtime.js";import{documentationItem as e}from"./documentation-item.js";import{purposeReferenceItem as t}from"./purpose-items.js";import{exampleDeclarationItems as n}from"./example-declaration-items.js";const r=[{label:`on`,insertText:"on ${1|click,select,submit,change,load,unload,enter,leave|}\n ${2:execute command}",documentation:`Wires what happens on an interaction - a click, a submit, entering or leaving the screen.`},{label:`uses`,insertText:"uses ${1:Behavior}",documentation:`Attaches a named behavior declared at the top level.`}],i=[t,e,...n,{label:`description`,insertText:'description "${1:what this module is for}"',documentation:`A human-readable description.`},{label:`authorize`,insertText:"authorize ${1:PolicyName}",documentation:`Policies that must pass for everything in the module.`},{label:`depends on`,insertText:"depends on ${1:Name}",documentation:`Declares an allowed module or feature dependency. Opts this container into independent explicit-reference checks.`},{label:`import "…"`,insertText:'import "${1:*/*.play}"',documentation:"Imports `.play` files into this module — their top level is the module's body."},{label:`feature`,insertText:`feature \${1:Name}
1
+ import"./_virtual/_virtual/_rolldown/runtime.js";import{exampleDeclarationItems as e}from"./example-declaration-items.js";import{documentationItem as t}from"./documentation-item.js";import{purposeReferenceItem as n}from"./purpose-items.js";const r=[{label:`on`,insertText:"on ${1|click,select,submit,change,load,unload,enter,leave|}\n ${2:execute command}",documentation:`Wires what happens on an interaction - a click, a submit, entering or leaving the screen.`},{label:`uses`,insertText:"uses ${1:Behavior}",documentation:`Attaches a named behavior declared at the top level.`}],i=[n,t,...e,{label:`description`,insertText:'description "${1:what this module is for}"',documentation:`A human-readable description.`},{label:`authorize`,insertText:"authorize ${1:PolicyName}",documentation:`Policies that must pass for everything in the module.`},{label:`depends on`,insertText:"depends on ${1:Name}",documentation:`Declares an allowed module or feature dependency. Opts this container into independent explicit-reference checks.`},{label:`import "…"`,insertText:'import "${1:*/*.play}"',documentation:"Imports `.play` files into this module — their top level is the module's body."},{label:`feature`,insertText:`feature \${1:Name}
2
2
  `,documentation:`Groups related slices into a vertical feature.`},{label:`screen`,insertText:"screen ${1:Name}\n data ${2:ReadModel} via query ${3:QueryName}",documentation:`Declares a module-level UI screen.`},{label:`screen template`,insertText:`screen template \${1:Name}
3
3
  fits slot \${2:content}
4
4
 
5
- \${3:slot}`,documentation:`Declares a reusable screen shape that fits a slot of the shell.`},{label:`dialog template`,insertText:"dialog template ${1:Name}\n ${2:body}\n ${3:actions}",documentation:`Declares a reusable dialog shape that opens over the shell.`},{label:`form`,insertText:'form ${1:Name} for ${2:Command}\n field ${3:property} label "${4:Label}"',documentation:`Declares a form bound to a command.`},{label:`contribute`,insertText:'contribute to ${1:Navigation}\n navigate to ${2:Screen}\n label "${3:Label}"',documentation:`Contributes an entry to a slot of the shell, such as navigation.`},{label:`navigation sidebar extends`,insertText:'navigation ${1|sidebar,topbar|} ${2|extends,overrides,inherits|}\n item ${3:id} title "${4:Title}" target ${5:Module.Feature}',documentation:"Changes a navigation region for this module: `extends` adds items after the application's, `overrides` replaces them, `inherits` shows the application's."},...r],a=[t,e,...n,{label:`description`,insertText:'description "${1:what this feature is for}"',documentation:`A human-readable description.`},{label:`authorize`,insertText:"authorize ${1:PolicyName}",documentation:`Policies that must pass for everything in the feature.`},{label:`depends on`,insertText:"depends on ${1:Name}",documentation:`Declares an allowed module or feature dependency. Sibling feature names resolve before module names.`},{label:`import "…"`,insertText:'import "${1:*.play}"',documentation:"Imports `.play` files into this feature — their top level is the feature's body."},{label:`feature`,insertText:`feature \${1:Name}
5
+ \${3:slot}`,documentation:`Declares a reusable screen shape that fits a slot of the shell.`},{label:`dialog template`,insertText:"dialog template ${1:Name}\n ${2:body}\n ${3:actions}",documentation:`Declares a reusable dialog shape that opens over the shell.`},{label:`form`,insertText:'form ${1:Name} for ${2:Command}\n field ${3:property} label "${4:Label}"',documentation:`Declares a form bound to a command.`},{label:`contribute`,insertText:'contribute to ${1:Navigation}\n navigate to ${2:Screen}\n label "${3:Label}"',documentation:`Contributes an entry to a slot of the shell, such as navigation.`},{label:`navigation sidebar extends`,insertText:'navigation ${1|sidebar,topbar|} ${2|extends,overrides,inherits|}\n item ${3:id} title "${4:Title}" target ${5:Module.Feature}',documentation:"Changes a navigation region for this module: `extends` adds items after the application's, `overrides` replaces them, `inherits` shows the application's."},...r],a=[n,t,...e,{label:`description`,insertText:'description "${1:what this feature is for}"',documentation:`A human-readable description.`},{label:`authorize`,insertText:"authorize ${1:PolicyName}",documentation:`Policies that must pass for everything in the feature.`},{label:`depends on`,insertText:"depends on ${1:Name}",documentation:`Declares an allowed module or feature dependency. Sibling feature names resolve before module names.`},{label:`import "…"`,insertText:'import "${1:*.play}"',documentation:"Imports `.play` files into this feature — their top level is the feature's body."},{label:`feature`,insertText:`feature \${1:Name}
6
6
  `,documentation:`Declares a nested sub-feature.`},{label:`slice StateChange`,insertText:`slice StateChange \${1:Name}
7
7
  `,documentation:`A command → events flow; something that changes the system.`},{label:`slice StateView`,insertText:`slice StateView \${1:Name}
8
8
  `,documentation:`A query + projection + screen; something that reads the system.`},{label:`slice Automation`,insertText:`slice Automation \${1:Name}
9
9
  `,documentation:`A reaction or reducer; something that runs when something happens.`},{label:`slice Translate`,insertText:`slice Translate \${1:Name}
10
- `,documentation:`A capture; converts external data into events.`},{label:`contribute`,insertText:'contribute to ${1:Navigation}\n navigate to ${2:Screen}\n label "${3:Label}"',documentation:`Contributes an entry to a slot of the shell, such as navigation.`},...r],o=[e,{label:`passive`,insertText:`passive`,documentation:`Opts into replay on demand for command decisions, not materialization. Default active, never inferred; queries and screens cannot observe this model.`},{label:`description`,insertText:'description "${1:what one instance holds}"',documentation:`A human-readable description.`},{label:`file`,insertText:"file ${1:Path}",documentation:`Names the file this read model is realized by.`},{label:`property`,insertText:"${1:property} ${2:Type}",documentation:`A property of the read model — a name and a type reference.`}],s=[{label:`from`,insertText:"from ${1:Source.Stream}",documentation:`Observe matching routed facts only, without filtering stream ids. ESM v10.`},{label:`description`,insertText:'description "${1:what the reducer does}"',documentation:`A human-readable description.`},{label:`on`,insertText:"on ${1:EventType}\n ```csharp\n ${2}\n ```",documentation:`A rule applied when the event occurs, in code or from a file.`}],c=[{label:`description`,insertText:'description "${1:input surface intent}"',documentation:`Report-only description of the form.`},{label:`populate via query`,insertText:"populate via query ${1:Query} by ${2:parameter}",documentation:`Fills the form from a query before it is shown.`},{label:`populate from item`,insertText:`populate from item`,documentation:`Fills the form from the item the screen was opened for.`},{label:`field`,insertText:'field ${1:property} label "${2:Label}"',documentation:`A form field bound to a command property.`},...r],l=[{label:`navigate to`,insertText:"navigate to ${1:Screen}",documentation:`The screen the entry opens.`},{label:`label`,insertText:'label "${1:Label}"',documentation:`The text of the entry.`},{label:`order`,insertText:"order ${1:10}",documentation:`Where the entry sits among the others; lower comes first.`}],u=[{label:`description`,insertText:'description "${1:what the behavior does}"',documentation:`A human-readable description.`},{label:`parameter`,insertText:"parameter ${1:name} ${2:Type}",documentation:`A value the behavior is given where it is attached.`},{label:`order`,insertText:"order ${1:10}",documentation:`The order behaviors attached to the same element run in.`},{label:`on`,insertText:"on ${1|click,select,submit,change,load,unload,enter,leave|}\n ${2:execute command}",documentation:`Wires what happens on an interaction.`}],step=(e,t,n)=>({label:e,insertText:t,documentation:n}),d=[step(`execute`,"execute ${1:command}",`Runs a command.`),step(`navigate to`,"navigate to ${1:Screen}",`Opens a screen.`),step(`open`,"open ${1:Dialog}",`Opens a dialog.`),step(`close`,`close`,`Closes the dialog.`),step(`refresh`,"refresh ${1:query}",`Reloads a query.`),step(`set`,"set ${1:name} ${2:value}",`Sets a value.`),step(`notify`,'notify ${1|info,warning,error|} "${2:message}"',`Shows a notification.`),step(`confirm`,`confirm \${1:message}
10
+ `,documentation:`A capture; converts external data into events.`},{label:`contribute`,insertText:'contribute to ${1:Navigation}\n navigate to ${2:Screen}\n label "${3:Label}"',documentation:`Contributes an entry to a slot of the shell, such as navigation.`},...r],o=[t,{label:`passive`,insertText:`passive`,documentation:`Opts into replay on demand for command decisions, not materialization. Default active, never inferred; queries and screens cannot observe this model.`},{label:`description`,insertText:'description "${1:what one instance holds}"',documentation:`A human-readable description.`},{label:`file`,insertText:"file ${1:Path}",documentation:`Names the file this read model is realized by.`},{label:`property`,insertText:"${1:property} ${2:Type}",documentation:`A property of the read model — a name and a type reference.`}],s=[{label:`from`,insertText:"from ${1:Source.Stream}",documentation:`Observe matching routed facts only, without filtering stream ids. ESM v10.`},{label:`description`,insertText:'description "${1:what the reducer does}"',documentation:`A human-readable description.`},{label:`on`,insertText:"on ${1:EventType}\n ```csharp\n ${2}\n ```",documentation:`A rule applied when the event occurs, in code or from a file.`}],c=[{label:`description`,insertText:'description "${1:input surface intent}"',documentation:`Report-only description of the form.`},{label:`populate via query`,insertText:"populate via query ${1:Query} by ${2:parameter}",documentation:`Fills the form from a query before it is shown.`},{label:`populate from item`,insertText:`populate from item`,documentation:`Fills the form from the item the screen was opened for.`},{label:`field`,insertText:'field ${1:property} label "${2:Label}"',documentation:`A form field bound to a command property.`},...r],l=[{label:`navigate to`,insertText:"navigate to ${1:Screen}",documentation:`The screen the entry opens.`},{label:`label`,insertText:'label "${1:Label}"',documentation:`The text of the entry.`},{label:`order`,insertText:"order ${1:10}",documentation:`Where the entry sits among the others; lower comes first.`}],u=[{label:`description`,insertText:'description "${1:what the behavior does}"',documentation:`A human-readable description.`},{label:`parameter`,insertText:"parameter ${1:name} ${2:Type}",documentation:`A value the behavior is given where it is attached.`},{label:`order`,insertText:"order ${1:10}",documentation:`The order behaviors attached to the same element run in.`},{label:`on`,insertText:"on ${1|click,select,submit,change,load,unload,enter,leave|}\n ${2:execute command}",documentation:`Wires what happens on an interaction.`}],step=(e,t,n)=>({label:e,insertText:t,documentation:n}),d=[step(`execute`,"execute ${1:command}",`Runs a command.`),step(`navigate to`,"navigate to ${1:Screen}",`Opens a screen.`),step(`open`,"open ${1:Dialog}",`Opens a dialog.`),step(`close`,`close`,`Closes the dialog.`),step(`refresh`,"refresh ${1:query}",`Reloads a query.`),step(`set`,"set ${1:name} ${2:value}",`Sets a value.`),step(`notify`,'notify ${1|info,warning,error|} "${2:message}"',`Shows a notification.`),step(`confirm`,`confirm \${1:message}
11
11
  on success
12
12
  \${2:execute command}`,`Asks before continuing.`),step(`raise`,"raise ${1:Trigger}",`Raises a trigger.`)],f=[step(`on success`,`on success
13
13
  \${1:notify info "Done"}`,`What happens when it succeeds.`),step(`on failure`,`on failure
@@ -1 +1 @@
1
- {"version":3,"file":"scope-items.js","names":["interactionItems","moduleScopeItems","purposeReferenceItem","documentationItem","exampleDeclarationItems","featureScopeItems","readModelItems","reducerItems","formItems","contributeItems","behaviorItems","actionStepItems","outcomeItems","personaItems","authenticationItems","onboardingItems","inviteMemberItems","legalTermsItems","emailItems","seedItems","themeItems","uiProfileItems","profileRootTemplateItems","profileAppearanceItems","profileIdentityItems","profileSampleDataItems","sampleDataItems","sampleShapeItems","layoutItems","toolbarItems","navigationItems","templateItems"],"sources":["../../scope-items.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { CompletionEntry } from './completion-items';\nimport { exampleDeclarationItems } from './example-declaration-items';\nimport { documentationItem } from './documentation-item';\nimport { purposeReferenceItem } from './purpose-items';\n\nconst interactions = ['click', 'double click', 'select', 'submit', 'change', 'load', 'unload', 'enter', 'leave'];\n\nconst interactionItems: CompletionEntry[] = [\n { label: 'on', insertText: 'on ${1|click,select,submit,change,load,unload,enter,leave|}\\n ${2:execute command}', documentation: 'Wires what happens on an interaction - a click, a submit, entering or leaving the screen.' },\n { label: 'uses', insertText: 'uses ${1:Behavior}', documentation: 'Attaches a named behavior declared at the top level.' },\n];\n\nexport const moduleScopeItems: CompletionEntry[] = [\n purposeReferenceItem,\n documentationItem,\n ...exampleDeclarationItems,\n { label: 'description', insertText: 'description \"${1:what this module is for}\"', documentation: 'A human-readable description.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'Policies that must pass for everything in the module.' },\n { label: 'depends on', insertText: 'depends on ${1:Name}', documentation: 'Declares an allowed module or feature dependency. Opts this container into independent explicit-reference checks.' },\n { label: 'import \"…\"', insertText: 'import \"${1:*/*.play}\"', documentation: 'Imports `.play` files into this module — their top level is the module\\'s body.' },\n { label: 'feature', insertText: 'feature ${1:Name}\\n ', documentation: 'Groups related slices into a vertical feature.' },\n { label: 'screen', insertText: 'screen ${1:Name}\\n data ${2:ReadModel} via query ${3:QueryName}', documentation: 'Declares a module-level UI screen.' },\n { label: 'screen template', insertText: 'screen template ${1:Name}\\n fits slot ${2:content}\\n\\n ${3:slot}', documentation: 'Declares a reusable screen shape that fits a slot of the shell.' },\n { label: 'dialog template', insertText: 'dialog template ${1:Name}\\n ${2:body}\\n ${3:actions}', documentation: 'Declares a reusable dialog shape that opens over the shell.' },\n { label: 'form', insertText: 'form ${1:Name} for ${2:Command}\\n field ${3:property} label \"${4:Label}\"', documentation: 'Declares a form bound to a command.' },\n { label: 'contribute', insertText: 'contribute to ${1:Navigation}\\n navigate to ${2:Screen}\\n label \"${3:Label}\"', documentation: 'Contributes an entry to a slot of the shell, such as navigation.' },\n { label: 'navigation sidebar extends', insertText: 'navigation ${1|sidebar,topbar|} ${2|extends,overrides,inherits|}\\n item ${3:id} title \"${4:Title}\" target ${5:Module.Feature}', documentation: 'Changes a navigation region for this module: `extends` adds items after the application\\'s, `overrides` replaces them, `inherits` shows the application\\'s.' },\n ...interactionItems,\n];\n\nexport const featureScopeItems: CompletionEntry[] = [\n purposeReferenceItem,\n documentationItem,\n ...exampleDeclarationItems,\n { label: 'description', insertText: 'description \"${1:what this feature is for}\"', documentation: 'A human-readable description.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'Policies that must pass for everything in the feature.' },\n { label: 'depends on', insertText: 'depends on ${1:Name}', documentation: 'Declares an allowed module or feature dependency. Sibling feature names resolve before module names.' },\n { label: 'import \"…\"', insertText: 'import \"${1:*.play}\"', documentation: 'Imports `.play` files into this feature — their top level is the feature\\'s body.' },\n { label: 'feature', insertText: 'feature ${1:Name}\\n ', documentation: 'Declares a nested sub-feature.' },\n { label: 'slice StateChange', insertText: 'slice StateChange ${1:Name}\\n ', documentation: 'A command → events flow; something that changes the system.' },\n { label: 'slice StateView', insertText: 'slice StateView ${1:Name}\\n ', documentation: 'A query + projection + screen; something that reads the system.' },\n { label: 'slice Automation', insertText: 'slice Automation ${1:Name}\\n ', documentation: 'A reaction or reducer; something that runs when something happens.' },\n { label: 'slice Translate', insertText: 'slice Translate ${1:Name}\\n ', documentation: 'A capture; converts external data into events.' },\n { label: 'contribute', insertText: 'contribute to ${1:Navigation}\\n navigate to ${2:Screen}\\n label \"${3:Label}\"', documentation: 'Contributes an entry to a slot of the shell, such as navigation.' },\n ...interactionItems,\n];\n\nexport const readModelItems: CompletionEntry[] = [\n documentationItem,\n { label: 'passive', insertText: 'passive', documentation: 'Opts into replay on demand for command decisions, not materialization. Default active, never inferred; queries and screens cannot observe this model.' },\n { label: 'description', insertText: 'description \"${1:what one instance holds}\"', documentation: 'A human-readable description.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the file this read model is realized by.' },\n { label: 'property', insertText: '${1:property} ${2:Type}', documentation: 'A property of the read model — a name and a type reference.' },\n];\n\nexport const reducerItems: CompletionEntry[] = [\n { label: 'from', insertText: 'from ${1:Source.Stream}', documentation: 'Observe matching routed facts only, without filtering stream ids. ESM v10.' },\n { label: 'description', insertText: 'description \"${1:what the reducer does}\"', documentation: 'A human-readable description.' },\n { label: 'on', insertText: 'on ${1:EventType}\\n ```csharp\\n ${2}\\n ```', documentation: 'A rule applied when the event occurs, in code or from a file.' },\n];\n\nexport const formItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:input surface intent}\"', documentation: 'Report-only description of the form.' },\n { label: 'populate via query', insertText: 'populate via query ${1:Query} by ${2:parameter}', documentation: 'Fills the form from a query before it is shown.' },\n { label: 'populate from item', insertText: 'populate from item', documentation: 'Fills the form from the item the screen was opened for.' },\n { label: 'field', insertText: 'field ${1:property} label \"${2:Label}\"', documentation: 'A form field bound to a command property.' },\n ...interactionItems,\n];\n\nexport const contributeItems: CompletionEntry[] = [\n { label: 'navigate to', insertText: 'navigate to ${1:Screen}', documentation: 'The screen the entry opens.' },\n { label: 'label', insertText: 'label \"${1:Label}\"', documentation: 'The text of the entry.' },\n { label: 'order', insertText: 'order ${1:10}', documentation: 'Where the entry sits among the others; lower comes first.' },\n];\n\nexport const behaviorItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:what the behavior does}\"', documentation: 'A human-readable description.' },\n { label: 'parameter', insertText: 'parameter ${1:name} ${2:Type}', documentation: 'A value the behavior is given where it is attached.' },\n { label: 'order', insertText: 'order ${1:10}', documentation: 'The order behaviors attached to the same element run in.' },\n { label: 'on', insertText: 'on ${1|click,select,submit,change,load,unload,enter,leave|}\\n ${2:execute command}', documentation: 'Wires what happens on an interaction.' },\n];\n\nconst step = (label: string, insertText: string, documentation: string): CompletionEntry => ({ label, insertText, documentation });\n\n// What an interaction does, and what can follow an action's outcome.\nexport const actionStepItems: CompletionEntry[] = [\n step('execute', 'execute ${1:command}', 'Runs a command.'),\n step('navigate to', 'navigate to ${1:Screen}', 'Opens a screen.'),\n step('open', 'open ${1:Dialog}', 'Opens a dialog.'),\n step('close', 'close', 'Closes the dialog.'),\n step('refresh', 'refresh ${1:query}', 'Reloads a query.'),\n step('set', 'set ${1:name} ${2:value}', 'Sets a value.'),\n step('notify', 'notify ${1|info,warning,error|} \"${2:message}\"', 'Shows a notification.'),\n step('confirm', 'confirm ${1:message}\\n on success\\n ${2:execute command}', 'Asks before continuing.'),\n step('raise', 'raise ${1:Trigger}', 'Raises a trigger.'),\n];\n\nexport const outcomeItems: CompletionEntry[] = [\n step('on success', 'on success\\n ${1:notify info \"Done\"}', 'What happens when it succeeds.'),\n step('on failure', 'on failure\\n ${1:notify error \"Failed\"}', 'What happens when it fails.'),\n ...actionStepItems,\n];\n\nexport const personaItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:who they are}\"', documentation: 'A human-readable description.' },\n { label: 'goal', insertText: 'goal \"${1:what they want to achieve}\"', documentation: 'A goal of this persona.' },\n { label: 'policy', insertText: 'policy ${1:PolicyName}', documentation: 'A policy this persona holds.' },\n { label: 'position', insertText: 'position ${1:0} ${2:0}', documentation: 'Where the persona sits on the personas canvas.' },\n { label: 'size', insertText: 'size ${1:300} ${2:180}', documentation: 'How big the persona is on the personas canvas.' },\n];\n\nexport const authenticationItems: CompletionEntry[] = [\n { label: 'provider', insertText: 'provider ${1:Name}', documentation: 'An identity provider.' },\n { label: 'provider (named)', insertText: 'provider ${1:Kind} name ${2:Name}', documentation: 'An identity provider of a kind, under its own name.' },\n];\n\nexport const onboardingItems: CompletionEntry[] = [\n { label: 'signup (creates tenant)', insertText: 'signup open creates tenant', documentation: 'Turns self-signup on; a sign-up creates a tenant for the person signing up.' },\n { label: 'signup (joins tenant)', insertText: 'signup open joins tenant', documentation: 'Turns self-signup on; a sign-up asks to join an existing tenant.' },\n { label: 'invite tenant', insertText: 'invite tenant as ${1:Persona}', documentation: 'An invitation that creates a tenant for the invitee, who becomes the persona.' },\n { label: 'invite member', insertText: 'invite member\\n by ${1:Persona}\\n grant ${2:Persona}', documentation: 'An invitation into an existing tenant: who may send it and which personas it grants.' },\n { label: 'legal terms', insertText: 'legal terms\\n file ${1:Legal/terms-of-service.md}', documentation: 'The documents a newcomer must accept, as files relative to the repository root.' },\n { label: 'offering', insertText: 'offering ${1:Name}', documentation: 'The offering a new tenant starts on. The name is opaque to the model.' },\n { label: 'emails', insertText: 'emails\\n invitation file ${1:Emails/invitation.html}\\n welcome file ${2:Emails/welcome.html}\\n images ${3:Emails/Images}', documentation: 'A template file per onboarding email and the folder holding their images.' },\n];\n\nexport const inviteMemberItems: CompletionEntry[] = [\n { label: 'by', insertText: 'by ${1:Persona}', documentation: 'The personas that may send the invitation.' },\n { label: 'grant', insertText: 'grant ${1:Persona}', documentation: 'The personas the invitation gives the invitee.' },\n];\n\nexport const legalTermsItems: CompletionEntry[] = [\n { label: 'file', insertText: 'file ${1:Legal/terms-of-service.md}', documentation: 'A document the newcomer must accept, relative to the repository root.' },\n];\n\nexport const emailItems: CompletionEntry[] = [\n { label: 'invitation', insertText: 'invitation file ${1:Emails/invitation.html}', documentation: 'The template of the invitation email.' },\n { label: 'welcome', insertText: 'welcome file ${1:Emails/welcome.html}', documentation: 'The template of the welcome email.' },\n { label: 'signupDeclined', insertText: 'signupDeclined file ${1:Emails/signup-declined.html}', documentation: 'The template of the email sent when a sign-up is declined.' },\n { label: 'images', insertText: 'images ${1:Emails/Images}', documentation: 'The folder, relative to the repository root, holding the images the templates use.' },\n];\n\nexport const seedItems: CompletionEntry[] = [\n { label: 'for', insertText: 'for ${1:\"event-source-id\"}\\n ${2:EventType}\\n ${3:property} = ${4:value}', documentation: 'Events to seed for one event source id.' },\n { label: 'position', insertText: 'position ${1:0} ${2:0}', documentation: 'Where the seed data sits on the seed data canvas.' },\n];\n\nexport const themeItems: CompletionEntry[] = [\n { label: 'compatible with', insertText: 'compatible with ${1:Package}', documentation: 'A component package the theme is compatible with.' },\n];\n\nexport const uiProfileItems: CompletionEntry[] = [\n { label: 'target platform', insertText: 'target platform ${1:web}', documentation: 'The platforms the profile is for.' },\n { label: 'target size', insertText: 'target size ${1|compact,regular|}', documentation: 'The screen sizes the profile is for.' },\n { label: 'packages', insertText: 'packages\\n ${1:Package}', documentation: 'The component packages the profile uses.' },\n { label: 'layout', insertText: 'layout ${1:Layout}', documentation: 'The layout of the profile. Older form of `root template`; prefer `root template`.' },\n { label: 'theme', insertText: 'theme ${1:Theme}', documentation: 'The theme of the profile, named by a declared theme\\'s identifier.' },\n { label: 'theme (package-provided)', insertText: 'theme \"${1:Scene Default Light}\"', documentation: 'The theme of the profile, named by the quoted display name of a theme a component package provides.' },\n { label: 'root template', insertText: 'root template ${1:Template}\\n option ${2:navigationMode} ${3:slim}', documentation: 'The template the whole application is drawn in: an own template, or `blueprint <Blueprint> <Name> [version \"<range>\"]`, with the options the shell exposes.' },\n { label: 'root template blueprint', insertText: 'root template blueprint ${1:Blueprint} ${2:Template} version \"${3:^1.0}\"', documentation: 'A root template a blueprint package ships, pinned to a semver range.' },\n { label: 'identity', insertText: 'identity\\n name \"${1:Name}\"\\n logo ${2|initials \"AB\",icon box,image \"data:image/svg+xml;base64,...\"|}\\n show name ${3|true,false|}', documentation: 'What the application calls itself and the mark it wears: `name`, `logo initials|icon|image` and `show name`.' },\n { label: 'appearance', insertText: 'appearance\\n color scheme ${1|light,dark,system|}\\n accent \"${2:#4f46e5}\"\\n corners ${3|sharp,default,round|}\\n font ${4:inter}', documentation: 'How the application looks regardless of the shell: colour scheme, accent colour, corners and font.' },\n { label: 'new screens use template', insertText: 'new screens use template ${1:Template}', documentation: 'The template a new screen starts from in the designer.' },\n { label: 'sample data', insertText: 'sample data\\n active ${1:Pack}', documentation: 'The sample data the whole application previews with, chosen once here.' },\n];\n\nexport const profileRootTemplateItems: CompletionEntry[] = [\n { label: 'option', insertText: 'option ${1:name} ${2:value}', documentation: 'Sets one of the shell\\'s own options, for example `option navigationMode slim`. The value is a word, a quoted string, a number, `true` or `false`.' },\n];\n\nexport const profileAppearanceItems: CompletionEntry[] = [\n { label: 'color scheme', insertText: 'color scheme ${1|light,dark,system|}', documentation: 'The colour scheme of the application: light, dark or follow the system.' },\n { label: 'accent', insertText: 'accent \"${1:#4f46e5}\"', documentation: 'The accent colour of the application.' },\n { label: 'corners', insertText: 'corners ${1|sharp,default,round|}', documentation: 'How rounded the application\\'s corners are: sharp, default or round.' },\n { label: 'font', insertText: 'font ${1|inter,ibm-plex-sans,source-serif-4,system-ui|}', documentation: 'The font of the application, an id from Scene\\'s font catalog.' },\n];\n\nexport const profileIdentityItems: CompletionEntry[] = [\n { label: 'name', insertText: 'name \"${1:Name}\"', documentation: 'What the application calls itself in its shell; leave it out to take the application\\'s own name.' },\n { label: 'logo initials', insertText: 'logo initials \"${1:AB}\"', documentation: 'A logo drawn from one or two characters.' },\n { label: 'logo icon', insertText: 'logo icon ${1|box,layers,home,users,receipt,package,database,palette|}', documentation: 'A logo drawn from one of Scene\\'s logo icons.' },\n { label: 'logo image', insertText: 'logo image \"data:image/svg+xml;base64,${1}\"', documentation: 'A logo image (PNG, JPG, SVG or WebP, up to 400 KB) as a base64 data URI.' },\n { label: 'show name', insertText: 'show name ${1|true,false|}', documentation: 'Whether the name is drawn beside the logo.' },\n];\n\nexport const profileSampleDataItems: CompletionEntry[] = [\n { label: 'active', insertText: 'active ${1:Pack}', documentation: 'The active sample data pack of the whole application: one declared in the document, or `blueprint <id>`.' },\n { label: 'shape maps to', insertText: 'shape ${1:Shape} maps to ${2:ReadModel}', documentation: 'Maps a sample data shape to the read model it supplies rows for.' },\n { label: 'bind', insertText: 'bind ${1:ReadModel} to ${2:Pack}', documentation: 'A rare override: binds one read model to a pack.' },\n];\n\nexport const sampleDataItems: CompletionEntry[] = [\n { label: 'title', insertText: 'title \"${1:Title}\"', documentation: 'The display title of the pack.' },\n { label: 'locale', insertText: 'locale ${1:en-GB}', documentation: 'The BCP 47 locale tag of the data.' },\n { label: 'shape', insertText: 'shape ${1:ReadModel}\\n row\\n ${2:field} = ${3:\"value\"}', documentation: 'The rows for one shape: the read model of the same name, or the one a ui profile maps it to.' },\n];\n\nexport const sampleShapeItems: CompletionEntry[] = [\n { label: 'row', insertText: 'row\\n ${1:field} = ${2:\"value\"}', documentation: 'One row of the shape.' },\n];\n\nexport const layoutItems: CompletionEntry[] = [\n { label: 'slot', insertText: '${1:slot}', documentation: 'A named slot of the shell.' },\n { label: 'slot contributes', insertText: '${1:slot} contributes ${2:Name}', documentation: 'A slot other declarations contribute to, such as `navigation contributes Navigation`.' },\n { label: 'navigation topbar', insertText: 'navigation ${1|topbar,sidebar|}\\n logo image \"${2:/logo.svg}\" title \"${3:Application}\"\\n item ${4:id} title \"${5:Title}\" target ${6:Module}', documentation: 'The application\\'s navigation region: a logo and items that target a module or feature.' },\n { label: 'arrangement', insertText: 'arrangement flow\\n column\\n ${1:slot}', documentation: 'How the slots are placed.' },\n];\n\nexport const toolbarItems: CompletionEntry[] = [\n { label: 'button', insertText: 'button ${1:id} title \"${2:Title}\" slice ${3:Module.Feature.Slice}', documentation: 'A button that invokes a State Change slice. The slice names the command and the dialog it opens over the page.' },\n { label: 'button (with emphasis)', insertText: 'button ${1:id} title \"${2:Title}\" slice ${3:Module.Feature.Slice} emphasis ${4|primary,secondary,quiet|} icon ${5:icon}', documentation: 'A toolbar button with an emphasis and an icon.' },\n { label: 'item action', insertText: 'item ${1:name} action ${2:Command}', documentation: 'A toolbar entry that runs a command.' },\n { label: 'item navigate', insertText: 'item ${1:name} navigate to ${2:Screen}', documentation: 'A toolbar entry that navigates to a screen.' },\n];\n\nexport const navigationItems: CompletionEntry[] = [\n { label: 'logo', insertText: 'logo image \"${1:/logo.svg}\" title \"${2:Application}\"', documentation: 'The application logo. Declared once, in a layout.' },\n { label: 'item', insertText: 'item ${1:id} title \"${2:Title}\" target ${3:Module.Feature}', documentation: 'A navigation item with a title, an optional `icon`, a `target` module or feature and an optional rendering `slot`. Sidebar items may nest `item` lines.' },\n { label: 'item (with slot)', insertText: 'item ${1:id} title \"${2:Title}\" icon ${3:icon} target ${4:Module.Feature} slot ${5:content}', documentation: 'A navigation item that renders its target into a named layout slot.' },\n];\n\nexport const templateItems: CompletionEntry[] = [\n { label: 'fits slot', insertText: 'fits slot ${1:content}', documentation: 'The slot of the shell the template fits.' },\n ...layoutItems,\n { label: 'on', insertText: 'on ${1|enter,leave,load,unload|}\\n ${2:refresh query}', documentation: 'Wires what happens on an interaction.' },\n];\n\nexport const interactionNames = interactions;\n"],"mappings":"gPAUA,MAAMA,EAAsC,CACxC,CAAE,MAAO,KAAM,WAAY,wFAAyF,cAAe,2FAA4F,EAC/N,CAAE,MAAO,OAAQ,WAAY,qBAAsB,cAAe,sDAAuD,CAC7H,EAEaC,EAAsC,CAC/CC,EACAC,EACA,GAAGC,EACH,CAAE,MAAO,cAAe,WAAY,6CAA8C,cAAe,+BAAgC,EACjI,CAAE,MAAO,YAAa,WAAY,4BAA6B,cAAe,uDAAwD,EACtI,CAAE,MAAO,aAAc,WAAY,uBAAwB,cAAe,mHAAoH,EAC9L,CAAE,MAAO,aAAc,WAAY,yBAA0B,cAAe,gFAAkF,EAC9J,CAAE,MAAO,UAAW,WAAY;MAA2B,cAAe,gDAAiD,EAC3H,CAAE,MAAO,SAAU,WAAY,qEAAsE,cAAe,oCAAqC,EACzJ,CAAE,MAAO,kBAAmB,WAAY;;;gBAA0E,cAAe,iEAAkE,EACnM,CAAE,MAAO,kBAAmB,WAAY,6DAA8D,cAAe,6DAA8D,EACnL,CAAE,MAAO,OAAQ,WAAY,8EAA+E,cAAe,qCAAsC,EACjK,CAAE,MAAO,aAAc,WAAY,qFAAsF,cAAe,kEAAmE,EAC3M,CAAE,MAAO,6BAA8B,WAAY,mIAAoI,cAAe,2JAA8J,EACpW,GAAGJ,CACP,EAEaK,EAAuC,CAChDH,EACAC,EACA,GAAGC,EACH,CAAE,MAAO,cAAe,WAAY,8CAA+C,cAAe,+BAAgC,EAClI,CAAE,MAAO,YAAa,WAAY,4BAA6B,cAAe,wDAAyD,EACvI,CAAE,MAAO,aAAc,WAAY,uBAAwB,cAAe,sGAAuG,EACjL,CAAE,MAAO,aAAc,WAAY,uBAAwB,cAAe,kFAAoF,EAC9J,CAAE,MAAO,UAAW,WAAY;MAA2B,cAAe,gCAAiC,EAC3G,CAAE,MAAO,oB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B,cAAe,oCAAqC,EACxG,CAAE,MAAO,QAAS,WAAY,mEAAoE,cAAe,8FAA+F,CACpN,EAEaC,EAAsC,CAC/C,CAAE,MAAO,MAAO,WAAY,qCAAsC,cAAe,uBAAwB,CAC7G,EAEaC,EAAiC,CAC1C,CAAE,MAAO,OAAQ,WAAY,YAAa,cAAe,4BAA6B,EACtF,CAAE,MAAO,mBAAoB,WAAY,kCAAmC,cAAe,uFAAwF,EACnL,CAAE,MAAO,oBAAqB,WAAY,oJAAqJ,cAAe,wFAA0F,EACxS,CAAE,MAAO,cAAe,WAAY;;oBAAmD,cAAe,2BAA4B,CACtI,EAEaC,EAAkC,CAC3C,CAAE,MAAO,SAAU,WAAY,oEAAqE,cAAe,gHAAiH,EACpO,CAAE,MAAO,yBAA0B,WAAY,0HAA2H,cAAe,gDAAiD,EAC1O,CAAE,MAAO,cAAe,WAAY,qCAAsC,cAAe,sCAAuC,EAChI,CAAE,MAAO,gBAAiB,WAAY,yCAA0C,cAAe,6CAA8C,CACjJ,EAEaC,EAAqC,CAC9C,CAAE,MAAO,OAAQ,WAAY,uDAAwD,cAAe,mDAAoD,EACxJ,CAAE,MAAO,OAAQ,WAAY,6DAA8D,cAAe,yJAA0J,EACpQ,CAAE,MAAO,mBAAoB,WAAY,8FAA+F,cAAe,qEAAsE,CACjO,EAEaC,EAAmC,CAC5C,CAAE,MAAO,YAAa,WAAY,yBAA0B,cAAe,0CAA2C,EACtH,GAAGH,EACH,CAAE,MAAO,KAAM,WAAY,2DAA4D,cAAe,uCAAwC,CAClJ"}
1
+ {"version":3,"file":"scope-items.js","names":["interactionItems","moduleScopeItems","purposeReferenceItem","documentationItem","exampleDeclarationItems","featureScopeItems","readModelItems","reducerItems","formItems","contributeItems","behaviorItems","actionStepItems","outcomeItems","personaItems","authenticationItems","onboardingItems","inviteMemberItems","legalTermsItems","emailItems","seedItems","themeItems","uiProfileItems","profileRootTemplateItems","profileAppearanceItems","profileIdentityItems","profileSampleDataItems","sampleDataItems","sampleShapeItems","layoutItems","toolbarItems","navigationItems","templateItems"],"sources":["../../scope-items.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { CompletionEntry } from './completion-items';\nimport { exampleDeclarationItems } from './example-declaration-items';\nimport { documentationItem } from './documentation-item';\nimport { purposeReferenceItem } from './purpose-items';\n\nconst interactions = ['click', 'double click', 'select', 'submit', 'change', 'load', 'unload', 'enter', 'leave'];\n\nconst interactionItems: CompletionEntry[] = [\n { label: 'on', insertText: 'on ${1|click,select,submit,change,load,unload,enter,leave|}\\n ${2:execute command}', documentation: 'Wires what happens on an interaction - a click, a submit, entering or leaving the screen.' },\n { label: 'uses', insertText: 'uses ${1:Behavior}', documentation: 'Attaches a named behavior declared at the top level.' },\n];\n\nexport const moduleScopeItems: CompletionEntry[] = [\n purposeReferenceItem,\n documentationItem,\n ...exampleDeclarationItems,\n { label: 'description', insertText: 'description \"${1:what this module is for}\"', documentation: 'A human-readable description.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'Policies that must pass for everything in the module.' },\n { label: 'depends on', insertText: 'depends on ${1:Name}', documentation: 'Declares an allowed module or feature dependency. Opts this container into independent explicit-reference checks.' },\n { label: 'import \"…\"', insertText: 'import \"${1:*/*.play}\"', documentation: 'Imports `.play` files into this module — their top level is the module\\'s body.' },\n { label: 'feature', insertText: 'feature ${1:Name}\\n ', documentation: 'Groups related slices into a vertical feature.' },\n { label: 'screen', insertText: 'screen ${1:Name}\\n data ${2:ReadModel} via query ${3:QueryName}', documentation: 'Declares a module-level UI screen.' },\n { label: 'screen template', insertText: 'screen template ${1:Name}\\n fits slot ${2:content}\\n\\n ${3:slot}', documentation: 'Declares a reusable screen shape that fits a slot of the shell.' },\n { label: 'dialog template', insertText: 'dialog template ${1:Name}\\n ${2:body}\\n ${3:actions}', documentation: 'Declares a reusable dialog shape that opens over the shell.' },\n { label: 'form', insertText: 'form ${1:Name} for ${2:Command}\\n field ${3:property} label \"${4:Label}\"', documentation: 'Declares a form bound to a command.' },\n { label: 'contribute', insertText: 'contribute to ${1:Navigation}\\n navigate to ${2:Screen}\\n label \"${3:Label}\"', documentation: 'Contributes an entry to a slot of the shell, such as navigation.' },\n { label: 'navigation sidebar extends', insertText: 'navigation ${1|sidebar,topbar|} ${2|extends,overrides,inherits|}\\n item ${3:id} title \"${4:Title}\" target ${5:Module.Feature}', documentation: 'Changes a navigation region for this module: `extends` adds items after the application\\'s, `overrides` replaces them, `inherits` shows the application\\'s.' },\n ...interactionItems,\n];\n\nexport const featureScopeItems: CompletionEntry[] = [\n purposeReferenceItem,\n documentationItem,\n ...exampleDeclarationItems,\n { label: 'description', insertText: 'description \"${1:what this feature is for}\"', documentation: 'A human-readable description.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'Policies that must pass for everything in the feature.' },\n { label: 'depends on', insertText: 'depends on ${1:Name}', documentation: 'Declares an allowed module or feature dependency. Sibling feature names resolve before module names.' },\n { label: 'import \"…\"', insertText: 'import \"${1:*.play}\"', documentation: 'Imports `.play` files into this feature — their top level is the feature\\'s body.' },\n { label: 'feature', insertText: 'feature ${1:Name}\\n ', documentation: 'Declares a nested sub-feature.' },\n { label: 'slice StateChange', insertText: 'slice StateChange ${1:Name}\\n ', documentation: 'A command → events flow; something that changes the system.' },\n { label: 'slice StateView', insertText: 'slice StateView ${1:Name}\\n ', documentation: 'A query + projection + screen; something that reads the system.' },\n { label: 'slice Automation', insertText: 'slice Automation ${1:Name}\\n ', documentation: 'A reaction or reducer; something that runs when something happens.' },\n { label: 'slice Translate', insertText: 'slice Translate ${1:Name}\\n ', documentation: 'A capture; converts external data into events.' },\n { label: 'contribute', insertText: 'contribute to ${1:Navigation}\\n navigate to ${2:Screen}\\n label \"${3:Label}\"', documentation: 'Contributes an entry to a slot of the shell, such as navigation.' },\n ...interactionItems,\n];\n\nexport const readModelItems: CompletionEntry[] = [\n documentationItem,\n { label: 'passive', insertText: 'passive', documentation: 'Opts into replay on demand for command decisions, not materialization. Default active, never inferred; queries and screens cannot observe this model.' },\n { label: 'description', insertText: 'description \"${1:what one instance holds}\"', documentation: 'A human-readable description.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the file this read model is realized by.' },\n { label: 'property', insertText: '${1:property} ${2:Type}', documentation: 'A property of the read model — a name and a type reference.' },\n];\n\nexport const reducerItems: CompletionEntry[] = [\n { label: 'from', insertText: 'from ${1:Source.Stream}', documentation: 'Observe matching routed facts only, without filtering stream ids. ESM v10.' },\n { label: 'description', insertText: 'description \"${1:what the reducer does}\"', documentation: 'A human-readable description.' },\n { label: 'on', insertText: 'on ${1:EventType}\\n ```csharp\\n ${2}\\n ```', documentation: 'A rule applied when the event occurs, in code or from a file.' },\n];\n\nexport const formItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:input surface intent}\"', documentation: 'Report-only description of the form.' },\n { label: 'populate via query', insertText: 'populate via query ${1:Query} by ${2:parameter}', documentation: 'Fills the form from a query before it is shown.' },\n { label: 'populate from item', insertText: 'populate from item', documentation: 'Fills the form from the item the screen was opened for.' },\n { label: 'field', insertText: 'field ${1:property} label \"${2:Label}\"', documentation: 'A form field bound to a command property.' },\n ...interactionItems,\n];\n\nexport const contributeItems: CompletionEntry[] = [\n { label: 'navigate to', insertText: 'navigate to ${1:Screen}', documentation: 'The screen the entry opens.' },\n { label: 'label', insertText: 'label \"${1:Label}\"', documentation: 'The text of the entry.' },\n { label: 'order', insertText: 'order ${1:10}', documentation: 'Where the entry sits among the others; lower comes first.' },\n];\n\nexport const behaviorItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:what the behavior does}\"', documentation: 'A human-readable description.' },\n { label: 'parameter', insertText: 'parameter ${1:name} ${2:Type}', documentation: 'A value the behavior is given where it is attached.' },\n { label: 'order', insertText: 'order ${1:10}', documentation: 'The order behaviors attached to the same element run in.' },\n { label: 'on', insertText: 'on ${1|click,select,submit,change,load,unload,enter,leave|}\\n ${2:execute command}', documentation: 'Wires what happens on an interaction.' },\n];\n\nconst step = (label: string, insertText: string, documentation: string): CompletionEntry => ({ label, insertText, documentation });\n\n// What an interaction does, and what can follow an action's outcome.\nexport const actionStepItems: CompletionEntry[] = [\n step('execute', 'execute ${1:command}', 'Runs a command.'),\n step('navigate to', 'navigate to ${1:Screen}', 'Opens a screen.'),\n step('open', 'open ${1:Dialog}', 'Opens a dialog.'),\n step('close', 'close', 'Closes the dialog.'),\n step('refresh', 'refresh ${1:query}', 'Reloads a query.'),\n step('set', 'set ${1:name} ${2:value}', 'Sets a value.'),\n step('notify', 'notify ${1|info,warning,error|} \"${2:message}\"', 'Shows a notification.'),\n step('confirm', 'confirm ${1:message}\\n on success\\n ${2:execute command}', 'Asks before continuing.'),\n step('raise', 'raise ${1:Trigger}', 'Raises a trigger.'),\n];\n\nexport const outcomeItems: CompletionEntry[] = [\n step('on success', 'on success\\n ${1:notify info \"Done\"}', 'What happens when it succeeds.'),\n step('on failure', 'on failure\\n ${1:notify error \"Failed\"}', 'What happens when it fails.'),\n ...actionStepItems,\n];\n\nexport const personaItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:who they are}\"', documentation: 'A human-readable description.' },\n { label: 'goal', insertText: 'goal \"${1:what they want to achieve}\"', documentation: 'A goal of this persona.' },\n { label: 'policy', insertText: 'policy ${1:PolicyName}', documentation: 'A policy this persona holds.' },\n { label: 'position', insertText: 'position ${1:0} ${2:0}', documentation: 'Where the persona sits on the personas canvas.' },\n { label: 'size', insertText: 'size ${1:300} ${2:180}', documentation: 'How big the persona is on the personas canvas.' },\n];\n\nexport const authenticationItems: CompletionEntry[] = [\n { label: 'provider', insertText: 'provider ${1:Name}', documentation: 'An identity provider.' },\n { label: 'provider (named)', insertText: 'provider ${1:Kind} name ${2:Name}', documentation: 'An identity provider of a kind, under its own name.' },\n];\n\nexport const onboardingItems: CompletionEntry[] = [\n { label: 'signup (creates tenant)', insertText: 'signup open creates tenant', documentation: 'Turns self-signup on; a sign-up creates a tenant for the person signing up.' },\n { label: 'signup (joins tenant)', insertText: 'signup open joins tenant', documentation: 'Turns self-signup on; a sign-up asks to join an existing tenant.' },\n { label: 'invite tenant', insertText: 'invite tenant as ${1:Persona}', documentation: 'An invitation that creates a tenant for the invitee, who becomes the persona.' },\n { label: 'invite member', insertText: 'invite member\\n by ${1:Persona}\\n grant ${2:Persona}', documentation: 'An invitation into an existing tenant: who may send it and which personas it grants.' },\n { label: 'legal terms', insertText: 'legal terms\\n file ${1:Legal/terms-of-service.md}', documentation: 'The documents a newcomer must accept, as files relative to the repository root.' },\n { label: 'offering', insertText: 'offering ${1:Name}', documentation: 'The offering a new tenant starts on. The name is opaque to the model.' },\n { label: 'emails', insertText: 'emails\\n invitation file ${1:Emails/invitation.html}\\n welcome file ${2:Emails/welcome.html}\\n images ${3:Emails/Images}', documentation: 'A template file per onboarding email and the folder holding their images.' },\n];\n\nexport const inviteMemberItems: CompletionEntry[] = [\n { label: 'by', insertText: 'by ${1:Persona}', documentation: 'The personas that may send the invitation.' },\n { label: 'grant', insertText: 'grant ${1:Persona}', documentation: 'The personas the invitation gives the invitee.' },\n];\n\nexport const legalTermsItems: CompletionEntry[] = [\n { label: 'file', insertText: 'file ${1:Legal/terms-of-service.md}', documentation: 'A document the newcomer must accept, relative to the repository root.' },\n];\n\nexport const emailItems: CompletionEntry[] = [\n { label: 'invitation', insertText: 'invitation file ${1:Emails/invitation.html}', documentation: 'The template of the invitation email.' },\n { label: 'welcome', insertText: 'welcome file ${1:Emails/welcome.html}', documentation: 'The template of the welcome email.' },\n { label: 'signupDeclined', insertText: 'signupDeclined file ${1:Emails/signup-declined.html}', documentation: 'The template of the email sent when a sign-up is declined.' },\n { label: 'images', insertText: 'images ${1:Emails/Images}', documentation: 'The folder, relative to the repository root, holding the images the templates use.' },\n];\n\nexport const seedItems: CompletionEntry[] = [\n { label: 'for', insertText: 'for ${1:\"event-source-id\"}\\n ${2:EventType}\\n ${3:property} = ${4:value}', documentation: 'Events to seed for one event source id.' },\n { label: 'position', insertText: 'position ${1:0} ${2:0}', documentation: 'Where the seed data sits on the seed data canvas.' },\n];\n\nexport const themeItems: CompletionEntry[] = [\n { label: 'compatible with', insertText: 'compatible with ${1:Package}', documentation: 'A component package the theme is compatible with.' },\n];\n\nexport const uiProfileItems: CompletionEntry[] = [\n { label: 'target platform', insertText: 'target platform ${1:web}', documentation: 'The platforms the profile is for.' },\n { label: 'target size', insertText: 'target size ${1|compact,regular|}', documentation: 'The screen sizes the profile is for.' },\n { label: 'packages', insertText: 'packages\\n ${1:Package}', documentation: 'The component packages the profile uses.' },\n { label: 'layout', insertText: 'layout ${1:Layout}', documentation: 'The layout of the profile. Older form of `root template`; prefer `root template`.' },\n { label: 'theme', insertText: 'theme ${1:Theme}', documentation: 'The theme of the profile, named by a declared theme\\'s identifier.' },\n { label: 'theme (package-provided)', insertText: 'theme \"${1:Scene Default Light}\"', documentation: 'The theme of the profile, named by the quoted display name of a theme a component package provides.' },\n { label: 'root template', insertText: 'root template ${1:Template}\\n option ${2:navigationMode} ${3:slim}', documentation: 'The template the whole application is drawn in: an own template, or `blueprint <Blueprint> <Name> [version \"<range>\"]`, with the options the shell exposes.' },\n { label: 'root template blueprint', insertText: 'root template blueprint ${1:Blueprint} ${2:Template} version \"${3:^1.0}\"', documentation: 'A root template a blueprint package ships, pinned to a semver range.' },\n { label: 'identity', insertText: 'identity\\n name \"${1:Name}\"\\n logo ${2|initials \"AB\",icon box,image \"data:image/svg+xml;base64,...\"|}\\n show name ${3|true,false|}', documentation: 'What the application calls itself and the mark it wears: `name`, `logo initials|icon|image` and `show name`.' },\n { label: 'appearance', insertText: 'appearance\\n color scheme ${1|light,dark,system|}\\n accent \"${2:#4f46e5}\"\\n corners ${3|sharp,default,round|}\\n font ${4:inter}', documentation: 'How the application looks regardless of the shell: colour scheme, accent colour, corners and font.' },\n { label: 'new screens use template', insertText: 'new screens use template ${1:Template}', documentation: 'The template a new screen starts from in the designer.' },\n { label: 'sample data', insertText: 'sample data\\n active ${1:Pack}', documentation: 'The sample data the whole application previews with, chosen once here.' },\n];\n\nexport const profileRootTemplateItems: CompletionEntry[] = [\n { label: 'option', insertText: 'option ${1:name} ${2:value}', documentation: 'Sets one of the shell\\'s own options, for example `option navigationMode slim`. The value is a word, a quoted string, a number, `true` or `false`.' },\n];\n\nexport const profileAppearanceItems: CompletionEntry[] = [\n { label: 'color scheme', insertText: 'color scheme ${1|light,dark,system|}', documentation: 'The colour scheme of the application: light, dark or follow the system.' },\n { label: 'accent', insertText: 'accent \"${1:#4f46e5}\"', documentation: 'The accent colour of the application.' },\n { label: 'corners', insertText: 'corners ${1|sharp,default,round|}', documentation: 'How rounded the application\\'s corners are: sharp, default or round.' },\n { label: 'font', insertText: 'font ${1|inter,ibm-plex-sans,source-serif-4,system-ui|}', documentation: 'The font of the application, an id from Scene\\'s font catalog.' },\n];\n\nexport const profileIdentityItems: CompletionEntry[] = [\n { label: 'name', insertText: 'name \"${1:Name}\"', documentation: 'What the application calls itself in its shell; leave it out to take the application\\'s own name.' },\n { label: 'logo initials', insertText: 'logo initials \"${1:AB}\"', documentation: 'A logo drawn from one or two characters.' },\n { label: 'logo icon', insertText: 'logo icon ${1|box,layers,home,users,receipt,package,database,palette|}', documentation: 'A logo drawn from one of Scene\\'s logo icons.' },\n { label: 'logo image', insertText: 'logo image \"data:image/svg+xml;base64,${1}\"', documentation: 'A logo image (PNG, JPG, SVG or WebP, up to 400 KB) as a base64 data URI.' },\n { label: 'show name', insertText: 'show name ${1|true,false|}', documentation: 'Whether the name is drawn beside the logo.' },\n];\n\nexport const profileSampleDataItems: CompletionEntry[] = [\n { label: 'active', insertText: 'active ${1:Pack}', documentation: 'The active sample data pack of the whole application: one declared in the document, or `blueprint <id>`.' },\n { label: 'shape maps to', insertText: 'shape ${1:Shape} maps to ${2:ReadModel}', documentation: 'Maps a sample data shape to the read model it supplies rows for.' },\n { label: 'bind', insertText: 'bind ${1:ReadModel} to ${2:Pack}', documentation: 'A rare override: binds one read model to a pack.' },\n];\n\nexport const sampleDataItems: CompletionEntry[] = [\n { label: 'title', insertText: 'title \"${1:Title}\"', documentation: 'The display title of the pack.' },\n { label: 'locale', insertText: 'locale ${1:en-GB}', documentation: 'The BCP 47 locale tag of the data.' },\n { label: 'shape', insertText: 'shape ${1:ReadModel}\\n row\\n ${2:field} = ${3:\"value\"}', documentation: 'The rows for one shape: the read model of the same name, or the one a ui profile maps it to.' },\n];\n\nexport const sampleShapeItems: CompletionEntry[] = [\n { label: 'row', insertText: 'row\\n ${1:field} = ${2:\"value\"}', documentation: 'One row of the shape.' },\n];\n\nexport const layoutItems: CompletionEntry[] = [\n { label: 'slot', insertText: '${1:slot}', documentation: 'A named slot of the shell.' },\n { label: 'slot contributes', insertText: '${1:slot} contributes ${2:Name}', documentation: 'A slot other declarations contribute to, such as `navigation contributes Navigation`.' },\n { label: 'navigation topbar', insertText: 'navigation ${1|topbar,sidebar|}\\n logo image \"${2:/logo.svg}\" title \"${3:Application}\"\\n item ${4:id} title \"${5:Title}\" target ${6:Module}', documentation: 'The application\\'s navigation region: a logo and items that target a module or feature.' },\n { label: 'arrangement', insertText: 'arrangement flow\\n column\\n ${1:slot}', documentation: 'How the slots are placed.' },\n];\n\nexport const toolbarItems: CompletionEntry[] = [\n { label: 'button', insertText: 'button ${1:id} title \"${2:Title}\" slice ${3:Module.Feature.Slice}', documentation: 'A button that invokes a State Change slice. The slice names the command and the dialog it opens over the page.' },\n { label: 'button (with emphasis)', insertText: 'button ${1:id} title \"${2:Title}\" slice ${3:Module.Feature.Slice} emphasis ${4|primary,secondary,quiet|} icon ${5:icon}', documentation: 'A toolbar button with an emphasis and an icon.' },\n { label: 'item action', insertText: 'item ${1:name} action ${2:Command}', documentation: 'A toolbar entry that runs a command.' },\n { label: 'item navigate', insertText: 'item ${1:name} navigate to ${2:Screen}', documentation: 'A toolbar entry that navigates to a screen.' },\n];\n\nexport const navigationItems: CompletionEntry[] = [\n { label: 'logo', insertText: 'logo image \"${1:/logo.svg}\" title \"${2:Application}\"', documentation: 'The application logo. Declared once, in a layout.' },\n { label: 'item', insertText: 'item ${1:id} title \"${2:Title}\" target ${3:Module.Feature}', documentation: 'A navigation item with a title, an optional `icon`, a `target` module or feature and an optional rendering `slot`. Sidebar items may nest `item` lines.' },\n { label: 'item (with slot)', insertText: 'item ${1:id} title \"${2:Title}\" icon ${3:icon} target ${4:Module.Feature} slot ${5:content}', documentation: 'A navigation item that renders its target into a named layout slot.' },\n];\n\nexport const templateItems: CompletionEntry[] = [\n { label: 'fits slot', insertText: 'fits slot ${1:content}', documentation: 'The slot of the shell the template fits.' },\n ...layoutItems,\n { label: 'on', insertText: 'on ${1|enter,leave,load,unload|}\\n ${2:refresh query}', documentation: 'Wires what happens on an interaction.' },\n];\n\nexport const interactionNames = interactions;\n"],"mappings":"A,gPAUA,MAAMA,EAAsC,CACxC,CAAE,MAAO,KAAM,WAAY,wFAAyF,cAAe,2FAA4F,EAC/N,CAAE,MAAO,OAAQ,WAAY,qBAAsB,cAAe,sDAAuD,CAC7H,EAEaC,EAAsC,CAC/CC,EACAC,EACA,GAAGC,EACH,CAAE,MAAO,cAAe,WAAY,6CAA8C,cAAe,+BAAgC,EACjI,CAAE,MAAO,YAAa,WAAY,4BAA6B,cAAe,uDAAwD,EACtI,CAAE,MAAO,aAAc,WAAY,uBAAwB,cAAe,mHAAoH,EAC9L,CAAE,MAAO,aAAc,WAAY,yBAA0B,cAAe,gFAAkF,EAC9J,CAAE,MAAO,UAAW,WAAY;MAA2B,cAAe,gDAAiD,EAC3H,CAAE,MAAO,SAAU,WAAY,qEAAsE,cAAe,oCAAqC,EACzJ,CAAE,MAAO,kBAAmB,WAAY;;;gBAA0E,cAAe,iEAAkE,EACnM,CAAE,MAAO,kBAAmB,WAAY,6DAA8D,cAAe,6DAA8D,EACnL,CAAE,MAAO,OAAQ,WAAY,8EAA+E,cAAe,qCAAsC,EACjK,CAAE,MAAO,aAAc,WAAY,qFAAs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ACjO,EAEaC,EAAmC,CAC5C,CAAE,MAAO,YAAa,WAAY,yBAA0B,cAAe,0CAA2C,EACtH,GAAGH,EACH,CAAE,MAAO,KAAM,WAAY,2DAA4D,cAAe,uCAAwC,CAClJ,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"structure-completions.js","names":["index","lines","matches","name","verb","subject","command","noun","symbols","event","indented","indentOf","indent","eventName","declared","inner","unit","sources","property","mappings","source","identifier","identity","concept","identityLine","properties","propertyLines","outcome","line","exampleValueFor","sliceIndex","headerIndex","fences","authorized","symbol","candidate","names","policy","header","textBefore","textAfter","fenceMap","lineIndex","previous","withoutComment","previousLine","opensEmptyBlock","nearestEnclosingLine","headerIndent","pad","block","headerLine","found","form"],"sources":["../../structure-completions.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { exampleValueFor } from './example-values';\nimport { CommandSymbol, DocumentSymbols, PropertySymbol } from './symbols';\n\n// A multi-line suggestion shown as ghost text at the cursor. The text starts at the cursor and\n// continues on following lines with absolute indentation, so inserting it needs no further work.\nexport interface StructureCompletion {\n text: string;\n}\n\nfunction lastIndexWhere(lines: string[], matches: (line: string, index: number) => boolean): number {\n for (let index = lines.length - 1; index >= 0; index--) if (matches(lines[index], index)) return index;\n return -1;\n}\n\nconst upperCamelWords = (name: string) => name.match(/[A-Z][a-z0-9]*/g) ?? [name];\n\nfunction pastTense(verb: string): string {\n if (/[^aeiou]y$/i.test(verb)) return `${verb.slice(0, -1)}ied`;\n return /e$/i.test(verb) ? `${verb}d` : `${verb}ed`;\n}\n\n// The event a command most likely produces: a declared event that names its subject, else the\n// subject followed by the past tense of the command's verb - AddProduct becomes ProductAdded.\nfunction likelyEventName(command: string, symbols: DocumentSymbols): string {\n const [verb, ...subject] = upperCamelWords(command);\n const noun = subject.join('');\n const declared = symbols.events.find(event => noun.length > 0 && event.name.startsWith(noun));\n return declared?.name ?? `${noun}${pastTense(verb)}`;\n}\n\n\n// The indentation of one level in the document, learned from its first indented line.\nfunction indentUnit(lines: string[]): number {\n const indented = lines.map(indentOf).filter(indent => indent > 0);\n return indented.length === 0 ? 4 : Math.min(...indented);\n}\n\nfunction producesBlock(command: CommandSymbol, symbols: DocumentSymbols, indent: number, unit: number): string {\n const eventName = likelyEventName(command.name, symbols);\n const declared = symbols.events.find(event => event.name === eventName);\n const inner = ' '.repeat(indent + unit);\n const sources = command.properties.filter(property => !property.isIdentifier);\n if (declared) {\n const mappings = declared.properties.filter(property => sources.some(source => source.name === property.name));\n const identifier = command.properties.find(property => property.isIdentifier);\n return [`produces ${eventName}`, ...(identifier ? [`${inner}for ${identifier.name}`] : []), ...mappings.map(property => `${inner}${property.name} = ${property.name}`)].join('\\n');\n }\n return [`produces event ${eventName}`, ...sources.map(property => `${inner}${property.name} ${property.type} = ${property.name}`)].join('\\n');\n}\n\n// What a command that has nothing yet most likely needs: the identity of the thing it acts on when a\n// concept for it is declared, the properties of the event it will most likely produce, and the production.\nfunction newCommandBlock(command: string, symbols: DocumentSymbols, indent: number, unit: number): string {\n const noun = upperCamelWords(command).slice(1).join('');\n const eventName = likelyEventName(command, symbols);\n const declared = symbols.events.find(event => event.name === eventName);\n const identity = noun.length > 0 && symbols.concepts.some(concept => concept.name === `${noun}Id`) ? `${noun[0].toLowerCase()}${noun.slice(1)}Id` : undefined;\n const identityLine = identity ? [`${identity} ${noun}Id identifier`] : [];\n const inner = ' '.repeat(indent + unit);\n const properties = (declared?.properties ?? []).filter(property => property.name !== identity);\n const propertyLines = properties.map(property => `${' '.repeat(indent)}${property.name} ${property.type}`);\n const outcome = declared\n ? [`${' '.repeat(indent)}produces ${eventName}`, ...(identity ? [`${inner}for ${identity}`] : []), ...properties.map(property => `${inner}${property.name} = ${property.name}`)]\n : [`${' '.repeat(indent)}produces event ${eventName}`];\n const lines = [...identityLine.map((line, index) => (index === 0 ? line : `${' '.repeat(indent)}${line}`)), ...propertyLines, ...outcome];\n return lines.join('\\n').trimStart();\n}\n\nfunction assignments(properties: PropertySymbol[], symbols: DocumentSymbols, indent: number): string[] {\n return properties.map(property => `${' '.repeat(indent)}${property.name} = ${exampleValueFor(property.type, symbols)}`);\n}\n\n// The command the slice enclosing a line declares, with whether it carries an authorize clause.\nfunction sliceCommand(lines: string[], fences: boolean[], headerIndex: number, symbols: DocumentSymbols) {\n let sliceIndex = -1;\n for (let index = headerIndex - 1; index >= 0; index--) {\n if (!fences[index] && /^\\s*slice\\s/.test(lines[index]) && indentOf(lines[index]) < indentOf(lines[headerIndex])) { sliceIndex = index; break; }\n }\n if (sliceIndex < 0) return undefined;\n let name: string | undefined;\n let authorized = false;\n for (let index = sliceIndex + 1; index < lines.length; index++) {\n if (lines[index].trim().length === 0 || fences[index]) continue;\n if (indentOf(lines[index]) <= indentOf(lines[sliceIndex])) break;\n const command = lines[index].trim().match(/^command\\s+(\\w+)\\s*$/);\n if (command) { name = command[1]; authorized = false; continue; }\n // A command gated only by an anonymous policy runs without a caller, so its specification needs none.\n if (name && /^authorize\\b/.test(lines[index].trim())) authorized = !anonymousPolicies(lines).has(lines[index].trim().replace(/^authorize\\s+/, ''));\n }\n const symbol = symbols.commands.find(candidate => candidate.name === name);\n return symbol ? { symbol, authorized } : undefined;\n}\n\nfunction anonymousPolicies(lines: readonly string[]): Set<string> {\n const names = new Set<string>();\n let policy: string | undefined;\n for (const line of lines) {\n const header = line.match(/^policy\\s+(\\w+)\\s*$/);\n if (header) { policy = header[1]; continue; }\n if (!/^\\s/.test(line) && line.trim().length > 0) policy = undefined;\n if (policy && /^\\s+require\\s+anonymous\\s*$/.test(line)) names.add(policy);\n }\n return names;\n}\n\nfunction specificationBlock(command: CommandSymbol, authorized: boolean, symbols: DocumentSymbols, indent: number, unit: number): string {\n const inner = indent + unit;\n const eventName = likelyEventName(command.name, symbols);\n const identifier = command.properties.find(property => property.isIdentifier);\n const sources = command.properties.filter(property => !property.isIdentifier);\n return [\n ...(authorized ? [`given caller`, `${' '.repeat(inner)}authenticated`] : []),\n ...(authorized ? [`${' '.repeat(indent)}when ${command.name}`] : [`when ${command.name}`]),\n ...assignments(command.properties, symbols, inner),\n `${' '.repeat(indent)}then ${eventName}`,\n ...(identifier ? [`${' '.repeat(inner)}for ${exampleValueFor(identifier.type, symbols)}`] : []),\n ...assignments(sources, symbols, inner),\n ].join('\\n');\n}\n\n// Suggests the structure a block most obviously needs next - the production of a command, the\n// skeleton of a specification, the fields of a form - when the cursor rests on an empty line directly\n// inside a block that has no content yet. Returns null when nothing is obviously missing.\nexport function structureCompletion(lines: string[], lineIndex: number, textBefore: string, textAfter: string, symbols: DocumentSymbols): StructureCompletion | null {\n if (textBefore.trim().length > 0 || textAfter.trim().length > 0) return null;\n const fences = fenceMap(lines);\n if (fences[lineIndex]) return null;\n const previous = lastIndexWhere(lines.slice(0, lineIndex), line => withoutComment(line).trim().length > 0);\n if (previous < 0 || fences[previous]) return null;\n const unit = indentUnit(lines);\n const previousLine = lines[previous].trim();\n const opensEmptyBlock = /^(?:command\\s+\\w+|specification\\s+\\w+|form\\s+\\w+\\s+for\\s+[\\w.]+)\\s*$/.test(previousLine);\n // An empty block's body starts one level in; otherwise the cursor continues the lines above it.\n const indent = opensEmptyBlock ? Math.max(textBefore.length, indentOf(lines[previous]) + unit) : textBefore.length || indentOf(lines[previous]);\n const header = opensEmptyBlock ? previousLine : nearestEnclosingLine(lines, fences, lineIndex, indent);\n if (!header) return null;\n const headerIndent = opensEmptyBlock ? indentOf(lines[previous]) : indent - Math.max(1, unit);\n const pad = ' '.repeat(Math.max(0, indent - textBefore.length));\n const wrap = (block: string | undefined) => (block ? { text: `${pad}${block}` } : null);\n\n const command = header.match(/^command\\s+(\\w+)\\s*$/);\n if (command) {\n const symbol = symbols.commands.find(candidate => candidate.name === command[1]);\n const headerLine = lastIndexWhere(lines, (line, index) => index < lineIndex && line.trim() === header && indentOf(line) < indent);\n const body = lines.slice(headerLine + 1, lineIndex).filter(line => line.trim().length > 0);\n const hasOutcome = body.some(line => /^\\s*(produces|handler)\\b/.test(line));\n if (hasOutcome) return null;\n if (!symbol || symbol.properties.length === 0) return wrap(newCommandBlock(command[1], symbols, indent, unit));\n return wrap(producesBlock(symbol, symbols, indent, unit));\n }\n\n if (/^specification\\s+\\w+\\s*$/.test(header) && headerIndent >= 0) {\n const found = sliceCommand(lines, fences, previous, symbols);\n return found ? wrap(specificationBlock(found.symbol, found.authorized, symbols, indent, unit)) : null;\n }\n\n const form = header.match(/^form\\s+\\w+\\s+for\\s+(?:\\w+\\.)*(\\w+)\\s*$/);\n if (form) {\n const symbol = symbols.commands.find(candidate => candidate.name === form[1]);\n return symbol ? wrap(symbol.properties.map((property, index) => `${index === 0 ? '' : ' '.repeat(indent)}field ${property.name}`).join('\\n')) : null;\n }\n return null;\n}\n"],"mappings":"oNAaA,SAAS,eAAe,EAAiB,EAA2D,CAChG,IAAK,IAAIA,EAAQC,EAAM,OAAS,EAAGD,GAAS,EAAG,IAAS,GAAIE,EAAQD,EAAMD,GAAQA,CAAK,EAAG,OAAOA,EACjG,MAAO,EACX,CAEA,MAAM,gBAAmB,GAAiBG,EAAK,MAAM,iBAAiB,GAAK,CAACA,CAAI,EAEhF,SAAS,UAAU,EAAsB,CAErC,MADI,cAAc,KAAKC,CAAI,EAAU,GAAGA,EAAK,MAAM,EAAG,EAAE,EAAE,KACnD,MAAM,KAAKA,CAAI,EAAI,GAAGA,EAAK,GAAK,GAAGA,EAAK,GACnD,CAIA,SAAS,gBAAgB,EAAiB,EAAkC,CACxE,GAAM,CAACA,EAAM,GAAGC,GAAW,gBAAgBC,CAAO,EAC5CC,EAAOF,EAAQ,KAAK,EAAE,EAE5B,OADiBG,EAAQ,OAAO,KAAK,GAASD,EAAK,OAAS,GAAKE,EAAM,KAAK,WAAWF,CAAI,CAC7E,CAAC,EAAE,MAAQ,GAAGA,IAAO,UAAUH,CAAI,GACrD,CAIA,SAAS,WAAW,EAAyB,C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AAa2B,EAAU,OAASkB,EAAK,EAAE,EAC5E,OAAOnB,EAAS,KAAKA,EAAO,WAAW,KAAK,EAAU,IAAU,GAAGlC,IAAU,EAAI,GAAK,IAAI,OAAOY,CAAM,EAAE,QAAQM,EAAS,MAAM,CAAC,CAAC,KAAK;CAAI,CAAC,EAAI,IACpJ,CACA,OAAO,IACX"}
1
+ {"version":3,"file":"structure-completions.js","names":["index","lines","matches","name","verb","subject","command","noun","symbols","event","indented","indentOf","indent","eventName","declared","inner","unit","sources","property","mappings","source","identifier","identity","concept","identityLine","properties","propertyLines","outcome","line","exampleValueFor","sliceIndex","headerIndex","fences","authorized","symbol","candidate","names","policy","header","textBefore","textAfter","fenceMap","lineIndex","previous","withoutComment","previousLine","opensEmptyBlock","nearestEnclosingLine","headerIndent","pad","block","headerLine","found","form"],"sources":["../../structure-completions.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { exampleValueFor } from './example-values';\nimport { CommandSymbol, DocumentSymbols, PropertySymbol } from './symbols';\n\n// A multi-line suggestion shown as ghost text at the cursor. The text starts at the cursor and\n// continues on following lines with absolute indentation, so inserting it needs no further work.\nexport interface StructureCompletion {\n text: string;\n}\n\nfunction lastIndexWhere(lines: string[], matches: (line: string, index: number) => boolean): number {\n for (let index = lines.length - 1; index >= 0; index--) if (matches(lines[index], index)) return index;\n return -1;\n}\n\nconst upperCamelWords = (name: string) => name.match(/[A-Z][a-z0-9]*/g) ?? [name];\n\nfunction pastTense(verb: string): string {\n if (/[^aeiou]y$/i.test(verb)) return `${verb.slice(0, -1)}ied`;\n return /e$/i.test(verb) ? `${verb}d` : `${verb}ed`;\n}\n\n// The event a command most likely produces: a declared event that names its subject, else the\n// subject followed by the past tense of the command's verb - AddProduct becomes ProductAdded.\nfunction likelyEventName(command: string, symbols: DocumentSymbols): string {\n const [verb, ...subject] = upperCamelWords(command);\n const noun = subject.join('');\n const declared = symbols.events.find(event => noun.length > 0 && event.name.startsWith(noun));\n return declared?.name ?? `${noun}${pastTense(verb)}`;\n}\n\n\n// The indentation of one level in the document, learned from its first indented line.\nfunction indentUnit(lines: string[]): number {\n const indented = lines.map(indentOf).filter(indent => indent > 0);\n return indented.length === 0 ? 4 : Math.min(...indented);\n}\n\nfunction producesBlock(command: CommandSymbol, symbols: DocumentSymbols, indent: number, unit: number): string {\n const eventName = likelyEventName(command.name, symbols);\n const declared = symbols.events.find(event => event.name === eventName);\n const inner = ' '.repeat(indent + unit);\n const sources = command.properties.filter(property => !property.isIdentifier);\n if (declared) {\n const mappings = declared.properties.filter(property => sources.some(source => source.name === property.name));\n const identifier = command.properties.find(property => property.isIdentifier);\n return [`produces ${eventName}`, ...(identifier ? [`${inner}for ${identifier.name}`] : []), ...mappings.map(property => `${inner}${property.name} = ${property.name}`)].join('\\n');\n }\n return [`produces event ${eventName}`, ...sources.map(property => `${inner}${property.name} ${property.type} = ${property.name}`)].join('\\n');\n}\n\n// What a command that has nothing yet most likely needs: the identity of the thing it acts on when a\n// concept for it is declared, the properties of the event it will most likely produce, and the production.\nfunction newCommandBlock(command: string, symbols: DocumentSymbols, indent: number, unit: number): string {\n const noun = upperCamelWords(command).slice(1).join('');\n const eventName = likelyEventName(command, symbols);\n const declared = symbols.events.find(event => event.name === eventName);\n const identity = noun.length > 0 && symbols.concepts.some(concept => concept.name === `${noun}Id`) ? `${noun[0].toLowerCase()}${noun.slice(1)}Id` : undefined;\n const identityLine = identity ? [`${identity} ${noun}Id identifier`] : [];\n const inner = ' '.repeat(indent + unit);\n const properties = (declared?.properties ?? []).filter(property => property.name !== identity);\n const propertyLines = properties.map(property => `${' '.repeat(indent)}${property.name} ${property.type}`);\n const outcome = declared\n ? [`${' '.repeat(indent)}produces ${eventName}`, ...(identity ? [`${inner}for ${identity}`] : []), ...properties.map(property => `${inner}${property.name} = ${property.name}`)]\n : [`${' '.repeat(indent)}produces event ${eventName}`];\n const lines = [...identityLine.map((line, index) => (index === 0 ? line : `${' '.repeat(indent)}${line}`)), ...propertyLines, ...outcome];\n return lines.join('\\n').trimStart();\n}\n\nfunction assignments(properties: PropertySymbol[], symbols: DocumentSymbols, indent: number): string[] {\n return properties.map(property => `${' '.repeat(indent)}${property.name} = ${exampleValueFor(property.type, symbols)}`);\n}\n\n// The command the slice enclosing a line declares, with whether it carries an authorize clause.\nfunction sliceCommand(lines: string[], fences: boolean[], headerIndex: number, symbols: DocumentSymbols) {\n let sliceIndex = -1;\n for (let index = headerIndex - 1; index >= 0; index--) {\n if (!fences[index] && /^\\s*slice\\s/.test(lines[index]) && indentOf(lines[index]) < indentOf(lines[headerIndex])) { sliceIndex = index; break; }\n }\n if (sliceIndex < 0) return undefined;\n let name: string | undefined;\n let authorized = false;\n for (let index = sliceIndex + 1; index < lines.length; index++) {\n if (lines[index].trim().length === 0 || fences[index]) continue;\n if (indentOf(lines[index]) <= indentOf(lines[sliceIndex])) break;\n const command = lines[index].trim().match(/^command\\s+(\\w+)\\s*$/);\n if (command) { name = command[1]; authorized = false; continue; }\n // A command gated only by an anonymous policy runs without a caller, so its specification needs none.\n if (name && /^authorize\\b/.test(lines[index].trim())) authorized = !anonymousPolicies(lines).has(lines[index].trim().replace(/^authorize\\s+/, ''));\n }\n const symbol = symbols.commands.find(candidate => candidate.name === name);\n return symbol ? { symbol, authorized } : undefined;\n}\n\nfunction anonymousPolicies(lines: readonly string[]): Set<string> {\n const names = new Set<string>();\n let policy: string | undefined;\n for (const line of lines) {\n const header = line.match(/^policy\\s+(\\w+)\\s*$/);\n if (header) { policy = header[1]; continue; }\n if (!/^\\s/.test(line) && line.trim().length > 0) policy = undefined;\n if (policy && /^\\s+require\\s+anonymous\\s*$/.test(line)) names.add(policy);\n }\n return names;\n}\n\nfunction specificationBlock(command: CommandSymbol, authorized: boolean, symbols: DocumentSymbols, indent: number, unit: number): string {\n const inner = indent + unit;\n const eventName = likelyEventName(command.name, symbols);\n const identifier = command.properties.find(property => property.isIdentifier);\n const sources = command.properties.filter(property => !property.isIdentifier);\n return [\n ...(authorized ? [`given caller`, `${' '.repeat(inner)}authenticated`] : []),\n ...(authorized ? [`${' '.repeat(indent)}when ${command.name}`] : [`when ${command.name}`]),\n ...assignments(command.properties, symbols, inner),\n `${' '.repeat(indent)}then ${eventName}`,\n ...(identifier ? [`${' '.repeat(inner)}for ${exampleValueFor(identifier.type, symbols)}`] : []),\n ...assignments(sources, symbols, inner),\n ].join('\\n');\n}\n\n// Suggests the structure a block most obviously needs next - the production of a command, the\n// skeleton of a specification, the fields of a form - when the cursor rests on an empty line directly\n// inside a block that has no content yet. Returns null when nothing is obviously missing.\nexport function structureCompletion(lines: string[], lineIndex: number, textBefore: string, textAfter: string, symbols: DocumentSymbols): StructureCompletion | null {\n if (textBefore.trim().length > 0 || textAfter.trim().length > 0) return null;\n const fences = fenceMap(lines);\n if (fences[lineIndex]) return null;\n const previous = lastIndexWhere(lines.slice(0, lineIndex), line => withoutComment(line).trim().length > 0);\n if (previous < 0 || fences[previous]) return null;\n const unit = indentUnit(lines);\n const previousLine = lines[previous].trim();\n const opensEmptyBlock = /^(?:command\\s+\\w+|specification\\s+\\w+|form\\s+\\w+\\s+for\\s+[\\w.]+)\\s*$/.test(previousLine);\n // An empty block's body starts one level in; otherwise the cursor continues the lines above it.\n const indent = opensEmptyBlock ? Math.max(textBefore.length, indentOf(lines[previous]) + unit) : textBefore.length || indentOf(lines[previous]);\n const header = opensEmptyBlock ? previousLine : nearestEnclosingLine(lines, fences, lineIndex, indent);\n if (!header) return null;\n const headerIndent = opensEmptyBlock ? indentOf(lines[previous]) : indent - Math.max(1, unit);\n const pad = ' '.repeat(Math.max(0, indent - textBefore.length));\n const wrap = (block: string | undefined) => (block ? { text: `${pad}${block}` } : null);\n\n const command = header.match(/^command\\s+(\\w+)\\s*$/);\n if (command) {\n const symbol = symbols.commands.find(candidate => candidate.name === command[1]);\n const headerLine = lastIndexWhere(lines, (line, index) => index < lineIndex && line.trim() === header && indentOf(line) < indent);\n const body = lines.slice(headerLine + 1, lineIndex).filter(line => line.trim().length > 0);\n const hasOutcome = body.some(line => /^\\s*(produces|handler)\\b/.test(line));\n if (hasOutcome) return null;\n if (!symbol || symbol.properties.length === 0) return wrap(newCommandBlock(command[1], symbols, indent, unit));\n return wrap(producesBlock(symbol, symbols, indent, unit));\n }\n\n if (/^specification\\s+\\w+\\s*$/.test(header) && headerIndent >= 0) {\n const found = sliceCommand(lines, fences, previous, symbols);\n return found ? wrap(specificationBlock(found.symbol, found.authorized, symbols, indent, unit)) : null;\n }\n\n const form = header.match(/^form\\s+\\w+\\s+for\\s+(?:\\w+\\.)*(\\w+)\\s*$/);\n if (form) {\n const symbol = symbols.commands.find(candidate => candidate.name === form[1]);\n return symbol ? wrap(symbol.properties.map((property, index) => `${index === 0 ? '' : ' '.repeat(indent)}field ${property.name}`).join('\\n')) : null;\n }\n return null;\n}\n"],"mappings":"A,oNAaA,SAAS,eAAe,EAAiB,EAA2D,CAChG,IAAK,IAAIA,EAAQC,EAAM,OAAS,EAAGD,GAAS,EAAG,IAAS,GAAIE,EAAQD,EAAMD,GAAQA,CAAK,EAAG,OAAOA,EACjG,MAAO,EACX,CAEA,MAAM,gBAAmB,GAAiBG,EAAK,MAAM,iBAAiB,GAAK,CAACA,CAAI,EAEhF,SAAS,UAAU,EAAsB,CAErC,MADI,cAAc,KAAKC,CAAI,EAAU,GAAGA,EAAK,MAAM,EAAG,EAAE,EAAE,KACnD,MAAM,KAAKA,CAAI,EAAI,GAAGA,EAAK,GAAK,GAAGA,EAAK,GACnD,CAIA,SAAS,gBAAgB,EAAiB,EAAkC,CACxE,GAAM,CAACA,EAAM,GAAGC,GAAW,gBAAgBC,CAAO,EAC5CC,EAAOF,EAAQ,KAAK,EAAE,EAE5B,OADiBG,EAAQ,OAAO,KAAK,GAASD,EAAK,OAAS,GAAKE,EAAM,KAAK,WAAWF,CAAI,CAC7E,CAAC,EAAE,MAA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,EACnE,GAAIe,EAAM,CACN,IAAMnB,EAAS1B,EAAQ,SAAS,KAAK,GAAa2B,EAAU,OAASkB,EAAK,EAAE,EAC5E,OAAOnB,EAAS,KAAKA,EAAO,WAAW,KAAK,EAAU,IAAU,GAAGlC,IAAU,EAAI,GAAK,IAAI,OAAOY,CAAM,EAAE,QAAQM,EAAS,MAAM,CAAC,CAAC,KAAK;CAAI,CAAC,EAAI,IACpJ,CACA,OAAO,IACX,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"sub-language-registry.js","names":["subLanguages","listeners","keyword","definition","listener"],"sources":["../../sub-language-registry.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';\n\nexport type MonarchTokenRules = languages.IMonarchLanguage['tokenizer'][string];\n\nexport interface SubLanguageCompletion {\n label: string;\n insertText: string;\n documentation: string;\n}\n\nexport interface SubLanguageDefinition {\n tokens: MonarchTokenRules;\n completions?: SubLanguageCompletion[];\n hovers?: Record<string, string>;\n}\n\nexport interface SubLanguage extends SubLanguageDefinition {\n keyword: string;\n}\n\nconst subLanguages = new Map<string, SubLanguage>();\nconst listeners = new Set<() => void>();\n\nexport function registerSubLanguage(keyword: string, definition: SubLanguageDefinition): void {\n subLanguages.set(keyword, { keyword, ...definition });\n listeners.forEach((listener) => listener());\n}\n\nexport function getSubLanguages(): SubLanguage[] {\n return [...subLanguages.values()];\n}\n\nexport function getSubLanguage(keyword: string): SubLanguage | undefined {\n return subLanguages.get(keyword);\n}\n\nexport function onSubLanguagesChanged(listener: () => void): void {\n listeners.add(listener);\n}\n"],"mappings":"iDAuBA,MAAMA,kBAAe,IAAI,IACnBC,kBAAY,IAAI,IAEtB,SAAgB,oBAAoB,EAAiB,EAAyC,CAC1FD,EAAa,IAAIE,EAAS,CAAE,UAAS,GAAGC,CAAW,CAAC,EACpDF,EAAU,QAAS,GAAaG,EAAS,CAAC,CAC9C,CAEA,SAAgB,iBAAiC,CAC7C,MAAO,CAAC,GAAGJ,EAAa,OAAO,CAAC,CACpC,CAEA,SAAgB,eAAe,EAA0C,CACrE,OAAOA,EAAa,IAAIE,CAAO,CACnC,CAEA,SAAgB,sBAAsB,EAA4B,CAC9DD,EAAU,IAAIG,CAAQ,CAC1B"}
1
+ {"version":3,"file":"sub-language-registry.js","names":["subLanguages","listeners","keyword","definition","listener"],"sources":["../../sub-language-registry.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';\n\nexport type MonarchTokenRules = languages.IMonarchLanguage['tokenizer'][string];\n\nexport interface SubLanguageCompletion {\n label: string;\n insertText: string;\n documentation: string;\n}\n\nexport interface SubLanguageDefinition {\n tokens: MonarchTokenRules;\n completions?: SubLanguageCompletion[];\n hovers?: Record<string, string>;\n}\n\nexport interface SubLanguage extends SubLanguageDefinition {\n keyword: string;\n}\n\nconst subLanguages = new Map<string, SubLanguage>();\nconst listeners = new Set<() => void>();\n\nexport function registerSubLanguage(keyword: string, definition: SubLanguageDefinition): void {\n subLanguages.set(keyword, { keyword, ...definition });\n listeners.forEach((listener) => listener());\n}\n\nexport function getSubLanguages(): SubLanguage[] {\n return [...subLanguages.values()];\n}\n\nexport function getSubLanguage(keyword: string): SubLanguage | undefined {\n return subLanguages.get(keyword);\n}\n\nexport function onSubLanguagesChanged(listener: () => void): void {\n listeners.add(listener);\n}\n"],"mappings":"A,iDAuBA,MAAMA,kBAAe,IAAI,IACnBC,kBAAY,IAAI,IAEtB,SAAgB,oBAAoB,EAAiB,EAAyC,CAC1FD,EAAa,IAAIE,EAAS,CAAE,UAAS,GAAGC,CAAW,CAAC,EACpDF,EAAU,QAAS,GAAaG,EAAS,CAAC,CAC9C,CAEA,SAAgB,iBAAiC,CAC7C,MAAO,CAAC,GAAGJ,EAAa,OAAO,CAAC,CACpC,CAEA,SAAgB,eAAe,EAA0C,CACrE,OAAOA,EAAa,IAAIE,CAAO,CACnC,CAEA,SAAgB,sBAAsB,EAA4B,CAC9DD,EAAU,IAAIG,CAAQ,CAC1B,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"CompletionProvider.js","names":["commonPropertyPaths","context","model","position","suggestions","textBeforeCursor","word","match","text","keyword","prefix","trimmed","languages","source","sourceType","option","statement","value","path","index","lineNumber"],"sources":["../../../../sub-languages/capture/CompletionProvider.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 { languages, type editor, type Position, type IRange } from 'monaco-editor';\n\ninterface CompletionContext {\n textBeforeCursor: string;\n currentWord: string;\n indentLevel: number;\n lineNumber: number;\n wordStartColumn: number;\n wordEndColumn: number;\n}\n\nconst commonPropertyPaths = [\n 'id',\n 'status',\n 'firstName',\n 'lastName',\n 'fullName',\n 'address.street',\n 'address.city',\n 'lineItems',\n 'lineItems.quantity',\n 'lineNumber',\n 'quantity',\n];\n\nexport class CompletionProvider implements languages.CompletionItemProvider {\n triggerCharacters = ['.', ' ', '=', '$'];\n\n provideCompletionItems(\n model: editor.ITextModel,\n position: Position,\n ): languages.ProviderResult<languages.CompletionList> {\n const context = this.buildContext(model, position);\n const suggestions: languages.CompletionItem[] = [];\n\n if (context.lineNumber === 1) {\n this.addCaptureLineCompletions(suggestions, context);\n } else if (this.isAfterKeyword(context, 'capture')) {\n this.addCaptureNameCompletions(suggestions, context);\n } else if (this.isAfterKeyword(context, 'source')) {\n this.addSourceTypeCompletions(suggestions, context);\n } else if (this.isAfterAppendKeyword(context)) {\n this.addAppendNameCompletions(suggestions, context);\n } else if (this.isAfterWhenKeyword(context)) {\n this.addWhenCompletions(suggestions, context);\n } else if (this.isAfterWhenFrom(context)) {\n this.addFromValueCompletions(suggestions, context);\n } else if (this.isAfterWhenTo(context)) {\n this.addToValueCompletions(suggestions, context);\n } else if (this.isAfterContextPrefix(context, '$.')) {\n this.addPathCompletions(suggestions, context, '$.');\n } else if (this.isAfterContextPrefix(context, '$previous.')) {\n this.addPathCompletions(suggestions, context, '$previous.');\n } else if (this.isAfterContextPrefix(context, '$context.')) {\n this.addContextCompletions(suggestions, context);\n } else if (this.isAfterContextPrefix(context, '$env.')) {\n this.addEnvironmentCompletions(suggestions, context);\n } else if (this.isAfterAssignment(context)) {\n this.addAssignmentValueCompletions(suggestions, context);\n } else if ((this.isStartOfLine(context) || this.isAfterIndent(context)) && context.indentLevel === 1) {\n this.addTopLevelStatementCompletions(suggestions, context);\n } else if ((this.isStartOfLine(context) || this.isAfterIndent(context)) && context.indentLevel >= 2) {\n this.addSourceBlockCompletions(suggestions, context, this.getCurrentSourceType(model, position.lineNumber));\n }\n\n return { suggestions };\n }\n\n private buildContext(model: editor.ITextModel, position: Position): CompletionContext {\n const lineContent = model.getLineContent(position.lineNumber);\n const textBeforeCursor = lineContent.substring(0, position.column - 1);\n const word = model.getWordUntilPosition(position);\n\n return {\n textBeforeCursor,\n currentWord: word.word || '',\n indentLevel: this.getIndentLevel(textBeforeCursor),\n lineNumber: position.lineNumber,\n wordStartColumn: word.startColumn,\n wordEndColumn: word.endColumn,\n };\n }\n\n private getIndentLevel(text: string): number {\n const match = text.match(/^(\\s*)/);\n return match ? Math.floor(match[1].length / 2) : 0;\n }\n\n private isStartOfLine(context: CompletionContext): boolean {\n return context.textBeforeCursor.trim() === '';\n }\n\n private isAfterIndent(context: CompletionContext): boolean {\n return /^\\s+$/.test(context.textBeforeCursor);\n }\n\n private isAfterKeyword(context: CompletionContext, keyword: string): boolean {\n const pattern = new RegExp(`\\\\b${keyword}\\\\s+\\\\w*$`);\n return pattern.test(context.textBeforeCursor);\n }\n\n private isAfterAppendKeyword(context: CompletionContext): boolean {\n return /\\bappend\\s+[\\w.]*$/.test(context.textBeforeCursor);\n }\n\n private isAfterWhenKeyword(context: CompletionContext): boolean {\n return /\\bwhen\\s+[\\w.]*$/.test(context.textBeforeCursor);\n }\n\n private isAfterWhenFrom(context: CompletionContext): boolean {\n return /\\bwhen\\s+[\\w.]+\\s+from\\s+[^\\s]*$/.test(context.textBeforeCursor);\n }\n\n private isAfterWhenTo(context: CompletionContext): boolean {\n return /\\bwhen\\s+[\\w.]+\\s+from\\s+\\S+\\s+to\\s+[^\\s]*$/.test(context.textBeforeCursor);\n }\n\n private isAfterAssignment(context: CompletionContext): boolean {\n return /=\\s*([$\\w.]*)$/.test(context.textBeforeCursor);\n }\n\n private isAfterContextPrefix(context: CompletionContext, prefix: string): boolean {\n return context.textBeforeCursor.endsWith(prefix);\n }\n\n private addCaptureLineCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n const trimmed = context.textBeforeCursor.trim();\n if (trimmed === '' || 'capture'.startsWith(trimmed)) {\n suggestions.push({\n label: 'capture',\n kind: languages.CompletionItemKind.Keyword,\n insertText: 'capture ',\n documentation: 'Define a capture declaration',\n detail: 'capture <Name>',\n range: this.getRangeForWord(context),\n });\n }\n\n if (trimmed.startsWith('capture ')) {\n this.addCaptureNameCompletions(suggestions, context);\n }\n }\n\n private addCaptureNameCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n suggestions.push({\n label: 'CaptureDefinition',\n kind: languages.CompletionItemKind.Class,\n insertText: 'CaptureDefinition',\n documentation: 'A descriptive name for this capture declaration',\n detail: 'Capture name',\n range: this.getRangeForWord(context),\n });\n }\n\n private addSourceTypeCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n [\n { label: 'api', detail: 'source api', documentation: 'Capture data by polling an HTTP API' },\n { label: 'webhook', detail: 'source webhook', documentation: 'Capture data from incoming webhook requests' },\n { label: 'message', detail: 'source message', documentation: 'Capture data from a message topic' },\n { label: 'events', detail: 'source events', documentation: \"Capture another application's public events (inbound translation); each 'from <Event>' names one consumed event\" },\n ].forEach((source) => {\n suggestions.push({\n label: source.label,\n kind: languages.CompletionItemKind.Keyword,\n insertText: source.label,\n documentation: source.documentation,\n detail: source.detail,\n range: this.getRangeForWord(context),\n });\n });\n }\n\n // Per source type — no `auth`/`bearer`/`url`: an API source references a named\n // External Service (`api <ServiceName>`) for base URL and auth; a webhook source's\n // authentication is configured on the source builder, not in CDL text.\n private addSourceBlockCompletions(suggestions: languages.CompletionItem[], context: CompletionContext, sourceType: string | null): void {\n const options: Record<string, Array<{ label: string; detail: string; documentation: string }>> = {\n api: [\n { label: 'api', detail: 'api <ServiceName>', documentation: 'References a configured External Service by name for the base URL and authentication' },\n { label: 'route', detail: 'route <path>', documentation: 'Optional path appended to the External Service base URL; if omitted, the base URL is used as-is' },\n { label: 'poll', detail: 'poll <interval>', documentation: 'The polling interval, for example 5m' },\n ],\n webhook: [\n { label: 'path', detail: 'path <route>', documentation: 'The inbound path this webhook listens on' },\n ],\n events: [\n { label: 'from', detail: 'from <Event>', documentation: \"Names a public event of another application to consume; repeat for more events\" },\n ],\n message: [\n { label: 'topic', detail: 'topic <name>', documentation: 'The topic or subject to subscribe to' },\n ],\n };\n\n (sourceType ? options[sourceType] ?? [] : []).forEach((option) => {\n suggestions.push({\n label: option.label,\n kind: languages.CompletionItemKind.Keyword,\n insertText: `${option.label} `,\n documentation: option.documentation,\n detail: option.detail,\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addTopLevelStatementCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n [\n { label: 'key', insertText: 'key ', detail: 'key <property>', documentation: 'Identify the captured entity' },\n { label: 'map', insertText: 'map', detail: 'map', documentation: 'Map captured fields into a normalized shape' },\n { label: 'append', insertText: 'append ', detail: 'append <EventName>', documentation: 'Append an event when a condition matches' },\n { label: 'nested', insertText: 'nested ', detail: 'nested <property>', documentation: 'Create a nested mapping scope' },\n { label: 'children', insertText: 'children ', detail: 'children <collection> identified by <property>', documentation: 'Handle child collections independently' },\n ].forEach((statement) => {\n suggestions.push({\n label: statement.label,\n kind: languages.CompletionItemKind.Keyword,\n insertText: statement.insertText,\n documentation: statement.documentation,\n detail: statement.detail,\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addAppendNameCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n suggestions.push({\n label: 'ItemChanged',\n kind: languages.CompletionItemKind.Class,\n insertText: 'ItemChanged',\n documentation: 'A generic event name for the appended event',\n detail: 'Event name',\n range: this.getRangeForWord(context),\n });\n }\n\n private addWhenCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n [\n { label: 'added', insertText: 'added', detail: 'when added', documentation: 'Append when a child item was added' },\n { label: 'removed', insertText: 'removed', detail: 'when removed', documentation: 'Append when a child item was removed' },\n { label: 'status', insertText: 'status', detail: 'when <property>', documentation: 'Append when a property changed' },\n { label: 'status transition', insertText: 'status from inactive to active', detail: 'when <property> from <value> to <value>', documentation: 'Append when a property changed between two values' },\n { label: 'quantity', insertText: 'quantity', detail: 'when <property>', documentation: 'Append when a property changed' },\n { label: 'lineNumber', insertText: 'lineNumber', detail: 'when <property>', documentation: 'Append when a specific property changed' },\n ].forEach((option) => {\n suggestions.push({\n label: option.label,\n kind: languages.CompletionItemKind.Keyword,\n insertText: option.insertText,\n documentation: option.documentation,\n detail: option.detail,\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addFromValueCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n [\n { label: '*', insertText: '*', detail: 'Wildcard', documentation: 'Match any previous value' },\n { label: 'inactive', insertText: 'inactive', detail: 'Common value', documentation: 'A common previous state value' },\n { label: 'active', insertText: 'active', detail: 'Common value', documentation: 'A common previous state value' },\n { label: 'true', insertText: 'true', detail: 'Boolean value', documentation: 'Boolean true' },\n { label: 'false', insertText: 'false', detail: 'Boolean value', documentation: 'Boolean false' },\n ].forEach((option) => {\n suggestions.push({\n label: option.label,\n kind: languages.CompletionItemKind.Value,\n insertText: option.insertText,\n documentation: option.documentation,\n detail: option.detail,\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addToValueCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n ['active', 'inactive', 'pending', 'true', 'false'].forEach((value) => {\n suggestions.push({\n label: value,\n kind: languages.CompletionItemKind.Value,\n insertText: value,\n documentation: `Common target value: ${value}`,\n detail: 'Target value',\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addAssignmentValueCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n [\n { label: '$.', insertText: '$.', detail: 'Current captured value', documentation: 'Reference the current captured payload' },\n { label: '$previous.', insertText: '$previous.', detail: 'Previous captured value', documentation: 'Reference the previous state of the payload' },\n { label: '$context.occurred', insertText: '$context.occurred', detail: 'Occurred timestamp', documentation: 'When the capture source produced the current data' },\n { label: '$context.eventSourceId', insertText: '$context.eventSourceId', detail: 'Event source identifier', documentation: 'The resolved event source identifier for the append operation' },\n { label: '$env.', insertText: '$env.', detail: 'Environment variable', documentation: 'Read an environment variable' },\n ].forEach((option) => {\n suggestions.push({\n label: option.label,\n kind: languages.CompletionItemKind.Variable,\n insertText: option.insertText,\n documentation: option.documentation,\n detail: option.detail,\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addPathCompletions(suggestions: languages.CompletionItem[], context: CompletionContext, prefix: string): void {\n commonPropertyPaths.forEach((path) => {\n suggestions.push({\n label: path,\n kind: languages.CompletionItemKind.Property,\n insertText: `${prefix}${path}`,\n documentation: `Common property path: ${prefix}${path}`,\n detail: prefix === '$.' ? 'Current value path' : 'Previous value path',\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addContextCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n [\n { label: 'occurred', insertText: '$context.occurred', detail: 'When the event occurred', documentation: 'Timestamp for when the append event happened' },\n { label: 'eventSourceId', insertText: '$context.eventSourceId', detail: 'Event source identifier', documentation: 'The event source identifier used for the appended event' },\n ].forEach((option) => {\n suggestions.push({\n label: option.label,\n kind: languages.CompletionItemKind.Property,\n insertText: option.insertText,\n documentation: option.documentation,\n detail: option.detail,\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addEnvironmentCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n suggestions.push({\n label: 'API_TOKEN',\n kind: languages.CompletionItemKind.Variable,\n insertText: '$env.API_TOKEN',\n documentation: 'Placeholder environment variable reference',\n detail: 'Environment variable',\n range: this.getRangeForWord(context),\n });\n }\n\n private getCurrentSourceType(model: editor.ITextModel, lineNumber: number): string | null {\n for (let index = lineNumber; index >= 1; index--) {\n const line = model.getLineContent(index).trim();\n const match = line.match(/^source\\s+(api|webhook|message|events)\\b/);\n if (match) {\n return match[1];\n }\n }\n return null;\n }\n\n private getRangeForWord(context: CompletionContext): IRange {\n return {\n startLineNumber: context.lineNumber,\n endLineNumber: context.lineNumber,\n startColumn: context.wordStartColumn,\n endColumn: context.wordEndColumn,\n };\n }\n}\n"],"mappings":"+FAcA,MAAMA,EAAsB,CACxB,KACA,SACA,YACA,WACA,WACA,iBACA,eACA,YACA,qBACA,aACA,UACJ,EAEA,IAAa,mBAAb,KAA4E,CACxE,kBAAoB,CAAC,IAAK,IAAK,IAAK,GAAG,EAEvC,uBACI,EACA,EACkD,CAClD,IAAMC,EAAU,KAAK,aAAaC,EAAOC,CAAQ,EAC3CC,EAA0C,CAAC,EAgCjD,OA9BIH,EAAQ,aAAe,EACvB,KAAK,0BAA0BG,EAAaH,CAAO,EAC5C,KAAK,eAAeA,EAAS,SAAS,EAC7C,KAAK,0BAA0BG,EAAaH,CAAO,EAC5C,KAAK,eAAeA,EAAS,QAAQ,EAC5C,KAAK,yBAAyBG,EAAaH,CAAO,EAC3C,KAAK,qBAAqBA,CAAO,EACxC,KAAK,yBAAyBG,EAAaH,CAAO,EAC3C,KAAK,mBAAmBA,CAAO,EACtC,KAAK,mBAAmBG,EAAaH,CAAO,EACrC,KAAK,gBAAgBA,CAAO,EACnC,KAAK,wBAAwBG,EAAaH,CAAO,EAC1C,KAAK,cAAcA,CAAO,EACjC,KAAK,sBAAsBG,EAAaH,CAAO,EACxC,KAAK,qBAAqBA,EAAS,IAAI,EAC9C,KAAK,mBAAmBG,EAAaH,EAAS,IAAI,EAC3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","names":["commonPropertyPaths","context","model","position","suggestions","textBeforeCursor","word","match","text","keyword","prefix","trimmed","languages","source","sourceType","option","statement","value","path","index","lineNumber"],"sources":["../../../../sub-languages/capture/CompletionProvider.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 { languages, type editor, type Position, type IRange } from 'monaco-editor';\n\ninterface CompletionContext {\n textBeforeCursor: string;\n currentWord: string;\n indentLevel: number;\n lineNumber: number;\n wordStartColumn: number;\n wordEndColumn: number;\n}\n\nconst commonPropertyPaths = [\n 'id',\n 'status',\n 'firstName',\n 'lastName',\n 'fullName',\n 'address.street',\n 'address.city',\n 'lineItems',\n 'lineItems.quantity',\n 'lineNumber',\n 'quantity',\n];\n\nexport class CompletionProvider implements languages.CompletionItemProvider {\n triggerCharacters = ['.', ' ', '=', '$'];\n\n provideCompletionItems(\n model: editor.ITextModel,\n position: Position,\n ): languages.ProviderResult<languages.CompletionList> {\n const context = this.buildContext(model, position);\n const suggestions: languages.CompletionItem[] = [];\n\n if (context.lineNumber === 1) {\n this.addCaptureLineCompletions(suggestions, context);\n } else if (this.isAfterKeyword(context, 'capture')) {\n this.addCaptureNameCompletions(suggestions, context);\n } else if (this.isAfterKeyword(context, 'source')) {\n this.addSourceTypeCompletions(suggestions, context);\n } else if (this.isAfterAppendKeyword(context)) {\n this.addAppendNameCompletions(suggestions, context);\n } else if (this.isAfterWhenKeyword(context)) {\n this.addWhenCompletions(suggestions, context);\n } else if (this.isAfterWhenFrom(context)) {\n this.addFromValueCompletions(suggestions, context);\n } else if (this.isAfterWhenTo(context)) {\n this.addToValueCompletions(suggestions, context);\n } else if (this.isAfterContextPrefix(context, '$.')) {\n this.addPathCompletions(suggestions, context, '$.');\n } else if (this.isAfterContextPrefix(context, '$previous.')) {\n this.addPathCompletions(suggestions, context, '$previous.');\n } else if (this.isAfterContextPrefix(context, '$context.')) {\n this.addContextCompletions(suggestions, context);\n } else if (this.isAfterContextPrefix(context, '$env.')) {\n this.addEnvironmentCompletions(suggestions, context);\n } else if (this.isAfterAssignment(context)) {\n this.addAssignmentValueCompletions(suggestions, context);\n } else if ((this.isStartOfLine(context) || this.isAfterIndent(context)) && context.indentLevel === 1) {\n this.addTopLevelStatementCompletions(suggestions, context);\n } else if ((this.isStartOfLine(context) || this.isAfterIndent(context)) && context.indentLevel >= 2) {\n this.addSourceBlockCompletions(suggestions, context, this.getCurrentSourceType(model, position.lineNumber));\n }\n\n return { suggestions };\n }\n\n private buildContext(model: editor.ITextModel, position: Position): CompletionContext {\n const lineContent = model.getLineContent(position.lineNumber);\n const textBeforeCursor = lineContent.substring(0, position.column - 1);\n const word = model.getWordUntilPosition(position);\n\n return {\n textBeforeCursor,\n currentWord: word.word || '',\n indentLevel: this.getIndentLevel(textBeforeCursor),\n lineNumber: position.lineNumber,\n wordStartColumn: word.startColumn,\n wordEndColumn: word.endColumn,\n };\n }\n\n private getIndentLevel(text: string): number {\n const match = text.match(/^(\\s*)/);\n return match ? Math.floor(match[1].length / 2) : 0;\n }\n\n private isStartOfLine(context: CompletionContext): boolean {\n return context.textBeforeCursor.trim() === '';\n }\n\n private isAfterIndent(context: CompletionContext): boolean {\n return /^\\s+$/.test(context.textBeforeCursor);\n }\n\n private isAfterKeyword(context: CompletionContext, keyword: string): boolean {\n const pattern = new RegExp(`\\\\b${keyword}\\\\s+\\\\w*$`);\n return pattern.test(context.textBeforeCursor);\n }\n\n private isAfterAppendKeyword(context: CompletionContext): boolean {\n return /\\bappend\\s+[\\w.]*$/.test(context.textBeforeCursor);\n }\n\n private isAfterWhenKeyword(context: CompletionContext): boolean {\n return /\\bwhen\\s+[\\w.]*$/.test(context.textBeforeCursor);\n }\n\n private isAfterWhenFrom(context: CompletionContext): boolean {\n return /\\bwhen\\s+[\\w.]+\\s+from\\s+[^\\s]*$/.test(context.textBeforeCursor);\n }\n\n private isAfterWhenTo(context: CompletionContext): boolean {\n return /\\bwhen\\s+[\\w.]+\\s+from\\s+\\S+\\s+to\\s+[^\\s]*$/.test(context.textBeforeCursor);\n }\n\n private isAfterAssignment(context: CompletionContext): boolean {\n return /=\\s*([$\\w.]*)$/.test(context.textBeforeCursor);\n }\n\n private isAfterContextPrefix(context: CompletionContext, prefix: string): boolean {\n return context.textBeforeCursor.endsWith(prefix);\n }\n\n private addCaptureLineCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n const trimmed = context.textBeforeCursor.trim();\n if (trimmed === '' || 'capture'.startsWith(trimmed)) {\n suggestions.push({\n label: 'capture',\n kind: languages.CompletionItemKind.Keyword,\n insertText: 'capture ',\n documentation: 'Define a capture declaration',\n detail: 'capture <Name>',\n range: this.getRangeForWord(context),\n });\n }\n\n if (trimmed.startsWith('capture ')) {\n this.addCaptureNameCompletions(suggestions, context);\n }\n }\n\n private addCaptureNameCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n suggestions.push({\n label: 'CaptureDefinition',\n kind: languages.CompletionItemKind.Class,\n insertText: 'CaptureDefinition',\n documentation: 'A descriptive name for this capture declaration',\n detail: 'Capture name',\n range: this.getRangeForWord(context),\n });\n }\n\n private addSourceTypeCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n [\n { label: 'api', detail: 'source api', documentation: 'Capture data by polling an HTTP API' },\n { label: 'webhook', detail: 'source webhook', documentation: 'Capture data from incoming webhook requests' },\n { label: 'message', detail: 'source message', documentation: 'Capture data from a message topic' },\n { label: 'events', detail: 'source events', documentation: \"Capture another application's public events (inbound translation); each 'from <Event>' names one consumed event\" },\n ].forEach((source) => {\n suggestions.push({\n label: source.label,\n kind: languages.CompletionItemKind.Keyword,\n insertText: source.label,\n documentation: source.documentation,\n detail: source.detail,\n range: this.getRangeForWord(context),\n });\n });\n }\n\n // Per source type — no `auth`/`bearer`/`url`: an API source references a named\n // External Service (`api <ServiceName>`) for base URL and auth; a webhook source's\n // authentication is configured on the source builder, not in CDL text.\n private addSourceBlockCompletions(suggestions: languages.CompletionItem[], context: CompletionContext, sourceType: string | null): void {\n const options: Record<string, Array<{ label: string; detail: string; documentation: string }>> = {\n api: [\n { label: 'api', detail: 'api <ServiceName>', documentation: 'References a configured External Service by name for the base URL and authentication' },\n { label: 'route', detail: 'route <path>', documentation: 'Optional path appended to the External Service base URL; if omitted, the base URL is used as-is' },\n { label: 'poll', detail: 'poll <interval>', documentation: 'The polling interval, for example 5m' },\n ],\n webhook: [\n { label: 'path', detail: 'path <route>', documentation: 'The inbound path this webhook listens on' },\n ],\n events: [\n { label: 'from', detail: 'from <Event>', documentation: \"Names a public event of another application to consume; repeat for more events\" },\n ],\n message: [\n { label: 'topic', detail: 'topic <name>', documentation: 'The topic or subject to subscribe to' },\n ],\n };\n\n (sourceType ? options[sourceType] ?? [] : []).forEach((option) => {\n suggestions.push({\n label: option.label,\n kind: languages.CompletionItemKind.Keyword,\n insertText: `${option.label} `,\n documentation: option.documentation,\n detail: option.detail,\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addTopLevelStatementCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n [\n { label: 'key', insertText: 'key ', detail: 'key <property>', documentation: 'Identify the captured entity' },\n { label: 'map', insertText: 'map', detail: 'map', documentation: 'Map captured fields into a normalized shape' },\n { label: 'append', insertText: 'append ', detail: 'append <EventName>', documentation: 'Append an event when a condition matches' },\n { label: 'nested', insertText: 'nested ', detail: 'nested <property>', documentation: 'Create a nested mapping scope' },\n { label: 'children', insertText: 'children ', detail: 'children <collection> identified by <property>', documentation: 'Handle child collections independently' },\n ].forEach((statement) => {\n suggestions.push({\n label: statement.label,\n kind: languages.CompletionItemKind.Keyword,\n insertText: statement.insertText,\n documentation: statement.documentation,\n detail: statement.detail,\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addAppendNameCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n suggestions.push({\n label: 'ItemChanged',\n kind: languages.CompletionItemKind.Class,\n insertText: 'ItemChanged',\n documentation: 'A generic event name for the appended event',\n detail: 'Event name',\n range: this.getRangeForWord(context),\n });\n }\n\n private addWhenCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n [\n { label: 'added', insertText: 'added', detail: 'when added', documentation: 'Append when a child item was added' },\n { label: 'removed', insertText: 'removed', detail: 'when removed', documentation: 'Append when a child item was removed' },\n { label: 'status', insertText: 'status', detail: 'when <property>', documentation: 'Append when a property changed' },\n { label: 'status transition', insertText: 'status from inactive to active', detail: 'when <property> from <value> to <value>', documentation: 'Append when a property changed between two values' },\n { label: 'quantity', insertText: 'quantity', detail: 'when <property>', documentation: 'Append when a property changed' },\n { label: 'lineNumber', insertText: 'lineNumber', detail: 'when <property>', documentation: 'Append when a specific property changed' },\n ].forEach((option) => {\n suggestions.push({\n label: option.label,\n kind: languages.CompletionItemKind.Keyword,\n insertText: option.insertText,\n documentation: option.documentation,\n detail: option.detail,\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addFromValueCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n [\n { label: '*', insertText: '*', detail: 'Wildcard', documentation: 'Match any previous value' },\n { label: 'inactive', insertText: 'inactive', detail: 'Common value', documentation: 'A common previous state value' },\n { label: 'active', insertText: 'active', detail: 'Common value', documentation: 'A common previous state value' },\n { label: 'true', insertText: 'true', detail: 'Boolean value', documentation: 'Boolean true' },\n { label: 'false', insertText: 'false', detail: 'Boolean value', documentation: 'Boolean false' },\n ].forEach((option) => {\n suggestions.push({\n label: option.label,\n kind: languages.CompletionItemKind.Value,\n insertText: option.insertText,\n documentation: option.documentation,\n detail: option.detail,\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addToValueCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n ['active', 'inactive', 'pending', 'true', 'false'].forEach((value) => {\n suggestions.push({\n label: value,\n kind: languages.CompletionItemKind.Value,\n insertText: value,\n documentation: `Common target value: ${value}`,\n detail: 'Target value',\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addAssignmentValueCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n [\n { label: '$.', insertText: '$.', detail: 'Current captured value', documentation: 'Reference the current captured payload' },\n { label: '$previous.', insertText: '$previous.', detail: 'Previous captured value', documentation: 'Reference the previous state of the payload' },\n { label: '$context.occurred', insertText: '$context.occurred', detail: 'Occurred timestamp', documentation: 'When the capture source produced the current data' },\n { label: '$context.eventSourceId', insertText: '$context.eventSourceId', detail: 'Event source identifier', documentation: 'The resolved event source identifier for the append operation' },\n { label: '$env.', insertText: '$env.', detail: 'Environment variable', documentation: 'Read an environment variable' },\n ].forEach((option) => {\n suggestions.push({\n label: option.label,\n kind: languages.CompletionItemKind.Variable,\n insertText: option.insertText,\n documentation: option.documentation,\n detail: option.detail,\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addPathCompletions(suggestions: languages.CompletionItem[], context: CompletionContext, prefix: string): void {\n commonPropertyPaths.forEach((path) => {\n suggestions.push({\n label: path,\n kind: languages.CompletionItemKind.Property,\n insertText: `${prefix}${path}`,\n documentation: `Common property path: ${prefix}${path}`,\n detail: prefix === '$.' ? 'Current value path' : 'Previous value path',\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addContextCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n [\n { label: 'occurred', insertText: '$context.occurred', detail: 'When the event occurred', documentation: 'Timestamp for when the append event happened' },\n { label: 'eventSourceId', insertText: '$context.eventSourceId', detail: 'Event source identifier', documentation: 'The event source identifier used for the appended event' },\n ].forEach((option) => {\n suggestions.push({\n label: option.label,\n kind: languages.CompletionItemKind.Property,\n insertText: option.insertText,\n documentation: option.documentation,\n detail: option.detail,\n range: this.getRangeForWord(context),\n });\n });\n }\n\n private addEnvironmentCompletions(suggestions: languages.CompletionItem[], context: CompletionContext): void {\n suggestions.push({\n label: 'API_TOKEN',\n kind: languages.CompletionItemKind.Variable,\n insertText: '$env.API_TOKEN',\n documentation: 'Placeholder environment variable reference',\n detail: 'Environment variable',\n range: this.getRangeForWord(context),\n });\n }\n\n private getCurrentSourceType(model: editor.ITextModel, lineNumber: number): string | null {\n for (let index = lineNumber; index >= 1; index--) {\n const line = model.getLineContent(index).trim();\n const match = line.match(/^source\\s+(api|webhook|message|events)\\b/);\n if (match) {\n return match[1];\n }\n }\n return null;\n }\n\n private getRangeForWord(context: CompletionContext): IRange {\n return {\n startLineNumber: context.lineNumber,\n endLineNumber: context.lineNumber,\n startColumn: context.wordStartColumn,\n endColumn: context.wordEndColumn,\n };\n }\n}\n"],"mappings":"A,+FAcA,MAAMA,EAAsB,CACxB,KACA,SACA,YACA,WACA,WACA,iBACA,eACA,YACA,qBACA,aACA,UACJ,EAEA,IAAa,mBAAb,KAA4E,CACxE,kBAAoB,CAAC,IAAK,IAAK,IAAK,GAAG,EAEvC,uBACI,EACA,EACkD,CAClD,IAAMC,EAAU,KAAK,aAAaC,EAAOC,CAAQ,EAC3CC,EAA0C,CAAC,EAgCjD,OA9BIH,EAAQ,aAAe,EACvB,KAAK,0BAA0BG,EAAaH,CAAO,EAC5C,KAAK,eAAeA,EAAS,SAAS,EAC7C,KAAK,0BAA0BG,EAAaH,CAAO,EAC5C,KAAK,eAAeA,EAAS,QAAQ,EAC5C,KAAK,yBAAyBG,EAAaH,CAAO,EAC3C,KAAK,qBAAqBA,CAAO,EACxC,KAAK,yBAAyBG,EAAaH,CAAO,EAC3C,KAAK,mBAAmBA,CAAO,EACtC,KAAK,mBAAmBG,EAAaH,CAAO,EACrC,KAAK,gBAAgBA,CAAO,EACnC,KAAK,wBAAwBG,EAAaH,CAAO,EAC1C,KAAK,cAAcA,CAAO,EACjC,KAAK,sBAAsBG,EAAaH,CAAO,EACxC,KAAK,qBAAqBA,EAAS,IAAI,EAC9C,KAAK,mBAAmBG,EAAaH,EAAS,IAAI,EAC3C,KAAK,qBAAqBA,EAAS,YAAY,EACtD,KAAK,mBAAmBG,EAAaH,EAAS,YAAY,EACnD,KAAK,qBAAqBA,EAAS,WAAW,EACrD,KAAK,sBAAsBG,EAAaH,CAAO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