@cratis/screenplay-language 5.2.0 → 5.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (408) 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 +2 -0
  67. package/dist/bundles/compiler/Parsing/ApplicationContextParser.js.map +1 -0
  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 +1 -1
  288. package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js.map +1 -1
  289. package/dist/bundles/compiler/Syntax/SourceOptions.js.map +1 -1
  290. package/dist/bundles/compiler/Syntax/SpecificationCaseOrigin.js.map +1 -1
  291. package/dist/bundles/compiler/Syntax/StreamIdFormatter.js.map +1 -1
  292. package/dist/bundles/compiler/Syntax/StrictSyntaxJson.js +1 -1
  293. package/dist/bundles/compiler/Syntax/Structure.js.map +1 -1
  294. package/dist/bundles/compiler/Syntax/SyntaxCollections.js +1 -1
  295. package/dist/bundles/compiler/Syntax/SyntaxCollections.js.map +1 -1
  296. package/dist/bundles/compiler/Syntax/SyntaxInvariants.js +1 -1
  297. package/dist/bundles/compiler/Syntax/SyntaxInvariants.js.map +1 -1
  298. package/dist/bundles/compiler/Syntax/SyntaxJson.js +1 -1
  299. package/dist/bundles/compiler/Syntax/SyntaxJson.js.map +1 -1
  300. package/dist/bundles/compiler/Syntax/SyntaxMemberContracts.js.map +1 -1
  301. package/dist/bundles/compiler/Syntax/index.js +1 -1
  302. package/dist/bundles/compiler/Text/ImplementationHintText.js.map +1 -1
  303. package/dist/bundles/compiler/Text/ReservedWords.js.map +1 -1
  304. package/dist/bundles/compiler/Text/SourceStreamNames.js.map +1 -1
  305. package/dist/bundles/compiler/Text/StringLiteral.js.map +1 -1
  306. package/dist/bundles/compiler/Text/ordinalIgnoreCaseKey.js.map +1 -1
  307. package/dist/bundles/compiler/Text/patterns.js.map +1 -1
  308. package/dist/bundles/compiler/index.js +1 -1
  309. package/dist/bundles/completion-items.js +18 -17
  310. package/dist/bundles/completion-items.js.map +1 -1
  311. package/dist/bundles/completion-planner.js +2 -2
  312. package/dist/bundles/completion-planner.js.map +1 -1
  313. package/dist/bundles/completions.js +1 -1
  314. package/dist/bundles/completions.js.map +1 -1
  315. package/dist/bundles/continuation-responses.js +1 -1
  316. package/dist/bundles/continuation-responses.js.map +1 -1
  317. package/dist/bundles/declarations.js.map +1 -1
  318. package/dist/bundles/dependency-completions.js.map +1 -1
  319. package/dist/bundles/dependency-target-analysis.js.map +1 -1
  320. package/dist/bundles/diagnostic-codes.js +1 -1
  321. package/dist/bundles/diagnostic-codes.js.map +1 -1
  322. package/dist/bundles/diagnostics.js +1 -1
  323. package/dist/bundles/diagnostics.js.map +1 -1
  324. package/dist/bundles/document-context.js.map +1 -1
  325. package/dist/bundles/documentation-item.js.map +1 -1
  326. package/dist/bundles/event-analysis-source.js.map +1 -1
  327. package/dist/bundles/event-context-catalog.js.map +1 -1
  328. package/dist/bundles/event-context.js.map +1 -1
  329. package/dist/bundles/event-source-authoring.js +11 -11
  330. package/dist/bundles/event-source-authoring.js.map +1 -1
  331. package/dist/bundles/example-analysis.js +2 -2
  332. package/dist/bundles/example-analysis.js.map +1 -1
  333. package/dist/bundles/example-authoring.js +2 -2
  334. package/dist/bundles/example-authoring.js.map +1 -1
  335. package/dist/bundles/example-declaration-items.js.map +1 -1
  336. package/dist/bundles/example-values.js.map +1 -1
  337. package/dist/bundles/file-imports.js.map +1 -1
  338. package/dist/bundles/file-references.js.map +1 -1
  339. package/dist/bundles/generation-completions.js.map +1 -1
  340. package/dist/bundles/hover-content.js +5 -5
  341. package/dist/bundles/hover-content.js.map +1 -1
  342. package/dist/bundles/hover.js.map +1 -1
  343. package/dist/bundles/index.js +1 -1
  344. package/dist/bundles/index.js.map +1 -1
  345. package/dist/bundles/inlay-hints.js.map +1 -1
  346. package/dist/bundles/inline-completions.js +1 -1
  347. package/dist/bundles/inline-completions.js.map +1 -1
  348. package/dist/bundles/inline-event-validation.js +1 -1
  349. package/dist/bundles/inline-event-validation.js.map +1 -1
  350. package/dist/bundles/keyword-docs.js +1 -1
  351. package/dist/bundles/keyword-docs.js.map +1 -1
  352. package/dist/bundles/language.js +1 -1
  353. package/dist/bundles/language.js.map +1 -1
  354. package/dist/bundles/named-rule-context.js.map +1 -1
  355. package/dist/bundles/operation-authoring.js +6 -6
  356. package/dist/bundles/operation-authoring.js.map +1 -1
  357. package/dist/bundles/persona-analysis.js +1 -1
  358. package/dist/bundles/persona-analysis.js.map +1 -1
  359. package/dist/bundles/production-destinations.js +1 -1
  360. package/dist/bundles/production-destinations.js.map +1 -1
  361. package/dist/bundles/purpose-items.js.map +1 -1
  362. package/dist/bundles/reaction-authoring.js +3 -3
  363. package/dist/bundles/reaction-authoring.js.map +1 -1
  364. package/dist/bundles/read-model-key-completions.js +1 -1
  365. package/dist/bundles/read-model-key-completions.js.map +1 -1
  366. package/dist/bundles/refusal-context.js.map +1 -1
  367. package/dist/bundles/response-analysis.js +1 -1
  368. package/dist/bundles/response-analysis.js.map +1 -1
  369. package/dist/bundles/response-completions.js +1 -1
  370. package/dist/bundles/response-completions.js.map +1 -1
  371. package/dist/bundles/response-tokens.js +2 -2
  372. package/dist/bundles/response-tokens.js.map +1 -1
  373. package/dist/bundles/scope-items.js +3 -3
  374. package/dist/bundles/scope-items.js.map +1 -1
  375. package/dist/bundles/structure-completions.js.map +1 -1
  376. package/dist/bundles/sub-language-registry.js.map +1 -1
  377. package/dist/bundles/sub-languages/capture/CompletionProvider.js.map +1 -1
  378. package/dist/bundles/sub-languages/capture/HoverProvider.js.map +1 -1
  379. package/dist/bundles/sub-languages/capture/Validator.js.map +1 -1
  380. package/dist/bundles/sub-languages/capture/index.js.map +1 -1
  381. package/dist/bundles/sub-languages/capture/language.js.map +1 -1
  382. package/dist/bundles/sub-languages/cdl.js.map +1 -1
  383. package/dist/bundles/sub-languages/pdl.js.map +1 -1
  384. package/dist/bundles/sub-languages/projection/CodeActionProvider.js.map +1 -1
  385. package/dist/bundles/sub-languages/projection/CompletionProvider.js +1 -1
  386. package/dist/bundles/sub-languages/projection/CompletionProvider.js.map +1 -1
  387. package/dist/bundles/sub-languages/projection/HoverProvider.js.map +1 -1
  388. package/dist/bundles/sub-languages/projection/Validator.js.map +1 -1
  389. package/dist/bundles/sub-languages/projection/index.js.map +1 -1
  390. package/dist/bundles/sub-languages/projection/language.js.map +1 -1
  391. package/dist/bundles/symbols.js +2 -2
  392. package/dist/bundles/symbols.js.map +1 -1
  393. package/dist/bundles/themes/screenplay-dark.js.map +1 -1
  394. package/dist/bundles/themes/screenplay-light.js.map +1 -1
  395. package/dist/bundles/tokens.js +1 -1
  396. package/dist/bundles/tokens.js.map +1 -1
  397. package/dist/bundles/validation.js +2 -2
  398. package/dist/bundles/validation.js.map +1 -1
  399. package/dist/completion-items.d.ts +1 -0
  400. package/dist/completion-items.d.ts.map +1 -1
  401. package/dist/completion-planner.d.ts.map +1 -1
  402. package/dist/diagnostic-codes.d.ts +6 -0
  403. package/dist/diagnostic-codes.d.ts.map +1 -1
  404. package/dist/keyword-docs.d.ts.map +1 -1
  405. package/dist/language.d.ts.map +1 -1
  406. package/dist/scope-items.d.ts.map +1 -1
  407. package/dist/tokens.d.ts.map +1 -1
  408. package/package.json +3 -3
@@ -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: '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,E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AY,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,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,M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mD,CACvI,EAEaC,EAAqC,CAC9C,CAAE,MAAO,QAAS,WAAY,qBAAsB,cAAe,gCAAiC,EACpG,CAAE,MAAO,SAAU,WAAY,oBAAqB,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,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,CACzC,IAAMM,EAAWT,EAAM,IAAIU,CAAQ,CAAC,CAAC,OAAO,GAAUC,EAAS,CAAC,EAChE,OAAOF,EAAS,SAAW,EAAI,EAAI,KAAK,IAAI,GAAGA,CAAQ,CAC3D,CAEA,SAAS,cAAc,EAAwB,EAA0B,EAAgB,EAAsB,CAC3G,IAAMG,EAAY,gBAAgBP,EAAQ,KAAME,CAAO,EACjDM,EAAWN,EAAQ,OAAO,KAAK,GAASC,EAAM,OAASI,CAAS,E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GAAGD,IAAMC,GAAQ,EAAI,KAE5E5C,EAAUgC,EAAO,MAAM,sBAAsB,EACnD,GAAIhC,EAAS,CACT,IAAM4B,EAAS1B,EAAQ,SAAS,KAAK,GAAa2B,EAAU,OAAS7B,EAAQ,EAAE,EACzE6C,EAAa,eAAelD,GAAQ,EAAM,IAAUD,EAAQ0C,GAAad,EAAK,KAAK,IAAMU,GAAU3B,EAASiB,CAAI,EAAIhB,CAAM,EAKhI,OAJaX,EAAM,MAAMkD,EAAa,EAAGT,CAAS,CAAC,CAAC,OAAO,GAAQd,EAAK,KAAK,CAAC,CAAC,OAAS,CAClE,CAAC,CAAC,KAAK,GAAQ,2BAA2B,KAAKA,CAAI,CAC5D,EAAU,KACnB,CAACM,GAAUA,EAAO,WAAW,SAAW,EAAU,KAAK,gBAAgB5B,EAAQ,GAAIE,EAASI,EAAQI,CAAI,CAAC,EACtG,KAAK,cAAckB,EAAQ1B,EAASI,EAAQI,CAAI,CAAC,CAC5D,CAEA,GAAI,2BAA2B,KAAKsB,CAAM,GAAKU,GAAgB,EAAG,CAC9D,IAAMI,EAAQ,aAAanD,EAAO+B,EAAQW,EAAUnC,CAAO,EAC3D,OAAO4C,EAAQ,KAAK,mBAAmBA,EAAM,OAAQA,EAAM,WAAY5C,EAASI,EAAQI,CAAI,CAAC,EAAI,IACrG,CAEA,IAAMqC,EAAOf,EAAO,MAAM,yCAAyC,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"}
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,MAAQ,GAAGA,IAAO,UAAUH,CAAI,GACrD,CAIA,SAAS,WAAW,EAAyB,CACzC,IAAMM,EAAWT,EAAM,IAAIU,CAAQ,CAAC,CAAC,OAAO,GAAUC,EAAS,CAAC,EAChE,OAAOF,EAAS,SAAW,EAAI,EAAI,KAAK,IAAI,GAAGA,CAAQ,CAC3D,CAEA,SAAS,cAAc,EAAwB,EAA0B,EAAgB,EAAsB,CAC3G,IAAMG,EAAY,gBAAgBP,EAAQ,KAAME,CA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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,EAC3C,KAAK,qBAAqBA,EAAS,YAAY,EACtD,KAAK,mBAAmBG,EAAaH,EAAS,YAAY,EACnD,KAAK,qBAAqBA,EAAS,WAAW,EACrD,KAAK,sBAAsBG,EAAaH,CAAO,EACxC,KAAK,qBAAqBA,EAAS,OAAO,EACjD,KAAK,0BAA0BG,EAAaH,CAAO,EAC5C,KAAK,kBAAkBA,CAAO,EACrC,KAAK,8BAA8BG,EAAaH,CAAO,GAC/C,KAAK,cAAcA,CAAO,GAAK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EAAkC,CACrG,CACI,CAAE,MAAO,WAAY,WAAY,oBAAqB,OAAQ,0BAA2B,cAAe,8CAA+C,EACvJ,CAAE,MAAO,gBAAiB,WAAY,yBAA0B,OAAQ,0BAA2B,cAAe,yDAA0D,CAChL,CAAC,CAAC,QAAS,GAAW,CAClBG,EAAY,KAAK,CACb,MAAOW,EAAO,MACd,KAAMH,EAAU,mBAAmB,SACnC,WAAYG,EAAO,WACnB,cAAeA,EAAO,cACtB,OAAQA,EAAO,OACf,MAAO,KAAK,gBAAgBd,CAAO,CACvC,CAAC,CACL,CAAC,CACL,CAEA,0BAAkC,EAAyC,EAAkC,CACzGG,EAAY,KAAK,CACb,MAAO,YACP,KAAMQ,EAAU,mBAAmB,SACnC,WAAY,iBACZ,cAAe,6CACf,OAAQ,uBACR,MAAO,KAAK,gBAAgBX,CAAO,CACvC,CAAC,CACL,CAEA,qBAA6B,EAA0B,EAAmC,CACtF,IAAK,IAAIkB,EAAQC,EAAYD,GAAS,EAAG,IAAS,CAE9C,IAAMZ,EADOL,EAAM,eAAeiB,CAAK,CAAC,CAAC,KACxB,CAAC,CAAC,MAAM,0CAA0C,EACnE,GAAIZ,EACA,OAAOA,EAAM,EAErB,CACA,OAAO,IACX,CAEA,gBAAwB,EAAoC,CACxD,MAAO,CACH,gBAAiBN,EAAQ,WACzB,cAAeA,EAAQ,WACvB,YAAaA,EAAQ,gBACrB,UAAWA,EAAQ,aACvB,CACJ,CACJ"}
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"],"m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cAAe,yDAA0D,CAChL,CAAC,CAAC,QAAS,GAAW,CAClBG,EAAY,KAAK,CACb,MAAOW,EAAO,MACd,KAAMH,EAAU,mBAAmB,SACnC,WAAYG,EAAO,WACnB,cAAeA,EAAO,cACtB,OAAQA,EAAO,OACf,MAAO,KAAK,gBAAgBd,CAAO,CACvC,CAAC,CACL,CAAC,CACL,CAEA,0BAAkC,EAAyC,EAAkC,CACzGG,EAAY,KAAK,CACb,MAAO,YACP,KAAMQ,EAAU,mBAAmB,SACnC,WAAY,iBACZ,cAAe,6CACf,OAAQ,uBACR,MAAO,KAAK,gBAAgBX,CAAO,CACvC,CAAC,CACL,CAEA,qBAA6B,EAA0B,EAAmC,CACtF,IAAK,IAAIkB,EAAQC,EAAYD,GAAS,EAAG,IAAS,CAE9C,IAAMZ,EADOL,EAAM,eAAeiB,CAAK,CAAC,CAAC,KACxB,CAAC,CAAC,MAAM,0CAA0C,EACnE,GAAIZ,EACA,OAAOA,EAAM,EAErB,CACA,OAAO,IACX,CAEA,gBAAwB,EAAoC,CACxD,MAAO,CACH,gBAAiBN,EAAQ,WACzB,cAAeA,EAAQ,WACvB,YAAaA,EAAQ,gBACrB,UAAWA,EAAQ,aACvB,CACJ,CACJ,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"HoverProvider.js","names":["token","model","position","keywordInfo","expressionInfo","tokens","column","startIndex","endIndex","word","\"$context\"","\"$identity\"","\"$previous\"","\"$env\""],"sources":["../../../../sub-languages/capture/HoverProvider.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { editor, languages, Position, IRange } from 'monaco-editor';\n\nexport class HoverProvider implements languages.HoverProvider {\n provideHover(model: editor.ITextModel, position: Position): languages.ProviderResult<languages.Hover> {\n const token = this.getTokenAtPosition(model, position);\n if (!token) {\n return null;\n }\n\n const keywordInfo = this.getKeywordInfo(token.word);\n if (keywordInfo) {\n return {\n contents: [{ value: keywordInfo }],\n range: token.range,\n };\n }\n\n const expressionInfo = this.getExpressionInfo(token.word);\n if (expressionInfo) {\n return {\n contents: [{ value: expressionInfo }],\n range: token.range,\n };\n }\n\n return null;\n }\n\n private getTokenAtPosition(model: editor.ITextModel, position: Position): { word: string; range: IRange } | null {\n const lineContent = model.getLineContent(position.lineNumber);\n const tokens = [...lineContent.matchAll(/\\$context|\\$identity|\\$previous|\\$env|[a-zA-Z_][\\w-]*/g)];\n const column = position.column - 1;\n\n for (const token of tokens) {\n const startIndex = token.index ?? 0;\n const endIndex = startIndex + token[0].length;\n if (column >= startIndex && column <= endIndex) {\n return {\n word: token[0],\n range: {\n startLineNumber: position.lineNumber,\n endLineNumber: position.lineNumber,\n startColumn: startIndex + 1,\n endColumn: endIndex + 1,\n },\n };\n }\n }\n\n return null;\n }\n\n // No `auth`/`bearer`/`url` — removed with the grammar. `api`, `route`, `path`, and\n // `topic` reflect the current source-property meanings (see grammar.md).\n private getKeywordInfo(word: string): string | null {\n const keywords: Record<string, string> = {\n capture: '**capture** *<Name>*\\n\\nDeclares a capture and gives it a unique name.',\n source: '**source** *<type>*\\n\\nDefines where the capture reads input from.',\n key: '**key** *<property>*\\n\\nSelects the property used to identify each captured item.',\n map: '**map**\\n\\nMaps source fields into a normalized shape for later append blocks.',\n append: '**append** *<EventName>*\\n\\nDeclares an event to append when the `when` clause matches.',\n when: '**when** *<condition>*\\n\\nSpecifies when an append block should fire.',\n nested: '**nested** *<property>*\\n\\nCreates a nested mapping scope for an object property.',\n children: '**children** *<collection>* **identified by** *<property>*\\n\\nCreates a scope for child collection items.',\n identified: '**identified**\\n\\nUsed with `children` to declare how child items are identified.',\n by: '**by**\\n\\nUsed in `children ... identified by`, `split ... by`, and similar clauses.',\n api: '**api**\\n\\nAs a source type (`source api`): polls an HTTP API for changes.\\n\\nAs a source property (`api <ServiceName>`): references a configured External Service by name for the base URL and authentication.',\n webhook: '**webhook**\\n\\nA source type for receiving webhook payloads.',\n message: '**message**\\n\\nA source type for consuming messages from a topic.',\n events: \"**events**\\n\\nA source type for consuming the public events of another application: `source events` with one `from <Event>` line per event. Inbound Translate slices only; admitted by executable semantic model (ESM) v9. The reference runner reports a typed Unsupported outcome for `when capture` over it.\",\n route: '**route** *<path>*\\n\\nOptional path appended to an API source\\'s External Service base URL. If omitted, the base URL is used as-is.',\n poll: '**poll** *<interval>*\\n\\nSets the polling interval for an API source.',\n path: '**path** *<route>*\\n\\nThe inbound path a webhook source listens on.',\n topic: '**topic** *<name>*\\n\\nConfigures the topic for a message source.',\n from: '**from** *<value>*\\n\\nUsed in a `when` clause to match the previous value, and under `source events` to name a consumed public event (`from <Event>`).',\n to: '**to** *<value>*\\n\\nUsed in a `when` clause to match the new value.',\n or: '**or**\\n\\nCombines multiple `when` conditions.',\n and: '**and**\\n\\nCombines multiple `when` conditions that must all match.',\n added: '**added**\\n\\nMatches when a child item was added.',\n removed: '**removed**\\n\\nMatches when a child item was removed.',\n translate: '**translate**\\n\\nMaps source values to new values inside a `map` block.',\n split: '**split** *<value>* **by** *<separator>*\\n\\nSplits a string into multiple mapped fields.',\n };\n\n return keywords[word] || null;\n }\n\n private getExpressionInfo(word: string): string | null {\n const expressions: Record<string, string> = {\n '$context': '**$context**\\n\\nCapture execution context.\\n\\n**Properties:**\\n- `occurred` - When the current event should be considered to have occurred\\n- `eventSourceId` - The resolved event source identifier',\n '$identity': '**$identity**\\n\\nThe caller, equivalent to `$context.identity`. Properties: `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`. Caller mappings are not portable capture inputs (PLAY0268).',\n '$previous': '**$previous**\\n\\nThe previous state for the captured item. Use dot notation such as `$previous.status`.',\n '$env': '**$env**\\n\\nEnvironment variables. Use dot notation such as `$env.API_TOKEN`.',\n };\n\n return expressions[word] || null;\n }\n}\n"],"mappings":"qDAKA,IAAa,cAAb,KAA8D,CAC1D,aAAa,EAA0B,EAA+D,CAClG,IAAMA,EAAQ,KAAK,mBAAmBC,EAAOC,CAAQ,EACrD,GAAI,CAAC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C,UAAa;;0FACbC,KAAQ;;oEAGK,EAAEJ,IAAS,IAChC,CACJ"}
1
+ {"version":3,"file":"HoverProvider.js","names":["token","model","position","keywordInfo","expressionInfo","tokens","column","startIndex","endIndex","word","\"$context\"","\"$identity\"","\"$previous\"","\"$env\""],"sources":["../../../../sub-languages/capture/HoverProvider.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { editor, languages, Position, IRange } from 'monaco-editor';\n\nexport class HoverProvider implements languages.HoverProvider {\n provideHover(model: editor.ITextModel, position: Position): languages.ProviderResult<languages.Hover> {\n const token = this.getTokenAtPosition(model, position);\n if (!token) {\n return null;\n }\n\n const keywordInfo = this.getKeywordInfo(token.word);\n if (keywordInfo) {\n return {\n contents: [{ value: keywordInfo }],\n range: token.range,\n };\n }\n\n const expressionInfo = this.getExpressionInfo(token.word);\n if (expressionInfo) {\n return {\n contents: [{ value: expressionInfo }],\n range: token.range,\n };\n }\n\n return null;\n }\n\n private getTokenAtPosition(model: editor.ITextModel, position: Position): { word: string; range: IRange } | null {\n const lineContent = model.getLineContent(position.lineNumber);\n const tokens = [...lineContent.matchAll(/\\$context|\\$identity|\\$previous|\\$env|[a-zA-Z_][\\w-]*/g)];\n const column = position.column - 1;\n\n for (const token of tokens) {\n const startIndex = token.index ?? 0;\n const endIndex = startIndex + token[0].length;\n if (column >= startIndex && column <= endIndex) {\n return {\n word: token[0],\n range: {\n startLineNumber: position.lineNumber,\n endLineNumber: position.lineNumber,\n startColumn: startIndex + 1,\n endColumn: endIndex + 1,\n },\n };\n }\n }\n\n return null;\n }\n\n // No `auth`/`bearer`/`url` — removed with the grammar. `api`, `route`, `path`, and\n // `topic` reflect the current source-property meanings (see grammar.md).\n private getKeywordInfo(word: string): string | null {\n const keywords: Record<string, string> = {\n capture: '**capture** *<Name>*\\n\\nDeclares a capture and gives it a unique name.',\n source: '**source** *<type>*\\n\\nDefines where the capture reads input from.',\n key: '**key** *<property>*\\n\\nSelects the property used to identify each captured item.',\n map: '**map**\\n\\nMaps source fields into a normalized shape for later append blocks.',\n append: '**append** *<EventName>*\\n\\nDeclares an event to append when the `when` clause matches.',\n when: '**when** *<condition>*\\n\\nSpecifies when an append block should fire.',\n nested: '**nested** *<property>*\\n\\nCreates a nested mapping scope for an object property.',\n children: '**children** *<collection>* **identified by** *<property>*\\n\\nCreates a scope for child collection items.',\n identified: '**identified**\\n\\nUsed with `children` to declare how child items are identified.',\n by: '**by**\\n\\nUsed in `children ... identified by`, `split ... by`, and similar clauses.',\n api: '**api**\\n\\nAs a source type (`source api`): polls an HTTP API for changes.\\n\\nAs a source property (`api <ServiceName>`): references a configured External Service by name for the base URL and authentication.',\n webhook: '**webhook**\\n\\nA source type for receiving webhook payloads.',\n message: '**message**\\n\\nA source type for consuming messages from a topic.',\n events: \"**events**\\n\\nA source type for consuming the public events of another application: `source events` with one `from <Event>` line per event. Inbound Translate slices only; admitted by executable semantic model (ESM) v9. The reference runner reports a typed Unsupported outcome for `when capture` over it.\",\n route: '**route** *<path>*\\n\\nOptional path appended to an API source\\'s External Service base URL. If omitted, the base URL is used as-is.',\n poll: '**poll** *<interval>*\\n\\nSets the polling interval for an API source.',\n path: '**path** *<route>*\\n\\nThe inbound path a webhook source listens on.',\n topic: '**topic** *<name>*\\n\\nConfigures the topic for a message source.',\n from: '**from** *<value>*\\n\\nUsed in a `when` clause to match the previous value, and under `source events` to name a consumed public event (`from <Event>`).',\n to: '**to** *<value>*\\n\\nUsed in a `when` clause to match the new value.',\n or: '**or**\\n\\nCombines multiple `when` conditions.',\n and: '**and**\\n\\nCombines multiple `when` conditions that must all match.',\n added: '**added**\\n\\nMatches when a child item was added.',\n removed: '**removed**\\n\\nMatches when a child item was removed.',\n translate: '**translate**\\n\\nMaps source values to new values inside a `map` block.',\n split: '**split** *<value>* **by** *<separator>*\\n\\nSplits a string into multiple mapped fields.',\n };\n\n return keywords[word] || null;\n }\n\n private getExpressionInfo(word: string): string | null {\n const expressions: Record<string, string> = {\n '$context': '**$context**\\n\\nCapture execution context.\\n\\n**Properties:**\\n- `occurred` - When the current event should be considered to have occurred\\n- `eventSourceId` - The resolved event source identifier',\n '$identity': '**$identity**\\n\\nThe caller, equivalent to `$context.identity`. Properties: `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`. Caller mappings are not portable capture inputs (PLAY0268).',\n '$previous': '**$previous**\\n\\nThe previous state for the captured item. Use dot notation such as `$previous.status`.',\n '$env': '**$env**\\n\\nEnvironment variables. Use dot notation such as `$env.API_TOKEN`.',\n };\n\n return expressions[word] || null;\n }\n}\n"],"mappings":"A,qDAKA,IAAa,cAAb,KAA8D,CAC1D,aAAa,EAA0B,EAA+D,CAClG,IAAMA,EAAQ,KAAK,mBAAmBC,EAAOC,CAAQ,EACrD,GAAI,CAACF,EACD,OAAO,KAGX,IAAMG,EAAc,KAAK,eAAeH,EAAM,IAAI,EAClD,GAAIG,EACA,MAAO,CACH,SAAU,CAAC,CAAE,MAAOA,CAAY,CAAC,EACjC,MAAOH,EAAM,KACjB,EAGJ,IAAMI,EAAiB,KAAK,kBAAkBJ,EAAM,IAAI,EAQxD,OAPII,EACO,CACH,SAAU,CAAC,CAAE,MAAOA,CAAe,CAAC,EACpC,MAAOJ,EAAM,KACjB,EAGG,IACX,CAEA,mBAA2B,EAA0B,EAA4D,CAE7G,IAAMK,EAAS,CAAC,GADIJ,EAAM,eAAeC,EAAS,UACrB,CAAC,CAAC,SAAS,wDAAwD,CAAC,EAC3FI,EAASJ,EAAS,OAAS,EAEjC,IAAK,IAAMF,KAASK,EAAQ,CACxB,IAAME,EAAaP,EAAM,OAAS,EAC5BQ,EAAWD,EAAaP,EAAM,EAAE,CAAC,OACvC,GAAIM,GAAUC,GAAcD,GAAUE,EAClC,MAAO,CACH,KAAMR,EAAM,GACZ,MAAO,CACH,gBAAiBE,EAAS,WAC1B,cAAeA,EAAS,WACxB,YAAaK,EAAa,EAC1B,UAAWC,EAAW,CAC1B,CACJ,CAER,CAEA,OAAO,IACX,CAIA,eAAuB,EAA6B,CA8BhD,MAAO,CA5BH,QAAS;;gDACT,OAAQ;;6CACR,IAAK;;2DACL,IAAK;;qEACL,OAAQ;;+DACR,KAAM;;6CACN,OAAQ;;wDACR,SAAU;;6CACV,WAAY;;mEACZ,GAAI,uFACJ,IAAK;;;;qIACL,QAAS;;+CACT,QAAS;;oDACT,OAAQ,kTACR,MAAO;;8GACP,KAAM;;8CACN,KAAM;;+CACN,MAAO;;4CACP,KAAM,yJACN,GAAI;;mDACJ,GAAI;;wCACJ,IAAK;;4DACL,MAAO;;sCACP,QAAS;;wCACT,UAAW;;0DACX,MAAO;;6CAGG,EAAEC,IAAS,IAC7B,CAEA,kBAA0B,EAA6B,CAQnD,MAAO,CANHC,SAAY;;;;;;4DACZC,UAAa,0MACbC,UAAa;;0FACbC,KAAQ;;oEAGK,EAAEJ,IAAS,IAChC,CACJ,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"Validator.js","names":["issues","firstNonEmptyLineIndex","firstLine","index","lines","trimmed","meaningfulLines","line","entry","current","hasWhenClause","next","candidate","eventName","startColumn"],"sources":["../../../../sub-languages/capture/Validator.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 { ValidationIssue } from '../../validation';\n\ninterface MeaningfulLine {\n line: string;\n trimmed: string;\n lineNumber: number;\n indent: number;\n}\n\n// Structural rules only, unaffected by the source-property grammar changes — the\n// grammar's own syntax (see grammar.md) is what the tokenizer enforces; these are\n// the compiler's semantic constraints on top of it. Takes plain lines rather than\n// a Monaco model so it stays usable outside an editor, matching ../../validation.ts.\nexport class Validator {\n validate(lines: string[]): ValidationIssue[] {\n const issues: ValidationIssue[] = [];\n\n let firstNonEmptyLineIndex = -1;\n let firstLine = '';\n for (let index = 0; index < lines.length; index++) {\n const trimmed = lines[index].trim();\n if (trimmed && !trimmed.startsWith('#')) {\n firstNonEmptyLineIndex = index;\n firstLine = trimmed;\n break;\n }\n }\n\n if (!firstLine) {\n return issues;\n }\n\n const captureMatch = firstLine.match(/^capture\\s+([\\w.]+)\\s*$/);\n if (!captureMatch) {\n issues.push(this.error(firstNonEmptyLineIndex, 1, firstLine.length + 1, 'Capture definition must start with \"capture <Name>\"'));\n return issues;\n }\n\n const meaningfulLines: MeaningfulLine[] = lines\n .map((line, index) => ({\n line,\n trimmed: line.trim(),\n lineNumber: index,\n indent: line.search(/\\S/),\n }))\n .filter((entry) => entry.trimmed && !entry.trimmed.startsWith('#'));\n\n const hasSource = meaningfulLines.some((entry) => entry.trimmed.startsWith('source '));\n if (!hasSource) {\n issues.push(this.error(firstNonEmptyLineIndex, 1, firstLine.length + 1, 'Capture definition must include a \"source\" block'));\n }\n\n const hasKey = meaningfulLines.some((entry) => entry.trimmed.startsWith('key '));\n if (!hasKey) {\n issues.push(this.error(firstNonEmptyLineIndex, 1, firstLine.length + 1, 'Capture definition must include a \"key\" declaration'));\n }\n\n for (let index = 0; index < meaningfulLines.length; index++) {\n const current = meaningfulLines[index];\n if (!current.trimmed.startsWith('append ')) {\n continue;\n }\n\n let hasWhenClause = false;\n for (let next = index + 1; next < meaningfulLines.length; next++) {\n const candidate = meaningfulLines[next];\n if (candidate.indent <= current.indent) {\n break;\n }\n if (candidate.trimmed.startsWith('when ')) {\n hasWhenClause = true;\n break;\n }\n }\n\n if (!hasWhenClause) {\n const eventName = current.trimmed.substring('append '.length).trim() || 'unnamed append block';\n const startColumn = current.line.indexOf(eventName) + 1;\n issues.push(this.error(\n current.lineNumber,\n startColumn > 0 ? startColumn : 1,\n startColumn > 0 ? startColumn + eventName.length : current.line.length + 1,\n `Append block '${eventName}' must include a \"when\" clause`,\n ));\n }\n }\n\n return issues;\n }\n\n private error(line: number, startColumn: number, endColumn: number, message: string): ValidationIssue {\n return { severity: 'error', line, startColumn, endColumn, message };\n }\n}\n"],"mappings":"qDAgBA,IAAa,UAAb,KAAuB,CACnB,SAAS,EAAo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,QAAQ,WAAW,OAAO,EAAG,CACvC,EAAgB,GAChB,KACJ,CACJ,CAEA,GAAI,CAACF,EAAe,CAChB,IAAMG,EAAYJ,EAAQ,QAAQ,UAAU,CAAgB,CAAC,CAAC,KAAK,GAAK,uBAClEK,EAAcL,EAAQ,KAAK,QAAQI,CAAS,EAAI,EACtDb,EAAO,KAAK,KAAK,MACbS,EAAQ,WACRK,EAAc,EAAIA,EAAc,EAChCA,EAAc,EAAIA,EAAcD,EAAU,OAASJ,EAAQ,KAAK,OAAS,EACzE,iBAAiBI,EAAU,+BAC/B,CAAC,CACL,CACJ,CAEA,OAAOb,CACX,CAEA,MAAc,EAAc,EAAqB,EAAmB,EAAkC,CAClG,MAAO,CAAE,SAAU,QAAS,OAAM,cAAa,YAAW,SAAQ,CACtE,CACJ"}
1
+ {"version":3,"file":"Validator.js","names":["issues","firstNonEmptyLineIndex","firstLine","index","lines","trimmed","meaningfulLines","line","entry","current","hasWhenClause","next","candidate","eventName","startColumn"],"sources":["../../../../sub-languages/capture/Validator.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 { ValidationIssue } from '../../validation';\n\ninterface MeaningfulLine {\n line: string;\n trimmed: string;\n lineNumber: number;\n indent: number;\n}\n\n// Structural rules only, unaffected by the source-property grammar changes — the\n// grammar's own syntax (see grammar.md) is what the tokenizer enforces; these are\n// the compiler's semantic constraints on top of it. Takes plain lines rather than\n// a Monaco model so it stays usable outside an editor, matching ../../validation.ts.\nexport class Validator {\n validate(lines: string[]): ValidationIssue[] {\n const issues: ValidationIssue[] = [];\n\n let firstNonEmptyLineIndex = -1;\n let firstLine = '';\n for (let index = 0; index < lines.length; index++) {\n const trimmed = lines[index].trim();\n if (trimmed && !trimmed.startsWith('#')) {\n firstNonEmptyLineIndex = index;\n firstLine = trimmed;\n break;\n }\n }\n\n if (!firstLine) {\n return issues;\n }\n\n const captureMatch = firstLine.match(/^capture\\s+([\\w.]+)\\s*$/);\n if (!captureMatch) {\n issues.push(this.error(firstNonEmptyLineIndex, 1, firstLine.length + 1, 'Capture definition must start with \"capture <Name>\"'));\n return issues;\n }\n\n const meaningfulLines: MeaningfulLine[] = lines\n .map((line, index) => ({\n line,\n trimmed: line.trim(),\n lineNumber: index,\n indent: line.search(/\\S/),\n }))\n .filter((entry) => entry.trimmed && !entry.trimmed.startsWith('#'));\n\n const hasSource = meaningfulLines.some((entry) => entry.trimmed.startsWith('source '));\n if (!hasSource) {\n issues.push(this.error(firstNonEmptyLineIndex, 1, firstLine.length + 1, 'Capture definition must include a \"source\" block'));\n }\n\n const hasKey = meaningfulLines.some((entry) => entry.trimmed.startsWith('key '));\n if (!hasKey) {\n issues.push(this.error(firstNonEmptyLineIndex, 1, firstLine.length + 1, 'Capture definition must include a \"key\" declaration'));\n }\n\n for (let index = 0; index < meaningfulLines.length; index++) {\n const current = meaningfulLines[index];\n if (!current.trimmed.startsWith('append ')) {\n continue;\n }\n\n let hasWhenClause = false;\n for (let next = index + 1; next < meaningfulLines.length; next++) {\n const candidate = meaningfulLines[next];\n if (candidate.indent <= current.indent) {\n break;\n }\n if (candidate.trimmed.startsWith('when ')) {\n hasWhenClause = true;\n break;\n }\n }\n\n if (!hasWhenClause) {\n const eventName = current.trimmed.substring('append '.length).trim() || 'unnamed append block';\n const startColumn = current.line.indexOf(eventName) + 1;\n issues.push(this.error(\n current.lineNumber,\n startColumn > 0 ? startColumn : 1,\n startColumn > 0 ? startColumn + eventName.length : current.line.length + 1,\n `Append block '${eventName}' must include a \"when\" clause`,\n ));\n }\n }\n\n return issues;\n }\n\n private error(line: number, startColumn: number, endColumn: number, message: string): ValidationIssue {\n return { severity: 'error', line, startColumn, endColumn, message };\n }\n}\n"],"mappings":"A,qDAgBA,IAAa,UAAb,KAAuB,CACnB,SAAS,EAAoC,CACzC,IAAMA,EAA4B,CAAC,EAE/BC,EAAyB,GACzBC,EAAY,GAChB,IAAK,IAAIC,EAAQ,EAAGA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AMG,EAAYJ,EAAQ,QAAQ,UAAU,CAAgB,CAAC,CAAC,KAAK,GAAK,uBAClEK,EAAcL,EAAQ,KAAK,QAAQI,CAAS,EAAI,EACtDb,EAAO,KAAK,KAAK,MACbS,EAAQ,WACRK,EAAc,EAAIA,EAAc,EAChCA,EAAc,EAAIA,EAAcD,EAAU,OAASJ,EAAQ,KAAK,OAAS,EACzE,iBAAiBI,EAAU,+BAC/B,CAAC,CACL,CACJ,CAEA,OAAOb,CACX,CAEA,MAAc,EAAc,EAAqB,EAAmB,EAAkC,CAClG,MAAO,CAAE,SAAU,QAAS,OAAM,cAAa,YAAW,SAAQ,CACtE,CACJ,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["disposersByMonaco","validator","model","issue","monaco","existing","languageConfiguration","monarchLanguage","Validator","disposables","CompletionProvider","HoverProvider","disposable","languageId"],"sources":["../../../../sub-languages/capture/index.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 { IDisposable, editor } from 'monaco-editor';\nimport { Monaco, languageConfiguration, languageId, monarchLanguage } from './language';\nimport { CompletionProvider } from './CompletionProvider';\nimport { HoverProvider } from './HoverProvider';\nimport { Validator } from './Validator';\n\nconst markerOwner = 'cdl-validator';\n\n// Keyed by Monaco instance rather than a single boolean — mirrors the composite\n// language's own registration guard (../../index.ts) and lets a second register()\n// call for the same instance hand back the existing disposer instead of doubling\n// up the completion/hover providers.\nconst disposersByMonaco = new Map<Monaco, () => void>();\n\nfunction toMarkers(monaco: Monaco, validator: Validator, model: editor.ITextModel): editor.IMarkerData[] {\n return validator.validate(model.getLinesContent()).map((issue) => ({\n severity: issue.severity === 'error' ? monaco.MarkerSeverity.Error : monaco.MarkerSeverity.Warning,\n message: issue.message,\n startLineNumber: issue.line + 1,\n startColumn: issue.startColumn,\n endLineNumber: issue.line + 1,\n endColumn: issue.endColumn,\n }));\n}\n\nexport function registerCaptureLanguage(monaco: Monaco): { dispose(): void } {\n const existing = disposersByMonaco.get(monaco);\n if (existing) {\n return { dispose: existing };\n }\n\n monaco.languages.register({ id: languageId });\n monaco.languages.setLanguageConfiguration(languageId, languageConfiguration);\n monaco.languages.setMonarchTokensProvider(languageId, monarchLanguage);\n\n const validator = new Validator();\n const disposables: IDisposable[] = [];\n\n disposables.push(monaco.languages.registerCompletionItemProvider(languageId, new CompletionProvider()));\n disposables.push(monaco.languages.registerHoverProvider(languageId, new HoverProvider()));\n\n const validateModel = (model: editor.ITextModel): void => {\n if (model.isDisposed() || model.getLanguageId() !== languageId) {\n return;\n }\n monaco.editor.setModelMarkers(model, markerOwner, toMarkers(monaco, validator, model));\n };\n\n disposables.push(monaco.editor.onDidCreateModel((model) => {\n if (model.getLanguageId() !== languageId) {\n return;\n }\n validateModel(model);\n disposables.push(model.onDidChangeContent(() => validateModel(model)));\n }));\n\n monaco.editor.getModels().forEach((model) => validateModel(model));\n\n const dispose = (): void => {\n disposables.forEach((disposable) => disposable.dispose());\n disposables.length = 0;\n disposersByMonaco.delete(monaco);\n };\n\n disposersByMonaco.set(monaco, dispose);\n return { dispose };\n}\n\nexport { languageId } from './language';\n"],"mappings":"2SASA,MAMMA,kBAAoB,IAAI,IAE9B,SAAS,UAAU,EAAgB,EAAsB,EAAgD,CACrG,OAAOC,EAAU,SAASC,EAAM,gBAAgB,CAAC,CAAC,CAAC,IAAK,IAAW,CAC/D,SAAUC,EAAM,WAAa,QAAUC,EAAO,eAAe,MAAQA,EAAO,eAAe,QAC3F,QAASD,EAAM,QACf,gBAAiBA,EAAM,KAAO,EAC9B,YAAaA,EAAM,YACnB,cAAeA,EAAM,KAAO,EAC5B,UAAWA,EAAM,SACrB,EAAE,CACN,CAEA,SAAgB,wBAAwB,EAAqC,CACzE,IAAME,EAAWL,EAAkB,IAAII,CAAM,EAC7C,GAAIC,EACA,MAAO,CAAE,QAASA,CAAS,EAG/BD,EAAO,UAAU,SAAS,CAAE,GAAA,KAAe,CAAC,EAC5CA,EAAO,UAAU,yBAAA,MAAqCE,CAAqB,EAC3EF,EAAO,UAAU,yBAAA,MAAqCG,CAAe,EAErE,IAAMN,EAAY,IAAIO,EAChBC,EAA6B,CAAC,EAEpCA,EAAY,KAAKL,EAAO,UAAU,+BAAA,MAA2C,IAAIM,CAAoB,CAAC,EACtGD,EAAY,KAAKL,EAAO,UAAU,sBAAA,MAAkC,IAAIO,CAAe,CAAC,EAExF,IAAM,cAAiB,GAAmC,CAClDT,EAAM,WAAW,GAAKA,EAAM,cAAc,IAAA,OAG9CE,EAAO,OAAO,gBAAgBF,EAAO,gBAAa,UAAUE,EAAQH,EAAWC,CAAK,CAAC,CACzF,EAEAO,EAAY,KAAKL,EAAO,OAAO,iBAAkB,GAAU,CACnDF,EAAM,cAAc,IAAA,QAGxB,cAAcA,CAAK,EACnBO,EAAY,KAAKP,EAAM,uBAAyB,cAAcA,CAAK,CAAC,CAAC,EACzE,CAAC,CAAC,EAEFE,EAAO,OAAO,UAAU,CAAC,CAAC,QAAS,GAAU,cAAcF,CAAK,CAAC,EAEjE,IAAM,YAAsB,CACxBO,EAAY,QAAS,GAAeG,EAAW,QAAQ,CAAC,EACxD,EAAY,OAAS,EACrBZ,EAAkB,OAAOI,CAAM,CACnC,EAGA,OADAJ,EAAkB,IAAII,EAAQ,OAAO,EAC9B,CAAE,OAAQ,CACrB"}
1
+ {"version":3,"file":"index.js","names":["disposersByMonaco","validator","model","issue","monaco","existing","languageConfiguration","monarchLanguage","Validator","disposables","CompletionProvider","HoverProvider","disposable","languageId"],"sources":["../../../../sub-languages/capture/index.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 { IDisposable, editor } from 'monaco-editor';\nimport { Monaco, languageConfiguration, languageId, monarchLanguage } from './language';\nimport { CompletionProvider } from './CompletionProvider';\nimport { HoverProvider } from './HoverProvider';\nimport { Validator } from './Validator';\n\nconst markerOwner = 'cdl-validator';\n\n// Keyed by Monaco instance rather than a single boolean — mirrors the composite\n// language's own registration guard (../../index.ts) and lets a second register()\n// call for the same instance hand back the existing disposer instead of doubling\n// up the completion/hover providers.\nconst disposersByMonaco = new Map<Monaco, () => void>();\n\nfunction toMarkers(monaco: Monaco, validator: Validator, model: editor.ITextModel): editor.IMarkerData[] {\n return validator.validate(model.getLinesContent()).map((issue) => ({\n severity: issue.severity === 'error' ? monaco.MarkerSeverity.Error : monaco.MarkerSeverity.Warning,\n message: issue.message,\n startLineNumber: issue.line + 1,\n startColumn: issue.startColumn,\n endLineNumber: issue.line + 1,\n endColumn: issue.endColumn,\n }));\n}\n\nexport function registerCaptureLanguage(monaco: Monaco): { dispose(): void } {\n const existing = disposersByMonaco.get(monaco);\n if (existing) {\n return { dispose: existing };\n }\n\n monaco.languages.register({ id: languageId });\n monaco.languages.setLanguageConfiguration(languageId, languageConfiguration);\n monaco.languages.setMonarchTokensProvider(languageId, monarchLanguage);\n\n const validator = new Validator();\n const disposables: IDisposable[] = [];\n\n disposables.push(monaco.languages.registerCompletionItemProvider(languageId, new CompletionProvider()));\n disposables.push(monaco.languages.registerHoverProvider(languageId, new HoverProvider()));\n\n const validateModel = (model: editor.ITextModel): void => {\n if (model.isDisposed() || model.getLanguageId() !== languageId) {\n return;\n }\n monaco.editor.setModelMarkers(model, markerOwner, toMarkers(monaco, validator, model));\n };\n\n disposables.push(monaco.editor.onDidCreateModel((model) => {\n if (model.getLanguageId() !== languageId) {\n return;\n }\n validateModel(model);\n disposables.push(model.onDidChangeContent(() => validateModel(model)));\n }));\n\n monaco.editor.getModels().forEach((model) => validateModel(model));\n\n const dispose = (): void => {\n disposables.forEach((disposable) => disposable.dispose());\n disposables.length = 0;\n disposersByMonaco.delete(monaco);\n };\n\n disposersByMonaco.set(monaco, dispose);\n return { dispose };\n}\n\nexport { languageId } from './language';\n"],"mappings":"A,2SASA,MAMMA,kBAAoB,IAAI,IAE9B,SAAS,UAAU,EAAgB,EAAsB,EAAgD,CACrG,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OAAO,EAC9B,CAAE,OAAQ,CACrB,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"language.js","names":["languageId","KEYWORDS","BUILTINS","OPERATORS","languageConfiguration","monarchLanguage"],"sources":["../../../../sub-languages/capture/language.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 Monaco = typeof import('monaco-editor');\n\n// Capture Declaration Language (CDL) — Chronicle's DSL for declaring change-data-capture\n// rules, registered here as its own standalone top-level Monaco language. This is distinct\n// from the lightweight CDL sub-language embedded inside a `.play` document's `capture`\n// blocks (../cdl.ts) — this module owns its own language id, tokenizer, and providers.\nexport const languageId = 'cdl';\n\n// `route`/`poll` are API source properties; `path` is the webhook inbound path; `topic`\n// is the message source subject. There is no `auth`/`bearer`/`url` — an API source\n// references a named External Service (`api <ServiceName>`) for base URL and auth, and\n// a webhook source's authentication is configured on the source builder, not in CDL text.\nconst KEYWORDS = [\n 'capture',\n 'source',\n 'key',\n 'map',\n 'append',\n 'when',\n 'nested',\n 'children',\n 'identified',\n 'by',\n 'api',\n 'webhook',\n 'message',\n 'events',\n 'route',\n 'poll',\n 'path',\n 'topic',\n 'from',\n 'to',\n 'or',\n 'and',\n 'added',\n 'removed',\n 'translate',\n 'split',\n] as const;\n\nconst BUILTINS = [\n '$context',\n '$identity',\n '$previous',\n '$env',\n] as const;\n\nconst OPERATORS = ['=', '=>', '.'];\n\nexport const languageConfiguration: languages.LanguageConfiguration = {\n comments: {\n lineComment: '#',\n },\n brackets: [\n ['{', '}'],\n ['[', ']'],\n ['(', ')'],\n ],\n autoClosingPairs: [\n { open: '{', close: '}' },\n { open: '[', close: ']' },\n { open: '(', close: ')' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n { open: '`', close: '`' },\n ],\n surroundingPairs: [\n { open: '{', close: '}' },\n { open: '[', close: ']' },\n { open: '(', close: ')' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n { open: '`', close: '`' },\n ],\n indentationRules: {\n increaseIndentPattern: /^.*(\\bcapture\\b\\s+\\S+|\\bsource\\b(?:\\s+\\w+)?|\\bmap\\b|\\bappend\\b\\s+\\S+|\\bnested\\b\\s+\\S+|\\bchildren\\b\\s+\\S+.*|\\btranslate\\b|\\bsplit\\b.*)\\s*$/,\n decreaseIndentPattern: /^.*\\}.*$/,\n },\n folding: {\n offSide: true,\n markers: {\n start: /^\\s*(capture|source|map|append|nested|children|translate|split)/,\n end: /^\\s*$/,\n },\n },\n wordPattern: /[$]?[a-zA-Z_][\\w$-]*/,\n};\n\nexport const monarchLanguage: languages.IMonarchLanguage = {\n defaultToken: '',\n tokenPostfix: '.cdl',\n\n keywords: KEYWORDS,\n builtins: BUILTINS,\n operators: OPERATORS,\n\n symbols: /[=><!~?:&|+\\-*/^%]+/,\n escapes: /\\\\(?:[abfnrtv\\\\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,\n\n tokenizer: {\n root: [\n { include: '@whitespace' },\n [/`/, { token: 'string.template', next: '@templateString' }],\n [/\\$\\.(?:[a-zA-Z_]\\w*(?:\\.[a-zA-Z_]\\w*)*)?/, 'variable'],\n [/\\$previous(?:\\.[a-zA-Z_]\\w*(?:\\.[a-zA-Z_]\\w*)*)?/, 'variable.predefined'],\n [/\\$context(?:\\.(?:occurred|eventSourceId))?/, 'variable.predefined'],\n [/\\$identity(?:\\.\\w+)*/, 'variable.predefined'],\n [/\\$env(?:\\.[A-Z_][A-Z0-9_]*)?/, 'variable.predefined'],\n [/@[a-zA-Z_$][\\w$]*/, 'identifier.escape'],\n [\n /[A-Z][a-zA-Z_$][\\w$]*/,\n {\n cases: {\n '@keywords': 'invalid',\n '@default': 'identifier',\n },\n },\n ],\n [\n /[a-z_$][\\w$]*/,\n {\n cases: {\n '@keywords': 'keyword',\n '@builtins': 'variable.predefined',\n '@default': 'identifier',\n },\n },\n ],\n [/[{}()[\\]]/, '@brackets'],\n [/=>/, 'operator.arrow'],\n [\n /@symbols/,\n {\n cases: {\n '@operators': 'operator',\n '@default': '',\n },\n },\n ],\n [/\\d*\\.\\d+([eE][-+]?\\d+)?/, 'number.float'],\n [/0[xX][0-9a-fA-F]+/, 'number.hex'],\n [/\\d+/, 'number'],\n [/[;,.]/, 'delimiter'],\n [/\"([^\"\\\\]|\\\\.)*$/, 'string.invalid'],\n [/\"/, { token: 'string.quote', next: '@string' }],\n ],\n\n whitespace: [\n [/[ \\t\\r\\n]+/, ''],\n [/#.*$/, 'comment'],\n ],\n\n templateString: [\n [/\\$\\{/, { token: 'delimiter.bracket', next: '@templateExpression' }],\n [/[^\\\\`$]+/, 'string.template'],\n [/@escapes/, 'string.template.escape'],\n [/\\\\./, 'string.template.escape.invalid'],\n [/`/, { token: 'string.template', next: '@pop' }],\n ],\n\n templateExpression: [\n [/\\}/, { token: 'delimiter.bracket', next: '@pop' }],\n { include: '@root' },\n ],\n\n string: [\n [/[^\\\\\"]+/, 'string'],\n [/@escapes/, 'string.escape'],\n [/\\\\./, 'string.escape.invalid'],\n [/\"/, { token: 'string.quote', next: '@pop' }],\n ],\n },\n};\n"],"mappings":"AAWA,MAAaA,EAAa,MAMpBC,EAAW,0LA2BjB,EAEMC,EAAW,CACb,WACA,YACA,YACA,MACJ,EAEMC,EAAY,CAAC,IAAK,KAAM,GAAG,EAEpBC,EAAyD,CAClE,SAAU,CACN,YAAa,GACjB,EACA,SAAU,CACN,CAAC,IAAK,GAAG,EACT,CAAC,IAAK,GAAG,EACT,CAAC,IAAK,GAAG,CACb,EACA,iBAAkB,CACd,CAAE,KAAM,IAAK,MAAO,GAAI,EACxB,CAAE,KAAM,IAAK,MAAO,GAAI,EACxB,CAAE,KAAM,IAAK,MAAO,GAAI,EACxB,CAAE,KAAM,IAAK,MAAO,GAAI,EACxB,CAAE,KAAM,IAAK,MAAO,GAAI,EACxB,CAAE,KAAM,IAAK,MAAO,G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AAC,aAAc,EAAE,EACjB,CAAC,OAAQ,SAAS,CACtB,EAEA,eAAgB,CACZ,CAAC,OAAQ,CAAE,MAAO,oBAAqB,KAAM,qBAAsB,CAAC,EACpE,CAAC,WAAY,iBAAiB,EAC9B,CAAC,WAAY,wBAAwB,EACrC,CAAC,MAAO,gCAAgC,EACxC,CAAC,IAAK,CAAE,MAAO,kBAAmB,KAAM,MAAO,CAAC,CACpD,EAEA,mBAAoB,CAChB,CAAC,KAAM,CAAE,MAAO,oBAAqB,KAAM,MAAO,CAAC,EACnD,CAAE,QAAS,OAAQ,CACvB,EAEA,OAAQ,CACJ,CAAC,UAAW,QAAQ,EACpB,CAAC,WAAY,eAAe,EAC5B,CAAC,MAAO,uBAAuB,EAC/B,CAAC,IAAK,CAAE,MAAO,eAAgB,KAAM,MAAO,CAAC,CACjD,CACJ,CACJ"}
1
+ {"version":3,"file":"language.js","names":["languageId","KEYWORDS","BUILTINS","OPERATORS","languageConfiguration","monarchLanguage"],"sources":["../../../../sub-languages/capture/language.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 Monaco = typeof import('monaco-editor');\n\n// Capture Declaration Language (CDL) — Chronicle's DSL for declaring change-data-capture\n// rules, registered here as its own standalone top-level Monaco language. This is distinct\n// from the lightweight CDL sub-language embedded inside a `.play` document's `capture`\n// blocks (../cdl.ts) — this module owns its own language id, tokenizer, and providers.\nexport const languageId = 'cdl';\n\n// `route`/`poll` are API source properties; `path` is the webhook inbound path; `topic`\n// is the message source subject. There is no `auth`/`bearer`/`url` — an API source\n// references a named External Service (`api <ServiceName>`) for base URL and auth, and\n// a webhook source's authentication is configured on the source builder, not in CDL text.\nconst KEYWORDS = [\n 'capture',\n 'source',\n 'key',\n 'map',\n 'append',\n 'when',\n 'nested',\n 'children',\n 'identified',\n 'by',\n 'api',\n 'webhook',\n 'message',\n 'events',\n 'route',\n 'poll',\n 'path',\n 'topic',\n 'from',\n 'to',\n 'or',\n 'and',\n 'added',\n 'removed',\n 'translate',\n 'split',\n] as const;\n\nconst BUILTINS = [\n '$context',\n '$identity',\n '$previous',\n '$env',\n] as const;\n\nconst OPERATORS = ['=', '=>', '.'];\n\nexport const languageConfiguration: languages.LanguageConfiguration = {\n comments: {\n lineComment: '#',\n },\n brackets: [\n ['{', '}'],\n ['[', ']'],\n ['(', ')'],\n ],\n autoClosingPairs: [\n { open: '{', close: '}' },\n { open: '[', close: ']' },\n { open: '(', close: ')' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n { open: '`', close: '`' },\n ],\n surroundingPairs: [\n { open: '{', close: '}' },\n { open: '[', close: ']' },\n { open: '(', close: ')' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n { open: '`', close: '`' },\n ],\n indentationRules: {\n increaseIndentPattern: /^.*(\\bcapture\\b\\s+\\S+|\\bsource\\b(?:\\s+\\w+)?|\\bmap\\b|\\bappend\\b\\s+\\S+|\\bnested\\b\\s+\\S+|\\bchildren\\b\\s+\\S+.*|\\btranslate\\b|\\bsplit\\b.*)\\s*$/,\n decreaseIndentPattern: /^.*\\}.*$/,\n },\n folding: {\n offSide: true,\n markers: {\n start: /^\\s*(capture|source|map|append|nested|children|translate|split)/,\n end: /^\\s*$/,\n },\n },\n wordPattern: /[$]?[a-zA-Z_][\\w$-]*/,\n};\n\nexport const monarchLanguage: languages.IMonarchLanguage = {\n defaultToken: '',\n tokenPostfix: '.cdl',\n\n keywords: KEYWORDS,\n builtins: BUILTINS,\n operators: OPERATORS,\n\n symbols: /[=><!~?:&|+\\-*/^%]+/,\n escapes: /\\\\(?:[abfnrtv\\\\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,\n\n tokenizer: {\n root: [\n { include: '@whitespace' },\n [/`/, { token: 'string.template', next: '@templateString' }],\n [/\\$\\.(?:[a-zA-Z_]\\w*(?:\\.[a-zA-Z_]\\w*)*)?/, 'variable'],\n [/\\$previous(?:\\.[a-zA-Z_]\\w*(?:\\.[a-zA-Z_]\\w*)*)?/, 'variable.predefined'],\n [/\\$context(?:\\.(?:occurred|eventSourceId))?/, 'variable.predefined'],\n [/\\$identity(?:\\.\\w+)*/, 'variable.predefined'],\n [/\\$env(?:\\.[A-Z_][A-Z0-9_]*)?/, 'variable.predefined'],\n [/@[a-zA-Z_$][\\w$]*/, 'identifier.escape'],\n [\n /[A-Z][a-zA-Z_$][\\w$]*/,\n {\n cases: {\n '@keywords': 'invalid',\n '@default': 'identifier',\n },\n },\n ],\n [\n /[a-z_$][\\w$]*/,\n {\n cases: {\n '@keywords': 'keyword',\n '@builtins': 'variable.predefined',\n '@default': 'identifier',\n },\n },\n ],\n [/[{}()[\\]]/, '@brackets'],\n [/=>/, 'operator.arrow'],\n [\n /@symbols/,\n {\n cases: {\n '@operators': 'operator',\n '@default': '',\n },\n },\n ],\n [/\\d*\\.\\d+([eE][-+]?\\d+)?/, 'number.float'],\n [/0[xX][0-9a-fA-F]+/, 'number.hex'],\n [/\\d+/, 'number'],\n [/[;,.]/, 'delimiter'],\n [/\"([^\"\\\\]|\\\\.)*$/, 'string.invalid'],\n [/\"/, { token: 'string.quote', next: '@string' }],\n ],\n\n whitespace: [\n [/[ \\t\\r\\n]+/, ''],\n [/#.*$/, 'comment'],\n ],\n\n templateString: [\n [/\\$\\{/, { token: 'delimiter.bracket', next: '@templateExpression' }],\n [/[^\\\\`$]+/, 'string.template'],\n [/@escapes/, 'string.template.escape'],\n [/\\\\./, 'string.template.escape.invalid'],\n [/`/, { token: 'string.template', next: '@pop' }],\n ],\n\n templateExpression: [\n [/\\}/, { token: 'delimiter.bracket', next: '@pop' }],\n { include: '@root' },\n ],\n\n string: [\n [/[^\\\\\"]+/, 'string'],\n [/@escapes/, 'string.escape'],\n [/\\\\./, 'string.escape.invalid'],\n [/\"/, { token: 'string.quote', next: '@pop' }],\n ],\n },\n};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qB,mBAAmB,EACzC,CACI,wBACA,CACI,MAAO,CACH,YAAa,UACb,WAAY,YAChB,CACJ,CACJ,EACA,CACI,gBACA,CACI,MAAO,CACH,YAAa,UACb,YAAa,sBACb,WAAY,YAChB,CACJ,CACJ,EACA,CAAC,YAAa,WAAW,EACzB,CAAC,KAAM,gBAAgB,EACvB,CACI,WACA,CACI,MAAO,CACH,aAAc,WACd,WAAY,EAChB,CACJ,CACJ,EACA,CAAC,0BAA2B,cAAc,EAC1C,CAAC,oBAAqB,YAAY,EAClC,CAAC,MAAO,QAAQ,EAChB,CAAC,QAAS,WAAW,EACrB,CAAC,kBAAmB,gBAAgB,EACpC,CAAC,IAAK,CAAE,MAAO,eAAgB,KAAM,SAAU,CAAC,CACpD,EAEA,WAAY,CACR,CAAC,aAAc,EAAE,EACjB,CAAC,OAAQ,SAAS,CACtB,EAEA,eAAgB,CACZ,CAAC,OAAQ,CAAE,MAAO,oBAAqB,KAAM,qBAAsB,CAAC,EACpE,CAAC,WAAY,iBAAiB,EAC9B,CAAC,WAAY,wBAAwB,EACrC,CAAC,MAAO,gCAAgC,EACxC,CAAC,IAAK,CAAE,MAAO,kBAAmB,KAAM,MAAO,CAAC,CACpD,EAEA,mBAAoB,CAChB,CAAC,KAAM,CAAE,MAAO,oBAAqB,KAAM,MAAO,CAAC,EACnD,CAAE,QAAS,OAAQ,CACvB,EAEA,OAAQ,CACJ,CAAC,UAAW,QAAQ,EACpB,CAAC,WAAY,eAAe,EAC5B,CAAC,MAAO,uBAAuB,EAC/B,CAAC,IAAK,CAAE,MAAO,eAAgB,KAAM,MAAO,CAAC,CACjD,CACJ,CACJ,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"cdl.js","names":["cdl"],"sources":["../../../sub-languages/cdl.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 { SubLanguageDefinition } from '../sub-language-registry';\n\n// Change Data Capture Language (CDL) — embedded inside `capture` blocks. This is the\n// lightweight definition mixed into the composite `.play` tokenizer; the full standalone\n// CDL language (its own tokenizer, context-aware completions, hover, and validation) lives\n// in `./capture` and is what `@cratis/screenplay-language/capture` exposes to consumers.\nexport const cdl: SubLanguageDefinition = {\n tokens: [\n [\n /\\b(?:source|api|route|poll|path|topic|key|map|translate|split|append|tag|when|children|nested|identified|by|from|to|and|or|added|removed|is|event)\\b/,\n 'keyword',\n ],\n ],\n completions: [\n {\n label: 'source',\n insertText: 'source ${1:api}',\n documentation: 'Declares where the captured data comes from.',\n },\n {\n label: 'key',\n insertText: 'key ${1:property}',\n documentation: 'Declares which source property identifies an instance.',\n },\n {\n label: 'map',\n insertText: 'map\\n ${1:property} = ${2:source}',\n documentation: 'Maps and translates source values before events are appended.',\n },\n {\n label: 'append',\n insertText: 'append ${1:EventType}\\n when ${2:property}',\n documentation: 'Appends an event when the source data changes.',\n },\n {\n label: 'translate',\n insertText: 'translate\\n \"${1:source}\" => ${2:target}',\n documentation: 'Translates source values into Screenplay values.',\n },\n {\n label: 'children',\n insertText: 'children ${1:collection} identified by ${2:key}',\n documentation: 'Captures changes in a child collection of the source data.',\n },\n {\n label: 'when added',\n insertText: 'when added',\n documentation: 'Appends the event when a new item appears in the source.',\n },\n {\n label: 'when removed',\n insertText: 'when removed',\n documentation: 'Appends the event when an item disappears from the source.',\n },\n ],\n hovers: {\n source: 'CDL — declares where the captured data comes from.',\n api: 'CDL — as a source type, polls an HTTP API; as a source property (`api <ServiceName>`), references a named External Service for the base URL and authentication.',\n route: 'CDL — optional path appended to an API source\\'s External Service base URL.',\n poll: 'CDL — the polling interval for an API source, e.g. 5m.',\n path: 'CDL — the inbound path a webhook source listens on.',\n topic: 'CDL — the topic a message source subscribes to.',\n key: 'CDL — declares which source property identifies an instance. On a `source events` capture, `key <property> is event source` promises each captured event is sourced by that key.',\n is: 'CDL — in `key <property> is event source`, marks the key as the event source of every captured event.',\n map: 'CDL — maps and translates source values before events are appended.',\n translate: 'CDL — translates source values into Screenplay values.',\n append: 'CDL — appends an event when the source data changes.',\n when: 'CDL — the change condition: a property change, added, or removed.',\n added: 'CDL — matches items that appear in the source.',\n removed: 'CDL — matches items that disappear from the source.',\n children: 'CDL — captures changes in a child collection of the source data.',\n identified: 'CDL — introduces the identifying key of a child collection.',\n },\n};\n"],"mappings":"AASA,MAAaA,EAA6B,CACtC,OAAQ,CACJ,CACI,uJACA,SACJ,CACJ,EACA,YAAa,CACT,CACI,MAAO,SACP,WAAY,kBACZ,cAAe,8CACnB,EACA,CACI,MAAO,MACP,WAAY,oBACZ,cAAe,wDACnB,EACA,CACI,MAAO,MACP,WAAY,uCACZ,cAAe,+DACnB,EACA,CACI,MAAO,SACP,WAAY,gDACZ,cAAe,gDACnB,EACA,CACI,MAAO,YACP,WAAY,8CACZ,cAAe,kDACnB,EACA,CACI,MAAO,WACP,WAAY,kDACZ,cAAe,4DACnB,EACA,CACI,MAAO,aACP,WAAY,aACZ,cAAe,0DACnB,EACA,CACI,MAAO,eACP,WAAY,eACZ,cAAe,4DACnB,CACJ,EACA,OAAQ,CACJ,OAAQ,qDACR,IAAK,kKACL,MAAO,6EACP,KAAM,yDACN,KAAM,sDACN,MAAO,kDACP,IAAK,mLACL,GAAI,wGACJ,IAAK,sEACL,UAAW,yDACX,OAAQ,uDACR,KAAM,oEACN,MAAO,iDACP,QAAS,sDACT,SAAU,mEACV,WAAY,6DAChB,CACJ"}
1
+ {"version":3,"file":"cdl.js","names":["cdl"],"sources":["../../../sub-languages/cdl.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 { SubLanguageDefinition } from '../sub-language-registry';\n\n// Change Data Capture Language (CDL) — embedded inside `capture` blocks. This is the\n// lightweight definition mixed into the composite `.play` tokenizer; the full standalone\n// CDL language (its own tokenizer, context-aware completions, hover, and validation) lives\n// in `./capture` and is what `@cratis/screenplay-language/capture` exposes to consumers.\nexport const cdl: SubLanguageDefinition = {\n tokens: [\n [\n /\\b(?:source|api|route|poll|path|topic|key|map|translate|split|append|tag|when|children|nested|identified|by|from|to|and|or|added|removed|is|event)\\b/,\n 'keyword',\n ],\n ],\n completions: [\n {\n label: 'source',\n insertText: 'source ${1:api}',\n documentation: 'Declares where the captured data comes from.',\n },\n {\n label: 'key',\n insertText: 'key ${1:property}',\n documentation: 'Declares which source property identifies an instance.',\n },\n {\n label: 'map',\n insertText: 'map\\n ${1:property} = ${2:source}',\n documentation: 'Maps and translates source values before events are appended.',\n },\n {\n label: 'append',\n insertText: 'append ${1:EventType}\\n when ${2:property}',\n documentation: 'Appends an event when the source data changes.',\n },\n {\n label: 'translate',\n insertText: 'translate\\n \"${1:source}\" => ${2:target}',\n documentation: 'Translates source values into Screenplay values.',\n },\n {\n label: 'children',\n insertText: 'children ${1:collection} identified by ${2:key}',\n documentation: 'Captures changes in a child collection of the source data.',\n },\n {\n label: 'when added',\n insertText: 'when added',\n documentation: 'Appends the event when a new item appears in the source.',\n },\n {\n label: 'when removed',\n insertText: 'when removed',\n documentation: 'Appends the event when an item disappears from the source.',\n },\n ],\n hovers: {\n source: 'CDL — declares where the captured data comes from.',\n api: 'CDL — as a source type, polls an HTTP API; as a source property (`api <ServiceName>`), references a named External Service for the base URL and authentication.',\n route: 'CDL — optional path appended to an API source\\'s External Service base URL.',\n poll: 'CDL — the polling interval for an API source, e.g. 5m.',\n path: 'CDL — the inbound path a webhook source listens on.',\n topic: 'CDL — the topic a message source subscribes to.',\n key: 'CDL — declares which source property identifies an instance. On a `source events` capture, `key <property> is event source` promises each captured event is sourced by that key.',\n is: 'CDL — in `key <property> is event source`, marks the key as the event source of every captured event.',\n map: 'CDL — maps and translates source values before events are appended.',\n translate: 'CDL — translates source values into Screenplay values.',\n append: 'CDL — appends an event when the source data changes.',\n when: 'CDL — the change condition: a property change, added, or removed.',\n added: 'CDL — matches items that appear in the source.',\n removed: 'CDL — matches items that disappear from the source.',\n children: 'CDL — captures changes in a child collection of the source data.',\n identified: 'CDL — introduces the identifying key of a child collection.',\n },\n};\n"],"mappings":"AASA,MAAaA,EAA6B,CACtC,OAAQ,CACJ,CACI,uJACA,SACJ,CACJ,EACA,YAAa,CACT,CACI,MAAO,SACP,WAAY,kBACZ,cAAe,8CACnB,EACA,CACI,MAAO,MACP,WAAY,oBACZ,cAAe,wDACnB,EACA,CACI,MAAO,MACP,WAAY,uCACZ,cAAe,+DACnB,EACA,CACI,MAAO,SACP,WAAY,gDACZ,cAAe,gDACnB,EACA,CACI,MAAO,YACP,WAAY,8CACZ,cAAe,kDACnB,EACA,CACI,MAAO,WACP,WAAY,kDACZ,cAAe,4DACnB,EACA,CACI,MAAO,aACP,WAAY,aACZ,cAAe,0DACnB,EACA,CACI,MAAO,eACP,WAAY,eACZ,cAAe,4DACnB,CACJ,EACA,OAAQ,CACJ,OAAQ,qDACR,IAAK,kKACL,MAAO,6EACP,KAAM,yDACN,KAAM,sDACN,MAAO,kDACP,IAAK,mLACL,GAAI,wGACJ,IAAK,sEACL,UAAW,yDACX,OAAQ,uDACR,KAAM,oEACN,MAAO,iDACP,QAAS,sDACT,SAAU,mEACV,WAAY,6DAChB,CACJ,E"}