@cratis/screenplay-language 4.78.0 → 4.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../bmp-word-characters.ts", "../../tokens.ts", "../../scope-items.ts", "../../completion-items.ts", "../../response-completions.ts", "../../operation-authoring.ts", "../../event-source-authoring.ts", "../../named-rule-context.ts", "../../example-values.ts", "../../structure-completions.ts", "../../sub-language-registry.ts", "../../completion-planner.ts", "../../completions.ts", "../../inline-completions.ts", "../../response-tokens.ts", "../../keyword-docs.ts", "../../hover-content.ts", "../../hover.ts", "../../inlay-hints.ts", "../../code-actions.ts", "../../diagnostics.ts", "../../sub-languages/pdl.ts", "../../sub-languages/cdl.ts", "../../themes/screenplay-dark.ts", "../../themes/screenplay-light.ts", "../../index.ts"],
4
- "sourcesContent": ["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// .NET regex \\w accepts these categories per UTF-16 code unit, not supplementary code points.\n// Monarch discards a rule's /u flag. Expand just this class into BMP ranges rather than enabling\n// Unicode mode for the entire grammar (which would change legacy regexes and embedded languages).\nconst word = /[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}]/u;\nconst escape = (value: number) => `\\\\u${value.toString(16).padStart(4, '0')}`;\nfunction ranges(): string {\n let result = '';\n for (let value = 0; value <= 0xffff; value++) {\n if (!word.test(String.fromCharCode(value))) continue;\n const start = value;\n while (value < 0xffff && word.test(String.fromCharCode(value + 1))) value++;\n result += escape(start) + (value > start ? `-${escape(value)}` : '');\n }\n return result;\n}\nexport const bmpWordCharacters = ranges();\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { languages } from 'monaco-editor';\nimport {\n clauseKeywords,\n codeBlockTags,\n constructKeywords,\n primitiveTypes,\n sliceTypes,\n} from './language';\nimport { MonarchTokenRules, SubLanguage } from './sub-language-registry';\nimport { bmpWordCharacters } from './bmp-word-characters';\n\n// Maps a Screenplay inline code tag to the Monaco language id used for embedded highlighting.\n// Declaration registration must not globally reserve existing property names.\n// Ambiguous standalone operation headers are supplied by typed semantic tokens.\nconst contextualConstructs = new Set(['operation', 'system', 'eventsource']);\n\nconst embeddedLanguages: Record<string, string> = {\n csharp: 'csharp',\n typescript: 'typescript',\n react: 'typescript',\n html: 'html',\n sql: 'sql',\n};\n\nfunction subLanguageState(keyword: string): string {\n return `subLanguage_${keyword}`;\n}\n\n// A construct keyword at the start of a line ends any indented sub-language block.\nfunction subLanguageExitRule(subLanguages: SubLanguage[]): MonarchTokenRules[number] {\n const exitKeywords = [...constructKeywords.filter(keyword => !contextualConstructs.has(keyword)), ...subLanguages.map((subLanguage) => subLanguage.keyword)];\n return [\n new RegExp(`^\\\\s*(?:${exitKeywords.join('|')})\\\\b`),\n { token: '@rematch', next: '@pop' },\n ];\n}\n\n// Shared across the composite `.play` tokenizer and every standalone sub-language tokenizer\n// (comments, `$`-prefixed context variables, strings, numbers, operators, delimiters, whitespace).\nexport const commonTokenRules: MonarchTokenRules = [\n [/\\/\\/.*$/, 'comment'],\n [/^(numbers)([ \\t]+)(exact)(?=[ \\t]*(?:(?:\\/\\/|#).*)?$)/, ['keyword', 'white', 'keyword']],\n [/\\$(?:context|eventContext|eventSourceId|causedBy)(?:\\.\\w+)*/, 'variable.predefined'],\n [/\\$(?:env|secrets|strings)\\.[\\w.]+/, 'variable.predefined'],\n [/\\$\\.[\\w.]*/, 'variable.predefined'],\n [/\"(?:[^\"\\\\]|\\\\.)*\"/, 'string'],\n [/\"(?:[^\"\\\\]|\\\\.)*$/, 'string.invalid'],\n [/\\d+(?:ms|s|m|h|d)\\b/, 'number'],\n [/-?\\d+\\.\\d+/, 'number.float'],\n [/-?\\d+/, 'number'],\n [/=>|==|!=|>=|<=|[><=:?]/, 'operator'],\n [/[[\\](),.]/, 'delimiter'],\n [/\\s+/, 'white'],\n];\n\nexport function createTokensProvider(subLanguages: SubLanguage[]): languages.IMonarchLanguage {\n const tokenizer: Record<string, MonarchTokenRules> = {\n root: [\n [/^(eventsource)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'type.identifier']],\n [/^(system)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'type.identifier']],\n [/^(\\s*)(produces\\s+operation)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@operationBody.$1' }]],\n [/^(\\s*)(given\\s+operation)(\\s+)([\\w.]+)(\\s+)(fails)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword']],\n [/^(\\s*)(then\\s+(?:operation|compensated))(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier']],\n [new RegExp(`^(\\\\s*)(command)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?://.*)?$)`), ['white', 'keyword', 'white', { token: 'type.identifier', next: '@commandBody.$1' }]],\n [/^(\\s*)(handler)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@handlerBody.$1' }]],\n [/^(\\s*@?[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(\\s+)(generated)(\\s+identifier|)(?=\\s*(?:\\/\\/.*)?$)/,\n ['identifier', 'type.identifier', 'white', 'keyword', 'keyword']],\n [/^(\\s*)(generated)(\\s+)([a-z_]\\w*)(\\s*=(?!=|>))/, ['white', 'keyword', 'white', 'identifier', 'operator']],\n [/^(\\s*)(then)(\\s+)(returns)\\b/, ['white', 'keyword', 'white', 'keyword']],\n // Only unambiguous response headers: two-token property declarations keep their names.\n [/^(\\s*)(returns)(?=\\s*(?:\\/\\/.*)?$|\\s+@\\w+\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword']],\n // A modifier only after a complete type; names called optional remain ordinary names.\n [/^(\\s*(?:by|filter)\\s+[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:from\\b|\\/\\/|$))/,\n ['identifier', 'type.identifier', 'white', 'keyword']],\n // Query prefixes cannot fall back to being property names.\n [/^(?!\\s*(?:by|filter)\\s+)(\\s*@?[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:identifier\\b|from\\b|=(?!=|>)|\\/\\/|$))/,\n ['identifier', 'type.identifier', 'white', 'keyword']],\n [/^(\\s*query\\s+[A-Za-z_]\\w*\\s*=>\\s*(?!observable\\s+optional\\s*(?:\\/\\/.*)?$)(?:observable\\s+)?)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:\\/\\/.*)?$)/,\n ['keyword', 'type.identifier', 'white', 'keyword']],\n // A specification's clock, trigger, capture and query steps - matched before a sub-language keyword\n // can claim 'capture' and read the rest of the specification as change data capture.\n [/^(\\s*)(given|when)(\\s+)(clock|capture|trigger|query)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(then)(\\s+)(result|no\\s+result)\\b/, ['white', 'keyword', 'white', 'keyword']],\n // A quoted import names .play files rather than a qualified name - the path reads as a link.\n [/^(\\s*)(import)(\\s+)(\"[^\"\\\\]*\")/, ['white', 'keyword', 'white', 'string.link']],\n // Retain the header indent so event metadata stops at the enclosing block boundary.\n [/^(\\s*)((?:produces\\s+)?event)(\\s+)([A-Za-z_]\\w*)(\\s+)(generation)(\\s+)(\\d+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', { token: 'number', next: '@eventBody.$1' }]],\n [/^(\\s*)((?:produces\\s+)?event)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@eventBody.$1' }]],\n // A tagged opening fence carries the embedded language; legacy tag lines still highlight.\n ...codeBlockTags.map(\n (tag): MonarchTokenRules[number] => [\n new RegExp(`^\\\\s*\\\\x60\\\\x60\\\\x60${tag}\\\\s*$`),\n { token: 'string.quote', next: `@codeBlock.${embeddedLanguages[tag]}`, nextEmbedded: embeddedLanguages[tag] },\n ],\n ),\n // Inline code block tags at end of line open an embedded code block.\n ...codeBlockTags.map(\n (tag): MonarchTokenRules[number] => [\n new RegExp(`\\\\b${tag}\\\\b(?=\\\\s*$)`),\n { token: 'keyword.tag', next: `@codeBlockPending.${embeddedLanguages[tag]}` },\n ],\n ),\n // Sub-language constructs switch to the registered sub-language's token rules.\n ...subLanguages.map(\n (subLanguage): MonarchTokenRules[number] => [\n new RegExp(`\\\\b${subLanguage.keyword}\\\\b`),\n { token: 'keyword', next: `@${subLanguageState(subLanguage.keyword)}` },\n ],\n ),\n // A bare description keyword at end of line opens a fenced plain-text block.\n [/\\bdescription\\b(?=\\s*$)/, { token: 'keyword', next: '@descriptionBlockPending' }],\n [/\\brow-click\\b/, 'keyword'],\n // A leading @ escapes a name that collides with a directive keyword - it is a name, not an attribute.\n [/^\\s*@[a-z_]\\w*/, 'identifier'],\n [/@\\w+/, 'annotation'],\n [\n /[A-Z]\\w*/,\n {\n cases: {\n '@sliceTypes': 'keyword.type',\n '@primitiveTypes': 'type',\n '@default': 'type.identifier',\n },\n },\n ],\n [\n /[a-z_]\\w*/,\n {\n cases: {\n '@keywords': 'keyword',\n '@default': 'identifier',\n },\n },\n ],\n { include: '@common' },\n ],\n\n commandBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(validate)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@commandValidation.$1' }]],\n { include: '@root' },\n ],\n\n commandValidation: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [new RegExp(`^(\\\\s*)([${bmpWordCharacters}.]+)(\\\\s+)(rule)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?:severity\\\\s+\\\\w+|message\\\\s+.*|//.*|$))`),\n ['white', 'identifier', 'white', 'keyword', 'white', { token: 'type.identifier', next: '@namedRuleBody.$1' }]],\n { include: '@root' },\n ],\n\n namedRuleBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n operationBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(execute|compensate)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@operationPhase.$1' }]],\n [/^(\\s*)(uses)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'type.identifier']],\n [/^(\\s*)(@?[a-z_]\\w*)(\\s+)([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(?=\\s*(?:=(?!=|>)|\\/\\/|$))/,\n ['white', 'identifier', 'white', 'type.identifier']],\n { include: '@root' },\n ],\n\n operationPhase: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n handlerBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n implementationBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(hint)(?=\\s+\")/, ['white', 'keyword']],\n { include: '@root' },\n ],\n\n eventBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(id)(?=\\s+\")/, ['white', 'keyword']],\n [/^(\\s*)(documentation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@descriptionBlockPending' }]],\n { include: '@root' },\n ],\n\n common: commonTokenRules,\n\n // After a code tag, the only thing allowed before the opening fence is whitespace.\n codeBlockPending: [\n [\n /^\\s*```\\s*$/,\n { token: 'string.quote', switchTo: '@codeBlock.$S2', nextEmbedded: '$S2' },\n ],\n [/^\\s*[^\\s`].*$/, { token: '@rematch', next: '@pop' }],\n [/\\s+/, 'white'],\n ],\n\n codeBlock: [\n [/^\\s*```\\s*$/, { token: 'string.quote', next: '@pop', nextEmbedded: '@pop' }],\n [/[^`]+/, ''],\n [/`/, ''],\n ],\n\n // After a bare description, the only thing allowed before the opening fence is whitespace.\n descriptionBlockPending: [\n [/\\/\\/.*$/, 'comment'],\n [/^\\s*```(?:text|markdown)?\\s*$/, { token: 'string.quote', switchTo: '@descriptionBlock' }],\n [/^\\s*[^\\s`].*$/, { token: '@rematch', next: '@pop' }],\n [/\\s+/, 'white'],\n ],\n\n descriptionBlock: [\n [/^\\s*```\\s*$/, { token: 'string.quote', next: '@pop' }],\n [/.+/, 'string'],\n ],\n };\n\n for (const subLanguage of subLanguages) {\n tokenizer[subLanguageState(subLanguage.keyword)] = [\n subLanguageExitRule(subLanguages),\n ...subLanguage.tokens,\n { include: '@common' },\n [/[A-Z]\\w*/, 'type.identifier'],\n [/[a-z_]\\w*/, 'identifier'],\n ];\n }\n\n return {\n defaultToken: '',\n tokenPostfix: '.play',\n ignoreCase: false,\n keywords: [...constructKeywords.filter(keyword => !contextualConstructs.has(keyword)), ...clauseKeywords, ...codeBlockTags],\n sliceTypes,\n primitiveTypes,\n tokenizer,\n } as languages.IMonarchLanguage;\n}\n", "// 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';\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 { 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: 'import \"\u2026\"', insertText: 'import \"${1:*/*.play}\"', documentation: 'Imports `.play` files into this module \u2014 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 ...interactionItems,\n];\n\nexport const featureScopeItems: CompletionEntry[] = [\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: 'import \"\u2026\"', insertText: 'import \"${1:*.play}\"', documentation: 'Imports `.play` files into this feature \u2014 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 \u2192 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 { 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 \u2014 a name and a type reference.' },\n];\n\nexport const reducerItems: CompletionEntry[] = [\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: '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: 'policy', insertText: 'policy ${1:PolicyName}', documentation: 'A policy this persona holds.' },\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 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];\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.' },\n { label: 'theme', insertText: 'theme ${1:Theme}', documentation: 'The theme of the profile.' },\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: 'arrangement', insertText: 'arrangement flow\\n column\\n ${1:slot}', documentation: 'How the slots are placed.' },\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", "// 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 { eventContextPaths } from './event-context';\n\nexport const optionalTypeItems: CompletionEntry[] = [\n { label: 'optional', insertText: 'optional', documentation: 'Allows the complete value, including a collection, to be absent.' },\n];\n\nexport interface CompletionEntry {\n label: string;\n insertText: string;\n documentation: string;\n}\n\nconst fenced = (tag: string) => `\\`\\`\\`${tag}\\n\\${1}\\n\\`\\`\\``;\n\nexport const topLevelItems: CompletionEntry[] = [\n { label: 'eventsource', insertText: 'eventsource ${1:Name}\\n identifier ${2:Type}\\n stream ${3:Name}', documentation: 'Application-owned source with nested streams; not admitted by any supported executable model (ESM) version yet (PLAY0268).' },\n { label: 'system', insertText: 'system ${1:Name}\\n description \"${2:external system}\"', documentation: 'Application-scoped external system; not admitted by any supported executable model (ESM) version yet.' },\n { label: 'import', insertText: 'import ${1:Module}.${2:Type}', documentation: 'Imports a type from another module by its qualified name.' },\n { label: 'import \"\u2026\"', insertText: 'import \"${1:**/*.play}\"', documentation: 'Imports other `.play` files by path or glob, relative to this file\\'s folder, as whole documents of the application.' },\n { label: 'concept', insertText: 'concept ${1:Name} : ${2|Uuid,String,Int,Decimal,Bool,Date,DateTime|}', documentation: 'Declares a formalized value type wrapping a primitive.' },\n { label: 'concept (enum)', insertText: 'concept ${1:Name} : Enum\\n ${2:value}', documentation: 'Declares an enumeration concept with a fixed set of values.' },\n { label: 'concept (@pii with reason)', insertText: 'concept ${1:Name} : ${2|String,Uuid,Int,Decimal,Bool,Date,DateTime|} @pii\\n pii reason \"${3:why this is personal data, its purpose and lawful basis}\"', documentation: 'Declares a personal-data concept together with the reason it is personal data.' },\n { label: 'type', insertText: 'type ${1:Name}\\n ${2:property} ${3:Type}', documentation: 'Declares a composite value type \u2014 a named shape built from several properties.' },\n { label: 'policy', insertText: 'policy ${1:Name}\\n require ${2:authenticated}', documentation: 'Declares a named authorization rule for commands and queries.' },\n { label: 'module', insertText: 'module ${1:Name}\\n ', documentation: 'Declares the top-level namespace \u2014 maps to a bounded context.' },\n { label: 'domain', insertText: 'domain ${1:Name}', documentation: 'The domain the file belongs to \u2014 optional, at most one per file, before everything else.' },\n { label: 'persona', insertText: 'persona ${1:Name}\\n description \"${2:who they are}\"', documentation: 'A named role interacting with the application, with the policies it holds.' },\n { label: 'authentication', insertText: 'authentication\\n provider ${1:Name}\\n ${2:setting} ${3:value}', documentation: 'Declares the identity providers of the application \u2014 at most one block per file.' },\n { label: 'seed', insertText: 'seed\\n for ${1:EventSourceId}\\n ${2:EventType}', documentation: 'Declares events to seed into the event store per event source id.' },\n { label: 'layout', insertText: 'layout ${1:Name}\\n ${2:slot}', documentation: 'Declares the application shell with named slots.' },\n { label: 'theme', insertText: 'theme ${1:Name}\\n compatible with ${2:Package}', documentation: 'Declares a theme and the component packages it is compatible with.' },\n { label: 'ui profile', insertText: 'ui profile ${1:Name}\\n target platform ${2:web}\\n layout ${3:Layout}\\n theme ${4:Theme}', documentation: 'Binds a target platform and size to a layout, theme and component packages.' },\n { label: 'behavior', insertText: 'behavior ${1:Name}\\n on ${2:click}\\n ${3:execute command}', documentation: 'A named interaction wiring, attached to a screen, form or dialog with `uses`.' },\n { label: 'trigger', insertText: 'trigger ${1:Name}\\n ${2:property} ${3:Type}', documentation: 'Declares an integration signal a reaction can run on.' },\n];\n\nexport const operationItems: CompletionEntry[] = [\n { label: 'uses', insertText: 'uses ${1:System}', documentation: 'Exactly one application-scoped external system.' },\n { label: 'description', insertText: 'description \"${1:intent}\"', documentation: 'Describes operation intent, without requiring code.' },\n { label: 'input', insertText: '${1:input} ${2:Type}', documentation: 'Typed operation input; no identifier or generated modifier.' },\n { label: 'execute', insertText: 'execute\\n description \"${1:effect}\"', documentation: 'Optional execution intent; not admitted by any supported executable model (ESM) version yet.' },\n { label: 'compensate', insertText: 'compensate\\n description \"${1:undo intent}\"', documentation: 'Optional compensation intent; not admitted by any supported executable model (ESM) version yet.' },\n];\n\nexport const operationImplementationItems: CompletionEntry[] = [\n { label: 'hint', insertText: 'hint \"${1:implementation guidance}\"', documentation: 'Ordered authoring guidance; not an executable implementation role.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Selects the phase\u2019s sole source attachment.' },\n ...['csharp', 'typescript', 'react', 'html', 'sql'].map(language => ({ label: language, insertText: fenced(language), documentation: 'Selects the phase\u2019s sole inline source; not admitted by any supported executable model (ESM) version yet.' })),\n];\n\nexport const operationPhaseItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:phase intent}\"', documentation: 'A description-only phase is valid, pending intent.' },\n { label: 'implementation', insertText: 'implementation\\n hint \"${1:guidance}\"', documentation: 'Hints with optional source; phase owns File/Code, wrapper owns hints only.' },\n ...operationImplementationItems.filter(item => item.label !== 'hint'),\n];\n\nexport const conceptItems: CompletionEntry[] = [\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the repository relative file this declaration is realized by, so the document can be navigated back to the code.' },\n { label: 'pii reason', insertText: 'pii reason \"${1:why this is personal data, its purpose and lawful basis}\"', documentation: 'Records why the `@pii` marker applies \u2014 purpose, lawful basis, whose subject it lives under.' },\n { label: 'sensitive reason', insertText: 'sensitive reason \"${1:why this value is sensitive}\"', documentation: 'Records why the `@sensitive` marker applies.' },\n { label: 'validate', insertText: 'validate\\n ${1:not empty} message \"${2:message}\"', documentation: 'Validation rules that travel with the value everywhere it appears.' },\n];\n\nexport const typeItems: CompletionEntry[] = [\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the repository relative file this declaration is realized by, so the document can be navigated back to the code.' },\n { label: 'description', insertText: 'description \"${1:what this shape represents}\"', documentation: 'A human-readable description of the type.' },\n { label: 'property', insertText: '${1:property} ${2:Type}', documentation: 'A property of the type \u2014 a name and a type reference.' },\n];\n\n\n\nexport const sliceItems: CompletionEntry[] = [\n { label: 'operation', insertText: 'operation ${1:Name}\\n uses ${2:System}\\n ${3:input} ${4:Type}', documentation: 'Reusable slice-owned operation intent; not admitted by any supported executable model (ESM) version yet.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the repository relative file this declaration is realized by, so the document can be navigated back to the code.' },\n { label: 'event', insertText: 'event ${1:Name}\\n ${2:property} ${3:Type}', documentation: 'Declares an event type \u2014 an immutable, past-tense fact.' },\n { label: 'event generation', insertText: 'event ${1:Name} generation ${2:2}\\n ${3:property} ${4:Type}', documentation: 'Declares a complete numbered event generation; start at 1 and do not skip a number.' },\n { label: 'command', insertText: 'command ${1:Name}\\n ${2:property} ${3:Type}', documentation: 'Declares a command \u2014 an imperative intent that produces events.' },\n { label: 'query', insertText: 'query ${1:Name} => ${2:ReadModel}', documentation: 'Declares a read-side entry point mapping to a return type.' },\n { label: 'query observable', insertText: 'query ${1:Name} => observable ${2:ReadModel}', documentation: 'Declares a live read \u2014 the query keeps pushing as the read model changes, instead of answering once.' },\n { label: 'readmodel', insertText: 'readmodel ${1:Name}\\n ${2:property} ${3:Type}', documentation: 'Declares the shape of a read model \u2014 its properties \u2014 that a projection, reducer or query fills and returns.' },\n { label: 'reducer', insertText: 'reducer ${1:Name} => ${2:ReadModel}\\n on ${3:EventType}\\n ```csharp\\n ${4}\\n ```', documentation: 'Declares a reducer building a read model from events with imperative code, for what a projection cannot express.' },\n { label: 'specification', insertText: 'specification ${1:Name}\\n given ${2:EventType}\\n when ${3:Command}\\n then ${4:EventType}', documentation: 'Given/when/then acceptance criteria for the slice.' },\n { label: 'projection', insertText: 'projection ${1:Name} => ${2:ReadModel}\\n from ${3:EventType}', documentation: 'Declares how events project into a read model (PDL).' },\n { label: 'capture', insertText: 'capture ${1:Name}\\n source ${2:api}', documentation: 'Declares a change data capture converting external data into events (CDL).' },\n { label: 'reaction', insertText: 'reaction ${1:Name}\\n when ${2:Trigger}', documentation: 'Declares behavior that runs when something happens.' },\n { label: 'screen', insertText: 'screen ${1:Name}\\n data ${2:ReadModel} via query ${3:QueryName}', documentation: 'Declares a UI screen.' },\n { label: 'constraint', insertText: 'constraint ${1:Name}\\n unique ${2:property} on ${3:EventType}', documentation: 'Declares a server-side rule enforced before events are committed.' },\n];\n\nexport const commandItems: CompletionEntry[] = [\n { label: 'property', insertText: '${1:property} ${2:Type}', documentation: 'An input of the command \u2014 a name and a type reference.' },\n { label: 'produces operation', insertText: 'produces operation ${1:Name}\\n uses ${2:System}\\n ${3:input} ${4:Type} = ${5:source}', documentation: 'Declares ordered operation intent; not admitted by any supported executable model (ESM) version yet (PLAY0268).' },\n { label: 'returns property', insertText: 'returns @${1:property}', documentation: 'Scalar response from a direct command property, only on acceptance. Executable as ESM v7.' },\n { label: 'returns block', insertText: 'returns\\n ${1:field} = ${2:property}', documentation: 'Unnamed record response with inferred or explicit field types, only on acceptance. Executable as ESM v7.' },\n { label: 'produces event', insertText: 'produces event ${1:Name}\\n ${2:property} ${3:Type} = ${4:source}', documentation: 'Declares a slice-owned generation-1 event and maps its properties. An omitted for uses the command identifier.' },\n { label: 'identifier property', insertText: '${1:property} ${2:Type} identifier', documentation: 'Marks the property a runtime resolves the event source id from. At most one per command.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'References the policies that must pass for the command to execute.' },\n { label: 'reads', insertText: 'reads ${1:View} by ${2:property}', documentation: 'Declares a view the command consults. Executable binding is not yet supported.' },\n { label: 'reads as', insertText: 'reads ${1:View} as ${2:alias} by ${3:property}', documentation: 'Names one instance of a view; every instance needs a unique alias when reading the same view more than once.' },\n { label: 'validate', insertText: 'validate\\n ${1:property} not empty message \"${2:message}\"', documentation: 'Declarative validation rules with messages.' },\n { label: 'validate csharp', insertText: `validate\\n ${fenced('csharp')}`, documentation: 'Imperative validation in C#, yielding the message of every rule the artifact breaks.' },\n { label: 'produces', insertText: 'produces ${1:EventType}\\n ${2:property} = ${3:source}', documentation: 'Declares the event the command emits, with property mappings.' },\n { label: 'produces when', insertText: 'produces when ${1:condition}\\n ${2:EventType}\\n ${3:property} = ${4:source}', documentation: 'Conditionally emits an event when the condition holds.' },\n { label: 'description', insertText: 'description \"${1:what the command asks for}\"', documentation: 'A human-readable description.' },\n { label: 'concurrency', insertText: 'concurrency\\n ${1|eventSource,sourceType,streamType,streamId,events|}', documentation: 'The scope of the concurrency check made when the command appends events.' },\n { label: 'handler', insertText: 'handler\\n ', documentation: 'Fully imperative command implementation \u2014 file reference or inline C#, instead of produces.' },\n];\n\nexport const eventItems: CompletionEntry[] = [\n { label: 'property', insertText: '${1:property} ${2:Type}', documentation: 'A property of the event \u2014 a name and a type reference.' },\n { label: 'description', insertText: 'description \"${1:what happened}\"', documentation: 'Authoring metadata, as one line or a text/markdown fence.' },\n { label: 'documentation', insertText: 'documentation\\n ```markdown\\n ${1:Details}\\n ```', documentation: 'Authoring-only Markdown documentation.' },\n { label: 'id', insertText: 'id \"${1:OldName}\"', documentation: 'Preserves a previous persisted event name after a rename. Leave absent for new events.' },\n { label: 'tag', insertText: 'tag ${1:audit}', documentation: 'An event-type tag stamped on every occurrence.' },\n];\n\nexport const inlineEventItems: CompletionEntry[] = [\n ...eventItems,\n { label: 'for', insertText: 'for ${1:identifier}', documentation: 'Explicitly names the command identifier used as the event source.' },\n { label: 'property mapping', insertText: '${1:property} ${2:Type} = ${3:source}', documentation: 'Declares and maps an event property on one line.' },\n];\n\nexport const producesItems: CompletionEntry[] = [\n { label: 'when', insertText: 'when ${1:condition}', documentation: 'Guards the produced event with a condition.' },\n];\n\nexport const implementationItems: CompletionEntry[] = [\n { label: 'hint', insertText: 'hint \"${1:implementation guidance}\"', documentation: 'Ordered nonblank guidance for a handler implementation. Not an execution guarantee.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Selects one existing model-relative attachment.' },\n ...['csharp', 'typescript', 'react', 'html', 'sql'].map(language => ({ label: language, insertText: fenced(language), documentation: 'Selects one inline payload. Handler execution remains unsupported.' })),\n];\n\nexport const handlerItems: CompletionEntry[] = [\n { label: 'implementation', insertText: 'implementation\\n hint \"${1:implementation guidance}\"', documentation: 'Handler-only implementation intent with optional file or tagged fence. With no payload it is pending.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Delegates the command implementation to an external C# file.' },\n { label: 'csharp', insertText: fenced('csharp'), documentation: 'Inline C# returning the events to append.' },\n];\n\nexport const queryItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:what this query is trying to accomplish}\"', documentation: 'What the query is for, in prose \u2014 what a generator or reviewer works from.' },\n { label: 'by', insertText: 'by ${1:param} ${2:Type}', documentation: 'Declares the identifying parameter of the query.' },\n { label: 'filter', insertText: 'filter ${1:param} ${2:Type} optional', documentation: 'Declares an optional filter parameter supplied by the caller.' },\n { label: 'filter from context', insertText: 'filter ${1:param} ${2:Type} from $context.${3|tenant,causedBy.subject,occurred|}', documentation: 'Declares a parameter filled from the query context instead of the caller.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'References the policies that must pass for the query to execute.' },\n { label: 'performer', insertText: 'performer\\n ', documentation: 'The code that performs the query \u2014 a file reference or an inline csharp/sql block.' },\n];\n\nexport const performerItems: CompletionEntry[] = [\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Delegates the query implementation to an external file.' },\n { label: 'csharp', insertText: fenced('csharp'), documentation: 'Inline C# returning the query result, with the QueryContext in scope as context.' },\n { label: 'sql', insertText: fenced('sql'), documentation: 'Inline SQL returning the query result.' },\n];\n\nexport const constraintItems: CompletionEntry[] = [\n { label: 'unique', insertText: 'unique ${1:property} on ${2:EventType}', documentation: 'Enforces a unique property value across an event type.' },\n { label: 'unique event', insertText: 'unique event ${1:EventType}', documentation: 'Enforces that the event type occurs at most once per event source.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Delegates the constraint to a custom C# implementation.' },\n];\n\nexport const reactionItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:what this reaction does}\"', documentation: 'What the reaction does \u2014 a complete statement of intent before any code exists.' },\n { label: 'when', insertText: 'when ${1:Trigger}', documentation: 'An event, a declared trigger or a host signal that sets the reaction off. A trigger needs no body.' },\n { label: 'every', insertText: 'every ${1:15} ${2|seconds,minutes,hours,days|}', documentation: 'Runs the reaction on an interval.' },\n { label: 'at', insertText: 'at ${1:08:00}', documentation: 'Runs the reaction at a time of day \u2014 every day unless narrowed with `on <Weekday>` or `on day <n>`.' },\n { label: 'where', insertText: 'where ${1:condition}', documentation: 'Narrows which occurrences actually run the reaction.' },\n];\n\nexport const reactionTriggerItems: CompletionEntry[] = [\n { label: 'reads', insertText: 'reads ${1:View}', documentation: 'The view this trigger consults. Optionally use `as <alias> by <trigger value>`; clock triggers take no values and cannot use `by`.' },\n { label: 'description', insertText: 'description \"${1:what this reaction does}\"', documentation: 'What this particular reaction does \u2014 enough on its own, with no file to point at.' },\n { label: 'produces', insertText: 'produces ${1:EventType}', documentation: 'An event the reaction appends.' },\n { label: 'invokes', insertText: 'invokes ${1:Command}', documentation: 'A command the reaction hands on. A command is asked for, not produced \u2014 it may still be rejected.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Delegates the reaction to an external C# file.' },\n { label: 'csharp', insertText: fenced('csharp'), documentation: 'Inline C# returning event side effects.' },\n];\n\nexport const triggerItems: CompletionEntry[] = [\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the repository relative file this declaration is realized by, so the document can be navigated back to the code.' },\n { label: 'description', insertText: 'description \"${1:when this occurs}\"', documentation: 'What makes an occurrence of this trigger happen.' },\n { label: 'value', insertText: '${1:name} ${2:Type}', documentation: 'A value an occurrence hands the reaction. The type is optional.' },\n];\n\nexport const specificationItems: CompletionEntry[] = [\n { label: 'given operation fails', insertText: 'given operation ${1:Name} fails', documentation: 'Failure fixture leaf; not admitted by any supported executable model (ESM) version yet (PLAY0268).' },\n { label: 'then operation', insertText: 'then operation ${1:Name}\\n ${2:input} = ${3:value}', documentation: 'Partial requested-operation assertion; not admitted by any supported executable model (ESM) version yet (PLAY0268).' },\n { label: 'then compensated', insertText: 'then compensated ${1:Name}', documentation: 'Compensation assertion leaf; not admitted by any supported executable model (ESM) version yet (PLAY0268).' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the repository relative file this declaration is realized by, so the document can be navigated back to the code.' },\n { label: 'given', insertText: 'given ${1:EventType}\\n ${2:property} = ${3:value}', documentation: 'Establishes prior state by replaying an event before the command runs.' },\n { label: 'given readmodel', insertText: 'given readmodel ${1:ReadModelType}\\n ${2:property} = ${3:value}', documentation: 'Establishes prior read model state directly.' },\n { label: 'when', insertText: 'when ${1:CommandType}\\n ${2:property} = ${3:value}', documentation: 'The command being exercised.' },\n { label: 'then', insertText: 'then ${1:EventType}\\n ${2:property} = ${3:value}', documentation: 'An event expected to be produced by the command.' },\n { label: 'then readmodel', insertText: 'then readmodel ${1:ReadModelType}\\n ${2:property} = ${3:value}', documentation: 'The read model state expected after the command.' },\n { label: 'then no readmodel', insertText: 'then no readmodel ${1:ReadModelType} for ${2:key}', documentation: 'Asserts that precisely one keyed read-model instance does not exist; another key may still be present.' },\n { label: 'then query', insertText: 'then query ${1:QueryName}\\n arguments\\n ${2:argument} = ${3:value}\\n result\\n ${4:property} = ${5:value}', documentation: 'The ordered query results expected for explicit arguments. Remove the result block to assert an empty result.' },\n { label: 'then error', insertText: 'then error', documentation: 'A rejection, for a reason this specification does not name.' },\n { label: 'then error \"...\"', insertText: 'then error \"${1:reason}\"', documentation: 'A rejection, for the named reason.' },\n { label: 'given clock', insertText: 'given clock \"${1:2026-10-05T08:00:00Z}\"', documentation: 'The instant the scenario happens at - the occurrence time of everything it does. At most once.' },\n { label: 'given capture', insertText: 'given capture ${1:Capture}\\n ${2:field} = ${3:value}', documentation: 'A record the capture\\'s source held before.' },\n { label: 'when clock', insertText: 'when clock \"${1:2026-10-05T09:00:00Z}\"', documentation: 'The clock reaches an instant, as the action.' },\n { label: 'when trigger', insertText: 'when trigger ${1:Trigger}\\n ${2:value} = ${3:value}', documentation: 'An application trigger fires, as the action.' },\n { label: 'when capture', insertText: 'when capture ${1:Capture}\\n ${2:field} = ${3:value}', documentation: 'The record a capture\\'s source holds now, as the action.' },\n { label: 'when query', insertText: 'when query ${1:Query}\\n ${2:argument} = ${3:value}', documentation: 'Performs a query, as the action.' },\n { label: 'then result', insertText: 'then result\\n ${1:property} = ${2:value}', documentation: 'One result the query performed by `when query` returns, in order.' },\n { label: 'then no result', insertText: 'then no result', documentation: 'The query performed by `when query` returns nothing.' },\n];\n\n// What follows a 'given', 'when' or 'then' already typed in a specification.\nexport const specificationStepItems: Record<'given' | 'when' | 'then', CompletionEntry[]> = {\n given: [\n { label: 'operation', insertText: 'operation ${1:Name} fails', documentation: 'Syntax-only failure fixture; no children.' },\n { label: 'clock', insertText: 'clock \"${1:2026-10-05T08:00:00Z}\"', documentation: 'The instant the scenario happens at - the occurrence time of everything it does.' },\n { label: 'capture', insertText: 'capture ${1:Capture}\\n ${2:field} = ${3:value}', documentation: 'A record the capture\\'s source held before. Repeat it for several records.' },\n { label: 'readmodel', insertText: 'readmodel ${1:ReadModelType}\\n ${2:property} = ${3:value}', documentation: 'Establishes prior read model state directly.' },\n { label: 'caller', insertText: 'caller\\n ${1:authenticated}', documentation: 'The identity the scenario runs as.' },\n ],\n when: [\n { label: 'clock', insertText: 'clock \"${1:2026-10-05T09:00:00Z}\"', documentation: 'The clock reaches an instant - what a scheduled reaction responds to.' },\n { label: 'trigger', insertText: 'trigger ${1:Trigger}\\n ${2:value} = ${3:value}', documentation: 'An application trigger fires, with the values it carries.' },\n { label: 'capture', insertText: 'capture ${1:Capture}\\n ${2:field} = ${3:value}', documentation: 'The record a capture\\'s source holds now.' },\n { label: 'query', insertText: 'query ${1:Query}\\n ${2:argument} = ${3:value}', documentation: 'Performs a query; assert what it returns with `then result` or `then no result`.' },\n { label: 'append', insertText: 'append ${1:EventType}\\n ${2:property} = ${3:value}', documentation: 'An event occurs, instead of a command being executed.' },\n ],\n then: [\n { label: 'operation', insertText: 'operation ${1:Name}\\n ${2:input} = ${3:value}', documentation: 'Syntax-only partial operation assertion; not admitted by any supported executable model (ESM) version yet.' },\n { label: 'compensated', insertText: 'compensated ${1:Name}', documentation: 'Syntax-only compensation assertion; no children.' },\n { label: 'returns value', insertText: 'returns ${1:value}', documentation: 'Scalar response expectation, compared by semantic value equality. Executable as ESM v7.' },\n { label: 'returns block', insertText: 'returns\\n ${1:field} = ${2:value}', documentation: 'Nonempty subset of response fields asserted by name. Executable as ESM v7.' },\n { label: 'result', insertText: 'result\\n ${1:property} = ${2:value}', documentation: 'One result the query performed by `when query` returns, in order.' },\n { label: 'result exactly', insertText: 'result exactly\\n ${1:property} = ${2:value}', documentation: 'One result, with every property asserted.' },\n { label: 'no result', insertText: 'no result', documentation: 'The query performed by `when query` returns nothing.' },\n { label: 'readmodel', insertText: 'readmodel ${1:ReadModelType}\\n ${2:property} = ${3:value}', documentation: 'The read model state expected afterwards.' },\n { label: 'error', insertText: 'error \"${1:reason}\"', documentation: 'A rejection, for the named reason.' },\n { label: 'denied', insertText: 'denied', documentation: 'The action is denied to the caller.' },\n ],\n};\n\nexport const namedRuleImplementationItems: CompletionEntry[] = [\n { label: 'hint', insertText: 'hint \"${1:predicate guidance}\"', documentation: 'Ordered nonblank authoring guidance. Does not execute or confirm the predicate.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'The sole named-rule predicate attachment.' },\n { label: 'csharp', insertText: fenced('csharp'), documentation: 'Opaque named-rule predicate returning a bool. Requires an admitting target.' },\n];\n\nexport const commandRuleItems: CompletionEntry[] = [\n { label: 'implementation', insertText: 'implementation\\n hint \"${1:predicate guidance}\"', documentation: 'Command named-rule intent with optional file or tagged fence. Pending intent cannot bind.' },\n ...namedRuleImplementationItems.filter(item => item.label !== 'hint'),\n];\n\nexport const ruleItems: CompletionEntry[] = [\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Gives the named predicate its implementation in an external C# file.' },\n { label: 'csharp', insertText: fenced('csharp'), documentation: 'Gives the named predicate its implementation as inline C# returning a bool.' },\n];\n\nexport const policyItems: CompletionEntry[] = [\n { label: 'require authenticated', insertText: 'require authenticated', documentation: 'Requires an authenticated caller.' },\n { label: 'require role', insertText: 'require role \"${1:role}\"', documentation: 'Requires the caller to have a role.' },\n { label: 'require claim', insertText: 'require claim \"${1:claim}\" matches ${2:subject}', documentation: 'Requires a claim to match the subject or a value.' },\n { label: 'csharp', insertText: fenced('csharp'), documentation: 'Fully custom policy logic in C#, returning a bool.' },\n];\n\nexport const validateItems: CompletionEntry[] = [\n { label: 'not empty', insertText: '${1:property} not empty message \"${2:message}\"', documentation: 'The property must have a value.' },\n { label: 'max', insertText: '${1:property} max ${2:500} message \"${3:message}\"', documentation: 'Maximum length or value.' },\n { label: 'min', insertText: '${1:property} min ${2:1} message \"${3:message}\"', documentation: 'Minimum length or value.' },\n { label: 'matches', insertText: '${1:property} matches \"${2:pattern}\" message \"${3:message}\"', documentation: 'The property must match a regular expression.' },\n { label: 'rule', insertText: '${1:property} rule ${2:PredicateName} message \"${3:message}\"', documentation: 'Names a predicate \u2014 optionally followed by an indented `file` reference or inline `csharp` block giving it a body; bare, it just states that a constraint exists.' },\n { label: '==', insertText: '${1:property} == ${2:value} message \"${3:message}\"', documentation: 'The property must equal the value.' },\n { label: '!=', insertText: '${1:property} != ${2:value} message \"${3:message}\"', documentation: 'The property must not equal the value.' },\n { label: 'length ==', insertText: '${1:property} length == ${2:3} message \"${3:message}\"', documentation: 'The property must have an exact length.' },\n { label: 'all >', insertText: '${1:collection}.${2:property} all > ${3:0} message \"${4:message}\"', documentation: 'Every element of a collection must satisfy the comparison.' },\n];\n\nexport const screenItems: CompletionEntry[] = [\n { label: 'data', insertText: 'data ${1:ReadModel} via query ${2:QueryName}', documentation: 'Binds a read model to the screen through a query.' },\n { label: 'action', insertText: 'action ${1:CommandName}', documentation: 'Makes a command available as an action on the screen.' },\n { label: 'layout', insertText: 'layout ${1:LayoutName}', documentation: 'Uses a layout template and fills its slots.' },\n { label: 'section', insertText: 'section ${1:name}', documentation: 'A named structural section of the screen.' },\n { label: 'table', insertText: 'table ${1:name}\\n column ${2:property} label \"${3:text}\"', documentation: 'A table widget over a read model or collection.' },\n { label: 'summary', insertText: 'summary ${1:ReadModel}\\n field ${2:property} label \"${3:text}\"', documentation: 'A summary widget showing labeled fields.' },\n { label: 'title', insertText: 'title \"${1:text}\"', documentation: 'The title of the screen or section.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Full external implementation \u2014 Stage uses the referenced file.' },\n { label: 'react', insertText: fenced('react'), documentation: 'Inline React/TSX component receiving the data contract as Props.' },\n { label: 'typescript', insertText: fenced('typescript'), documentation: 'Inline plain TypeScript.' },\n { label: 'html', insertText: fenced('html'), documentation: 'Inline static HTML.' },\n];\n\nexport const actionItems: CompletionEntry[] = [\n { label: 'navigate to', insertText: 'navigate to ${1:ScreenName}', documentation: 'Navigates to a screen after the action completes.' },\n { label: 'label', insertText: 'label \"${1:text}\"', documentation: 'The display label of the action.' },\n];\n\nexport const tableItems: CompletionEntry[] = [\n { label: 'column', insertText: 'column ${1:property} label \"${2:text}\"', documentation: 'A column bound to a property.' },\n { label: 'on row-click', insertText: 'on row-click navigate to ${1:ScreenName} by ${2:param}', documentation: 'Navigates when a row is clicked.' },\n];\n\nexport const contextVariableItems: CompletionEntry[] = [\n { label: '$context.occurred', insertText: '$context.occurred', documentation: 'When the command or query was received.' },\n { label: '$context.tenant', insertText: '$context.tenant', documentation: 'The tenant the command or query is executing for.' },\n { label: '$context.command.', insertText: '$context.command.${1:property}', documentation: 'A property of the command being handled.' },\n { label: '$context.arguments.', insertText: '$context.arguments.${1:name}', documentation: 'An argument of the query being performed.' },\n { label: '$context.causedBy.subject', insertText: '$context.causedBy.subject', documentation: 'Subject of the identity that caused the command or query.' },\n { label: '$context.causedBy.name', insertText: '$context.causedBy.name', documentation: 'Display name of the identity that caused the command or query.' },\n { label: '$context.causedBy.userName', insertText: '$context.causedBy.userName', documentation: 'User name of the identity that caused the command or query.' },\n { label: '$context.causation.type', insertText: '$context.causation.type', documentation: 'What caused this \u2014 a command, a reactor, a schedule.' },\n { label: '$context.identity.id', insertText: '$context.identity.id', documentation: 'The identifier of the caller from the auth token.' },\n { label: '$context.identity.name', insertText: '$context.identity.name', documentation: 'The display name of the caller.' },\n { label: '$context.identity.userName', insertText: '$context.identity.userName', documentation: 'The user name of the caller.' },\n { label: '$context.identity.isAuthenticated', insertText: '$context.identity.isAuthenticated', documentation: 'Whether the caller is authenticated.' },\n { label: '$context.identity.roles', insertText: '$context.identity.roles', documentation: 'The roles the caller holds.' },\n { label: '$context.identity.claims.', insertText: '$context.identity.claims.${1:name}', documentation: 'The value of a claim the caller carries.' },\n { label: '$env.', insertText: '$env.${1:VAR_NAME}', documentation: 'An environment variable.' },\n // Every $eventContext path the event-context catalog lists, for projections - the underlying value of a concept\n // is left out, it reads the same as the member it belongs to.\n ...eventContextPaths\n .filter((path) => path.name !== 'value')\n .map((path) => ({ label: `$eventContext.${path.path}`, insertText: `$eventContext.${path.path}`, documentation: `${path.description} (PDL)` })),\n];\n\nexport { moduleScopeItems as moduleItems, featureScopeItems as featureItems } from './scope-items';\n\n// What a slice of each type can hold. A slice of an unknown type keeps everything.\nconst sliceMembers: Record<string, readonly string[]> = {\n StateChange: ['operation', 'file', 'description', 'event', 'event generation', 'command', 'constraint', 'screen', 'specification'],\n StateView: ['file', 'description', 'readmodel', 'query', 'query observable', 'projection', 'reducer', 'screen', 'specification', 'event', 'event generation'],\n Automation: ['operation', 'file', 'description', 'reaction', 'reducer', 'command', 'event', 'event generation', 'readmodel', 'specification'],\n Translate: ['file', 'description', 'capture', 'event', 'event generation', 'specification'],\n};\n\nexport function sliceItemsFor(sliceType: string | undefined): CompletionEntry[] {\n const members = sliceType ? sliceMembers[sliceType] : undefined;\n return members ? sliceItems.filter(item => members.includes(item.label)) : sliceItems;\n}\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { enclosingChain, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { CompletionEntry, optionalTypeItems } from './completion-items';\nimport { DocumentSymbols, PropertySymbol, propertyTypeReference, scanDocument } from './symbols';\nimport { typeReferenceText } from './TypeReferenceSymbol';\nimport { responseAvailability, responseAnalysis } from './response-analysis';\nimport { primitiveTypes } from './language';\n\nexport function responseCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n const fences = fenceMap(lines);\n if (fences[line] || withoutComment(before).length < before.length) return null;\n const indent = before.trim() === '' ? before.length : indentOf(lines[line]);\n const chain = enclosingChain(lines, fences, line, indent);\n const enclosing = nearestEnclosingLine(lines, fences, line, indent);\n const namedCommand = (name: string | undefined) => {\n const matches = symbols.commands.filter(command => command.name === name);\n return matches.length === 1 ? matches[0] : undefined;\n };\n const entry = (property: PropertySymbol, insertText = property.name): CompletionEntry => ({\n label: property.name, insertText,\n documentation: `${typeReferenceText(propertyTypeReference(property))}${property.isGenerated ? ' \u2014 generated, not request/form input' : ''}. ${responseAvailability}`,\n });\n if (chain.includes('command')) {\n // Merged symbol line offsets belong to different documents. Only the current (possibly\n // unsaved) source can own the cursor; application symbols are for external lookup.\n const command = scanDocument(lines).commands.filter(command => command.line < line).at(-1);\n if (!command) return null;\n if (chain[0] === 'command') {\n if (/^\\s*returns\\s+@?\\w*$/.test(before)) {\n if (!/returns\\s+@/.test(before) && command.properties.some(property => property.name === 'returns' && property.line === line)) return null;\n return command.properties.map(property => entry(property, `${/returns\\s+@/.test(before) ? '' : '@'}${property.name}`));\n }\n const modifier = before.match(/^\\s*@?[a-z_]\\w*\\s+([\\w.]+)\\s+(\\w*)$/);\n if (modifier && ['generated', 'identifier'].some(word => word.startsWith(modifier[2]))) {\n const concept = symbols.concepts.find(concept => concept.name === modifier[1]);\n if (concept?.primitive === 'Uuid') return [\n ...('optional'.startsWith(modifier[2]) ? optionalTypeItems : []),\n { label: 'generated', insertText: 'generated', documentation: `Required scalar Uuid concept with no validation rules; not a request/form input. ${responseAvailability}` },\n { label: 'generated identifier', insertText: 'generated identifier', documentation: `Specification fixture uses an indented for value. ${responseAvailability}` },\n { label: 'identifier', insertText: 'identifier', documentation: 'Names the event source identifier.' },\n ];\n }\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.]+\\s+generated\\s+\\w*$/.test(before)) return [{ label: 'identifier', insertText: 'identifier', documentation: responseAvailability }];\n }\n if (chain[0] === 'returns') {\n if (/=\\s*@?\\w*$/.test(before)) return command.properties.map(property => entry(property));\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.]*$/.test(before)) return [...symbols.concepts.map(concept => concept.name), ...symbols.types.map(type => type.name), ...primitiveTypes].map(name => ({ label: name, insertText: name, documentation: `Explicit response type must exactly match the source. ${responseAvailability}` }));\n return command.properties.map(property => entry(property, `${property.name} = ${property.name}`));\n }\n }\n if (chain[0] === 'form' && enclosing && (/^\\s*field\\s+\\w*$/.test(before) || before.trim() === '')) {\n const command = namedCommand(enclosing.match(/\\bfor\\s+([\\w.]+)$/)?.[1]);\n if (command) return command.properties.filter(property => !property.isGenerated).map(property => entry(property, before.trim() === '' ? `field ${property.name}` : property.name));\n }\n if (chain.includes('specification')) {\n if (chain[0] === 'when' && enclosing) {\n const name = enclosing.match(/^when\\s+([\\w.]+)$/)?.[1];\n const command = namedCommand(name);\n if (!command) return null;\n if (/^\\s*generated\\s+\\w*$/.test(before)) return command.properties.filter(property => property.isGenerated && !property.isIdentifier).map(property => entry(property, `${property.name} = \"\\${1:uuid}\"`));\n if (before.trim() === '') return [\n ...command.properties.filter(property => !property.isGenerated).map(property => entry(property, `${property.name} = \\${1:value}`)),\n ...command.properties.filter(property => property.isGenerated && !property.isIdentifier).map(property => ({ ...entry(property, `generated ${property.name} = \"\\${1:uuid}\"`), label: `generated ${property.name}` })),\n ...(command.properties.some(property => property.isGenerated && property.isIdentifier) ? [{ label: 'for', insertText: 'for \"${1:uuid}\"', documentation: `Generated identifier fixture, not request input. ${responseAvailability}` }] : []),\n ];\n }\n if (chain[0] === 'then' && /^then\\s+returns$/.test(enclosing ?? '')) {\n const specification = [...responseAnalysis(lines).specifications.values()].filter(specification => specification.location.line - 1 < line).at(-1);\n const command = namedCommand(specification?.when?.commandType);\n if (command?.response?.kind === 'RecordCommandResponseSyntax') {\n const properties = new Map(command.properties.map(property => [property.name, property]));\n return command.response.fields.map(field => {\n const source = properties.get(field.source.property);\n const type = field.type ?? (source ? propertyTypeReference(source) : undefined);\n return { label: field.name, insertText: `${field.name} = \\${1:value}`, documentation: `${type ? typeReferenceText(type) : 'Unresolved type'}. ${responseAvailability}` };\n });\n }\n }\n }\n return null;\n}\n", "// 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 { CompletionEntry, operationItems, operationPhaseItems, operationImplementationItems } from './completion-items';\nimport { enclosingChain, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { DocumentSymbols } from './symbols';\nimport { responseAnalysis } from './response-analysis';\nimport { OperationAnalysis, OperationDeclaration, OperationPhase } from './OperationAnalysis';\nimport { TypeReferenceSymbol, typeReferenceText } from './TypeReferenceSymbol';\n\nexport const operationAvailability = 'Syntax-only; not admitted by any supported executable model (ESM) version yet (PLAY0268) (#301). No semantic or requirement identity is assigned.';\n\nexport function analyzeOperations(lines: string[], symbols?: DocumentSymbols) {\n return responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [],\n symbols?.authoringPlacement, symbols?.authoringPath).operations;\n}\n\nexport function phaseState(phase: OperationPhase | null): string {\n return !phase ? 'not declared' : phase.file ? `file ${phase.file.path}` : phase.code ? `inline ${phase.code.language}` : 'pending';\n}\n\nexport function operationDetails(operation: OperationDeclaration): string {\n const inputs = operation.inputs.map(input => `${input.name} ${typeReferenceText(input.type)}`).join('\\n');\n const phase = (name: string, value: OperationPhase | null) => `${name}: ${name === 'compensate' && !value ? 'not declared' : phaseState(value)}${value?.description ? ` \u2014 ${value.description}` : ''}${value?.implementation?.hints.map(hint => `\\n hint: ${hint.text}`).join('') ?? ''}`;\n return `**operation ${[...operation.scope, operation.name].join('.')}**\\n\\n${operation.description ?? ''}\\n\\nUses ${operation.uses}\\n\\n\\`\\`\\`screenplay\\n${inputs}\\n\\`\\`\\`\\n\\n${phase('execute', operation.execute)}\\n\\n${phase('compensate', operation.compensate)}\\n\\n${operationAvailability}`;\n}\n\nexport function operationCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n const fences = fenceMap(lines);\n if (fences[line] || withoutComment(before).length < before.length) return null;\n const indent = before.trim() === '' ? before.length : indentOf(lines[line]);\n const chain = enclosingChain(lines, fences, line, indent);\n const enclosing = nearestEnclosingLine(lines, fences, line, indent) ?? '';\n const analysis = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols.authoringPlacement, symbols.authoringPath);\n const operations = analysis.operations;\n const context = operations.contexts.get(line);\n const targets = () => {\n if (!context) return [];\n const reference = before.match(/(?:produces|given\\s+operation|then\\s+(?:operation|compensated))\\s+([\\w.]*)$/)?.[1] ?? before.trim();\n const qualifiers = reference.split('.').slice(0, -1);\n return operations.targets(context.scope).filter(target => qualifiers.length === 0 ||\n qualifiers.length <= target.declaration.scope.length && qualifiers.every((part, index) => target.declaration.scope[target.declaration.scope.length - qualifiers.length + index] === part))\n .map(target => ({ label: target.name, insertText: qualifiers.length > 0 ? target.declaration.name : target.name, documentation: operationDetails(target.declaration) }));\n };\n if (chain.includes('specification') && /^\\s*(?:given\\s+operation|then\\s+(?:operation|compensated))\\s+[\\w.]*$/.test(before)) return targets();\n if (chain[0] === 'command' && /^\\s*produces\\s+[\\w.]*$/.test(before)) return targets().length ? [\n { label: 'event', insertText: 'event ${1:Name}', documentation: 'Declares an inline event.' },\n { label: 'operation', insertText: 'operation ${1:Name}\\n uses ${2:System}\\n ${3:input} ${4:Type} = ${5:source}', documentation: operationAvailability },\n ...symbols.events.map(event => ({ label: event.name, insertText: event.name, documentation: 'Declared event.' })), ...targets()\n ] : null;\n if (context?.commandLine !== undefined && chain[0] === 'produces' && /^produces\\s+when\\b/.test(enclosing) && /^\\s*[\\w.]*$/.test(before)) return targets();\n const ownedOperation = context?.operation;\n const operation = ownedOperation && (line === ownedOperation.location.line - 1 || indent > indentOf(lines[ownedOperation.location.line - 1])) ? ownedOperation : undefined;\n if (operation && /^\\s*uses\\s+\\w*$/.test(before) && !operation.inputs.some(input => input.location.line === line + 1)) return operations.systems.map(system => ({ label: system.name, insertText: system.name, documentation: `${system.description ?? 'External system'}. ${operationAvailability}` }));\n if (chain[0] === 'implementation' && ['execute', 'compensate'].includes(chain[1])) return operationImplementationItems;\n if (['execute', 'compensate'].includes(chain[0]) && operation) return operationPhaseItems;\n const production = context?.production;\n const targetLine = (production?.targetLocation ?? production?.location)?.line;\n const inProductionBody = targetLine !== undefined && line > targetLine - 1 && indent > indentOf(lines[targetLine - 1]);\n const mappedOperation = operation ?? (inProductionBody ? production?.declaration : undefined);\n // Typed ranges include blank lines and comments. The caret must still be inside\n // the target's body, not dedented to a command member or conditional target line.\n // Ancestor keywords cannot own mappings, including deeper composite paths.\n if (mappedOperation) {\n const rhs = before.match(/=\\s*([\\w.]*)$/);\n if (rhs && context?.commandLine !== undefined) {\n const command = analysis.commands.get(context.commandLine);\n let properties: readonly { name: string; type: TypeReferenceSymbol; isGenerated?: boolean }[] = command?.properties ?? [];\n const parts = rhs[1].split('.');\n for (const part of parts.slice(0, -1)) {\n const property = properties.find(property => property.name === part);\n if (!property || property.type.isCollection) return [];\n const types = operations.types.filter(type => type.name === property.type.name);\n if (types.length !== 1) return [];\n properties = types[0].properties;\n }\n return properties.map(property => ({ label: property.name, insertText: property.name, documentation: `${typeReferenceText(property.type)}${property.isGenerated ? ' \u2014 generated source, not request input' : ''}. ${operationAvailability}` }));\n }\n if (operation && /^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+\\w*$/.test(before)) return [{ label: 'optional', insertText: 'optional', documentation: 'Allows absence of the complete operation input value.' }];\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.[\\]?]*$/.test(before) && operation) return [...operations.concepts.map(concept => concept.name), ...operations.types.map(type => type.name), 'String', 'Uuid', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime'].map(name => ({ label: name, insertText: name, documentation: 'Operation input type.' }));\n if (operation) return operationItems;\n return mappedOperation.inputs.map(input => ({ label: input.name, insertText: `${input.name} = \\${1:source}`, documentation: `${typeReferenceText(input.type)}. ${operationAvailability}` }));\n }\n if (chain[0] === 'then' && /^then\\s+operation\\s+/.test(enclosing)) {\n const name = enclosing.match(/^then\\s+operation\\s+([\\w.]+)/)?.[1];\n const declaration = operations.references.filter(reference => reference.name === name && reference.location.line - 1 < line && reference.kind === 'operation').at(-1)?.declaration;\n if (declaration) {\n const value = before.match(/^\\s*(\\w+)\\s*=\\s*[^=]*$/);\n if (value) {\n const type = declaration.inputs.find(input => input.name === value[1])?.type;\n const concept = operations.concepts.filter(concept => concept.name === type?.name);\n if (concept.length === 1 && concept[0].type === 'Enum') return concept[0].values.map(value => ({ label: value, insertText: JSON.stringify(value), documentation: `${type?.name} value.` }));\n }\n return declaration.inputs.map(input => ({ label: input.name, insertText: `${input.name} = \\${1:value}`, documentation: `${typeReferenceText(input.type)}. Partial assertion; ${operationAvailability}` }));\n }\n }\n return null;\n}\n\n// Shared by both editor hosts. Only the parser-owned target span can bind a reference;\n// a repeated identifier in a trailing comment or a condition is not that reference.\nexport function operationReferenceAt(analysis: OperationAnalysis, lines: string[], line: number, start: number, end: number) {\n const source = withoutComment(lines[line] ?? '');\n return analysis.references.find(reference => {\n const target = reference.targetLocation ?? reference.location;\n return target.line === line + 1 && start >= target.column && end <= target.column + reference.name.length &&\n source.slice(target.column - 1, target.column - 1 + reference.name.length) === reference.name;\n });\n}\n\nexport function operationHover(lines: string[], line: number, start: number, end: number, symbols?: DocumentSymbols): string | null {\n const analysis = analyzeOperations(lines, symbols);\n const source = lines[line] ?? '';\n const at = (location: { line: number; column: number }, name: string) => {\n const column = location.column + (source[location.column - 1] === '@' ? 1 : 0);\n return location.line === line + 1 && start === column && end === column + name.length && source.slice(start - 1, end - 1) === name;\n };\n const context = analysis.contexts.get(line);\n const property = context?.operation?.inputs.find(input => at(input.location, input.name));\n if (property) return `**${property.name}** \u2014 ${typeReferenceText(property.type)}. Operation input, not a command request field. ${operationAvailability}`;\n const equals = source.indexOf('=');\n if (equals >= 0 && start - 1 > equals && context?.commandLine !== undefined && (context.operation || context.production?.declaration)) {\n const command = responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(text => text !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, symbols?.authoringPath).commands.get(context.commandLine);\n const expression = source.slice(equals + 1, end - 1).trim();\n const parts = expression.split('.');\n let properties: readonly { name: string; type: TypeReferenceSymbol }[] = command?.properties ?? [];\n for (const [index, part] of parts.entries()) {\n const property = properties.find(property => property.name === part);\n if (!property) break;\n if (index === parts.length - 1) return `**${part}** \u2014 ${typeReferenceText(property.type)}. Command source for an operation input. ${operationAvailability}`;\n const types = analysis.types.filter(type => type.name === property.type.name);\n if (types.length !== 1 || property.type.isCollection) break;\n properties = types[0].properties;\n }\n }\n const reference = operationReferenceAt(analysis, lines, line, start, end);\n if (reference?.declaration) return operationDetails(reference.declaration);\n if (reference?.kind === 'ambiguous') return `Ambiguous production: no declaration kind was selected. ${operationAvailability}`;\n const operation = context?.operation;\n if (operation && operation.location.line === line + 1) {\n const header = withoutComment(source).match(/^\\s*(?:produces\\s+)?operation\\s+/)?.[0];\n if (header && start === header.length + 1 && end === start + operation.name.length) return operationDetails(operation);\n }\n if (operation?.usesLocation?.line === line + 1 && start >= operation.usesLocation.column && end <= operation.usesLocation.column + operation.uses.length && withoutComment(source).slice(start - 1, end - 1) === operation.uses.slice(start - operation.usesLocation.column, end - operation.usesLocation.column)) {\n const systems = analysis.systems.filter(system => system.name === operation.uses);\n return systems.length === 1 ? `**system ${systems[0].name}**\\n\\n${systems[0].description ?? ''}\\n\\n${operationAvailability}` : `Unresolved or ambiguous external system. ${operationAvailability}`;\n }\n for (const phase of [operation?.execute, operation?.compensate]) {\n if (!phase) continue;\n if (phase.location.line === line + 1 || phase.implementation?.location.line === line + 1 || phase.implementation?.hints.some(hint => hint.location.line === line + 1)) return `${phaseState(phase)}\\n\\n${phase.description ?? ''}\\n\\n${phase.implementation?.hints.map(hint => hint.text).join('\\n') ?? ''}\\n\\n${operationAvailability}`;\n }\n const system = analysis.systems.find(system => system.location.path === (symbols?.authoringPath ?? 'current.play') && system.location.line === line + 1);\n return system ? `**system ${system.name}**\\n\\n${system.description ?? ''}\\n\\n${operationAvailability}` : null;\n}\n", "// 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 { CompletionEntry } from './completion-items';\nimport { fenceMap, indentOf, withoutComment } from './document-context';\nimport { AuthoredEventSource } from './AuthoredEventSource';\nimport { AuthoredStream } from './AuthoredStream';\nimport { isSourceStreamName, isSourceStreamTypeName, sourceStreamPattern } from '@cratis/screenplay-compiler';\nimport { DocumentSymbols, symbolsForBuffer } from './symbols';\nimport { responseAnalysis } from './response-analysis';\nimport { typeReferenceText } from './TypeReferenceSymbol';\n\nexport const eventSourceAvailability = 'Syntax-only; not admitted by any supported executable model (ESM) version yet (PLAY0268) (#302). Authored classification does not supply an identity destination. No semantic IDs or automatic identity refactors.';\n\nconst routePrefix = sourceStreamPattern('^\\\\s*stream\\\\s+(?:[A-Za-z_]\\\\w*(?:\\\\.[A-Za-z_]\\\\w*)?\\\\.?)?$');\nconst keyPrefix = sourceStreamPattern('^\\\\s*streamId\\\\s*=\\\\s*([\\\\w.]*)$');\nconst identifierTypePrefix = sourceStreamPattern('^\\\\s*identifier\\\\s+[\\\\w.]*$');\nconst streamTypePrefix = sourceStreamPattern('^\\\\s*streamId\\\\s+[\\\\w.]*$');\n\nexport function analyzeEventSources(lines: string[], symbols?: DocumentSymbols) {\n symbols = symbolsForBuffer(lines, symbols);\n return responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, symbols?.authoringPath, symbols?.authoringPlacementResolved).eventSources;\n}\n\nexport function eventSourceDetails(source: AuthoredEventSource, stream?: AuthoredStream): string {\n return [`**${stream ? `stream ${source.name}.${stream.name}` : `eventsource ${source.name}`}**`,\n stream?.description ?? source.description ?? '',\n source.identifier ? `Identifier type: ${typeReferenceText(source.identifier)}` : 'No identifier type declared.',\n stream ? stream.streamId ? `Stream id type: ${typeReferenceText(stream.streamId)}` : 'Unkeyed stream.' : source.streams.map(stream => `${stream.name}${stream.streamId ? ` \u2014 ${typeReferenceText(stream.streamId)}` : ' \u2014 unkeyed'}`).join('\\n'),\n (stream?.id ?? (!stream ? source.id : null)) ? 'Stored-name pin (rename-only metadata; not a semantic ID).' : '', eventSourceAvailability].filter(Boolean).join('\\n\\n');\n}\n\nexport function eventSourceReferenceAt(lines: string[], line: number, start: number, end: number, symbols?: DocumentSymbols) {\n const analysis = analyzeEventSources(lines, symbols);\n const at = (route: typeof analysis.routes[number]) => {\n const location = route.referenceLocation;\n const name = `${route.eventSource}.${route.stream}`;\n return location?.line === line + 1 && start >= location.column && end <= location.column + name.length &&\n withoutComment(lines[line] ?? '').slice(location.column - 1, location.column - 1 + name.length) === name;\n };\n const candidate = analysis.ambiguousCandidates.find(at);\n if (candidate) return { route: candidate, resolution: { state: 'ambiguous', source: undefined, stream: undefined }, target: undefined };\n const route = analysis.routes.find(at);\n if (!route) return null;\n const resolution = analysis.resolve(route.eventSource, route.stream);\n const sourcePart = end <= route.referenceLocation!.column + route.eventSource.length;\n return { route, resolution, target: resolution.state === 'unique' ? sourcePart ? resolution.source : resolution.stream : undefined };\n}\n\n// The location is a typed header start. Match its exact prefix, never search comments or another\n// occurrence of the same name. Both hosts use this to navigate to the authored identifier.\nexport function eventSourceIdentifier(location: { line: number; column: number; path?: string }, name: string, source: string) {\n const line = withoutComment(source.split(/\\r?\\n/)[location.line - 1] ?? '');\n const prefix = line.slice(location.column - 1).match(/^(?:eventsource|stream)\\s+/)?.[0];\n return prefix && line.slice(location.column - 1 + prefix.length, location.column - 1 + prefix.length + name.length) === name\n ? { ...location, column: location.column + prefix.length } : undefined;\n}\n\nexport function eventSourceHover(lines: string[], line: number, start: number, end: number, symbols?: DocumentSymbols): string | null {\n symbols = symbolsForBuffer(lines, symbols);\n const analysis = analyzeEventSources(lines, symbols);\n const reference = eventSourceReferenceAt(lines, line, start, end, symbols);\n if (reference) return reference.resolution.source && reference.resolution.stream ? eventSourceDetails(reference.resolution.source, reference.resolution.stream)\n : `Physical stream owner: ${reference.resolution.state}; no route selected. ${'reasons' in reference.resolution ? reference.resolution.reasons.join(' ') : ''} ${eventSourceAvailability}`;\n const context = analysis.contexts.get(line);\n const declaration = context?.stream ?? context?.source;\n if (declaration) {\n const name = eventSourceIdentifier(declaration.location, declaration.name, lines.join('\\n'));\n if (name?.line === line + 1 && start === name.column && end === start + declaration.name.length && context?.source) {\n const confidence = analysis.resolve(context.source.name, context.stream?.name);\n return eventSourceDetails(context.source, context.stream) + (confidence.state === 'unique' ? '' : `\\n\\nPhysical ownership: ${confidence.state}. ${confidence.reasons.join(' ')}`);\n }\n }\n if (context?.route?.streamId && context.command) {\n const mapping = context.route.streamId;\n if (mapping.location.line === line + 1 && start === mapping.location.column && end === start + 8)\n return `Authored stream id mapping. ${eventSourceAvailability}`;\n const expression = mapping.source as { kind?: string; path?: string; location?: { line: number; column: number } };\n if (expression.kind === 'PathExpressionSyntax' && expression.path && expression.location?.line === line + 1 &&\n start >= expression.location.column && end <= expression.location.column + expression.path.length) {\n const typed = responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, symbols?.authoringPath, symbols?.authoringPlacementResolved);\n const prefix = expression.path.slice(0, end - expression.location.column);\n const parts = prefix.split('.');\n let properties = context.command.properties;\n let optional = false;\n let collection = false;\n for (const [index, part] of parts.entries()) {\n const matches = properties.filter(property => property.name === part);\n if (matches.length !== 1) break;\n const property = matches[0];\n optional ||= property.type.isOptional;\n collection ||= property.type.isCollection;\n if (index === parts.length - 1)\n return `**${part}** \u2014 ${typeReferenceText({ ...property.type, isOptional: optional, isCollection: collection })}. Command source for authored stream id. ${eventSourceAvailability}`;\n const types = typed.operations.types.filter(type => type.name === property.type.name);\n if (types.length !== 1 || collection) break;\n properties = types[0].properties.map(property => ({ ...property, isIdentifier: false }));\n }\n }\n }\n if (context?.source && /^\\s*id\\s+\"/.test(withoutComment(lines[line] ?? '')) && start === indentOf(lines[line]) + 1 && end === start + 2)\n return `Stored-name pin: rename-only metadata, not a semantic identity or an automatic refactor. ${eventSourceAvailability}`;\n const type = context?.stream?.streamId ?? context?.source?.identifier;\n if (type && type.location?.line === line + 1 && start >= type.location.column && end <= type.location.column + type.name.length)\n return `${typeReferenceText(type)} \u2014 authored ${context?.stream ? 'stream id' : 'identifier'} type. ${eventSourceAvailability}`;\n return null;\n}\n\nexport function eventSourceCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n // .NET word characters are UTF-16 code units; supplementary letters are not identifiers.\n if (fenceMap(lines)[line] || withoutComment(before).length < before.length || /[\\uD800-\\uDFFF]/.test(before)) return null;\n const analysis = analyzeEventSources(lines, symbols);\n const context = analysis.contexts.get(line);\n const indent = before.trim() ? indentOf(lines[line]) : before.length;\n if (context?.command && indent > indentOf(lines[context.command.location.line - 1]) &&\n (!context.route || indent <= indentOf(lines[context.route.location.line - 1])) && routePrefix.test(before)) {\n // A property named stream remains legal. Only offer routes whose complete-input\n // candidates have no known value-type competitor; never silently rewrite ambiguity.\n const typed = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols.authoringPlacement, symbols.authoringPath);\n const names = new Set([...typed.operations.concepts, ...typed.operations.types].map(type => type.name));\n // targets already exclude competing imports from the authoritative parsed documents.\n // Scanned symbols can retain an import removed from the current unsaved buffer.\n const qualified = before.trim().split(/\\s+/)[1] ?? '';\n return analysis.targets.filter(target => isSourceStreamName(target.source.name) && isSourceStreamName(target.stream.name) && !names.has(target.name) && (!qualified.includes('.') || target.name.startsWith(qualified.slice(0, qualified.lastIndexOf('.') + 1))))\n .map(target => ({ label: target.name, insertText: qualified.includes('.') ? target.stream.name : target.name, documentation: eventSourceDetails(target.source, target.stream) }));\n }\n if (context?.route && context.command && indent > indentOf(lines[context.route.location.line - 1]) && keyPrefix.test(before)) {\n const target = analysis.resolve(context.route.eventSource, context.route.stream).stream?.streamId;\n if (!target) return [];\n const typed = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols.authoringPlacement, symbols.authoringPath);\n const concepts = typed.operations.concepts.filter(concept => concept.name === target.name);\n const supported = ['String', 'Uuid'].includes(target.name) || concepts.length === 1 && ['String', 'Uuid', 'Int'].includes(concepts[0].type) && concepts[0].values.length === 0;\n if (!supported || target.isOptional || target.isCollection) return [];\n const parts = keyPrefix.exec(before)![1].split('.');\n let properties = context.command.properties;\n for (const part of parts.slice(0, -1)) {\n const matches = properties.filter(property => property.name === part);\n if (matches.length !== 1 || matches[0].type.isOptional || matches[0].type.isCollection) return [];\n const types = typed.operations.types.filter(type => type.name === matches[0].type.name);\n if (types.length !== 1) return [];\n properties = types[0].properties.map(property => ({ ...property, isIdentifier: false }));\n }\n return properties.filter(property => isSourceStreamName(property.name) && property.type.name === target.name && !property.type.isOptional && !property.type.isCollection)\n .map(property => ({ label: property.name, insertText: property.name, documentation: `${typeReferenceText(property.type)} \u2014 command source for authored stream id. ${eventSourceAvailability}` }));\n }\n if (context?.source && indent > indentOf(lines[context.source.location.line - 1])) {\n const ownsStream = context.stream && indent > indentOf(lines[context.stream.location.line - 1]);\n if ((ownsStream ? streamTypePrefix : identifierTypePrefix).test(before)) {\n const typed = responseAnalysis(lines, symbols.authoringDocuments ?? [], symbols.authoringPlacement, symbols.authoringPath);\n const streamId = /^\\s*streamId\\b/.test(before);\n return [...(streamId ? ['String', 'Uuid'] : ['String', 'Uuid', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime']), ...typed.operations.concepts.filter(concept => !streamId || ['String', 'Uuid', 'Int'].includes(concept.type) && concept.values.length === 0).map(concept => concept.name)]\n .filter(isSourceStreamTypeName).map(name => ({ label: name, insertText: name, documentation: eventSourceAvailability }));\n }\n if (/^\\s*$/.test(before)) return ownsStream ? [\n { label: 'streamId', insertText: 'streamId ${1:Type}', documentation: eventSourceAvailability },\n { label: 'description', insertText: 'description \"${1:Description}\"', documentation: 'Authored description.' }\n ] : [\n { label: 'identifier', insertText: 'identifier ${1:Type}', documentation: eventSourceAvailability },\n { label: 'stream', insertText: 'stream ${1:Name}', documentation: eventSourceAvailability },\n { label: 'description', insertText: 'description \"${1:Description}\"', documentation: 'Authored description.' }\n ];\n }\n return null;\n}\n", "// 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 { bmpWordCharacters } from './bmp-word-characters';\nimport { fenceMap, indentOf, withoutComment } from './document-context';\n\n// The command property form, with the compiler/tokenizer BMP identifier boundary, including its existing optional severity/message suffixes.\nexport const commandNamedRulePattern = new RegExp(`^[${bmpWordCharacters}.]+\\\\s+rule\\\\s+[A-Za-z_][${bmpWordCharacters}]*(?:\\\\s+severity\\\\s+(?:information|warning|error))?(?:\\\\s+message\\\\s+.*)?$`);\n\nexport function namedRuleContext(lines: string[], lineIndex: number, indent: number): 'rule' | 'implementation' | null {\n const fences = fenceMap(lines);\n const owners: string[] = [];\n let boundary = indent;\n for (let index = lineIndex - 1; index >= 0 && boundary > 0; index--) {\n if (fences[index]) continue;\n const line = withoutComment(lines[index]).trimEnd();\n if (line.trim().length === 0 || indentOf(line) >= boundary) continue;\n owners.push(line.trim());\n boundary = indentOf(line);\n }\n const wrapped = owners[0] === 'implementation';\n const offset = wrapped ? 1 : 0;\n return commandNamedRulePattern.test(owners[offset] ?? '') && owners[offset + 1] === 'validate' && /^command\\s/.test(owners[offset + 2] ?? '')\n ? wrapped ? 'implementation' : 'rule' : null;\n}\n", "// 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 { DocumentSymbols } from './symbols';\n\nconst exampleUuid = '\"0f8fad5b-d9cb-469f-a165-70867728950e\"';\n\nconst primitiveExamples: Record<string, string> = {\n Uuid: exampleUuid,\n String: '\"Example\"',\n Int: '1',\n Decimal: '1.5',\n Bool: 'true',\n Date: '\"2026-01-15\"',\n DateTime: '\"2026-01-15T10:00:00Z\"',\n};\n\n// An example value to write in a specification for a property of the given type, resolving concepts\n// down to the primitive they wrap. Collections and unknown types fall back to a quoted string.\nexport function exampleValueFor(type: string, symbols: DocumentSymbols): string {\n const bare = type.replace(/\\s+optional$/, '').replace(/\\?$/, '');\n if (bare.endsWith('[]')) return '\"Example\"';\n const primitive = symbols.concepts.find(concept => concept.name === bare)?.primitive ?? bare;\n return primitiveExamples[primitive] ?? '\"Example\"';\n}\n", "// 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 if (name && /^authorize\\b/.test(lines[index].trim())) authorized = true;\n }\n const symbol = symbols.commands.find(candidate => candidate.name === name);\n return symbol ? { symbol, authorized } : undefined;\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", "// 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", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { enclosingChain, enclosingHeaders, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { namedRuleContext } from './named-rule-context';\nimport { responseCompletions } from './response-completions';\nimport { DocumentSymbols, scanDocument } from './symbols';\nimport { structureCompletion } from './structure-completions';\nimport { getSubLanguage } from './sub-language-registry';\nimport * as items from './completion-items';\nimport * as scope from './scope-items';\nimport { CompletionEntry } from './completion-items';\n\n// Matches a validation rule line ending in \"rule <Name>\" (optionally followed by a\n// message clause) - both the command form (\"<property> rule <Name>\") and the\n// concept implied-subject form (\"rule <Name>\"). Its first word is the property\n// name, not \"rule\", so it can't be recognized through the chain[0] keyword switch\n// the way \"on <EventType>\" or \"handler\" are - hence the dedicated regex check.\nconst RULE_LINE_PATTERN = /(?:^|\\s)rule\\s+[A-Za-z_]\\w*(?:\\s+severity\\s+(?:information|warning|error))?(?:\\s+message\\s+.*)?$/;\n\nexport type CompletionPlan =\n | { kind: 'none' }\n | { kind: 'entries'; entries: CompletionEntry[] }\n | { kind: 'contextVariables'; replaceLength: number }\n | { kind: 'playFiles'; replaceLength: number }\n | { kind: 'policies' }\n | { kind: 'events' }\n | { kind: 'triggers' }\n | { kind: 'commands' }\n | { kind: 'producesTargets' }\n | { kind: 'screens' }\n | { kind: 'queries' }\n | { kind: 'types' };\n\n// What the position sits inside, beyond the keyword chain: the whole header of each enclosing block, so a\n// slice's type and a template's kind are known, and the document's own lines, so a declaration that may\n// appear once is not offered again.\nexport interface CompletionScope {\n headers: readonly string[];\n document: readonly string[];\n}\n\nconst declaredIn = (document: readonly string[], keyword: string) => document.some(line => new RegExp(`^${keyword}\\\\b`).test(line));\n\nfunction topLevelEntries(document: readonly string[]): CompletionEntry[] {\n return items.topLevelItems.filter(item => !(item.label === 'domain' && declaredIn(document, 'domain')) && !(item.label === 'authentication' && declaredIn(document, 'authentication')));\n}\n\nconst isTemplate = (header: string | undefined) => /^(?:screen|dialog)\\s+template\\b/.test(header ?? '');\n\n// A whole block as one completion entry. Continuation lines are indented relative to the line it is inserted on,\n// which is how the editors indent a multi-line snippet.\nfunction expansionEntry(text: string, indent: number): CompletionEntry {\n const relative = text.split('\\n').map((line, index) => (index === 0 ? line : line.slice(Math.min(indent, indentOf(line))))).join('\\n');\n const label = text.split('\\n')[0].trim();\n return { label, insertText: relative.replace(/[$}\\\\]/g, '\\\\$&'), documentation: 'Expands the whole block from what the command and its events declare.' };\n}\n\nexport function completionEntriesFor(chain: string[], where: CompletionScope = { headers: [], document: [] }): CompletionEntry[] {\n const construct = chain[0];\n if (construct === undefined || construct === 'domain') return topLevelEntries(where.document);\n const subLanguage = getSubLanguage(construct);\n if (subLanguage) return subLanguage.completions ?? [];\n const header = where.headers[0];\n switch (construct) {\n case 'module':\n return items.moduleItems;\n case 'feature':\n return items.featureItems;\n case 'slice':\n return items.sliceItemsFor(header?.split(/\\s+/)[1]);\n case 'concept':\n return items.conceptItems;\n case 'type':\n return items.typeItems;\n case 'command':\n return items.commandItems;\n case 'event':\n return items.eventItems;\n case 'readmodel':\n return scope.readModelItems;\n case 'reducer':\n return scope.reducerItems;\n case 'form':\n return scope.formItems;\n case 'contribute':\n return scope.contributeItems;\n case 'behavior':\n return scope.behaviorItems;\n case 'persona':\n return scope.personaItems;\n case 'authentication':\n return scope.authenticationItems;\n case 'seed':\n return scope.seedItems;\n case 'theme':\n return scope.themeItems;\n case 'ui':\n return scope.uiProfileItems;\n case 'on':\n case 'success':\n case 'failure':\n case 'confirm':\n return scope.outcomeItems;\n case 'layout':\n return scope.layoutItems;\n case 'system':\n return items.operationItems.filter(item => item.label === 'description');\n case 'operation':\n return items.operationItems;\n case 'execute':\n case 'compensate':\n return items.operationPhaseItems;\n case 'produces':\n return items.producesItems;\n case 'handler':\n return items.handlerItems;\n case 'implementation':\n return chain[1] === 'handler' ? items.implementationItems : ['execute', 'compensate'].includes(chain[1]) ? items.operationImplementationItems : [];\n case 'query':\n return items.queryItems;\n case 'performer':\n return items.performerItems;\n case 'constraint':\n return items.constraintItems;\n case 'reaction':\n return items.reactionItems;\n case 'trigger':\n return items.triggerItems;\n case 'when':\n case 'every':\n case 'at':\n return chain.includes('reaction') ? items.reactionTriggerItems : [];\n case 'specification':\n return items.specificationItems;\n case 'policy':\n return items.policyItems;\n case 'validate':\n return items.validateItems;\n case 'action':\n return items.actionItems;\n case 'table':\n case 'summary':\n return items.tableItems;\n case 'screen':\n return isTemplate(header) ? scope.templateItems : items.screenItems;\n case 'dialog':\n return scope.templateItems;\n default:\n if (isTemplate(where.headers.find(candidate => isTemplate(candidate)))) return scope.templateItems;\n // Sections inside a screen expose the screen vocabulary.\n if (chain.includes('screen') || construct === 'section') return items.screenItems;\n if (chain.includes('produces')) return items.producesItems;\n return [];\n }\n}\n\n// Decides what to complete at a position, without any editor dependency \u2014 the\n// Monaco service and the VSCode extension both materialize the plan into items.\nexport function planCompletions(\n lines: string[],\n lineIndex: number,\n textBefore: string,\n symbols: DocumentSymbols = scanDocument(lines),\n): CompletionPlan {\n const fences = fenceMap(lines);\n if (fences[lineIndex] || withoutComment(textBefore).length < textBefore.length) return { kind: 'none' };\n const responseEntries = responseCompletions(lines, lineIndex, textBefore, scanDocument(lines));\n if (responseEntries !== null) return { kind: 'entries', entries: responseEntries };\n\n // Inside the quotes of a file import, what is wanted is a path - replacing what has been typed so far.\n const importPath = textBefore.match(/^\\s*import\\s+\"([^\"]*)$/);\n if (importPath) {\n return { kind: 'playFiles', replaceLength: importPath[1].length };\n }\n\n // A quote or a slash only asks for a completion inside an import path.\n if (/[\"/]$/.test(textBefore)) return { kind: 'none' };\n\n const contextVariableMatch = textBefore.match(/\\$[\\w.]*$/);\n if (contextVariableMatch) {\n return { kind: 'contextVariables', replaceLength: contextVariableMatch[0].length };\n }\n\n const currentLine = lines[lineIndex] ?? '';\n const effectiveIndent =\n textBefore.trim().length === 0 ? textBefore.length : indentOf(currentLine);\n const chain = enclosingChain(lines, fences, lineIndex, effectiveIndent);\n const ruleContext = namedRuleContext(lines, lineIndex, effectiveIndent);\n if (ruleContext === 'implementation') return { kind: 'entries', entries: items.namedRuleImplementationItems };\n if (ruleContext === 'rule') return { kind: 'entries', entries: items.commandRuleItems };\n\n const propertyOwner = ['event', 'command', 'type', 'readmodel', 'trigger', 'when', 'every', 'at'].includes(chain[0]) ||\n (chain[0] === 'produces' && /^produces\\s+event\\b/.test(nearestEnclosingLine(lines, fences, lineIndex, effectiveIndent) ?? ''));\n const propertyName = textBefore.trimStart().split(/\\s+/)[0];\n const reservedProperty = (chain[0] === 'command' && ['reads', 'authorize', 'produces'].includes(propertyName)) ||\n (chain[0] === 'event' && propertyName === 'tag') ||\n (['trigger', 'when', 'every', 'at'].includes(chain[0]) && ['description', 'file', 'reads', 'produces', 'invokes'].includes(propertyName));\n const optionalPrefix = (match: RegExpMatchArray | null) => match !== null && 'optional'.startsWith(match[1]);\n const afterPropertyType = propertyOwner && !reservedProperty && optionalPrefix(textBefore.match(/^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+(\\w*)$/));\n const afterQueryType = (chain[0] === 'query' && optionalPrefix(textBefore.match(/^\\s*(?:by|filter)\\s+[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+(\\w*)$/))) ||\n optionalPrefix(textBefore.match(/^\\s*query\\s+[A-Za-z_]\\w*\\s*=>\\s*(?:observable\\s+)?[\\w.]+(?:\\[\\])?\\s+(\\w*)$/));\n if ((afterPropertyType || afterQueryType) && !/=>\\s*observable\\s+$/.test(textBefore)) return { kind: 'entries', entries: items.optionalTypeItems };\n\n if (/\\bauthorize\\s+[\\w\\s]*$/.test(textBefore) || chain[0] === 'authorize') {\n return { kind: 'policies' };\n }\n if (/\\bwhen\\s+\\w*$/.test(textBefore) && chain.includes('reaction')) {\n return { kind: 'triggers' };\n }\n if (/\\bon\\s+\\w*$/.test(textBefore) && chain.includes('constraint')) {\n return { kind: 'events' };\n }\n if (/\\binvokes\\s+\\w*$/.test(textBefore) && chain.includes('reaction')) {\n return { kind: 'commands' };\n }\n if (/\\b(?:on|unique\\s+event)\\s+\\w*$/.test(textBefore) && chain[0] === 'constraint') {\n return { kind: 'events' };\n }\n if (/\\bproduces\\s+\\w*$/.test(textBefore)) {\n return { kind: 'producesTargets' };\n }\n if (/\\bnavigate\\s+to\\s+\\w*$/.test(textBefore)) {\n return { kind: 'screens' };\n }\n if (chain[0] === 'specification') {\n if (/^\\s*when\\s+query\\s+[\\w.]*$/.test(textBefore)) return { kind: 'queries' };\n const step = textBefore.match(/^\\s*(given|when|then)\\s+\\w*$/);\n if (step) return { kind: 'entries', entries: items.specificationStepItems[step[1] as 'given' | 'when' | 'then'] };\n }\n if (/\\b(?:via|then)\\s+query\\s+[\\w.]*$/.test(textBefore)) {\n return { kind: 'queries' };\n }\n if (\n (chain[0] === 'event' || chain[0] === 'command' || chain[0] === 'type') &&\n /^\\s+[a-z_]\\w*\\s+[\\w[\\]?]*$/.test(textBefore)\n ) {\n return { kind: 'types' };\n }\n if (chain[0] === 'query' && /^\\s+(?:by|filter)\\s+[a-z_]\\w*\\s+[\\w[\\]?]*$/.test(textBefore)) {\n return { kind: 'types' };\n }\n\n const enclosingLine = nearestEnclosingLine(lines, fences, lineIndex, effectiveIndent);\n if (enclosingLine && /^produces\\s+operation\\b/.test(enclosingLine)) return { kind: 'entries', entries: items.operationItems };\n if (enclosingLine && /^produces\\s+event\\b/.test(enclosingLine)) {\n if (/^\\s+@?[a-z_]\\w*\\s+[\\w[\\]?]*$/.test(textBefore)) return { kind: 'types' };\n return { kind: 'entries', entries: items.inlineEventItems };\n }\n if (enclosingLine && RULE_LINE_PATTERN.test(enclosingLine)) {\n return { kind: 'entries', entries: items.ruleItems };\n }\n\n const headers = enclosingHeaders(lines, fences, lineIndex, effectiveIndent);\n if (chain[0] === 'for' && chain.includes('seed')) return { kind: 'events' };\n const entries = completionEntriesFor(chain, { headers, document: lines });\n const expansion = chain[0] === 'command' ? structureCompletion(lines, lineIndex, ' '.repeat(effectiveIndent), '', symbols) : null;\n return { kind: 'entries', entries: expansion ? [expansionEntry(expansion.text, effectiveIndent), ...entries] : entries };\n}\n", "// 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 } from 'monaco-editor';\nimport { typeReferenceSymbol, typeReferenceText } from './TypeReferenceSymbol';\nimport { Monaco, primitiveTypes } from './language';\nimport { DocumentSymbols, knownEventNames, knownTriggerNames, symbolsForBuffer } from './symbols';\nimport { responseCompletions } from './response-completions';\nimport { operationCompletions } from './operation-authoring';\nimport { eventSourceCompletions } from './event-source-authoring';\nimport { planCompletions } from './completion-planner';\nimport { contextVariableItems, producesItems, CompletionEntry } from './completion-items';\n\n// What a host knows beyond the one model the editor holds.\nexport interface CompletionOptions {\n // The paths a file import written in the model can name, relative to the model's folder - typically\n // importablePaths over the host's .play files. Without it, an import path is not completed.\n playFiles?: (model: editor.ITextModel) => readonly string[];\n application?: (model: editor.ITextModel) => DocumentSymbols;\n // Notify after changing application documents or placement, even when this buffer is unchanged.\n onDidChangeApplication?: (listener: () => void) => { dispose(): void };\n}\n\nexport function createCompletionProvider(monaco: Monaco, options: CompletionOptions = {}): languages.CompletionItemProvider {\n return {\n triggerCharacters: [' ', '$', '@', '.', '\"', '/'],\n\n provideCompletionItems(model, position) {\n const lines = model.getLinesContent();\n const lineIndex = position.lineNumber - 1;\n const currentLine = lines[lineIndex] ?? '';\n const textBefore = currentLine.substring(0, position.column - 1);\n const application = options.application?.(model);\n const symbols = symbolsForBuffer(lines, application);\n const responseEntries = eventSourceCompletions(lines, lineIndex, textBefore, symbols) ?? operationCompletions(lines, lineIndex, textBefore, symbols) ?? responseCompletions(lines, lineIndex, textBefore, symbols);\n const plan = responseEntries === null ? planCompletions(lines, lineIndex, textBefore, symbols) : { kind: 'entries' as const, entries: responseEntries };\n if (plan.kind === 'none') return { suggestions: [] };\n\n const word = model.getWordUntilPosition(position);\n const range = new monaco.Range(\n position.lineNumber,\n word.startColumn,\n position.lineNumber,\n word.endColumn,\n );\n const kinds = monaco.languages.CompletionItemKind;\n const asSnippet = monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet;\n\n const snippet = (entry: CompletionEntry): languages.CompletionItem => ({\n label: entry.label,\n kind: entry.insertText.includes('$') ? kinds.Snippet : kinds.Keyword,\n insertText: entry.insertText,\n insertTextRules: asSnippet,\n documentation: entry.documentation,\n range,\n });\n const symbolItem = (\n name: string,\n kind: languages.CompletionItemKind,\n detail: string,\n ): languages.CompletionItem => ({\n label: name,\n kind,\n insertText: name,\n detail,\n range,\n });\n const eventNames = () => {\n const inlineNames = new Set(symbols.events.filter(event => event.inline).map(event => event.name));\n return [...new Set(knownEventNames(symbols))].map((name) => symbolItem(name, kinds.Event, inlineNames.has(name) ? 'inline event' : 'event'));\n };\n\n switch (plan.kind) {\n case 'playFiles': {\n const pathRange = new monaco.Range(\n position.lineNumber,\n position.column - plan.replaceLength,\n position.lineNumber,\n position.column,\n );\n return {\n suggestions: (options.playFiles?.(model) ?? []).map((path) => ({\n label: path,\n kind: path.includes('*') ? kinds.Folder : kinds.File,\n insertText: path,\n range: pathRange,\n })),\n };\n }\n case 'contextVariables': {\n const variableRange = new monaco.Range(\n position.lineNumber,\n position.column - plan.replaceLength,\n position.lineNumber,\n word.endColumn,\n );\n return {\n suggestions: contextVariableItems.map((entry) => ({\n ...snippet(entry),\n range: variableRange,\n })),\n };\n }\n case 'policies':\n return {\n suggestions: symbols.policies.map((policy) =>\n symbolItem(policy.name, kinds.Reference, 'policy'),\n ),\n };\n case 'events':\n return { suggestions: eventNames() };\n case 'triggers':\n return {\n suggestions: [...new Set(knownTriggerNames(symbols))].map((name) =>\n symbolItem(name, kinds.Event, 'trigger'),\n ),\n };\n case 'commands':\n return {\n suggestions: symbols.commands.map((command) =>\n symbolItem(command.name, kinds.Method, 'command'),\n ),\n };\n case 'producesTargets':\n return { suggestions: [...producesItems.map(snippet), ...eventNames()] };\n case 'screens':\n return {\n suggestions: symbols.screens.map((screen) =>\n symbolItem(screen.name, kinds.Interface, 'screen'),\n ),\n };\n case 'queries':\n return {\n suggestions: symbols.queries.map((query) =>\n symbolItem(query.name, kinds.Function, `query => ${typeReferenceText(query.returnTypeReference ?? typeReferenceSymbol(query.returnType))}`),\n ),\n };\n case 'types':\n return {\n suggestions: [\n ...symbols.concepts.map((concept) =>\n symbolItem(\n concept.name,\n kinds.Class,\n `concept : ${concept.primitive}${concept.attributes.length ? ' ' + concept.attributes.join(' ') : ''}`,\n ),\n ),\n ...symbols.types.map((type) =>\n symbolItem(\n type.name,\n kinds.Struct,\n `type (${type.properties.length} properties)`,\n ),\n ),\n ...primitiveTypes.map((primitive) =>\n symbolItem(primitive, kinds.Struct, 'primitive'),\n ),\n ],\n };\n case 'entries':\n return { suggestions: plan.entries.map(snippet) };\n }\n },\n };\n}\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { languages } from 'monaco-editor';\nimport type { CompletionOptions } from './completions';\nimport { structureCompletion } from './structure-completions';\nimport { symbolsForBuffer } from './symbols';\n\n// Ghost text for the structure a block obviously needs next, from the compiler's own model.\nexport function createInlineCompletionProvider(options: CompletionOptions): languages.InlineCompletionsProvider {\n return {\n provideInlineCompletions(model, position) {\n const lines = model.getLinesContent();\n const lineIndex = position.lineNumber - 1;\n const line = lines[lineIndex] ?? '';\n const symbols = symbolsForBuffer(lines, options.application?.(model));\n const suggestion = structureCompletion(lines, lineIndex, line.substring(0, position.column - 1), line.substring(position.column - 1), symbols);\n if (!suggestion) return { items: [] };\n // The suggestion replaces the indentation before the cursor, so it starts with indentation of its own -\n // the editors take Tab as 'indent' rather than 'accept' for a suggestion that does not.\n return { items: [{ insertText: `${line.substring(0, position.column - 1)}${suggestion.text}`, range: { startLineNumber: position.lineNumber, startColumn: 1, endLineNumber: position.lineNumber, endColumn: position.column } }] };\n },\n disposeInlineCompletions() {},\n };\n}\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { responseAnalysis } from './response-analysis';\nimport { DocumentSymbols } from './symbols';\nimport { withoutComment } from './document-context';\n\nexport const responseTokenTypes = ['keyword', 'property', 'type'] as const;\n\n// Semantic overlays resolve the local returns ambiguity that a line-based grammar cannot.\nexport function responseTokens(lines: string[], symbols?: DocumentSymbols): { line: number; column: number; length: number; type: number }[] {\n const tokens: { line: number; column: number; length: number; type: number }[] = [];\n const add = (line: number, column: number, length: number, type: number) => {\n const source = lines[line - 1];\n if (source === undefined || column < 1 || length < 1) return;\n const start = column - 1 + (source[column - 1] === '@' ? 1 : 0);\n if (start + length <= source.length) tokens.push({ line: line - 1, column: start, length, type });\n };\n const path = symbols?.authoringPath ?? 'current.play';\n const analysis = responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, path, symbols?.authoringPlacementResolved);\n for (const source of analysis.eventSources.declarations.filter(source => source.location.path === path)) {\n add(source.location.line, source.location.column, 11, 0);\n if (source.identifier) add(source.identifier.location.line, source.identifier.location.column, source.identifier.name.length, 2);\n for (const stream of source.streams) {\n add(stream.location.line, stream.location.column, 6, 0);\n if (stream.streamId) add(stream.streamId.location.line, stream.streamId.location.column, stream.streamId.name.length, 2);\n }\n }\n for (const route of analysis.eventSources.routes) {\n add(route.location.line, route.location.column, 6, 0);\n if (route.referenceLocation) add(route.referenceLocation.line, route.referenceLocation.column, `${route.eventSource}.${route.stream}`.length, 2);\n if (route.streamId) add(route.streamId.location.line, route.streamId.location.column, 8, 0);\n }\n for (const command of analysis.commands.values()) {\n for (const property of command.properties) {\n if (!property.isGenerated) continue;\n const source = withoutComment(lines[property.location.line - 1] ?? '');\n add(property.location.line, source.lastIndexOf('generated') + 1, 9, 0);\n }\n const response = command.response;\n if (!response) continue;\n add(response.location.line, response.location.column, 7, 0);\n if (response.kind === 'ScalarCommandResponseSyntax') {\n add(response.source.location.line, response.source.location.column, response.source.property.length, 1);\n } else for (const field of response.fields) {\n add(field.location.line, field.location.column, field.name.length, 1);\n add(field.source.location.line, field.source.location.column, field.source.property.length, 1);\n if (field.type) add(field.type.location.line, field.type.location.column, field.type.name.length, 2);\n }\n }\n for (const specification of analysis.specifications.values()) {\n for (const fixture of specification.when?.generatedValues ?? []) {\n add(fixture.location.line, fixture.location.column, 9, 0);\n }\n if (specification.thenReturns) add(specification.thenReturns.location.line, (lines[specification.thenReturns.location.line - 1] ?? '').indexOf('returns') + 1, 7, 0);\n }\n for (const system of analysis.operations.systems.filter(system => system.location.path === path)) {\n add(system.location.line, system.location.column, 6, 0);\n }\n for (const operation of analysis.operations.declarations.filter(operation => operation.location.path === path)) {\n const header = withoutComment(lines[operation.location.line - 1] ?? '');\n const keyword = header.indexOf('operation', operation.location.column - 1);\n if (keyword >= 0) add(operation.location.line, keyword + 1, 9, 0);\n for (const input of operation.inputs) {\n add(input.location.line, input.location.column, input.name.length, 1);\n add(input.type.location.line, input.type.location.column, input.type.name.length, 2);\n }\n if (operation.usesLocation) add(operation.usesLocation.line, (lines[operation.usesLocation.line - 1] ?? '').indexOf('uses') + 1, 4, 0);\n for (const phase of [operation.execute, operation.compensate]) {\n if (!phase) continue;\n const name = withoutComment(lines[phase.location.line - 1] ?? '').trim();\n add(phase.location.line, phase.location.column, name.length, 0);\n if (phase.implementation) add(phase.implementation.location.line, phase.implementation.location.column, 14, 0);\n for (const hint of phase.implementation?.hints ?? []) add(hint.location.line, hint.location.column, 4, 0);\n }\n }\n // Overlays never overlap or duplicate a typed token, even with recovered malformed syntax.\n const ordered = tokens.sort((left, right) => left.line - right.line || left.column - right.column);\n return ordered.filter((token, index) => index === 0 || token.line !== ordered[index - 1].line || token.column >= ordered[index - 1].column + ordered[index - 1].length);\n}\n", "// 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 { eventContextPaths } from './event-context';\n\n// These words are contextual beneath a handler, never global property keywords.\nexport const handlerIntentDocs = {\n implementation: 'Handler-only intent with ordered hints and at most one file or tagged fence. No payload means pending. Handler execution is unsupported; this is not confirmation.',\n hint: 'One nonblank quoted implementation hint. Order and decoded text are retained; hints do not execute or confirm code.',\n};\n\nexport const keywordDocs: Record<string, string> = {\n domain: 'The domain the file belongs to \u2014 optional, at most one per file, before everything else.',\n import: 'Imports a type from another module by its qualified name \u2014 `import Module.Type` \u2014 making it available by its short name; or, quoted, other `.play` files by path or glob \u2014 `import \"Orders/**/*.play\"`, relative to this file\\'s folder. Written inside a module or feature, a file import places the imported files there: their top level is that module\\'s or feature\\'s body.',\n concept: 'A formalized value type wrapping a primitive. Attributes such as `@pii` travel with every usage, optionally with a `<attribute> reason \"...\"` line saying why.',\n type: 'A composite value type \u2014 a named shape built from several properties, referenced by events, commands and other types the same way a concept is.',\n reason: 'Records why a concept attribute applies \u2014 the purpose, the lawful basis, whose subject the value lives under. Written as `pii reason \"...\"` in the concept body.',\n optional: 'Allows a value to be absent. Write it after the type: `note String optional` or `lines InvoiceLine[] optional`. The collection itself may be absent; its items keep their declared type.',\n identifier: 'Marks the command property a runtime resolves the event source id from. At most one per command; without it a new Uuid is generated.',\n policy: 'A named authorization rule referenced by commands and queries. Multiple policies AND together.',\n persona: 'A named role interacting with the application, with an optional description and its associated policies.',\n authentication: 'Declares the identity providers of the application \u2014 at most one block per file.',\n provider: 'A named identity provider within `authentication`, with free-form `name value` settings.',\n description: 'A human-readable description of a module, feature, slice, persona, or command \u2014 the first body line, as a quoted single line or a fenced ```text block for multiple lines.',\n module: 'The top-level namespace \u2014 maps to a bounded context.',\n layout: 'A reusable screen template with named slots.',\n template: 'Declares the named slots of a layout.',\n feature: 'A vertical slice grouping. Features nest arbitrarily deep.',\n slice: 'The atomic unit of behavior, aligned with Event Modeling. Has a type and a name.',\n event: 'An immutable, past-tense fact. Declare it in a slice or inline with `produces event <Name>` in a command. Inline properties are typed mappings; inline tags belong to the event type.',\n documentation: 'Authoring-only event documentation in a fenced ```markdown block. It does not change executable model bytes.',\n id: 'Preserves the previous persisted event name after a rename. Leave absent on new events; repeating the current name is redundant.',\n command: 'An imperative intent. Declares authorization, validation, and what events it produces \u2014 declaratively, or via a full handler.',\n query: 'A read-side entry point mapping to a return type, with an optional description, parameters and performer.',\n observable: 'Qualifies a query return type as a live read \u2014 `query <Name> => observable <ReadModel>` keeps pushing as the read model changes, instead of answering once.',\n performer: 'The code that performs a query \u2014 a `file <Path>` reference or an inline `csharp`/`sql` block. The query\\'s counterpart to a command handler.',\n from: 'Fills a query parameter from the query context instead of the caller, as in `filter tenantId TenantId from $context.tenant`.',\n projection: 'Declares how events project into a read model, using the embedded Projection Declaration Language (PDL).',\n capture: 'Converts external data into events, using the embedded Change Data Capture Language (CDL).',\n reaction: 'Behavior that runs when something happens. Lives inside Automation slices. A trigger with no body states intent on its own \u2014 `file`/code is optional realization metadata.',\n trigger: 'Declares a kind of occurrence a reaction can respond to, and the values it hands the reaction. What makes one occur belongs to whoever provides it, never to the compiler.',\n where: 'Narrows which occurrences actually run the reaction.',\n contains: 'Text comparison \u2014 true when the left string holds the right one anywhere.',\n every: 'Runs a reaction on an interval \u2014 `every 15 minutes`, `every 1 day`.',\n invokes: 'A command a reaction hands on. A command is asked for, not produced \u2014 it may still be rejected.',\n screen: 'A UI declaration. Supports intent, structure, and layout-with-code levels, or a full file reference.',\n constraint: 'A server-side rule enforced in the Chronicle kernel before events are committed.',\n authorize: 'References the policies that must all pass for the construct to execute.',\n validate: 'Declarative validation rules, or `validate` followed by ```csharp for imperative rules \u2014 on commands and concepts.',\n produces: 'References a declared event with `produces <Name>`, or declares one inline with `produces event <Name>`. An inline omitted `for` uses the command identifier only when all destinations are the same source; legacy plain omission allocates an identity.',\n reads: 'Declares a view consulted by a command or reaction trigger: `reads <View> [as <alias>] [by <value>]`. A reaction `by` names a value taken by its trigger; clock triggers cannot use `by`. Repeated views require unique aliases. Runtime binding is not yet supported for command or reaction reads.',\n as: 'Names an instance of a view in a command or reaction trigger reads declaration, for example `reads Account as source by sourceId`.',\n handler: 'A fully imperative command implementation \u2014 a `file <Path>` reference or an inline `csharp` block, instead of `produces`.',\n when: 'Guards a produced event or a capture append with a condition.',\n rule: 'Names a predicate. Bare, it states that a constraint exists without expressing what it computes \u2014 nothing resolves the name. Optionally followed by an indented `file <Path>` reference or inline `csharp` block giving it a body.',\n require: 'A policy condition: `authenticated`, `role \"...\"`, or `claim \"...\" matches ...`.',\n authenticated: 'Requires an authenticated caller.',\n role: 'Requires the caller to have the given role.',\n claim: 'Requires a claim on the caller to match a subject or value.',\n subject: 'The subject (identity) of the caller.',\n data: 'Binds a read model to a screen through a query.',\n action: 'Makes a command available as an action on a screen.',\n navigate: 'Navigates to a screen, optionally passing a parameter with `by`.',\n section: 'A named structural section of a screen.',\n table: 'A table widget over a read model or child collection.',\n summary: 'A summary widget showing labeled fields.',\n column: 'A table column bound to a property.',\n field: 'A summary field bound to a property.',\n title: 'The display title of a screen or section.',\n label: 'The display label of an action, column, or field.',\n unique: 'A uniqueness constraint \u2014 `unique <property> on <EventType>` or `unique event <EventType>`.',\n concurrency: 'The concurrency scope enforced when the command appends events \u2014 dimensions: `eventSource`, `sourceType`, `streamType`, `streamId`, `events`.',\n eventSource: 'Concurrency dimension \u2014 scope the check to the event source id of the command.',\n sourceType: 'Concurrency dimension \u2014 scope the check to an event source type.',\n streamType: 'Concurrency dimension \u2014 scope the check to an event stream type.',\n streamId: 'Concurrency dimension \u2014 scope the check to an event stream id.',\n tag: 'Attaches a tag to appended events \u2014 a static identifier or string, or a `$context.` expression resolved at append time.',\n seed: 'Declares events to seed into the event store per event source id \u2014 multiple blocks accumulate.',\n for: 'Names the event source of a production or seed group. Inside `produces event`, omission uses the command identifier unless another production targets a different source.',\n readmodel: 'Declares a read model \u2014 its name and properties \u2014 in a slice, or, in a specification, read model state: `given readmodel` establishes it, `then readmodel` asserts it, `then no readmodel <View> for <key>` asserts keyed absence.',\n reducer: 'Builds a read model from events with imperative code \u2014 `reducer <Name> => <ReadModel>` with an `on <EventType>` rule per event. Use it when a projection cannot express the transition.',\n specification: 'Given/when/then acceptance criteria for a slice: prior events and state, the command, query or appended event under test, and the events, state, results, errors or denials that follow.',\n dialog: 'A dialog opened over the shell, or with `dialog template` a reusable dialog shape.',\n form: 'A form bound to a command \u2014 `form <Name> for <Command>` with a `field` per input.',\n contribute: 'Contributes entries to a slot of the shell \u2014 `contribute to Navigation` with `navigate to`, `label` and `order`.',\n theme: 'A named theme and the component packages it is compatible with.',\n ui: 'A UI profile \u2014 `ui profile <Name>` binds a target platform and size to a layout, theme and packages.',\n behavior: 'A named interaction wiring of `on <interaction>` handlers, attached to a screen, form or dialog with `uses`.',\n system: 'An application-scoped external system that operations use.',\n eventsource: 'An application-owned event source with nested streams.',\n operation: 'A reusable operation intent that uses one external system.',\n no: 'A keyed absence assertion: `then no readmodel <View> for <key>`.',\n arguments: 'The values supplied to a query asserted by `then query`.',\n result: 'One expected result - `then result [exactly]` after `when query`, or a `result` block inside `then query`. Repeat it to assert several results in authored order.',\n clock: 'The instant a specification happens at - `given clock \"2026-10-05T08:00:00Z\"` fixes when everything occurs; `when clock \"<instant>\"` is the clock reaching it, as the action.',\n exactly: 'Requires every property to match, rather than only the ones asserted - on `then readmodel`, `then query` and `then result`.',\n file: 'Delegates the implementation to an external file; the Screenplay contract stays visible.',\n by: 'Introduces the identifying parameter.',\n via: 'Connects screen data to the query that supplies it.',\n filter: 'An optional query filter parameter.',\n on: 'The event a constraint applies to, the day a schedule narrows to, or a widget interaction such as `on row-click`.',\n message: 'The validation message reported when the rule fails.',\n matches: 'Matches a value against a regular expression or a named pattern such as `email`.',\n all: 'Applies a comparison to every element of a collection.',\n max: 'Maximum length or value.',\n min: 'Minimum length or value.',\n length: 'Constrains the exact length of a value.',\n today: 'The current date.',\n empty: 'Used with `not empty` \u2014 the value must be present.',\n not: 'Negates a validation condition, as in `not empty`.',\n and: 'Both conditions must hold.',\n or: 'Either condition may hold.',\n csharp: 'An inline C# block whose opening fence is ```csharp.',\n sql: 'An inline SQL block between triple backticks \u2014 a query performer written against a relational store.',\n typescript: 'An inline TypeScript block between triple backticks.',\n react: 'An inline React/TSX block; receives the surrounding data contract as `Props`.',\n html: 'An inline static HTML block.',\n StateChange: 'Slice type \u2014 a command \u2192 events flow; something that changes the system.',\n StateView: 'Slice type \u2014 a query + projection + screen; something that reads the system.',\n Automation: 'Slice type \u2014 a reaction or reducer; something that runs when something happens.',\n Translate: 'Slice type \u2014 a capture; converts external data into events.',\n Uuid: 'Primitive type \u2014 a universally unique identifier.',\n String: 'Primitive type \u2014 a string of characters.',\n Int: 'Primitive type \u2014 an integer number.',\n Decimal: 'Primitive type \u2014 a decimal number.',\n Bool: 'Primitive type \u2014 true or false.',\n Date: 'Primitive type \u2014 a date without time.',\n DateTime: 'Primitive type \u2014 a date and time.',\n Enum: 'An enumeration concept with a fixed set of values.',\n};\n\n// What the words of a specification's steps mean there - where 'trigger', 'capture' and 'query' name what the\n// scenario exercises rather than declare one.\nexport const specificationKeywordDocs: Record<string, string> = {\n clock: keywordDocs.clock,\n trigger: '`when trigger <Trigger>` - an application trigger fires, as the action, with the values on the lines beneath it.',\n capture: '`given capture <Capture>` - a record the capture\\'s source held before; `when capture <Capture>` - the record it sees now, as the action. The fields go on the lines beneath.',\n query: '`when query <Query>` - the query is performed, as the action, with its arguments on the lines beneath; assert what it returns with `then result` or `then no result`. `then query` instead asserts a query after another action.',\n result: '`then result [exactly]` - one result the query performed by `when query` returns, in order; `then no result` - it returns nothing.',\n};\n\nexport const attributeDocs: Record<string, string> = {\n pii: '`@pii` \u2014 the value is personally identifiable information; Chronicle manages and erases it automatically wherever the concept is used. Add `pii reason \"...\"` in the concept body to record why.',\n sensitive: '`@sensitive` \u2014 the value is sensitive; Chronicle applies its sensitivity rules automatically wherever the concept is used. Add `sensitive reason \"...\"` in the concept body to record why.',\n};\n\nexport const contextVariableDocs: Record<string, string> = {\n '$context.occurred': 'When the command or query was received.',\n '$context.tenant': 'The tenant the command or query is executing for.',\n '$context.command': 'The command being handled, shaped by its `command` declaration.',\n '$context.arguments': 'The arguments of the query being performed.',\n '$context.causedBy': 'The identity that caused the command or query \u2014 `subject`, `name`, `userName`.',\n '$context.causedBy.subject': 'The subject of the identity that caused the command or query.',\n '$context.causedBy.name': 'The display name of the identity that caused the command or query.',\n '$context.causedBy.userName': 'The user name of the identity that caused the command or query.',\n '$context.causation': 'What caused the command or query \u2014 `type`, `occurred`, `properties`.',\n '$context.causation.type': 'What caused the command or query \u2014 a command, a reactor, a schedule.',\n '$context.identity': 'The caller a decision is made about \u2014 `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`.',\n '$context.identity.id': 'The identifier of the caller from the auth token.',\n '$context.identity.name': 'The display name of the caller.',\n '$context.identity.userName': 'The user name of the caller.',\n '$context.identity.isAuthenticated': 'Whether the caller is authenticated.',\n '$context.identity.roles': 'The roles the caller holds.',\n '$context.identity.claims': 'The claims the caller carries \u2014 `$context.identity.claims.<name>` reads one.',\n '$env': 'An environment variable, e.g. `$env.SERVICE_NAME`.',\n '$secrets': 'An encrypted secret resolved at runtime, e.g. `$secrets.azureAdClientId` \u2014 stays symbolic in the compiled tree.',\n '$strings': 'A localized string resolved from the `.strings` file of the active locale, e.g. `$strings.invoices.title`.',\n // Every $eventContext path the event-context catalog lists, for projections.\n ...Object.fromEntries(eventContextPaths.map((path) => [`$eventContext.${path.path}`, path.description])),\n};\n", "// 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 { namedRuleContext } from './named-rule-context';\nimport { eventSourceHover } from './event-source-authoring';\nimport { operationHover } from './operation-authoring';\nimport { DocumentSymbols } from './symbols';\nimport { responseAnalysis, responseAvailability } from './response-analysis';\nimport { enclosingChain, fenceMap, indentOf, withoutComment } from './document-context';\nimport { directBody, propertyTypeReference, scanDocument } from './symbols';\nimport { typeReferenceText } from './TypeReferenceSymbol';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { getSubLanguage } from './sub-language-registry';\nimport { attributeDocs, contextVariableDocs, handlerIntentDocs, keywordDocs, specificationKeywordDocs } from './keyword-docs';\n\n// Produces the hover markdown for a word at a position, without any editor\n// dependency \u2014 the Monaco service and the VSCode extension share this content.\n// Columns are 1-based, matching both editors' word-at-position APIs.\nexport function hoverContent(\n lines: string[],\n lineIndex: number,\n word: string,\n startColumn: number,\n endColumn: number,\n application?: DocumentSymbols,\n): string | null {\n const fences = fenceMap(lines);\n if (fences[lineIndex]) return null;\n\n const line = lines[lineIndex] ?? '';\n if (endColumn - 1 > withoutComment(line).length) return null;\n let inString = false;\n let inTemplate = false;\n for (let index = 0; index < startColumn - 1; index++) {\n if (line[index] === '\\\\' && inString) index++;\n else if (line[index] === '\"' && !inTemplate) inString = !inString;\n else if (line[index] === '`' && !inString) inTemplate = !inTemplate;\n }\n if (inString || inTemplate) return null;\n const sourceHover = eventSourceHover(lines, lineIndex, startColumn, endColumn, application);\n if (sourceHover) return sourceHover;\n const operation = operationHover(lines, lineIndex, startColumn, endColumn, application);\n if (operation) return operation;\n const tokenAt = (column: number, name: string): boolean => {\n const start = column + (line[column - 1] === '@' ? 1 : 0);\n return word === name && startColumn === start && endColumn === start + name.length && line.slice(start - 1, endColumn - 1) === name;\n };\n const before = line.charAt(startColumn - 2);\n\n if (before === '@') {\n const doc = attributeDocs[word];\n if (doc) return doc;\n }\n if (before === '$' || before === '.') {\n const variable = line.substring(0, endColumn - 1).match(/\\$[\\w.]*$/)?.[0];\n if (variable) {\n const doc =\n contextVariableDocs[variable] ??\n (variable.startsWith('$env') ? contextVariableDocs['$env'] : undefined);\n if (doc) return doc;\n }\n }\n\n // Do not mistake a property/type named optional for the contextual modifier.\n const prefix = line.slice(0, startColumn - 1);\n // Commit to query-parameter context before matching the name and type.\n const followsPropertyType = /^\\s*(?:by|filter)\\s+/.test(prefix)\n ? /^\\s*(?:by|filter)\\s+[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+$/.test(prefix)\n : /^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+$/.test(prefix);\n const followsQueryType = /^\\s*query\\s+\\w+\\s*=>\\s*(?:observable\\s+)?[\\w.]+(?:\\[\\])?\\s+$/.test(prefix) &&\n !/^\\s*query\\s+\\w+\\s*=>\\s*observable\\s+$/.test(prefix);\n if (word === 'optional' && (followsPropertyType || followsQueryType)) {\n return `**optional** \u2014 ${keywordDocs.optional}`;\n }\n\n if (word === 'implementation' || word === 'hint') {\n const chain = enclosingChain(lines, fences, lineIndex, indentOf(line));\n const ruleContext = namedRuleContext(lines, lineIndex, indentOf(line));\n if ((word === 'implementation' && ruleContext === 'rule' && /^\\s*implementation\\s*$/.test(withoutComment(line))) ||\n (word === 'hint' && ruleContext === 'implementation' && /^\\s*hint\\s+\"/.test(line))) {\n return `**${word}** \u2014 Command named-rule guidance with at most one file or tagged fence. No payload means pending and fails binding (PLAY0268). Attached predicates keep their existing pure RuleContext contract; reference execution is unsupported, never confirmation.`;\n }\n if (word === 'implementation' && chain[0] === 'handler' && /^\\s*implementation\\s*$/.test(withoutComment(line))) {\n return `**implementation** \u2014 ${handlerIntentDocs.implementation}`;\n }\n if (word === 'hint' && chain[0] === 'implementation' && chain[1] === 'handler' && /^\\s*hint\\s+\"/.test(line)) {\n return `**hint** \u2014 ${handlerIntentDocs.hint}`;\n }\n }\n\n const symbols = scanDocument(lines);\n const owner = symbols.commands.filter(command => command.line < lineIndex).at(-1);\n const property = owner?.properties.find(property => property.name === word && property.line === lineIndex);\n if (property?.isGenerated || (word === 'generated' && owner?.properties.some(property => property.isGenerated && property.line === lineIndex) && followsPropertyType)) {\n return `**${property?.name ?? 'generated'}** \u2014 ${property ? typeReferenceText(propertyTypeReference(property)) + '. ' : ''}Generated value, not a request or form input. ${responseAvailability}`;\n }\n const response = owner?.response;\n if (response?.location.line === lineIndex + 1 && (tokenAt(response.location.column, 'returns') || (response.kind === 'ScalarCommandResponseSyntax' && tokenAt(response.source.location.column, response.source.property)))) {\n const source = response.kind === 'ScalarCommandResponseSyntax' ? owner?.properties.find(property => property.name === response.source.property) : undefined;\n return `**returns**${source ? ` \u2014 ${typeReferenceText(propertyTypeReference(source))}` : ' \u2014 unnamed record response'}. ${responseAvailability}`;\n }\n if (response?.kind === 'RecordCommandResponseSyntax') {\n const field = response.fields.find(field => field.location.line === lineIndex + 1 && (tokenAt(field.location.column, field.name) || tokenAt(field.source.location.column, field.source.property)));\n if (field) {\n const source = owner?.properties.find(property => property.name === field.source.property);\n const type = field.type ? typeReferenceText(field.type) : source ? typeReferenceText(propertyTypeReference(source)) : 'Unresolved type';\n return `**${field.name}** \u2014 ${type}${field.type ? ' (explicit)' : ' (inferred)'} = ${field.source.property}. ${source?.isGenerated ? 'Generated source, not request input. ' : ''}${responseAvailability}`;\n }\n }\n for (const specification of responseAnalysis(lines).specifications.values()) {\n if ((word === 'returns' && specification.thenReturns?.location.line === lineIndex + 1) || (word === 'generated' && specification.when?.generatedValues?.some(value => value.location.line === lineIndex + 1))) return responseAvailability;\n }\n\n const concept = symbols.concepts.find((candidate) => candidate.name === word);\n if (concept) {\n const attributes = concept.attributes.length ? ` ${concept.attributes.join(' ')}` : '';\n const values = concept.enumValues.length\n ? `\\n\\nValues: ${concept.enumValues.join(', ')}`\n : '';\n const reasons = Object.entries(concept.attributeReasons)\n .map(([attribute, reason]) => `\\n\\n**@${attribute}** \u2014 ${reason}`)\n .join('');\n return `\\`\\`\\`screenplay\\nconcept ${concept.name} : ${concept.primitive}${attributes}\\n\\`\\`\\`${reasons}${values}`;\n }\n\n const type = symbols.types.find((candidate) => candidate.name === word);\n if (type) {\n const properties = type.properties\n .map((property) => `${property.name} ${typeReferenceText(propertyTypeReference(property))}`)\n .join('\\n');\n return `\\`\\`\\`screenplay\\ntype ${type.name}\\n${properties}\\n\\`\\`\\``;\n }\n\n const policy = symbols.policies.find((candidate) => candidate.name === word);\n if (policy) {\n const body = policy.requires.length ? policy.requires.join('\\n') : '(custom C#)';\n return `\\`\\`\\`screenplay\\npolicy ${policy.name}\\n${body}\\n\\`\\`\\``;\n }\n\n const event = symbols.events.find((candidate) => candidate.name === word && candidate.line === lineIndex) ??\n symbols.events.filter((candidate) => candidate.name === word)\n .sort((left, right) => (right.generation ?? 1) - (left.generation ?? 1))[0];\n if (event) {\n const properties = event.properties\n .map((property) => `${property.name} ${typeReferenceText(propertyTypeReference(property))}`)\n .join('\\n');\n return `\\`\\`\\`screenplay\\nevent ${event.name}${event.generation !== undefined ? ` generation ${event.generation}` : ''}\\n${properties}\\n\\`\\`\\``;\n }\n\n const command = symbols.commands.find((candidate) => candidate.name === word);\n if (command && command.properties.length > 0) {\n const properties = command.properties\n .map(\n (property) =>\n `${property.name} ${typeReferenceText(propertyTypeReference(property))}${property.isGenerated ? ' generated' : ''}${property.isIdentifier ? ' identifier' : ''}`,\n )\n .join('\\n');\n return `\\`\\`\\`screenplay\\ncommand ${command.name}\\n${properties}\\n\\`\\`\\`${command.response || command.properties.some(property => property.isGenerated) ? `\\n\\n${responseAvailability}` : ''}`;\n }\n\n // Sub-language keywords take precedence inside their construct.\n const chain = enclosingChain(lines, fences, lineIndex, indentOf(line));\n for (const construct of [line.trim().split(/\\s+/)[0], ...chain]) {\n const subLanguage = getSubLanguage(construct ?? '');\n const doc = subLanguage?.hovers?.[word];\n if (doc) return doc;\n }\n\n if (word === 'reads' && (chain[0] === 'every' || chain[0] === 'at') && chain.includes('reaction')) {\n return '**reads** \u2014 Declares a whole view this clock trigger consults: `reads <View>`. Clock triggers take no values, so `by` is unavailable.';\n }\n\n const step = line.trim().match(/^(given|when|then)\\s+(?:no\\s+)?(\\w+)/);\n if (step && step[2] === word && chain[0] === 'specification' && specificationKeywordDocs[word]) {\n return `**${word}** \u2014 ${specificationKeywordDocs[word]}`;\n }\n\n if (word === 'id' || word === 'documentation') {\n const source = eventAnalysisSource(lines);\n const inEvent = symbols.events.some(event => directBody(source, fences, event.line, indentOf(source[event.line])).includes(lineIndex));\n const directive = word === 'id' ? /^\\s*id\\s+\"/.test(source[lineIndex]) : /^\\s*documentation\\s*$/.test(source[lineIndex]);\n if (!inEvent || !directive || startColumn !== indentOf(line) + 1) return null;\n }\n\n if (word === 'optional' || word === 'generated' || word === 'returns') return null;\n const keywordDoc = keywordDocs[word];\n if (keywordDoc) return `**${word}** \u2014 ${keywordDoc}`;\n\n return null;\n}\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { languages } from 'monaco-editor';\nimport { hoverContent } from './hover-content';\nimport { CompletionOptions } from './completions';\n\nexport function createHoverProvider(options: CompletionOptions = {}): languages.HoverProvider {\n return {\n provideHover(model, position) {\n const word = model.getWordAtPosition(position);\n if (!word) return null;\n\n const content = hoverContent(\n model.getLinesContent(),\n position.lineNumber - 1,\n word.word,\n word.startColumn,\n word.endColumn,\n options.application?.(model),\n );\n return content ? { contents: [{ value: content }] } : null;\n },\n };\n}\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { languages } from 'monaco-editor';\nimport { destinationHints } from './production-destinations';\nimport { CompletionOptions } from './completions';\n\nexport function createInlayHintsProvider(options: CompletionOptions = {}): languages.InlayHintsProvider {\n return {\n provideInlayHints(model, range) {\n const hints = destinationHints(model.getLinesContent(), options.application?.(model)).filter(hint => hint.line + 1 >= range.startLineNumber && hint.line + 1 <= range.endLineNumber);\n return {\n hints: hints.map(hint => ({ position: { lineNumber: hint.line + 1, column: hint.column }, label: hint.label, paddingLeft: true })),\n dispose() {},\n };\n },\n };\n}\n", "// 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, IRange, languages } from 'monaco-editor';\nimport { DiagnosticCodes, isQuickFixDiagnostic, prepareQuickFixes } from '@cratis/screenplay-compiler';\n\nconst migrateOptional = 'source.screenplay.migrateOptional';\nconst containsKind = (requested: string, kind: string) => requested === '' || requested === kind || kind.startsWith(`${requested}.`);\n\nfunction intersects(left: IRange, right: IRange): boolean {\n return (left.startLineNumber < right.endLineNumber || (left.startLineNumber === right.endLineNumber && left.startColumn <= right.endColumn)) &&\n (right.startLineNumber < left.endLineNumber || (right.startLineNumber === left.endLineNumber && right.startColumn <= left.endColumn));\n}\n\n// The compiler owns recipes and verification. The adapter only translates verified offsets and pins\n// edits to the analyzed buffer version, so future fixes need no editor-specific parsing or .NET bridge.\nexport function createCodeActionProvider(placement?: readonly string[]): languages.CodeActionProvider {\n const cache = new WeakMap<editor.ITextModel, { version: number; placement: string; fixes: ReturnType<typeof prepareQuickFixes> }>();\n return {\n provideCodeActions(model, range, context, token) {\n const migrationRequested = context.only !== undefined && containsKind(context.only, migrateOptional);\n const migrationOnly = context.only !== undefined && migrationRequested && !containsKind(context.only, 'quickfix');\n if (token.isCancellationRequested || (context.only !== undefined && !migrationRequested && !containsKind(context.only, 'quickfix'))) return { actions: [], dispose() {} };\n const diagnostics = context.markers.filter(marker => {\n const code = typeof marker.code === 'object' ? marker.code.value : marker.code;\n return isQuickFixDiagnostic(code) && intersects(marker, range);\n });\n if (!migrationRequested && diagnostics.length === 0) return { actions: [], dispose() {} };\n const version = model.getVersionId();\n const placementKey = JSON.stringify(placement) ?? '';\n let analysis = cache.get(model);\n if (analysis?.version !== version || analysis.placement !== placementKey) {\n analysis = { version, placement: placementKey, fixes: prepareQuickFixes(model.getValue(), { placement }) };\n cache.set(model, analysis);\n }\n const occurrences = migrationOnly ? [] : analysis.fixes(diagnostics.map(diagnostic => ({\n line: diagnostic.startLineNumber,\n diagnosticCode: String(typeof diagnostic.code === 'object' ? diagnostic.code.value : diagnostic.code),\n }))).filter(fix => fix.scope === 'occurrence');\n const requested = [...occurrences, ...(context.only === undefined || migrationRequested ? analysis.fixes(undefined, DiagnosticCodes.LegacyOptionalSuffix) : [])];\n const fixes = requested.filter(fix => context.only === undefined || containsKind(context.only, fix.scope === 'document' ? migrateOptional : 'quickfix'));\n if (token.isCancellationRequested || model.getVersionId() !== version) return { actions: [], dispose() {} };\n return {\n actions: fixes.map(fix => ({\n title: fix.title,\n kind: fix.scope === 'document' ? migrateOptional : 'quickfix',\n isPreferred: fix.scope === 'occurrence',\n edit: { edits: fix.edits.map(edit => {\n const start = model.getPositionAt(edit.start);\n const end = model.getPositionAt(edit.start + edit.length);\n return { resource: model.uri, versionId: version, textEdit: {\n range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column },\n text: edit.text,\n } };\n }) },\n })),\n dispose() {},\n };\n },\n };\n}\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { editor } from 'monaco-editor';\nimport { Monaco, languageId } from './language';\nimport { validateLines } from './validation';\nimport { CompletionOptions } from './completions';\nimport { symbolsForBuffer } from './symbols';\n\nconst owner = 'screenplay';\nconst validationDelay = 300;\n\nexport function validate(monaco: Monaco, model: editor.ITextModel, options: CompletionOptions = {}): editor.IMarkerData[] {\n const lines = model.getLinesContent();\n const application = symbolsForBuffer(lines, options.application?.(model));\n return validateLines(lines, { application, path: application.authoringPath, placement: application.authoringPlacement }).map((issue) => ({\n severity:\n issue.severity === 'error'\n ? monaco.MarkerSeverity.Error\n : issue.severity === 'information'\n ? monaco.MarkerSeverity.Info\n : monaco.MarkerSeverity.Warning,\n tags: issue.code === 'PLAY0479' ? [monaco.MarkerTag.Deprecated] : undefined,\n message: issue.message,\n code: issue.code,\n startLineNumber: issue.line + 1,\n startColumn: issue.startColumn,\n endLineNumber: issue.line + 1,\n endColumn: issue.endColumn,\n }));\n}\n\nfunction watch(monaco: Monaco, model: editor.ITextModel, options: CompletionOptions): void {\n let handle: ReturnType<typeof setTimeout> | undefined;\n\n const run = () => {\n if (model.isDisposed()) return;\n if (model.getLanguageId() !== languageId) {\n monaco.editor.setModelMarkers(model, owner, []);\n return;\n }\n monaco.editor.setModelMarkers(model, owner, validate(monaco, model, options));\n };\n const schedule = () => {\n if (handle !== undefined) clearTimeout(handle);\n handle = setTimeout(run, validationDelay);\n };\n\n const contextChange = options.onDidChangeApplication?.(run);\n model.onDidChangeContent(schedule);\n model.onDidChangeLanguage(run);\n model.onWillDispose(() => {\n contextChange?.dispose();\n if (handle !== undefined) clearTimeout(handle);\n });\n run();\n}\n\nexport function attachDiagnostics(monaco: Monaco, options: CompletionOptions = {}): void {\n monaco.editor.getModels().forEach((model) => watch(monaco, model, options));\n monaco.editor.onDidCreateModel((model) => watch(monaco, model, options));\n}\n", "// 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// Projection Declaration Language (PDL) \u2014 embedded inside `projection` blocks.\n// See https://www.cratis.io/chronicle/projections/projection-declaration-language/grammar/\nexport const pdl: SubLanguageDefinition = {\n tokens: [\n [\n /\\b(?:from|every|all|nested|join|children|identified|by|key|parent|with|remove|via|clear|on|sequence|automap|no|exclude|literal|set|increment|decrement|add|subtract|count)\\b/,\n 'keyword',\n ],\n ],\n completions: [\n {\n label: 'key',\n insertText: 'key ${1:property}',\n documentation: 'Declares which property identifies the read model instance.',\n },\n {\n label: 'from',\n insertText: 'from ${1:EventType}',\n documentation: 'Maps properties from an event onto the read model.',\n },\n {\n label: 'join',\n insertText: 'join ${1:property} on ${2:key}',\n documentation: 'Joins related state onto the read model by a key property.',\n },\n {\n label: 'children',\n insertText: 'children ${1:collection} identified by ${2:key}',\n documentation: 'Projects events into a child collection on the read model.',\n },\n {\n label: 'remove with',\n insertText: 'remove with ${1:EventType}',\n documentation: 'Removes the read model instance when the event occurs.',\n },\n {\n label: 'parent',\n insertText: 'parent ${1:property}',\n documentation: 'Declares the property that identifies the parent of a child.',\n },\n {\n label: 'clear',\n insertText: 'clear ${1:property}',\n documentation: 'Removes the value a property holds when the event occurs.',\n },\n {\n label: 'increment',\n insertText: 'increment ${1:property}',\n documentation: 'Increments a numeric property when the event occurs.',\n },\n {\n label: 'decrement',\n insertText: 'decrement ${1:property}',\n documentation: 'Decrements a numeric property when the event occurs.',\n },\n ],\n hovers: {\n from: 'PDL \u2014 maps properties from an event onto the read model.',\n every: 'PDL \u2014 applies property mappings for every event type in the projection.',\n join: 'PDL \u2014 joins related state onto the read model by a key property.',\n children: 'PDL \u2014 projects events into a child collection on the read model.',\n identified: 'PDL \u2014 introduces the identifying key of a child collection.',\n key: 'PDL \u2014 declares which property identifies the read model instance.',\n parent: 'PDL \u2014 declares the property that identifies the parent of a child.',\n remove: 'PDL \u2014 removes the read model instance when an event occurs.',\n clear: 'PDL \u2014 clear <property> removes the value a property holds; clear with <EventType> nulls a nested object.',\n increment: 'PDL \u2014 increments a numeric property when the event occurs.',\n decrement: 'PDL \u2014 decrements a numeric property when the event occurs.',\n },\n};\n", "// 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) \u2014 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)\\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 \u2014 declares where the captured data comes from.',\n api: 'CDL \u2014 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 \u2014 optional path appended to an API source\\'s External Service base URL.',\n poll: 'CDL \u2014 the polling interval for an API source, e.g. 5m.',\n path: 'CDL \u2014 the inbound path a webhook source listens on.',\n topic: 'CDL \u2014 the topic a message source subscribes to.',\n key: 'CDL \u2014 declares which source property identifies an instance.',\n map: 'CDL \u2014 maps and translates source values before events are appended.',\n translate: 'CDL \u2014 translates source values into Screenplay values.',\n append: 'CDL \u2014 appends an event when the source data changes.',\n when: 'CDL \u2014 the change condition: a property change, added, or removed.',\n added: 'CDL \u2014 matches items that appear in the source.',\n removed: 'CDL \u2014 matches items that disappear from the source.',\n children: 'CDL \u2014 captures changes in a child collection of the source data.',\n identified: 'CDL \u2014 introduces the identifying key of a child collection.',\n },\n};\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { editor } from 'monaco-editor';\n\nexport const screenplayDarkThemeName = 'screenplay-dark';\n\nexport const screenplayDark: editor.IStandaloneThemeData = {\n base: 'vs-dark',\n inherit: true,\n rules: [\n { token: 'keyword.play', foreground: 'C586C0' },\n { token: 'keyword.tag.play', foreground: '569CD6', fontStyle: 'italic' },\n { token: 'keyword.type.play', foreground: '4FC1FF', fontStyle: 'bold' },\n { token: 'type.play', foreground: '4EC9B0' },\n { token: 'type.identifier.play', foreground: '4EC9B0' },\n { token: 'identifier.play', foreground: '9CDCFE' },\n { token: 'annotation.play', foreground: 'DCDCAA' },\n { token: 'variable.predefined.play', foreground: 'D7BA7D' },\n { token: 'string.play', foreground: 'CE9178' },\n { token: 'string.link.play', foreground: 'CE9178', fontStyle: 'underline' },\n { token: 'string.invalid.play', foreground: 'F44747' },\n { token: 'string.quote.play', foreground: '6A9955' },\n { token: 'number.play', foreground: 'B5CEA8' },\n { token: 'number.float.play', foreground: 'B5CEA8' },\n { token: 'comment.play', foreground: '6A9955', fontStyle: 'italic' },\n { token: 'operator.play', foreground: 'D4D4D4' },\n { token: 'delimiter.play', foreground: 'CCCCCC' },\n ],\n colors: {\n 'editor.background': '#1E1E1E',\n },\n};\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { editor } from 'monaco-editor';\n\nexport const screenplayLightThemeName = 'screenplay-light';\n\nexport const screenplayLight: editor.IStandaloneThemeData = {\n base: 'vs',\n inherit: true,\n rules: [\n { token: 'keyword.play', foreground: 'AF00DB' },\n { token: 'keyword.tag.play', foreground: '0000FF', fontStyle: 'italic' },\n { token: 'keyword.type.play', foreground: '0070C1', fontStyle: 'bold' },\n { token: 'type.play', foreground: '267F99' },\n { token: 'type.identifier.play', foreground: '267F99' },\n { token: 'identifier.play', foreground: '001080' },\n { token: 'annotation.play', foreground: '795E26' },\n { token: 'variable.predefined.play', foreground: 'B45309' },\n { token: 'string.play', foreground: 'A31515' },\n { token: 'string.link.play', foreground: 'A31515', fontStyle: 'underline' },\n { token: 'string.invalid.play', foreground: 'CD3131' },\n { token: 'string.quote.play', foreground: '008000' },\n { token: 'number.play', foreground: '098658' },\n { token: 'number.float.play', foreground: '098658' },\n { token: 'comment.play', foreground: '008000', fontStyle: 'italic' },\n { token: 'operator.play', foreground: '000000' },\n { token: 'delimiter.play', foreground: '000000' },\n ],\n colors: {\n 'editor.background': '#FFFFFF',\n },\n};\n", "// 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 {\n Monaco,\n languageConfiguration,\n languageExtensionPoint,\n languageId,\n} from './language';\nimport { createTokensProvider } from './tokens';\nimport { CompletionOptions, createCompletionProvider } from './completions';\nimport { createInlineCompletionProvider } from './inline-completions';\nimport { responseTokens, responseTokenTypes } from './response-tokens';\nimport { createHoverProvider } from './hover';\nimport { createInlayHintsProvider } from './inlay-hints';\nimport { eventSourceIdentifier, eventSourceReferenceAt } from './event-source-authoring';\nimport { createCodeActionProvider } from './code-actions';\nimport { attachDiagnostics } from './diagnostics';\nimport {\n getSubLanguage,\n getSubLanguages,\n onSubLanguagesChanged,\n registerSubLanguage,\n} from './sub-language-registry';\nimport { pdl } from './sub-languages/pdl';\nimport { cdl } from './sub-languages/cdl';\nimport { screenplayDark, screenplayDarkThemeName } from './themes/screenplay-dark';\nimport { screenplayLight, screenplayLightThemeName } from './themes/screenplay-light';\n\nconst registeredInstances = new Set<Monaco>();\n\nfunction applyTokensProvider(monaco: Monaco): void {\n monaco.languages.setMonarchTokensProvider(languageId, createTokensProvider(getSubLanguages()));\n}\n\n// Sub-languages registered after register() recompose the tokenizer on the fly.\nonSubLanguagesChanged(() => registeredInstances.forEach(applyTokensProvider));\n\n// Registers the built-in PDL and CDL sub-languages. Hosts that do not go through\n// register() \u2014 such as the VSCode extension \u2014 call this before using the registry.\nexport function ensureBuiltInSubLanguages(): void {\n if (!getSubLanguage('projection')) registerSubLanguage('projection', pdl);\n if (!getSubLanguage('capture')) registerSubLanguage('capture', cdl);\n}\n\n// What a host can tell the language service beyond the models it holds.\nexport type LanguageServiceOptions = CompletionOptions;\n\nexport function register(monaco: Monaco, options: LanguageServiceOptions = {}): void {\n if (registeredInstances.has(monaco)) return;\n\n ensureBuiltInSubLanguages();\n\n registeredInstances.add(monaco);\n\n monaco.languages.register(languageExtensionPoint);\n monaco.languages.setLanguageConfiguration(languageId, languageConfiguration);\n applyTokensProvider(monaco);\n monaco.languages.registerCompletionItemProvider(languageId, createCompletionProvider(monaco, options));\n monaco.languages.registerInlineCompletionsProvider(languageId, createInlineCompletionProvider(options));\n monaco.languages.registerHoverProvider(languageId, createHoverProvider(options));\n monaco.languages.registerDefinitionProvider(languageId, {\n provideDefinition(model, position) {\n const word = model.getWordAtPosition(position);\n if (!word) return [];\n const symbols = options.application?.(model);\n const reference = eventSourceReferenceAt(model.getLinesContent(), position.lineNumber - 1, word.startColumn, word.endColumn, symbols);\n const target = reference?.target;\n if (!target) return [];\n const current = symbols?.authoringPath ?? 'current.play';\n const source = target.location.path === current ? model.getValue() : symbols?.authoringDocuments?.find(document => document.path === target.location.path)?.source;\n const location = source && eventSourceIdentifier(target.location, target.name, source);\n if (!location) return [];\n // Foreign navigation requires an actual host model, not a guessed path or merged line.\n const targetUri = target.location.path && model.uri.path.endsWith(`/${current}`)\n ? model.uri.with({ path: model.uri.path.slice(0, -current.length) + target.location.path }) : undefined;\n const targetModels = targetUri ? monaco.editor.getModels().filter(candidate => candidate.uri.toString() === targetUri.toString()) : [];\n const targetModel = target.location.path === current ? model : targetModels.length === 1 ? targetModels[0] : undefined;\n return targetModel ? [{ uri: targetModel.uri, range: new monaco.Range(location.line, location.column, location.line, location.column + target.name.length) }] : [];\n }\n });\n monaco.languages.registerDocumentSemanticTokensProvider(languageId, {\n getLegend: () => ({ tokenTypes: [...responseTokenTypes], tokenModifiers: [] }),\n provideDocumentSemanticTokens(model) {\n const data: number[] = [];\n let previousLine = 0;\n let previousColumn = 0;\n for (const token of responseTokens(model.getLinesContent(), options.application?.(model))) {\n data.push(token.line - previousLine, token.line === previousLine ? token.column - previousColumn : token.column, token.length, token.type, 0);\n previousLine = token.line;\n previousColumn = token.column;\n }\n return { data: new Uint32Array(data) };\n },\n releaseDocumentSemanticTokens() {},\n });\n monaco.languages.registerInlayHintsProvider(languageId, createInlayHintsProvider(options));\n monaco.languages.registerCodeActionProvider(languageId, createCodeActionProvider());\n monaco.editor.defineTheme(screenplayDarkThemeName, screenplayDark);\n monaco.editor.defineTheme(screenplayLightThemeName, screenplayLight);\n attachDiagnostics(monaco, options);\n}\n\nexport {\n causedByProperties,\n clauseKeywords,\n codeBlockTags,\n conceptAttributes,\n constructKeywords,\n contextRoots,\n languageId,\n primitiveTypes,\n sliceTypes,\n} from './language';\nexport type { Monaco } from './language';\nexport { getSubLanguage, getSubLanguages, registerSubLanguage } from './sub-language-registry';\nexport type {\n MonarchTokenRules,\n SubLanguage,\n SubLanguageCompletion,\n SubLanguageDefinition,\n} from './sub-language-registry';\nexport { pdl } from './sub-languages/pdl';\nexport { cdl } from './sub-languages/cdl';\nexport { screenplayDarkThemeName } from './themes/screenplay-dark';\nexport { screenplayLightThemeName } from './themes/screenplay-light';\nexport { enclosingChain, fenceMap, firstWord, indentOf, withoutComment } from './document-context';\nexport {\n fileReferenceKeyword,\n fileReferenceOn,\n fileReferences,\n isAbsoluteFileReferencePath,\n} from './file-references';\nexport type { FileReference } from './file-references';\nexport { fileImportOn, fileImports, importablePaths, isFileImportLine } from './file-imports';\nexport type { FileImport } from './file-imports';\nexport type { CompletionOptions } from './completions';\nexport { builtInTriggerNames, knownEventNames, knownTriggerNames, knownTypeNames, mergeSymbols, scanDocument, symbolsForBuffer } from './symbols';\nexport type {\n CommandSymbol,\n ConceptSymbol,\n DocumentSymbols,\n EventSymbol,\n ImportSymbol,\n NamedSymbol,\n PolicySymbol,\n PropertySymbol,\n ReadSymbol,\n QuerySymbol,\n TypeSymbol,\n} from './symbols';\nexport { attributeDocs, contextVariableDocs, keywordDocs, specificationKeywordDocs } from './keyword-docs';\nexport { eventContextMemberAt, eventContextMembers, eventContextMembersAfter, eventContextPaths, namesEventContextMember } from './event-context';\nexport type { EventContextMember, EventContextPath } from './event-context';\nexport { contextVariableItems, producesItems, specificationStepItems } from './completion-items';\nexport type { CompletionEntry } from './completion-items';\nexport { completionEntriesFor, planCompletions } from './completion-planner';\nexport type { CompletionPlan } from './completion-planner';\nexport { responseTokens, responseTokenTypes } from './response-tokens';\nexport { responseCompletions } from './response-completions';\nexport { structureCompletion } from './structure-completions';\nexport { blockHeaderPattern } from './language';\nexport type { StructureCompletion } from './structure-completions';\nexport { analyzeEventSources, eventSourceAvailability, eventSourceCompletions, eventSourceDetails, eventSourceHover, eventSourceIdentifier, eventSourceReferenceAt } from './event-source-authoring';\nexport type { EventSourceAnalysis } from './EventSourceAnalysis';\nexport type { AuthoredEventSource } from './AuthoredEventSource';\nexport type { AuthoredStream } from './AuthoredStream';\nexport type { AuthoredCommandRoute } from './AuthoredCommandRoute';\nexport { analyzeOperations, operationCompletions, operationDetails, operationAvailability, operationHover, operationReferenceAt, phaseState } from './operation-authoring';\nexport type { OperationAnalysis, OperationDeclaration, OperationInput, OperationPhase, OperationReference, SystemDeclaration } from './OperationAnalysis';\nexport { responseAvailability, responseAnalysis } from './response-analysis';\nexport { hoverContent } from './hover-content';\nexport { validateLines } from './validation';\nexport { destinationHints, productionDestinations } from './production-destinations';\nexport type { DestinationHint } from './DestinationHint';\nexport type { ProductionSymbol } from './ProductionSymbol';\nexport type { ValidationContext, ValidationIssue, ValidationSeverity } from './validation';\nexport { createCodeActionProvider } from './code-actions';\nexport { typeReferenceSymbol, typeReferenceText } from './TypeReferenceSymbol';\nexport type { TypeReferenceSymbol } from './TypeReferenceSymbol';\nexport { diagnosticCodes } from './diagnostic-codes';\nexport type { DiagnosticCode } from './diagnostic-codes';\n"],
5
- "mappings": "+fAMA,IAAMA,GAAO,6BACPC,GAASC,EAACC,GAAkB,MAAMA,EAAM,SAAS,EAAE,EAAE,SAAS,EAAG,GAAG,CAAC,GAA5D,UACf,SAASC,IAAiB,CACtB,IAAIC,EAAS,GACb,QAASF,EAAQ,EAAGA,GAAS,MAAQA,IAAS,CAC1C,GAAI,CAACH,GAAK,KAAK,OAAO,aAAaG,CAAK,CAAC,EAAG,SAC5C,IAAMG,EAAQH,EACd,KAAOA,EAAQ,OAAUH,GAAK,KAAK,OAAO,aAAaG,EAAQ,CAAC,CAAC,GAAGA,IACpEE,GAAUJ,GAAOK,CAAK,GAAKH,EAAQG,EAAQ,IAAIL,GAAOE,CAAK,CAAC,GAAK,GACrE,CACA,OAAOE,CACX,CATSH,EAAAE,GAAA,UAUF,IAAMG,EAAoBH,GAAO,ECDxC,IAAMI,GAAuB,IAAI,IAAI,CAAC,YAAa,SAAU,aAAa,CAAC,EAErEC,GAA4C,CAC9C,OAAQ,SACR,WAAY,aACZ,MAAO,aACP,KAAM,OACN,IA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AAOE,EAAc,CAAC,CAAE,IAAKA,EAAY,IAAK,MAAO,IAAIhC,EAAO,MAAM2B,EAAS,KAAMA,EAAS,OAAQA,EAAS,KAAMA,EAAS,OAASL,EAAO,KAAK,MAAM,CAAE,CAAC,EAAI,CAAC,CACrK,CACJ,CAAC,EACDtB,EAAO,UAAU,uCAAuCC,EAAY,CAChE,UAAWG,EAAA,KAAO,CAAE,WAAY,CAAC,GAAG6B,EAAkB,EAAG,eAAgB,CAAC,CAAE,GAAjE,aACX,8BAA8Bf,EAAO,CACjC,IAAMgB,EAAiB,CAAC,EACpBC,EAAe,EACfC,EAAiB,EACrB,QAAWC,KAASC,GAAepB,EAAM,gBAAgB,EAAGN,EAAQ,cAAcM,CAAK,CAAC,EACpFgB,EAAK,KAAKG,EAAM,KAAOF,EAAcE,EAAM,OAASF,EAAeE,EAAM,OAASD,EAAiBC,EAAM,OAAQA,EAAM,OAAQA,EAAM,KAAM,CAAC,EAC5IF,EAAeE,EAAM,KACrBD,EAAiBC,EAAM,OAE3B,MAAO,CAAE,KAAM,IAAI,YAAYH,CAAI,CAAE,CACzC,EACA,+BAAgC,CAAC,CACrC,CAAC,EACDlC,EAAO,UAAU,2BAA2BC,EAAYsC,GAAyB3B,CAAO,CAAC,EACzFZ,EAAO,UAAU,2BAA2BC,EAAYuC,GAAyB,CAAC,EAClFxC,EAAO,OAAO,YAAYyC,GAAyBC,EAAc,EACjE1C,EAAO,OAAO,YAAY2C,GAA0BC,EAAe,EACnEC,GAAkB7C,EAAQY,CAAO,EACrC,CArDgBR,EAAAO,GAAA",
6
- "names": ["word", "escape", "__name", "value", "ranges", "result", "start", "bmpWordCharacters", "contextualConstructs", "embeddedLanguages", "subLanguageState", "keyword", "__name", "subLanguageExitRule", "subLanguages", "exitKeywords", "constructKeywords", "subLanguage", "commonTokenRules", "createTokensProvider", "tokenizer", "bmpWordCharacters", "codeBlockTags", "tag", "clauseKeywords", "sliceTypes", "primitiveTypes", "interactionItems", "moduleScopeItems", "featureScopeItems", "readModelItems", "reducerItems", "formItems", "contributeItems", "behaviorItems", "step", "__name", "label", "insertText", "documentation", "actionStepItems", "outcomeItems", "personaItems", "authenticationItems", "seedItems", "themeItems", "uiProfileItems", "layoutItems", "templateItems", "optionalTypeItems", "fenced", "__name", "tag", "topLevelItems", "operationItems", "operationImplementationItems", "language", "operationPhaseItems", "item", "conceptItems", "typeItems", "sliceItems", "commandItems", "eventItems", "inlineEventItems", "producesItems", "implementationItems", "handlerItems", "queryItems", "performerItems", "constraintItems", "reactionItems", "reactionTriggerItems", "triggerItems", "specificationItems", "specificationStepItems", "namedRuleImplementationItems", "commandRuleItems", "ruleItems", "policyItems", "validateItems", "screenItems", "actionItems", "tableItems", "contextVariableItems", "eventContextPaths", "path", "sliceMembers", "sliceItemsFor", "sliceType", "members", "responseCompletions", "lines", "line", "before", "symbols", "fences", "fenceMap", "withoutComment", "indent", "indentOf", "chain", "enclosingChain", "enclosing", "nearestEnclosingLine", "namedCommand", "__name", "name", "matches", "command", "entry", "property", "insertText", "typeReferenceText", "propertyTypeReference", "responseAvailability", "scanDocument", "modifier", "word", "concept", "optionalTypeItems", "type", "primitiveTypes", "specification", "responseAnalysis", "properties", "field", "source", "operationAvailability", "analyzeOperations", "lines", "symbols", "responseAnalysis", "source", "__name", "phaseState", "phase", "operationDetails", "operation", "inputs", "input", "typeReferenceText", "name", "value", "hint", "operationCompletions", "line", "before", "fences", "fenceMap", "withoutComment", "indent", "indentOf", "chain", "enclosingChain", "enclosing", "nearestEnclosingLine", "analysis", "operations", "context", "targets", "qualifiers", "target", "part", "index", "event", "ownedOperation", "system", "operationImplementationItems", "operationPhaseItems", "production", "targetLine", "inProductionBody", "mappedOperation", "rhs", "properties", "parts", "property", "types", "type", "concept", "operationItems", "declaration", "reference", "operationReferenceAt", "start", "end", "operationHover", "at", "location", "column", "equals", "command", "text", "header", "systems", "eventSourceAvailability", "routePrefix", "sourceStreamPattern", "keyPrefix", "identifierTypePrefix", "streamTypePrefix", "analyzeEventSources", "lines", "symbols", "symbolsForBuffer", "responseAnalysis", "source", "__name", "eventSourceDetails", "stream", "typeReferenceText", "eventSourceReferenceAt", "line", "start", "end", "analysis", "at", "route", "location", "name", "withoutComment", "candidate", "resolution", "sourcePart", "eventSourceIdentifier", "prefix", "eventSourceHover", "reference", "context", "declaration", "confidence", "mapping", "expression", "typed", "parts", "properties", "optional", "collection", "index", "part", "matches", "property", "types", "type", "indentOf", "eventSourceCompletions", "before", "fenceMap", "indent", "names", "qualified", "target", "isSourceStreamName", "concepts", "concept", "ownsStream", "streamId", "isSourceStreamTypeName", "commandNamedRulePattern", "bmpWordCharacters", "namedRuleContext", "lines", "lineIndex", "indent", "fences", "fenceMap", "owners", "boundary", "index", "line", "withoutComment", "indentOf", "wrapped", "offset", "__name", "exampleUuid", "primitiveExamples", "exampleValueFor", "type", "symbols", "bare", "primitive", "concept", "__name", "lastIndexWhere", "lines", "matches", "index", "__name", "upperCamelWords", "name", "pastTense", "verb", "likelyEventName", "command", "symbols", "subject", "noun", "event", "indentUnit", "indented", "indentOf", "indent", "producesBlock", "unit", "eventName", "declared", "inner", "sources", "property", "mappings", "source", "identifier", "newCommandBlock", "identity", "concept", "identityLine", "properties", "propertyLines", "outcome", "line", "assignments", "exampleValueFor", "sliceCommand", "fences", "headerIndex", "sliceIndex", "authorized", "symbol", "candidate", "specificationBlock", "structureCompletion", "lineIndex", "textBefore", "textAfter", "fenceMap", "previous", "withoutComment", "previousLine", "opensEmptyBlock", "header", "nearestEnclosingLine", "headerIndent", "pad", "wrap", "block", "headerLine", "found", "form", "subLanguages", "listeners", "registerSubLanguage", "keyword", "definition", "listener", "__name", "getSubLanguages", "getSubLanguage", "onSubLanguagesChanged", "RULE_LINE_PATTERN", "declaredIn", "__name", "document", "keyword", "line", "topLevelEntries", "topLevelItems", "item", "isTemplate", "header", "expansionEntry", "text", "indent", "relative", "index", "indentOf", "completionEntriesFor", "chain", "where", "construct", "subLanguage", "getSubLanguage", "moduleScopeItems", "featureScopeItems", "sliceItemsFor", "conceptItems", "typeItems", "commandItems", "eventItems", "readModelItems", "reducerItems", "formItems", "contributeItems", "behaviorItems", "personaItems", "authenticationItems", "seedItems", "themeItems", "uiProfileItems", "outcomeItems", "layoutItems", "operationItems", "operationPhaseItems", "producesItems", "handlerItems", "implementationItems", "operationImplementationItems", "queryItems", "performerItems", "constraintItems", "reactionItems", "triggerItems", "reactionTriggerItems", "specificationItems", "policyItems", "validateItems", "actionItems", "tableItems", "templateItems", "screenItems", "candidate", "planCompletions", "lines", "lineIndex", "textBefore", "symbols", "scanDocument", "fences", "fenceMap", "withoutComment", "responseEntries", "responseCompletions", "importPath", "contextVariableMatch", "currentLine", "effectiveIndent", "enclosingChain", "ruleContext", "namedRuleContext", "namedRuleImplementationItems", "commandRuleItems", "propertyOwner", "nearestEnclosingLine", "propertyName", "reservedProperty", "optionalPrefix", "match", "afterPropertyType", "afterQueryType", "optionalTypeItems", "step", "specificationStepItems", "enclosingLine", "inlineEventItems", "ruleItems", "headers", "enclosingHeaders", "entries", "expansion", "structureCompletion", "createCompletionProvider", "monaco", "options", "model", "position", "lines", "lineIndex", "textBefore", "application", "symbols", "symbolsForBuffer", "responseEntries", "eventSourceCompletions", "operationCompletions", "responseCompletions", "plan", "planCompletions", "word", "range", "kinds", "asSnippet", "snippet", "__name", "entry", "symbolItem", "name", "kind", "detail", "eventNames", "inlineNames", "event", "knownEventNames", "pathRange", "path", "variableRange", "contextVariableItems", "policy", "knownTriggerNames", "command", "producesItems", "screen", "query", "typeReferenceText", "typeReferenceSymbol", "concept", "type", "primitiveTypes", "primitive", "createInlineCompletionProvider", "options", "model", "position", "lines", "lineIndex", "line", "symbols", "symbolsForBuffer", "suggestion", "structureCompletion", "__name", "responseTokenTypes", "responseTokens", "lines", "symbols", "tokens", "add", "__name", "line", "column", "length", "type", "source", "start", "path", "analysis", "responseAnalysis", "stream", "route", "command", "property", "withoutComment", "response", "field", "specification", "fixture", "system", "operation", "keyword", "input", "phase", "name", "hint", "ordered", "left", "right", "token", "index", "handlerIntentDocs", "keywordDocs", "specificationKeywordDocs", "attributeDocs", "contextVariableDocs", "eventContextPaths", "path", "hoverContent", "lines", "lineIndex", "word", "startColumn", "endColumn", "application", "fences", "fenceMap", "line", "withoutComment", "inString", "inTemplate", "index", "sourceHover", "eventSourceHover", "operation", "operationHover", "tokenAt", "__name", "column", "name", "start", "before", "doc", "attributeDocs", "variable", "contextVariableDocs", "prefix", "followsPropertyType", "followsQueryType", "keywordDocs", "chain", "enclosingChain", "indentOf", "ruleContext", "namedRuleContext", "handlerIntentDocs", "symbols", "scanDocument", "owner", "command", "property", "typeReferenceText", "propertyTypeReference", "responseAvailability", "response", "source", "field", "type", "specification", "responseAnalysis", "value", "concept", "candidate", "attributes", "values", "reasons", "attribute", "reason", "properties", "policy", "body", "event", "left", "right", "construct", "getSubLanguage", "step", "specificationKeywordDocs", "eventAnalysisSource", "inEvent", "directBody", "directive", "keywordDoc", "createHoverProvider", "options", "model", "position", "word", "content", "hoverContent", "__name", "createInlayHintsProvider", "options", "model", "range", "destinationHints", "hint", "__name", "migrateOptional", "containsKind", "__name", "requested", "kind", "intersects", "left", "right", "createCodeActionProvider", "placement", "cache", "model", "range", "context", "token", "migrationRequested", "migrationOnly", "diagnostics", "marker", "code", "isQuickFixDiagnostic", "version", "placementKey", "analysis", "prepareQuickFixes", "fixes", "diagnostic", "fix", "DiagnosticCodes", "edit", "start", "end", "owner", "validationDelay", "validate", "monaco", "model", "options", "lines", "application", "symbolsForBuffer", "validateLines", "issue", "__name", "watch", "handle", "run", "languageId", "schedule", "contextChange", "attachDiagnostics", "pdl", "cdl", "screenplayDarkThemeName", "screenplayDark", "screenplayLightThemeName", "screenplayLight", "registeredInstances", "applyTokensProvider", "monaco", "languageId", "createTokensProvider", "getSubLanguages", "__name", "onSubLanguagesChanged", "ensureBuiltInSubLanguages", "getSubLanguage", "registerSubLanguage", "pdl", "cdl", "register", "options", "languageExtensionPoint", "languageConfiguration", "createCompletionProvider", "createInlineCompletionProvider", "createHoverProvider", "model", "position", "word", "symbols", "target", "eventSourceReferenceAt", "current", "source", "document", "location", "eventSourceIdentifier", "targetUri", "targetModels", "candidate", "targetModel", "responseTokenTypes", "data", "previousLine", "previousColumn", "token", "responseTokens", "createInlayHintsProvider", "createCodeActionProvider", "screenplayDarkThemeName", "screenplayDark", "screenplayLightThemeName", "screenplayLight", "attachDiagnostics"]
4
+ "sourcesContent": ["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// .NET regex \\w accepts these categories per UTF-16 code unit, not supplementary code points.\n// Monarch discards a rule's /u flag. Expand just this class into BMP ranges rather than enabling\n// Unicode mode for the entire grammar (which would change legacy regexes and embedded languages).\nconst word = /[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}]/u;\nconst escape = (value: number) => `\\\\u${value.toString(16).padStart(4, '0')}`;\nfunction ranges(): string {\n let result = '';\n for (let value = 0; value <= 0xffff; value++) {\n if (!word.test(String.fromCharCode(value))) continue;\n const start = value;\n while (value < 0xffff && word.test(String.fromCharCode(value + 1))) value++;\n result += escape(start) + (value > start ? `-${escape(value)}` : '');\n }\n return result;\n}\nexport const bmpWordCharacters = ranges();\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { languages } from 'monaco-editor';\nimport {\n clauseKeywords,\n codeBlockTags,\n constructKeywords,\n primitiveTypes,\n sliceTypes,\n} from './language';\nimport { MonarchTokenRules, SubLanguage } from './sub-language-registry';\nimport { bmpWordCharacters } from './bmp-word-characters';\n\n// Maps a Screenplay inline code tag to the Monaco language id used for embedded highlighting.\n// Declaration registration must not globally reserve existing property names.\n// Ambiguous standalone operation headers are supplied by typed semantic tokens.\nconst contextualConstructs = new Set(['operation', 'system', 'eventsource']);\n\nconst embeddedLanguages: Record<string, string> = {\n csharp: 'csharp',\n typescript: 'typescript',\n react: 'typescript',\n html: 'html',\n sql: 'sql',\n};\n\nfunction subLanguageState(keyword: string): string {\n return `subLanguage_${keyword}`;\n}\n\n// A construct keyword at the start of a line ends any indented sub-language block.\nfunction subLanguageExitRule(subLanguages: SubLanguage[]): MonarchTokenRules[number] {\n const exitKeywords = [...constructKeywords.filter(keyword => !contextualConstructs.has(keyword)), ...subLanguages.map((subLanguage) => subLanguage.keyword)];\n return [\n new RegExp(`^\\\\s*(?:${exitKeywords.join('|')})\\\\b`),\n { token: '@rematch', next: '@pop' },\n ];\n}\n\n// Shared across the composite `.play` tokenizer and every standalone sub-language tokenizer\n// (comments, `$`-prefixed context variables, strings, numbers, operators, delimiters, whitespace).\nexport const commonTokenRules: MonarchTokenRules = [\n [/\\/\\/.*$/, 'comment'],\n [/^(numbers)([ \\t]+)(exact)(?=[ \\t]*(?:(?:\\/\\/|#).*)?$)/, ['keyword', 'white', 'keyword']],\n [/\\$(?:context|eventContext|eventSourceId|causedBy)(?:\\.\\w+)*/, 'variable.predefined'],\n [/\\$(?:env|secrets|strings)\\.[\\w.]+/, 'variable.predefined'],\n [/\\$\\.[\\w.]*/, 'variable.predefined'],\n [/\"(?:[^\"\\\\]|\\\\.)*\"/, 'string'],\n [/\"(?:[^\"\\\\]|\\\\.)*$/, 'string.invalid'],\n [/\\d+(?:ms|s|m|h|d)\\b/, 'number'],\n [/-?\\d+\\.\\d+/, 'number.float'],\n [/-?\\d+/, 'number'],\n [/=>|==|!=|>=|<=|[><=:?]/, 'operator'],\n [/[[\\](),.]/, 'delimiter'],\n [/\\s+/, 'white'],\n];\n\nexport function createTokensProvider(subLanguages: SubLanguage[]): languages.IMonarchLanguage {\n const tokenizer: Record<string, MonarchTokenRules> = {\n root: [\n [/^(eventsource)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'type.identifier']],\n [/^(system)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'type.identifier']],\n [/^(\\s*)(produces\\s+operation)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@operationBody.$1' }]],\n [/^(\\s*)(given\\s+operation)(\\s+)([\\w.]+)(\\s+)(fails)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword']],\n [/^(\\s*)(then\\s+(?:operation|compensated))(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier']],\n [new RegExp(`^(\\\\s*)(command)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?://.*)?$)`), ['white', 'keyword', 'white', { token: 'type.identifier', next: '@commandBody.$1' }]],\n [/^(\\s*)(handler)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@handlerBody.$1' }]],\n [/^(\\s*@?[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(\\s+)(generated)(\\s+identifier|)(?=\\s*(?:\\/\\/.*)?$)/,\n ['identifier', 'type.identifier', 'white', 'keyword', 'keyword']],\n [/^(\\s*)(generated)(\\s+)([a-z_]\\w*)(\\s*=(?!=|>))/, ['white', 'keyword', 'white', 'identifier', 'operator']],\n [/^(\\s*)(then)(\\s+)(returns)\\b/, ['white', 'keyword', 'white', 'keyword']],\n // Only unambiguous response headers: two-token property declarations keep their names.\n [/^(\\s*)(returns)(?=\\s*(?:\\/\\/.*)?$|\\s+@\\w+\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword']],\n // A modifier only after a complete type; names called optional remain ordinary names.\n [/^(\\s*(?:by|filter)\\s+[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:from\\b|\\/\\/|$))/,\n ['identifier', 'type.identifier', 'white', 'keyword']],\n // Query prefixes cannot fall back to being property names.\n [/^(?!\\s*(?:by|filter)\\s+)(\\s*@?[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:identifier\\b|from\\b|=(?!=|>)|\\/\\/|$))/,\n ['identifier', 'type.identifier', 'white', 'keyword']],\n [/^(\\s*query\\s+[A-Za-z_]\\w*\\s*=>\\s*(?!observable\\s+optional\\s*(?:\\/\\/.*)?$)(?:observable\\s+)?)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:\\/\\/.*)?$)/,\n ['keyword', 'type.identifier', 'white', 'keyword']],\n // A specification's clock, trigger, capture and query steps - matched before a sub-language keyword\n // can claim 'capture' and read the rest of the specification as change data capture.\n [/^(\\s*)(given|when)(\\s+)(clock|capture|trigger|query)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(then)(\\s+)(result|no\\s+result)\\b/, ['white', 'keyword', 'white', 'keyword']],\n // A quoted import names .play files rather than a qualified name - the path reads as a link.\n [/^(\\s*)(import)(\\s+)(\"[^\"\\\\]*\")/, ['white', 'keyword', 'white', 'string.link']],\n // Retain the header indent so event metadata stops at the enclosing block boundary.\n [/^(\\s*)((?:produces\\s+)?event)(\\s+)([A-Za-z_]\\w*)(\\s+)(generation)(\\s+)(\\d+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', { token: 'number', next: '@eventBody.$1' }]],\n [/^(\\s*)((?:produces\\s+)?event)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@eventBody.$1' }]],\n // A tagged opening fence carries the embedded language; legacy tag lines still highlight.\n ...codeBlockTags.map(\n (tag): MonarchTokenRules[number] => [\n new RegExp(`^\\\\s*\\\\x60\\\\x60\\\\x60${tag}\\\\s*$`),\n { token: 'string.quote', next: `@codeBlock.${embeddedLanguages[tag]}`, nextEmbedded: embeddedLanguages[tag] },\n ],\n ),\n // Inline code block tags at end of line open an embedded code block.\n ...codeBlockTags.map(\n (tag): MonarchTokenRules[number] => [\n new RegExp(`\\\\b${tag}\\\\b(?=\\\\s*$)`),\n { token: 'keyword.tag', next: `@codeBlockPending.${embeddedLanguages[tag]}` },\n ],\n ),\n // Sub-language constructs switch to the registered sub-language's token rules.\n ...subLanguages.map(\n (subLanguage): MonarchTokenRules[number] => [\n new RegExp(`\\\\b${subLanguage.keyword}\\\\b`),\n { token: 'keyword', next: `@${subLanguageState(subLanguage.keyword)}` },\n ],\n ),\n // A bare description keyword at end of line opens a fenced plain-text block.\n [/\\bdescription\\b(?=\\s*$)/, { token: 'keyword', next: '@descriptionBlockPending' }],\n [/\\brow-click\\b/, 'keyword'],\n // A leading @ escapes a name that collides with a directive keyword - it is a name, not an attribute.\n [/^\\s*@[a-z_]\\w*/, 'identifier'],\n [/@\\w+/, 'annotation'],\n [\n /[A-Z]\\w*/,\n {\n cases: {\n '@sliceTypes': 'keyword.type',\n '@primitiveTypes': 'type',\n '@default': 'type.identifier',\n },\n },\n ],\n [\n /[a-z_]\\w*/,\n {\n cases: {\n '@keywords': 'keyword',\n '@default': 'identifier',\n },\n },\n ],\n { include: '@common' },\n ],\n\n commandBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(validate)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@commandValidation.$1' }]],\n { include: '@root' },\n ],\n\n commandValidation: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [new RegExp(`^(\\\\s*)([${bmpWordCharacters}.]+)(\\\\s+)(rule)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?:severity\\\\s+\\\\w+|message\\\\s+.*|//.*|$))`),\n ['white', 'identifier', 'white', 'keyword', 'white', { token: 'type.identifier', next: '@namedRuleBody.$1' }]],\n { include: '@root' },\n ],\n\n namedRuleBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n operationBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(execute|compensate)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@operationPhase.$1' }]],\n [/^(\\s*)(uses)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'type.identifier']],\n [/^(\\s*)(@?[a-z_]\\w*)(\\s+)([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(?=\\s*(?:=(?!=|>)|\\/\\/|$))/,\n ['white', 'identifier', 'white', 'type.identifier']],\n { include: '@root' },\n ],\n\n operationPhase: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n handlerBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n implementationBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(hint)(?=\\s+\")/, ['white', 'keyword']],\n { include: '@root' },\n ],\n\n eventBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(id)(?=\\s+\")/, ['white', 'keyword']],\n [/^(\\s*)(documentation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@descriptionBlockPending' }]],\n { include: '@root' },\n ],\n\n common: commonTokenRules,\n\n // After a code tag, the only thing allowed before the opening fence is whitespace.\n codeBlockPending: [\n [\n /^\\s*```\\s*$/,\n { token: 'string.quote', switchTo: '@codeBlock.$S2', nextEmbedded: '$S2' },\n ],\n [/^\\s*[^\\s`].*$/, { token: '@rematch', next: '@pop' }],\n [/\\s+/, 'white'],\n ],\n\n codeBlock: [\n [/^\\s*```\\s*$/, { token: 'string.quote', next: '@pop', nextEmbedded: '@pop' }],\n [/[^`]+/, ''],\n [/`/, ''],\n ],\n\n // After a bare description, the only thing allowed before the opening fence is whitespace.\n descriptionBlockPending: [\n [/\\/\\/.*$/, 'comment'],\n [/^\\s*```(?:text|markdown)?\\s*$/, { token: 'string.quote', switchTo: '@descriptionBlock' }],\n [/^\\s*[^\\s`].*$/, { token: '@rematch', next: '@pop' }],\n [/\\s+/, 'white'],\n ],\n\n descriptionBlock: [\n [/^\\s*```\\s*$/, { token: 'string.quote', next: '@pop' }],\n [/.+/, 'string'],\n ],\n };\n\n for (const subLanguage of subLanguages) {\n tokenizer[subLanguageState(subLanguage.keyword)] = [\n subLanguageExitRule(subLanguages),\n ...subLanguage.tokens,\n { include: '@common' },\n [/[A-Z]\\w*/, 'type.identifier'],\n [/[a-z_]\\w*/, 'identifier'],\n ];\n }\n\n return {\n defaultToken: '',\n tokenPostfix: '.play',\n ignoreCase: false,\n keywords: [...constructKeywords.filter(keyword => !contextualConstructs.has(keyword)), ...clauseKeywords, ...codeBlockTags],\n sliceTypes,\n primitiveTypes,\n tokenizer,\n } as languages.IMonarchLanguage;\n}\n", "// 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';\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 { 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 \"\u2026\"', insertText: 'import \"${1:*/*.play}\"', documentation: 'Imports `.play` files into this module \u2014 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 ...interactionItems,\n];\n\nexport const featureScopeItems: CompletionEntry[] = [\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 \"\u2026\"', insertText: 'import \"${1:*.play}\"', documentation: 'Imports `.play` files into this feature \u2014 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 \u2192 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 { 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 \u2014 a name and a type reference.' },\n];\n\nexport const reducerItems: CompletionEntry[] = [\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: '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: 'policy', insertText: 'policy ${1:PolicyName}', documentation: 'A policy this persona holds.' },\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 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];\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.' },\n { label: 'theme', insertText: 'theme ${1:Theme}', documentation: 'The theme of the profile.' },\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: 'arrangement', insertText: 'arrangement flow\\n column\\n ${1:slot}', documentation: 'How the slots are placed.' },\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", "// 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 { eventContextPaths } from './event-context';\n\nexport const optionalTypeItems: CompletionEntry[] = [\n { label: 'optional', insertText: 'optional', documentation: 'Allows the complete value, including a collection, to be absent.' },\n];\n\nexport interface CompletionEntry {\n label: string;\n insertText: string;\n documentation: string;\n}\n\nconst fenced = (tag: string) => `\\`\\`\\`${tag}\\n\\${1}\\n\\`\\`\\``;\n\nexport const topLevelItems: CompletionEntry[] = [\n { label: 'eventsource', insertText: 'eventsource ${1:Name}\\n identifier ${2:Type}\\n stream ${3:Name}', documentation: 'Application-owned source with nested streams; not admitted by any supported executable model (ESM) version yet (PLAY0268).' },\n { label: 'system', insertText: 'system ${1:Name}\\n description \"${2:external system}\"', documentation: 'Application-scoped external system; not admitted by any supported executable model (ESM) version yet.' },\n { label: 'import', insertText: 'import ${1:Module}.${2:Type}', documentation: 'Imports a type from another module by its qualified name.' },\n { label: 'import \"\u2026\"', insertText: 'import \"${1:**/*.play}\"', documentation: 'Imports other `.play` files by path or glob, relative to this file\\'s folder, as whole documents of the application.' },\n { label: 'concept', insertText: 'concept ${1:Name} : ${2|Uuid,String,Int,Decimal,Bool,Date,DateTime|}', documentation: 'Declares a formalized value type wrapping a primitive.' },\n { label: 'concept (enum)', insertText: 'concept ${1:Name} : Enum\\n ${2:value}', documentation: 'Declares an enumeration concept with a fixed set of values.' },\n { label: 'concept (@pii with reason)', insertText: 'concept ${1:Name} : ${2|String,Uuid,Int,Decimal,Bool,Date,DateTime|} @pii\\n pii reason \"${3:why this is personal data, its purpose and lawful basis}\"', documentation: 'Declares a personal-data concept together with the reason it is personal data.' },\n { label: 'type', insertText: 'type ${1:Name}\\n ${2:property} ${3:Type}', documentation: 'Declares a composite value type \u2014 a named shape built from several properties.' },\n { label: 'policy', insertText: 'policy ${1:Name}\\n require ${2:authenticated}', documentation: 'Declares a named authorization rule for commands and queries.' },\n { label: 'module', insertText: 'module ${1:Name}\\n ', documentation: 'Declares the top-level namespace \u2014 maps to a bounded context.' },\n { label: 'domain', insertText: 'domain ${1:Name}', documentation: 'The domain the file belongs to \u2014 optional, at most one per file, before everything else.' },\n { label: 'persona', insertText: 'persona ${1:Name}\\n description \"${2:who they are}\"', documentation: 'A named role interacting with the application, with the policies it holds.' },\n { label: 'authentication', insertText: 'authentication\\n provider ${1:Name}\\n ${2:setting} ${3:value}', documentation: 'Declares the identity providers of the application \u2014 at most one block per file.' },\n { label: 'seed', insertText: 'seed\\n for ${1:EventSourceId}\\n ${2:EventType}', documentation: 'Declares events to seed into the event store per event source id.' },\n { label: 'layout', insertText: 'layout ${1:Name}\\n ${2:slot}', documentation: 'Declares the application shell with named slots.' },\n { label: 'theme', insertText: 'theme ${1:Name}\\n compatible with ${2:Package}', documentation: 'Declares a theme and the component packages it is compatible with.' },\n { label: 'ui profile', insertText: 'ui profile ${1:Name}\\n target platform ${2:web}\\n layout ${3:Layout}\\n theme ${4:Theme}', documentation: 'Binds a target platform and size to a layout, theme and component packages.' },\n { label: 'behavior', insertText: 'behavior ${1:Name}\\n on ${2:click}\\n ${3:execute command}', documentation: 'A named interaction wiring, attached to a screen, form or dialog with `uses`.' },\n { label: 'trigger', insertText: 'trigger ${1:Name}\\n ${2:property} ${3:Type}', documentation: 'Declares an integration signal a reaction can run on.' },\n];\n\nexport const operationItems: CompletionEntry[] = [\n { label: 'uses', insertText: 'uses ${1:System}', documentation: 'Exactly one application-scoped external system.' },\n { label: 'description', insertText: 'description \"${1:intent}\"', documentation: 'Describes operation intent, without requiring code.' },\n { label: 'input', insertText: '${1:input} ${2:Type}', documentation: 'Typed operation input; no identifier or generated modifier.' },\n { label: 'execute', insertText: 'execute\\n description \"${1:effect}\"', documentation: 'Optional execution intent; not admitted by any supported executable model (ESM) version yet.' },\n { label: 'compensate', insertText: 'compensate\\n description \"${1:undo intent}\"', documentation: 'Optional compensation intent; not admitted by any supported executable model (ESM) version yet.' },\n];\n\nexport const operationImplementationItems: CompletionEntry[] = [\n { label: 'hint', insertText: 'hint \"${1:implementation guidance}\"', documentation: 'Ordered authoring guidance; not an executable implementation role.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Selects the phase\u2019s sole source attachment.' },\n ...['csharp', 'typescript', 'react', 'html', 'sql'].map(language => ({ label: language, insertText: fenced(language), documentation: 'Selects the phase\u2019s sole inline source; not admitted by any supported executable model (ESM) version yet.' })),\n];\n\nexport const operationPhaseItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:phase intent}\"', documentation: 'A description-only phase is valid, pending intent.' },\n { label: 'implementation', insertText: 'implementation\\n hint \"${1:guidance}\"', documentation: 'Hints with optional source; phase owns File/Code, wrapper owns hints only.' },\n ...operationImplementationItems.filter(item => item.label !== 'hint'),\n];\n\nexport const conceptItems: CompletionEntry[] = [\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the repository relative file this declaration is realized by, so the document can be navigated back to the code.' },\n { label: 'pii reason', insertText: 'pii reason \"${1:why this is personal data, its purpose and lawful basis}\"', documentation: 'Records why the `@pii` marker applies \u2014 purpose, lawful basis, whose subject it lives under.' },\n { label: 'sensitive reason', insertText: 'sensitive reason \"${1:why this value is sensitive}\"', documentation: 'Records why the `@sensitive` marker applies.' },\n { label: 'validate', insertText: 'validate\\n ${1:not empty} message \"${2:message}\"', documentation: 'Validation rules that travel with the value everywhere it appears.' },\n];\n\nexport const typeItems: CompletionEntry[] = [\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the repository relative file this declaration is realized by, so the document can be navigated back to the code.' },\n { label: 'description', insertText: 'description \"${1:what this shape represents}\"', documentation: 'A human-readable description of the type.' },\n { label: 'property', insertText: '${1:property} ${2:Type}', documentation: 'A property of the type \u2014 a name and a type reference.' },\n];\n\n\n\nexport const sliceItems: CompletionEntry[] = [\n { label: 'operation', insertText: 'operation ${1:Name}\\n uses ${2:System}\\n ${3:input} ${4:Type}', documentation: 'Reusable slice-owned operation intent; not admitted by any supported executable model (ESM) version yet.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the repository relative file this declaration is realized by, so the document can be navigated back to the code.' },\n { label: 'event', insertText: 'event ${1:Name}\\n ${2:property} ${3:Type}', documentation: 'Declares an event type \u2014 an immutable, past-tense fact.' },\n { label: 'event generation', insertText: 'event ${1:Name} generation ${2:2}\\n ${3:property} ${4:Type}', documentation: 'Declares a complete numbered event generation; start at 1 and do not skip a number.' },\n { label: 'command', insertText: 'command ${1:Name}\\n ${2:property} ${3:Type}', documentation: 'Declares a command \u2014 an imperative intent that produces events.' },\n { label: 'query', insertText: 'query ${1:Name} => ${2:ReadModel}', documentation: 'Declares a read-side entry point mapping to a return type.' },\n { label: 'query observable', insertText: 'query ${1:Name} => observable ${2:ReadModel}', documentation: 'Declares a live read \u2014 the query keeps pushing as the read model changes, instead of answering once.' },\n { label: 'readmodel', insertText: 'readmodel ${1:Name}\\n ${2:property} ${3:Type}', documentation: 'Declares the shape of a read model \u2014 its properties \u2014 that a projection, reducer or query fills and returns.' },\n { label: 'reducer', insertText: 'reducer ${1:Name} => ${2:ReadModel}\\n on ${3:EventType}\\n ```csharp\\n ${4}\\n ```', documentation: 'Declares a reducer building a read model from events with imperative code, for what a projection cannot express.' },\n { label: 'specification', insertText: 'specification ${1:Name}\\n given ${2:EventType}\\n when ${3:Command}\\n then ${4:EventType}', documentation: 'Given/when/then acceptance criteria for the slice.' },\n { label: 'projection', insertText: 'projection ${1:Name} => ${2:ReadModel}\\n from ${3:EventType}', documentation: 'Declares how events project into a read model (PDL).' },\n { label: 'capture', insertText: 'capture ${1:Name}\\n source ${2:api}', documentation: 'Declares a change data capture converting external data into events (CDL).' },\n { label: 'reaction', insertText: 'reaction ${1:Name}\\n when ${2:Trigger}', documentation: 'Declares behavior that runs when something happens.' },\n { label: 'screen', insertText: 'screen ${1:Name}\\n data ${2:ReadModel} via query ${3:QueryName}', documentation: 'Declares a UI screen.' },\n { label: 'constraint', insertText: 'constraint ${1:Name}\\n unique ${2:property} on ${3:EventType}', documentation: 'Declares a server-side rule enforced before events are committed.' },\n];\n\nexport const commandItems: CompletionEntry[] = [\n { label: 'property', insertText: '${1:property} ${2:Type}', documentation: 'An input of the command \u2014 a name and a type reference.' },\n { label: 'produces operation', insertText: 'produces operation ${1:Name}\\n uses ${2:System}\\n ${3:input} ${4:Type} = ${5:source}', documentation: 'Declares ordered operation intent; not admitted by any supported executable model (ESM) version yet (PLAY0268).' },\n { label: 'returns property', insertText: 'returns @${1:property}', documentation: 'Scalar response from a direct command property, only on acceptance. Executable as ESM v7.' },\n { label: 'returns block', insertText: 'returns\\n ${1:field} = ${2:property}', documentation: 'Unnamed record response with inferred or explicit field types, only on acceptance. Executable as ESM v7.' },\n { label: 'produces event', insertText: 'produces event ${1:Name}\\n ${2:property} ${3:Type} = ${4:source}', documentation: 'Declares a slice-owned generation-1 event and maps its properties. An omitted for uses the command identifier.' },\n { label: 'identifier property', insertText: '${1:property} ${2:Type} identifier', documentation: 'Marks the property a runtime resolves the event source id from. At most one per command.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'References the policies that must pass for the command to execute.' },\n { label: 'reads', insertText: 'reads ${1:View} by ${2:property}', documentation: 'Declares a view the command consults. Executable binding is not yet supported.' },\n { label: 'reads as', insertText: 'reads ${1:View} as ${2:alias} by ${3:property}', documentation: 'Names one instance of a view; every instance needs a unique alias when reading the same view more than once.' },\n { label: 'validate', insertText: 'validate\\n ${1:property} not empty message \"${2:message}\"', documentation: 'Declarative validation rules with messages.' },\n { label: 'validate csharp', insertText: `validate\\n ${fenced('csharp')}`, documentation: 'Imperative validation in C#, yielding the message of every rule the artifact breaks.' },\n { label: 'produces', insertText: 'produces ${1:EventType}\\n ${2:property} = ${3:source}', documentation: 'Declares the event the command emits, with property mappings.' },\n { label: 'produces when', insertText: 'produces when ${1:condition}\\n ${2:EventType}\\n ${3:property} = ${4:source}', documentation: 'Conditionally emits an event when the condition holds.' },\n { label: 'description', insertText: 'description \"${1:what the command asks for}\"', documentation: 'A human-readable description.' },\n { label: 'concurrency', insertText: 'concurrency\\n ${1|eventSource,sourceType,streamType,streamId,events|}', documentation: 'The scope of the concurrency check made when the command appends events.' },\n { label: 'handler', insertText: 'handler\\n ', documentation: 'Fully imperative command implementation \u2014 file reference or inline C#, instead of produces.' },\n];\n\nexport const eventItems: CompletionEntry[] = [\n { label: 'property', insertText: '${1:property} ${2:Type}', documentation: 'A property of the event \u2014 a name and a type reference.' },\n { label: 'description', insertText: 'description \"${1:what happened}\"', documentation: 'Authoring metadata, as one line or a text/markdown fence.' },\n { label: 'documentation', insertText: 'documentation\\n ```markdown\\n ${1:Details}\\n ```', documentation: 'Authoring-only Markdown documentation.' },\n { label: 'id', insertText: 'id \"${1:OldName}\"', documentation: 'Preserves a previous persisted event name after a rename. Leave absent for new events.' },\n { label: 'tag', insertText: 'tag ${1:audit}', documentation: 'An event-type tag stamped on every occurrence.' },\n];\n\nexport const inlineEventItems: CompletionEntry[] = [\n ...eventItems,\n { label: 'for', insertText: 'for ${1:identifier}', documentation: 'Explicitly names the command identifier used as the event source.' },\n { label: 'property mapping', insertText: '${1:property} ${2:Type} = ${3:source}', documentation: 'Declares and maps an event property on one line.' },\n];\n\nexport const producesItems: CompletionEntry[] = [\n { label: 'when', insertText: 'when ${1:condition}', documentation: 'Guards the produced event with a condition.' },\n];\n\nexport const implementationItems: CompletionEntry[] = [\n { label: 'hint', insertText: 'hint \"${1:implementation guidance}\"', documentation: 'Ordered nonblank guidance for a handler implementation. Not an execution guarantee.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Selects one existing model-relative attachment.' },\n ...['csharp', 'typescript', 'react', 'html', 'sql'].map(language => ({ label: language, insertText: fenced(language), documentation: 'Selects one inline payload. Handler execution remains unsupported.' })),\n];\n\nexport const handlerItems: CompletionEntry[] = [\n { label: 'implementation', insertText: 'implementation\\n hint \"${1:implementation guidance}\"', documentation: 'Handler-only implementation intent with optional file or tagged fence. With no payload it is pending.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Delegates the command implementation to an external C# file.' },\n { label: 'csharp', insertText: fenced('csharp'), documentation: 'Inline C# returning the events to append.' },\n];\n\nexport const queryItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:what this query is trying to accomplish}\"', documentation: 'What the query is for, in prose \u2014 what a generator or reviewer works from.' },\n { label: 'by', insertText: 'by ${1:param} ${2:Type}', documentation: 'Declares the identifying parameter of the query.' },\n { label: 'filter', insertText: 'filter ${1:param} ${2:Type} optional', documentation: 'Declares an optional filter parameter supplied by the caller.' },\n { label: 'filter from context', insertText: 'filter ${1:param} ${2:Type} from $context.${3|tenant,causedBy.subject,occurred|}', documentation: 'Declares a parameter filled from the query context instead of the caller.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'References the policies that must pass for the query to execute.' },\n { label: 'performer', insertText: 'performer\\n ', documentation: 'The code that performs the query \u2014 a file reference or an inline csharp/sql block.' },\n];\n\nexport const performerItems: CompletionEntry[] = [\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Delegates the query implementation to an external file.' },\n { label: 'csharp', insertText: fenced('csharp'), documentation: 'Inline C# returning the query result, with the QueryContext in scope as context.' },\n { label: 'sql', insertText: fenced('sql'), documentation: 'Inline SQL returning the query result.' },\n];\n\nexport const constraintItems: CompletionEntry[] = [\n { label: 'unique', insertText: 'unique ${1:property} on ${2:EventType}', documentation: 'Enforces a unique property value across an event type.' },\n { label: 'unique event', insertText: 'unique event ${1:EventType}', documentation: 'Enforces that the event type occurs at most once per event source.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Delegates the constraint to a custom C# implementation.' },\n];\n\nexport const reactionItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:what this reaction does}\"', documentation: 'What the reaction does \u2014 a complete statement of intent before any code exists.' },\n { label: 'when', insertText: 'when ${1:Trigger}', documentation: 'An event, a declared trigger or a host signal that sets the reaction off. A trigger needs no body.' },\n { label: 'every', insertText: 'every ${1:15} ${2|seconds,minutes,hours,days|}', documentation: 'Runs the reaction on an interval.' },\n { label: 'at', insertText: 'at ${1:08:00}', documentation: 'Runs the reaction at a time of day \u2014 every day unless narrowed with `on <Weekday>` or `on day <n>`.' },\n { label: 'where', insertText: 'where ${1:condition}', documentation: 'Narrows which occurrences actually run the reaction.' },\n];\n\nexport const reactionTriggerItems: CompletionEntry[] = [\n { label: 'reads', insertText: 'reads ${1:View}', documentation: 'The view this trigger consults. Optionally use `as <alias> by <trigger value>`; clock triggers take no values and cannot use `by`.' },\n { label: 'description', insertText: 'description \"${1:what this reaction does}\"', documentation: 'What this particular reaction does \u2014 enough on its own, with no file to point at.' },\n { label: 'produces', insertText: 'produces ${1:EventType}', documentation: 'An event the reaction appends.' },\n { label: 'invokes', insertText: 'invokes ${1:Command}', documentation: 'A command the reaction hands on. A command is asked for, not produced \u2014 it may still be rejected.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Delegates the reaction to an external C# file.' },\n { label: 'csharp', insertText: fenced('csharp'), documentation: 'Inline C# returning event side effects.' },\n];\n\nexport const triggerItems: CompletionEntry[] = [\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the repository relative file this declaration is realized by, so the document can be navigated back to the code.' },\n { label: 'description', insertText: 'description \"${1:when this occurs}\"', documentation: 'What makes an occurrence of this trigger happen.' },\n { label: 'value', insertText: '${1:name} ${2:Type}', documentation: 'A value an occurrence hands the reaction. The type is optional.' },\n];\n\nexport const specificationItems: CompletionEntry[] = [\n { label: 'given operation fails', insertText: 'given operation ${1:Name} fails', documentation: 'Failure fixture leaf; not admitted by any supported executable model (ESM) version yet (PLAY0268).' },\n { label: 'then operation', insertText: 'then operation ${1:Name}\\n ${2:input} = ${3:value}', documentation: 'Partial requested-operation assertion; not admitted by any supported executable model (ESM) version yet (PLAY0268).' },\n { label: 'then compensated', insertText: 'then compensated ${1:Name}', documentation: 'Compensation assertion leaf; not admitted by any supported executable model (ESM) version yet (PLAY0268).' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the repository relative file this declaration is realized by, so the document can be navigated back to the code.' },\n { label: 'given', insertText: 'given ${1:EventType}\\n ${2:property} = ${3:value}', documentation: 'Establishes prior state by replaying an event before the command runs.' },\n { label: 'given readmodel', insertText: 'given readmodel ${1:ReadModelType}\\n ${2:property} = ${3:value}', documentation: 'Establishes prior read model state directly.' },\n { label: 'when', insertText: 'when ${1:CommandType}\\n ${2:property} = ${3:value}', documentation: 'The command being exercised.' },\n { label: 'then', insertText: 'then ${1:EventType}\\n ${2:property} = ${3:value}', documentation: 'An event expected to be produced by the command.' },\n { label: 'then readmodel', insertText: 'then readmodel ${1:ReadModelType}\\n ${2:property} = ${3:value}', documentation: 'The read model state expected after the command.' },\n { label: 'then no readmodel', insertText: 'then no readmodel ${1:ReadModelType} for ${2:key}', documentation: 'Asserts that precisely one keyed read-model instance does not exist; another key may still be present.' },\n { label: 'then query', insertText: 'then query ${1:QueryName}\\n arguments\\n ${2:argument} = ${3:value}\\n result\\n ${4:property} = ${5:value}', documentation: 'The ordered query results expected for explicit arguments. Remove the result block to assert an empty result.' },\n { label: 'then error', insertText: 'then error', documentation: 'A rejection, for a reason this specification does not name.' },\n { label: 'then error \"...\"', insertText: 'then error \"${1:reason}\"', documentation: 'A rejection, for the named reason.' },\n { label: 'given clock', insertText: 'given clock \"${1:2026-10-05T08:00:00Z}\"', documentation: 'The instant the scenario happens at - the occurrence time of everything it does. At most once.' },\n { label: 'given capture', insertText: 'given capture ${1:Capture}\\n ${2:field} = ${3:value}', documentation: 'A record the capture\\'s source held before.' },\n { label: 'when clock', insertText: 'when clock \"${1:2026-10-05T09:00:00Z}\"', documentation: 'The clock reaches an instant, as the action.' },\n { label: 'when trigger', insertText: 'when trigger ${1:Trigger}\\n ${2:value} = ${3:value}', documentation: 'An application trigger fires, as the action.' },\n { label: 'when capture', insertText: 'when capture ${1:Capture}\\n ${2:field} = ${3:value}', documentation: 'The record a capture\\'s source holds now, as the action.' },\n { label: 'when query', insertText: 'when query ${1:Query}\\n ${2:argument} = ${3:value}', documentation: 'Performs a query, as the action.' },\n { label: 'then result', insertText: 'then result\\n ${1:property} = ${2:value}', documentation: 'One result the query performed by `when query` returns, in order.' },\n { label: 'then no result', insertText: 'then no result', documentation: 'The query performed by `when query` returns nothing.' },\n];\n\n// What follows a 'given', 'when' or 'then' already typed in a specification.\nexport const specificationStepItems: Record<'given' | 'when' | 'then', CompletionEntry[]> = {\n given: [\n { label: 'operation', insertText: 'operation ${1:Name} fails', documentation: 'Syntax-only failure fixture; no children.' },\n { label: 'clock', insertText: 'clock \"${1:2026-10-05T08:00:00Z}\"', documentation: 'The instant the scenario happens at - the occurrence time of everything it does.' },\n { label: 'capture', insertText: 'capture ${1:Capture}\\n ${2:field} = ${3:value}', documentation: 'A record the capture\\'s source held before. Repeat it for several records.' },\n { label: 'readmodel', insertText: 'readmodel ${1:ReadModelType}\\n ${2:property} = ${3:value}', documentation: 'Establishes prior read model state directly.' },\n { label: 'caller', insertText: 'caller\\n ${1:authenticated}', documentation: 'The identity the scenario runs as.' },\n ],\n when: [\n { label: 'clock', insertText: 'clock \"${1:2026-10-05T09:00:00Z}\"', documentation: 'The clock reaches an instant - what a scheduled reaction responds to.' },\n { label: 'trigger', insertText: 'trigger ${1:Trigger}\\n ${2:value} = ${3:value}', documentation: 'An application trigger fires, with the values it carries.' },\n { label: 'capture', insertText: 'capture ${1:Capture}\\n ${2:field} = ${3:value}', documentation: 'The record a capture\\'s source holds now.' },\n { label: 'query', insertText: 'query ${1:Query}\\n ${2:argument} = ${3:value}', documentation: 'Performs a query; assert what it returns with `then result` or `then no result`.' },\n { label: 'append', insertText: 'append ${1:EventType}\\n ${2:property} = ${3:value}', documentation: 'An event occurs, instead of a command being executed.' },\n ],\n then: [\n { label: 'operation', insertText: 'operation ${1:Name}\\n ${2:input} = ${3:value}', documentation: 'Syntax-only partial operation assertion; not admitted by any supported executable model (ESM) version yet.' },\n { label: 'compensated', insertText: 'compensated ${1:Name}', documentation: 'Syntax-only compensation assertion; no children.' },\n { label: 'returns value', insertText: 'returns ${1:value}', documentation: 'Scalar response expectation, compared by semantic value equality. Executable as ESM v7.' },\n { label: 'returns block', insertText: 'returns\\n ${1:field} = ${2:value}', documentation: 'Nonempty subset of response fields asserted by name. Executable as ESM v7.' },\n { label: 'result', insertText: 'result\\n ${1:property} = ${2:value}', documentation: 'One result the query performed by `when query` returns, in order.' },\n { label: 'result exactly', insertText: 'result exactly\\n ${1:property} = ${2:value}', documentation: 'One result, with every property asserted.' },\n { label: 'no result', insertText: 'no result', documentation: 'The query performed by `when query` returns nothing.' },\n { label: 'readmodel', insertText: 'readmodel ${1:ReadModelType}\\n ${2:property} = ${3:value}', documentation: 'The read model state expected afterwards.' },\n { label: 'error', insertText: 'error \"${1:reason}\"', documentation: 'A rejection, for the named reason.' },\n { label: 'denied', insertText: 'denied', documentation: 'The action is denied to the caller.' },\n ],\n};\n\nexport const namedRuleImplementationItems: CompletionEntry[] = [\n { label: 'hint', insertText: 'hint \"${1:predicate guidance}\"', documentation: 'Ordered nonblank authoring guidance. Does not execute or confirm the predicate.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'The sole named-rule predicate attachment.' },\n { label: 'csharp', insertText: fenced('csharp'), documentation: 'Opaque named-rule predicate returning a bool. Requires an admitting target.' },\n];\n\nexport const commandRuleItems: CompletionEntry[] = [\n { label: 'implementation', insertText: 'implementation\\n hint \"${1:predicate guidance}\"', documentation: 'Command named-rule intent with optional file or tagged fence. Pending intent cannot bind.' },\n ...namedRuleImplementationItems.filter(item => item.label !== 'hint'),\n];\n\nexport const ruleItems: CompletionEntry[] = [\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Gives the named predicate its implementation in an external C# file.' },\n { label: 'csharp', insertText: fenced('csharp'), documentation: 'Gives the named predicate its implementation as inline C# returning a bool.' },\n];\n\nexport const policyItems: CompletionEntry[] = [\n { label: 'require authenticated', insertText: 'require authenticated', documentation: 'Requires an authenticated caller.' },\n { label: 'require role', insertText: 'require role \"${1:role}\"', documentation: 'Requires the caller to have a role.' },\n { label: 'require claim', insertText: 'require claim \"${1:claim}\" matches ${2:subject}', documentation: 'Requires a claim to match the subject or a value.' },\n { label: 'csharp', insertText: fenced('csharp'), documentation: 'Fully custom policy logic in C#, returning a bool.' },\n];\n\nexport const validateItems: CompletionEntry[] = [\n { label: 'not empty', insertText: '${1:property} not empty message \"${2:message}\"', documentation: 'The property must have a value.' },\n { label: 'max', insertText: '${1:property} max ${2:500} message \"${3:message}\"', documentation: 'Maximum length or value.' },\n { label: 'min', insertText: '${1:property} min ${2:1} message \"${3:message}\"', documentation: 'Minimum length or value.' },\n { label: 'matches', insertText: '${1:property} matches \"${2:pattern}\" message \"${3:message}\"', documentation: 'The property must match a regular expression.' },\n { label: 'rule', insertText: '${1:property} rule ${2:PredicateName} message \"${3:message}\"', documentation: 'Names a predicate \u2014 optionally followed by an indented `file` reference or inline `csharp` block giving it a body; bare, it just states that a constraint exists.' },\n { label: '==', insertText: '${1:property} == ${2:value} message \"${3:message}\"', documentation: 'The property must equal the value.' },\n { label: '!=', insertText: '${1:property} != ${2:value} message \"${3:message}\"', documentation: 'The property must not equal the value.' },\n { label: 'length ==', insertText: '${1:property} length == ${2:3} message \"${3:message}\"', documentation: 'The property must have an exact length.' },\n { label: 'all >', insertText: '${1:collection}.${2:property} all > ${3:0} message \"${4:message}\"', documentation: 'Every element of a collection must satisfy the comparison.' },\n];\n\nexport const screenItems: CompletionEntry[] = [\n { label: 'data', insertText: 'data ${1:ReadModel} via query ${2:QueryName}', documentation: 'Binds a read model to the screen through a query.' },\n { label: 'action', insertText: 'action ${1:CommandName}', documentation: 'Makes a command available as an action on the screen.' },\n { label: 'layout', insertText: 'layout ${1:LayoutName}', documentation: 'Uses a layout template and fills its slots.' },\n { label: 'section', insertText: 'section ${1:name}', documentation: 'A named structural section of the screen.' },\n { label: 'table', insertText: 'table ${1:name}\\n column ${2:property} label \"${3:text}\"', documentation: 'A table widget over a read model or collection.' },\n { label: 'summary', insertText: 'summary ${1:ReadModel}\\n field ${2:property} label \"${3:text}\"', documentation: 'A summary widget showing labeled fields.' },\n { label: 'title', insertText: 'title \"${1:text}\"', documentation: 'The title of the screen or section.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Full external implementation \u2014 Stage uses the referenced file.' },\n { label: 'react', insertText: fenced('react'), documentation: 'Inline React/TSX component receiving the data contract as Props.' },\n { label: 'typescript', insertText: fenced('typescript'), documentation: 'Inline plain TypeScript.' },\n { label: 'html', insertText: fenced('html'), documentation: 'Inline static HTML.' },\n];\n\nexport const actionItems: CompletionEntry[] = [\n { label: 'navigate to', insertText: 'navigate to ${1:ScreenName}', documentation: 'Navigates to a screen after the action completes.' },\n { label: 'label', insertText: 'label \"${1:text}\"', documentation: 'The display label of the action.' },\n];\n\nexport const tableItems: CompletionEntry[] = [\n { label: 'column', insertText: 'column ${1:property} label \"${2:text}\"', documentation: 'A column bound to a property.' },\n { label: 'on row-click', insertText: 'on row-click navigate to ${1:ScreenName} by ${2:param}', documentation: 'Navigates when a row is clicked.' },\n];\n\nexport const contextVariableItems: CompletionEntry[] = [\n { label: '$context.occurred', insertText: '$context.occurred', documentation: 'When the command or query was received.' },\n { label: '$context.tenant', insertText: '$context.tenant', documentation: 'The tenant the command or query is executing for.' },\n { label: '$context.command.', insertText: '$context.command.${1:property}', documentation: 'A property of the command being handled.' },\n { label: '$context.arguments.', insertText: '$context.arguments.${1:name}', documentation: 'An argument of the query being performed.' },\n { label: '$context.causedBy.subject', insertText: '$context.causedBy.subject', documentation: 'Subject of the identity that caused the command or query.' },\n { label: '$context.causedBy.name', insertText: '$context.causedBy.name', documentation: 'Display name of the identity that caused the command or query.' },\n { label: '$context.causedBy.userName', insertText: '$context.causedBy.userName', documentation: 'User name of the identity that caused the command or query.' },\n { label: '$context.causation.type', insertText: '$context.causation.type', documentation: 'What caused this \u2014 a command, a reactor, a schedule.' },\n { label: '$context.identity.id', insertText: '$context.identity.id', documentation: 'The identifier of the caller from the auth token.' },\n { label: '$context.identity.name', insertText: '$context.identity.name', documentation: 'The display name of the caller.' },\n { label: '$context.identity.userName', insertText: '$context.identity.userName', documentation: 'The user name of the caller.' },\n { label: '$context.identity.isAuthenticated', insertText: '$context.identity.isAuthenticated', documentation: 'Whether the caller is authenticated.' },\n { label: '$context.identity.roles', insertText: '$context.identity.roles', documentation: 'The roles the caller holds.' },\n { label: '$context.identity.claims.', insertText: '$context.identity.claims.${1:name}', documentation: 'The value of a claim the caller carries.' },\n { label: '$env.', insertText: '$env.${1:VAR_NAME}', documentation: 'An environment variable.' },\n // Every $eventContext path the event-context catalog lists, for projections - the underlying value of a concept\n // is left out, it reads the same as the member it belongs to.\n ...eventContextPaths\n .filter((path) => path.name !== 'value')\n .map((path) => ({ label: `$eventContext.${path.path}`, insertText: `$eventContext.${path.path}`, documentation: `${path.description} (PDL)` })),\n];\n\nexport { moduleScopeItems as moduleItems, featureScopeItems as featureItems } from './scope-items';\n\n// What a slice of each type can hold. A slice of an unknown type keeps everything.\nconst sliceMembers: Record<string, readonly string[]> = {\n StateChange: ['operation', 'file', 'description', 'event', 'event generation', 'command', 'constraint', 'screen', 'specification'],\n StateView: ['file', 'description', 'readmodel', 'query', 'query observable', 'projection', 'reducer', 'screen', 'specification', 'event', 'event generation'],\n Automation: ['operation', 'file', 'description', 'reaction', 'reducer', 'command', 'event', 'event generation', 'readmodel', 'specification'],\n Translate: ['file', 'description', 'capture', 'event', 'event generation', 'specification'],\n};\n\nexport function sliceItemsFor(sliceType: string | undefined): CompletionEntry[] {\n const members = sliceType ? sliceMembers[sliceType] : undefined;\n return members ? sliceItems.filter(item => members.includes(item.label)) : sliceItems;\n}\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { enclosingChain, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { CompletionEntry, optionalTypeItems } from './completion-items';\nimport { DocumentSymbols, PropertySymbol, propertyTypeReference, scanDocument } from './symbols';\nimport { typeReferenceText } from './TypeReferenceSymbol';\nimport { responseAvailability, responseAnalysis } from './response-analysis';\nimport { primitiveTypes } from './language';\n\nexport function responseCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n const fences = fenceMap(lines);\n if (fences[line] || withoutComment(before).length < before.length) return null;\n const indent = before.trim() === '' ? before.length : indentOf(lines[line]);\n const chain = enclosingChain(lines, fences, line, indent);\n const enclosing = nearestEnclosingLine(lines, fences, line, indent);\n const namedCommand = (name: string | undefined) => {\n const matches = symbols.commands.filter(command => command.name === name);\n return matches.length === 1 ? matches[0] : undefined;\n };\n const entry = (property: PropertySymbol, insertText = property.name): CompletionEntry => ({\n label: property.name, insertText,\n documentation: `${typeReferenceText(propertyTypeReference(property))}${property.isGenerated ? ' \u2014 generated, not request/form input' : ''}. ${responseAvailability}`,\n });\n if (chain.includes('command')) {\n // Merged symbol line offsets belong to different documents. Only the current (possibly\n // unsaved) source can own the cursor; application symbols are for external lookup.\n const command = scanDocument(lines).commands.filter(command => command.line < line).at(-1);\n if (!command) return null;\n if (chain[0] === 'command') {\n if (/^\\s*returns\\s+@?\\w*$/.test(before)) {\n if (!/returns\\s+@/.test(before) && command.properties.some(property => property.name === 'returns' && property.line === line)) return null;\n return command.properties.map(property => entry(property, `${/returns\\s+@/.test(before) ? '' : '@'}${property.name}`));\n }\n const modifier = before.match(/^\\s*@?[a-z_]\\w*\\s+([\\w.]+)\\s+(\\w*)$/);\n if (modifier && ['generated', 'identifier'].some(word => word.startsWith(modifier[2]))) {\n const concept = symbols.concepts.find(concept => concept.name === modifier[1]);\n if (concept?.primitive === 'Uuid') return [\n ...('optional'.startsWith(modifier[2]) ? optionalTypeItems : []),\n { label: 'generated', insertText: 'generated', documentation: `Required scalar Uuid concept with no validation rules; not a request/form input. ${responseAvailability}` },\n { label: 'generated identifier', insertText: 'generated identifier', documentation: `Specification fixture uses an indented for value. ${responseAvailability}` },\n { label: 'identifier', insertText: 'identifier', documentation: 'Names the event source identifier.' },\n ];\n }\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.]+\\s+generated\\s+\\w*$/.test(before)) return [{ label: 'identifier', insertText: 'identifier', documentation: responseAvailability }];\n }\n if (chain[0] === 'returns') {\n if (/=\\s*@?\\w*$/.test(before)) return command.properties.map(property => entry(property));\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.]*$/.test(before)) return [...symbols.concepts.map(concept => concept.name), ...symbols.types.map(type => type.name), ...primitiveTypes].map(name => ({ label: name, insertText: name, documentation: `Explicit response type must exactly match the source. ${responseAvailability}` }));\n return command.properties.map(property => entry(property, `${property.name} = ${property.name}`));\n }\n }\n if (chain[0] === 'form' && enclosing && (/^\\s*field\\s+\\w*$/.test(before) || before.trim() === '')) {\n const command = namedCommand(enclosing.match(/\\bfor\\s+([\\w.]+)$/)?.[1]);\n if (command) return command.properties.filter(property => !property.isGenerated).map(property => entry(property, before.trim() === '' ? `field ${property.name}` : property.name));\n }\n if (chain.includes('specification')) {\n if (chain[0] === 'when' && enclosing) {\n const name = enclosing.match(/^when\\s+([\\w.]+)$/)?.[1];\n const command = namedCommand(name);\n if (!command) return null;\n if (/^\\s*generated\\s+\\w*$/.test(before)) return command.properties.filter(property => property.isGenerated && !property.isIdentifier).map(property => entry(property, `${property.name} = \"\\${1:uuid}\"`));\n if (before.trim() === '') return [\n ...command.properties.filter(property => !property.isGenerated).map(property => entry(property, `${property.name} = \\${1:value}`)),\n ...command.properties.filter(property => property.isGenerated && !property.isIdentifier).map(property => ({ ...entry(property, `generated ${property.name} = \"\\${1:uuid}\"`), label: `generated ${property.name}` })),\n ...(command.properties.some(property => property.isGenerated && property.isIdentifier) ? [{ label: 'for', insertText: 'for \"${1:uuid}\"', documentation: `Generated identifier fixture, not request input. ${responseAvailability}` }] : []),\n ];\n }\n if (chain[0] === 'then' && /^then\\s+returns$/.test(enclosing ?? '')) {\n const specification = [...responseAnalysis(lines).specifications.values()].filter(specification => specification.location.line - 1 < line).at(-1);\n const command = namedCommand(specification?.when?.commandType);\n if (command?.response?.kind === 'RecordCommandResponseSyntax') {\n const properties = new Map(command.properties.map(property => [property.name, property]));\n return command.response.fields.map(field => {\n const source = properties.get(field.source.property);\n const type = field.type ?? (source ? propertyTypeReference(source) : undefined);\n return { label: field.name, insertText: `${field.name} = \\${1:value}`, documentation: `${type ? typeReferenceText(type) : 'Unresolved type'}. ${responseAvailability}` };\n });\n }\n }\n }\n return null;\n}\n", "// 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 { CompletionEntry, operationItems, operationPhaseItems, operationImplementationItems } from './completion-items';\nimport { enclosingChain, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { DocumentSymbols } from './symbols';\nimport { responseAnalysis } from './response-analysis';\nimport { OperationAnalysis, OperationDeclaration, OperationPhase } from './OperationAnalysis';\nimport { TypeReferenceSymbol, typeReferenceText } from './TypeReferenceSymbol';\n\nexport const operationAvailability = 'Syntax-only; not admitted by any supported executable model (ESM) version yet (PLAY0268) (#301). No semantic or requirement identity is assigned.';\n\nexport function analyzeOperations(lines: string[], symbols?: DocumentSymbols) {\n return responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [],\n symbols?.authoringPlacement, symbols?.authoringPath).operations;\n}\n\nexport function phaseState(phase: OperationPhase | null): string {\n return !phase ? 'not declared' : phase.file ? `file ${phase.file.path}` : phase.code ? `inline ${phase.code.language}` : 'pending';\n}\n\nexport function operationDetails(operation: OperationDeclaration): string {\n const inputs = operation.inputs.map(input => `${input.name} ${typeReferenceText(input.type)}`).join('\\n');\n const phase = (name: string, value: OperationPhase | null) => `${name}: ${name === 'compensate' && !value ? 'not declared' : phaseState(value)}${value?.description ? ` \u2014 ${value.description}` : ''}${value?.implementation?.hints.map(hint => `\\n hint: ${hint.text}`).join('') ?? ''}`;\n return `**operation ${[...operation.scope, operation.name].join('.')}**\\n\\n${operation.description ?? ''}\\n\\nUses ${operation.uses}\\n\\n\\`\\`\\`screenplay\\n${inputs}\\n\\`\\`\\`\\n\\n${phase('execute', operation.execute)}\\n\\n${phase('compensate', operation.compensate)}\\n\\n${operationAvailability}`;\n}\n\nexport function operationCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n const fences = fenceMap(lines);\n if (fences[line] || withoutComment(before).length < before.length) return null;\n const indent = before.trim() === '' ? before.length : indentOf(lines[line]);\n const chain = enclosingChain(lines, fences, line, indent);\n const enclosing = nearestEnclosingLine(lines, fences, line, indent) ?? '';\n const analysis = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols.authoringPlacement, symbols.authoringPath);\n const operations = analysis.operations;\n const context = operations.contexts.get(line);\n const targets = () => {\n if (!context) return [];\n const reference = before.match(/(?:produces|given\\s+operation|then\\s+(?:operation|compensated))\\s+([\\w.]*)$/)?.[1] ?? before.trim();\n const qualifiers = reference.split('.').slice(0, -1);\n return operations.targets(context.scope).filter(target => qualifiers.length === 0 ||\n qualifiers.length <= target.declaration.scope.length && qualifiers.every((part, index) => target.declaration.scope[target.declaration.scope.length - qualifiers.length + index] === part))\n .map(target => ({ label: target.name, insertText: qualifiers.length > 0 ? target.declaration.name : target.name, documentation: operationDetails(target.declaration) }));\n };\n if (chain.includes('specification') && /^\\s*(?:given\\s+operation|then\\s+(?:operation|compensated))\\s+[\\w.]*$/.test(before)) return targets();\n if (chain[0] === 'command' && /^\\s*produces\\s+[\\w.]*$/.test(before)) return targets().length ? [\n { label: 'event', insertText: 'event ${1:Name}', documentation: 'Declares an inline event.' },\n { label: 'operation', insertText: 'operation ${1:Name}\\n uses ${2:System}\\n ${3:input} ${4:Type} = ${5:source}', documentation: operationAvailability },\n ...symbols.events.map(event => ({ label: event.name, insertText: event.name, documentation: 'Declared event.' })), ...targets()\n ] : null;\n if (context?.commandLine !== undefined && chain[0] === 'produces' && /^produces\\s+when\\b/.test(enclosing) && /^\\s*[\\w.]*$/.test(before)) return targets();\n const ownedOperation = context?.operation;\n const operation = ownedOperation && (line === ownedOperation.location.line - 1 || indent > indentOf(lines[ownedOperation.location.line - 1])) ? ownedOperation : undefined;\n if (operation && /^\\s*uses\\s+\\w*$/.test(before) && !operation.inputs.some(input => input.location.line === line + 1)) return operations.systems.map(system => ({ label: system.name, insertText: system.name, documentation: `${system.description ?? 'External system'}. ${operationAvailability}` }));\n if (chain[0] === 'implementation' && ['execute', 'compensate'].includes(chain[1])) return operationImplementationItems;\n if (['execute', 'compensate'].includes(chain[0]) && operation) return operationPhaseItems;\n const production = context?.production;\n const targetLine = (production?.targetLocation ?? production?.location)?.line;\n const inProductionBody = targetLine !== undefined && line > targetLine - 1 && indent > indentOf(lines[targetLine - 1]);\n const mappedOperation = operation ?? (inProductionBody ? production?.declaration : undefined);\n // Typed ranges include blank lines and comments. The caret must still be inside\n // the target's body, not dedented to a command member or conditional target line.\n // Ancestor keywords cannot own mappings, including deeper composite paths.\n if (mappedOperation) {\n const rhs = before.match(/=\\s*([\\w.]*)$/);\n if (rhs && context?.commandLine !== undefined) {\n const command = analysis.commands.get(context.commandLine);\n let properties: readonly { name: string; type: TypeReferenceSymbol; isGenerated?: boolean }[] = command?.properties ?? [];\n const parts = rhs[1].split('.');\n for (const part of parts.slice(0, -1)) {\n const property = properties.find(property => property.name === part);\n if (!property || property.type.isCollection) return [];\n const types = operations.types.filter(type => type.name === property.type.name);\n if (types.length !== 1) return [];\n properties = types[0].properties;\n }\n return properties.map(property => ({ label: property.name, insertText: property.name, documentation: `${typeReferenceText(property.type)}${property.isGenerated ? ' \u2014 generated source, not request input' : ''}. ${operationAvailability}` }));\n }\n if (operation && /^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+\\w*$/.test(before)) return [{ label: 'optional', insertText: 'optional', documentation: 'Allows absence of the complete operation input value.' }];\n if (/^\\s*@?[a-z_]\\w*\\s+[\\w.[\\]?]*$/.test(before) && operation) return [...operations.concepts.map(concept => concept.name), ...operations.types.map(type => type.name), 'String', 'Uuid', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime'].map(name => ({ label: name, insertText: name, documentation: 'Operation input type.' }));\n if (operation) return operationItems;\n return mappedOperation.inputs.map(input => ({ label: input.name, insertText: `${input.name} = \\${1:source}`, documentation: `${typeReferenceText(input.type)}. ${operationAvailability}` }));\n }\n if (chain[0] === 'then' && /^then\\s+operation\\s+/.test(enclosing)) {\n const name = enclosing.match(/^then\\s+operation\\s+([\\w.]+)/)?.[1];\n const declaration = operations.references.filter(reference => reference.name === name && reference.location.line - 1 < line && reference.kind === 'operation').at(-1)?.declaration;\n if (declaration) {\n const value = before.match(/^\\s*(\\w+)\\s*=\\s*[^=]*$/);\n if (value) {\n const type = declaration.inputs.find(input => input.name === value[1])?.type;\n const concept = operations.concepts.filter(concept => concept.name === type?.name);\n if (concept.length === 1 && concept[0].type === 'Enum') return concept[0].values.map(value => ({ label: value, insertText: JSON.stringify(value), documentation: `${type?.name} value.` }));\n }\n return declaration.inputs.map(input => ({ label: input.name, insertText: `${input.name} = \\${1:value}`, documentation: `${typeReferenceText(input.type)}. Partial assertion; ${operationAvailability}` }));\n }\n }\n return null;\n}\n\n// Shared by both editor hosts. Only the parser-owned target span can bind a reference;\n// a repeated identifier in a trailing comment or a condition is not that reference.\nexport function operationReferenceAt(analysis: OperationAnalysis, lines: string[], line: number, start: number, end: number) {\n const source = withoutComment(lines[line] ?? '');\n return analysis.references.find(reference => {\n const target = reference.targetLocation ?? reference.location;\n return target.line === line + 1 && start >= target.column && end <= target.column + reference.name.length &&\n source.slice(target.column - 1, target.column - 1 + reference.name.length) === reference.name;\n });\n}\n\nexport function operationHover(lines: string[], line: number, start: number, end: number, symbols?: DocumentSymbols): string | null {\n const analysis = analyzeOperations(lines, symbols);\n const source = lines[line] ?? '';\n const at = (location: { line: number; column: number }, name: string) => {\n const column = location.column + (source[location.column - 1] === '@' ? 1 : 0);\n return location.line === line + 1 && start === column && end === column + name.length && source.slice(start - 1, end - 1) === name;\n };\n const context = analysis.contexts.get(line);\n const property = context?.operation?.inputs.find(input => at(input.location, input.name));\n if (property) return `**${property.name}** \u2014 ${typeReferenceText(property.type)}. Operation input, not a command request field. ${operationAvailability}`;\n const equals = source.indexOf('=');\n if (equals >= 0 && start - 1 > equals && context?.commandLine !== undefined && (context.operation || context.production?.declaration)) {\n const command = responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(text => text !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, symbols?.authoringPath).commands.get(context.commandLine);\n const expression = source.slice(equals + 1, end - 1).trim();\n const parts = expression.split('.');\n let properties: readonly { name: string; type: TypeReferenceSymbol }[] = command?.properties ?? [];\n for (const [index, part] of parts.entries()) {\n const property = properties.find(property => property.name === part);\n if (!property) break;\n if (index === parts.length - 1) return `**${part}** \u2014 ${typeReferenceText(property.type)}. Command source for an operation input. ${operationAvailability}`;\n const types = analysis.types.filter(type => type.name === property.type.name);\n if (types.length !== 1 || property.type.isCollection) break;\n properties = types[0].properties;\n }\n }\n const reference = operationReferenceAt(analysis, lines, line, start, end);\n if (reference?.declaration) return operationDetails(reference.declaration);\n if (reference?.kind === 'ambiguous') return `Ambiguous production: no declaration kind was selected. ${operationAvailability}`;\n const operation = context?.operation;\n if (operation && operation.location.line === line + 1) {\n const header = withoutComment(source).match(/^\\s*(?:produces\\s+)?operation\\s+/)?.[0];\n if (header && start === header.length + 1 && end === start + operation.name.length) return operationDetails(operation);\n }\n if (operation?.usesLocation?.line === line + 1 && start >= operation.usesLocation.column && end <= operation.usesLocation.column + operation.uses.length && withoutComment(source).slice(start - 1, end - 1) === operation.uses.slice(start - operation.usesLocation.column, end - operation.usesLocation.column)) {\n const systems = analysis.systems.filter(system => system.name === operation.uses);\n return systems.length === 1 ? `**system ${systems[0].name}**\\n\\n${systems[0].description ?? ''}\\n\\n${operationAvailability}` : `Unresolved or ambiguous external system. ${operationAvailability}`;\n }\n for (const phase of [operation?.execute, operation?.compensate]) {\n if (!phase) continue;\n if (phase.location.line === line + 1 || phase.implementation?.location.line === line + 1 || phase.implementation?.hints.some(hint => hint.location.line === line + 1)) return `${phaseState(phase)}\\n\\n${phase.description ?? ''}\\n\\n${phase.implementation?.hints.map(hint => hint.text).join('\\n') ?? ''}\\n\\n${operationAvailability}`;\n }\n const system = analysis.systems.find(system => system.location.path === (symbols?.authoringPath ?? 'current.play') && system.location.line === line + 1);\n return system ? `**system ${system.name}**\\n\\n${system.description ?? ''}\\n\\n${operationAvailability}` : null;\n}\n", "// 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 { CompletionEntry } from './completion-items';\nimport { fenceMap, indentOf, withoutComment } from './document-context';\nimport { AuthoredEventSource } from './AuthoredEventSource';\nimport { AuthoredStream } from './AuthoredStream';\nimport { isSourceStreamName, isSourceStreamTypeName, sourceStreamPattern } from '@cratis/screenplay-compiler';\nimport { DocumentSymbols, symbolsForBuffer } from './symbols';\nimport { responseAnalysis } from './response-analysis';\nimport { typeReferenceText } from './TypeReferenceSymbol';\n\nexport const eventSourceAvailability = 'Syntax-only; not admitted by any supported executable model (ESM) version yet (PLAY0268) (#302). Authored classification does not supply an identity destination. No semantic IDs or automatic identity refactors.';\n\nexport const specificationRouteAvailability = 'Specification event routes are syntax-only; not admitted by any supported executable model (ESM) version yet (PLAY0268) (#457).';\n\nconst routePrefix = sourceStreamPattern('^\\\\s*stream\\\\s+(?:[A-Za-z_]\\\\w*(?:\\\\.[A-Za-z_]\\\\w*)?\\\\.?)?$');\nconst keyPrefix = sourceStreamPattern('^\\\\s*streamId\\\\s*=\\\\s*([\\\\w.]*)$');\nconst identifierTypePrefix = sourceStreamPattern('^\\\\s*identifier\\\\s+[\\\\w.]*$');\nconst streamTypePrefix = sourceStreamPattern('^\\\\s*streamId\\\\s+[\\\\w.]*$');\n\nexport function analyzeEventSources(lines: string[], symbols?: DocumentSymbols) {\n symbols = symbolsForBuffer(lines, symbols);\n return responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, symbols?.authoringPath, symbols?.authoringPlacementResolved).eventSources;\n}\n\nexport function eventSourceDetails(source: AuthoredEventSource, stream?: AuthoredStream): string {\n return [`**${stream ? `stream ${source.name}.${stream.name}` : `eventsource ${source.name}`}**`,\n stream?.description ?? source.description ?? '',\n source.identifier ? `Identifier type: ${typeReferenceText(source.identifier)}` : 'No identifier type declared.',\n stream ? stream.streamId ? `Stream id type: ${typeReferenceText(stream.streamId)}` : 'Unkeyed stream.' : source.streams.map(stream => `${stream.name}${stream.streamId ? ` \u2014 ${typeReferenceText(stream.streamId)}` : ' \u2014 unkeyed'}`).join('\\n'),\n (stream?.id ?? (!stream ? source.id : null)) ? 'Stored-name pin (rename-only metadata; not a semantic ID).' : '', eventSourceAvailability].filter(Boolean).join('\\n\\n');\n}\n\nexport function eventSourceReferenceAt(lines: string[], line: number, start: number, end: number, symbols?: DocumentSymbols) {\n const analysis = analyzeEventSources(lines, symbols);\n const at = (route: typeof analysis.routes[number]) => {\n const location = route.referenceLocation;\n const name = `${route.eventSource}.${route.stream}`;\n return location?.line === line + 1 && start >= location.column && end <= location.column + name.length &&\n withoutComment(lines[line] ?? '').slice(location.column - 1, location.column - 1 + name.length) === name;\n };\n const candidate = analysis.ambiguousCandidates.find(at);\n if (candidate) return { route: candidate, resolution: { state: 'ambiguous', source: undefined, stream: undefined }, target: undefined };\n const route = analysis.routes.find(at);\n if (!route) return null;\n const resolution = analysis.resolve(route.eventSource, route.stream);\n const sourcePart = end <= route.referenceLocation!.column + route.eventSource.length;\n return { route, resolution, target: resolution.state === 'unique' ? sourcePart ? resolution.source : resolution.stream : undefined };\n}\n\n// The location is a typed header start. Match its exact prefix, never search comments or another\n// occurrence of the same name. Both hosts use this to navigate to the authored identifier.\nexport function eventSourceIdentifier(location: { line: number; column: number; path?: string }, name: string, source: string) {\n const line = withoutComment(source.split(/\\r?\\n/)[location.line - 1] ?? '');\n const prefix = line.slice(location.column - 1).match(/^(?:eventsource|stream)\\s+/)?.[0];\n return prefix && line.slice(location.column - 1 + prefix.length, location.column - 1 + prefix.length + name.length) === name\n ? { ...location, column: location.column + prefix.length } : undefined;\n}\n\nexport function eventSourceHover(lines: string[], line: number, start: number, end: number, symbols?: DocumentSymbols): string | null {\n symbols = symbolsForBuffer(lines, symbols);\n const analysis = analyzeEventSources(lines, symbols);\n const reference = eventSourceReferenceAt(lines, line, start, end, symbols);\n if (reference) return reference.resolution.source && reference.resolution.stream ? eventSourceDetails(reference.resolution.source, reference.resolution.stream) + (analysis.contexts.get(line)?.event ? `\\n\\n${specificationRouteAvailability}` : '')\n : `Physical stream owner: ${reference.resolution.state}; no route selected. ${'reasons' in reference.resolution ? reference.resolution.reasons.join(' ') : ''} ${eventSourceAvailability}`;\n const context = analysis.contexts.get(line);\n if (context?.event?.noStream?.location.line === line + 1 && start >= context.event.noStream.location.column && end <= context.event.noStream.location.column + 9)\n return `Assert an unrouted event; omitting a route on then leaves it unasserted. ${specificationRouteAvailability}`;\n if (context?.event && context.route?.streamId?.location.line === line + 1 && start === context.route.streamId.location.column && end === start + 8)\n return `Concrete literal stream id, not a command property mapping. ${specificationRouteAvailability}`;\n const declaration = context?.stream ?? context?.source;\n if (declaration) {\n const name = eventSourceIdentifier(declaration.location, declaration.name, lines.join('\\n'));\n if (name?.line === line + 1 && start === name.column && end === start + declaration.name.length && context?.source) {\n const confidence = analysis.resolve(context.source.name, context.stream?.name);\n return eventSourceDetails(context.source, context.stream) + (confidence.state === 'unique' ? '' : `\\n\\nPhysical ownership: ${confidence.state}. ${confidence.reasons.join(' ')}`);\n }\n }\n if (context?.route?.streamId && context.command) {\n const mapping = context.route.streamId;\n if (mapping.location.line === line + 1 && start === mapping.location.column && end === start + 8)\n return `Authored stream id mapping. ${eventSourceAvailability}`;\n const expression = mapping.source as { kind?: string; path?: string; location?: { line: number; column: number } };\n if (expression.kind === 'PathExpressionSyntax' && expression.path && expression.location?.line === line + 1 &&\n start >= expression.location.column && end <= expression.location.column + expression.path.length) {\n const typed = responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, symbols?.authoringPath, symbols?.authoringPlacementResolved);\n const prefix = expression.path.slice(0, end - expression.location.column);\n const parts = prefix.split('.');\n let properties = context.command.properties;\n let optional = false;\n let collection = false;\n for (const [index, part] of parts.entries()) {\n const matches = properties.filter(property => property.name === part);\n if (matches.length !== 1) break;\n const property = matches[0];\n optional ||= property.type.isOptional;\n collection ||= property.type.isCollection;\n if (index === parts.length - 1)\n return `**${part}** \u2014 ${typeReferenceText({ ...property.type, isOptional: optional, isCollection: collection })}. Command source for authored stream id. ${eventSourceAvailability}`;\n const types = typed.operations.types.filter(type => type.name === property.type.name);\n if (types.length !== 1 || collection) break;\n properties = types[0].properties.map(property => ({ ...property, isIdentifier: false }));\n }\n }\n }\n if (context?.source && /^\\s*id\\s+\"/.test(withoutComment(lines[line] ?? '')) && start === indentOf(lines[line]) + 1 && end === start + 2)\n return `Stored-name pin: rename-only metadata, not a semantic identity or an automatic refactor. ${eventSourceAvailability}`;\n const type = context?.stream?.streamId ?? context?.source?.identifier;\n if (type && type.location?.line === line + 1 && start >= type.location.column && end <= type.location.column + type.name.length)\n return `${typeReferenceText(type)} \u2014 authored ${context?.stream ? 'stream id' : 'identifier'} type. ${eventSourceAvailability}`;\n return null;\n}\n\nexport function eventSourceCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n // .NET word characters are UTF-16 code units; supplementary letters are not identifiers.\n if (fenceMap(lines)[line] || withoutComment(before).length < before.length || /[\\uD800-\\uDFFF]/.test(before)) return null;\n const analysis = analyzeEventSources(lines, symbols);\n const context = analysis.contexts.get(line);\n const indent = before.trim() ? indentOf(lines[line]) : before.length;\n if (context?.event && indent > indentOf(lines[context.event.location.line - 1])) {\n if (context.route && indent > indentOf(lines[context.route.location.line - 1])) {\n const target = analysis.resolve(context.route.eventSource, context.route.stream).stream?.streamId;\n if (!target || context.route.streamId && context.route.streamId.location.line !== line + 1) return [];\n const typed = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols.authoringPlacement, symbols.authoringPath, symbols.authoringPlacementResolved);\n const primitive = typed.operations.concepts.find(concept => concept.name === target.name)?.type ?? target.name;\n const literal = primitive === 'Int' ? '0' : primitive === 'Uuid' ? '\"00000000-0000-0000-0000-000000000000\"' : '\"${1:value}\"';\n if (/^\\s*(?:streamId\\s*=\\s*)?$/.test(before) || 'streamId'.startsWith(before.trim()))\n return [{ label: 'streamId', insertText: before.includes('=') ? literal : `streamId = ${literal}`, documentation: `Concrete ${typeReferenceText(target)} literal. ${specificationRouteAvailability}` }];\n return [];\n }\n if (routePrefix.test(before) && (!context.event.stream || context.event.stream.location.line === line + 1) && !context.event.noStream) {\n const qualified = before.trim().split(/\\s+/)[1] ?? '';\n // Specification payload lines require '=', so imported value types cannot compete\n // with a route here as they do under a command. Physical ownership still must be unique.\n const targets = analysis.declarations.flatMap(source => source.streams.filter(stream => analysis.resolve(source.name, stream.name).state === 'unique')\n .map(stream => ({ name: `${source.name}.${stream.name}`, source, stream })));\n return targets.filter(target => isSourceStreamName(target.source.name) && isSourceStreamName(target.stream.name) && (!qualified.includes('.') || target.name.startsWith(qualified.slice(0, qualified.lastIndexOf('.') + 1))))\n .map(target => ({ label: target.name, insertText: qualified.includes('.') ? target.stream.name : target.name, documentation: `${eventSourceDetails(target.source, target.stream)}\\n\\n${specificationRouteAvailability}` }));\n }\n if (context.event.stream || context.event.noStream)\n return !before.trim() || 'stream'.startsWith(before.trim()) || 'no stream'.startsWith(before.trim()) ? [] : null;\n const entries = [{ label: 'stream', insertText: 'stream ${1:Source.Stream}', documentation: specificationRouteAvailability },\n ...(context.expectation ? [{ label: 'no stream', insertText: /^\\s*no\\s+/.test(before) ? 'stream' : 'no stream', documentation: `Assert an unrouted fact. ${specificationRouteAvailability}` }] : [])];\n const matching = entries.filter(entry => entry.label.startsWith(before.trim()));\n return matching.length > 0 ? matching : null;\n }\n if (context?.command && indent > indentOf(lines[context.command.location.line - 1]) &&\n (!context.route || indent <= indentOf(lines[context.route.location.line - 1])) && routePrefix.test(before)) {\n // A property named stream remains legal. Only offer routes whose complete-input\n // candidates have no known value-type competitor; never silently rewrite ambiguity.\n const typed = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols.authoringPlacement, symbols.authoringPath);\n const names = new Set([...typed.operations.concepts, ...typed.operations.types].map(type => type.name));\n // targets already exclude competing imports from the authoritative parsed documents.\n // Scanned symbols can retain an import removed from the current unsaved buffer.\n const qualified = before.trim().split(/\\s+/)[1] ?? '';\n return analysis.targets.filter(target => isSourceStreamName(target.source.name) && isSourceStreamName(target.stream.name) && !names.has(target.name) && (!qualified.includes('.') || target.name.startsWith(qualified.slice(0, qualified.lastIndexOf('.') + 1))))\n .map(target => ({ label: target.name, insertText: qualified.includes('.') ? target.stream.name : target.name, documentation: eventSourceDetails(target.source, target.stream) }));\n }\n if (context?.route && context.command && indent > indentOf(lines[context.route.location.line - 1]) && keyPrefix.test(before)) {\n const target = analysis.resolve(context.route.eventSource, context.route.stream).stream?.streamId;\n if (!target) return [];\n const typed = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols.authoringPlacement, symbols.authoringPath);\n const concepts = typed.operations.concepts.filter(concept => concept.name === target.name);\n const supported = ['String', 'Uuid'].includes(target.name) || concepts.length === 1 && ['String', 'Uuid', 'Int'].includes(concepts[0].type) && concepts[0].values.length === 0;\n if (!supported || target.isOptional || target.isCollection) return [];\n const parts = keyPrefix.exec(before)![1].split('.');\n let properties = context.command.properties;\n for (const part of parts.slice(0, -1)) {\n const matches = properties.filter(property => property.name === part);\n if (matches.length !== 1 || matches[0].type.isOptional || matches[0].type.isCollection) return [];\n const types = typed.operations.types.filter(type => type.name === matches[0].type.name);\n if (types.length !== 1) return [];\n properties = types[0].properties.map(property => ({ ...property, isIdentifier: false }));\n }\n return properties.filter(property => isSourceStreamName(property.name) && property.type.name === target.name && !property.type.isOptional && !property.type.isCollection)\n .map(property => ({ label: property.name, insertText: property.name, documentation: `${typeReferenceText(property.type)} \u2014 command source for authored stream id. ${eventSourceAvailability}` }));\n }\n if (context?.source && indent > indentOf(lines[context.source.location.line - 1])) {\n const ownsStream = context.stream && indent > indentOf(lines[context.stream.location.line - 1]);\n if ((ownsStream ? streamTypePrefix : identifierTypePrefix).test(before)) {\n const typed = responseAnalysis(lines, symbols.authoringDocuments ?? [], symbols.authoringPlacement, symbols.authoringPath);\n const streamId = /^\\s*streamId\\b/.test(before);\n return [...(streamId ? ['String', 'Uuid'] : ['String', 'Uuid', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime']), ...typed.operations.concepts.filter(concept => !streamId || ['String', 'Uuid', 'Int'].includes(concept.type) && concept.values.length === 0).map(concept => concept.name)]\n .filter(isSourceStreamTypeName).map(name => ({ label: name, insertText: name, documentation: eventSourceAvailability }));\n }\n if (/^\\s*$/.test(before)) return ownsStream ? [\n { label: 'streamId', insertText: 'streamId ${1:Type}', documentation: eventSourceAvailability },\n { label: 'description', insertText: 'description \"${1:Description}\"', documentation: 'Authored description.' }\n ] : [\n { label: 'identifier', insertText: 'identifier ${1:Type}', documentation: eventSourceAvailability },\n { label: 'stream', insertText: 'stream ${1:Name}', documentation: eventSourceAvailability },\n { label: 'description', insertText: 'description \"${1:Description}\"', documentation: 'Authored description.' }\n ];\n }\n return null;\n}\n", "// 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 { bmpWordCharacters } from './bmp-word-characters';\nimport { fenceMap, indentOf, withoutComment } from './document-context';\n\n// The command property form, with the compiler/tokenizer BMP identifier boundary, including its existing optional severity/message suffixes.\nexport const commandNamedRulePattern = new RegExp(`^[${bmpWordCharacters}.]+\\\\s+rule\\\\s+[A-Za-z_][${bmpWordCharacters}]*(?:\\\\s+severity\\\\s+(?:information|warning|error))?(?:\\\\s+message\\\\s+.*)?$`);\n\nexport function namedRuleContext(lines: string[], lineIndex: number, indent: number): 'rule' | 'implementation' | null {\n const fences = fenceMap(lines);\n const owners: string[] = [];\n let boundary = indent;\n for (let index = lineIndex - 1; index >= 0 && boundary > 0; index--) {\n if (fences[index]) continue;\n const line = withoutComment(lines[index]).trimEnd();\n if (line.trim().length === 0 || indentOf(line) >= boundary) continue;\n owners.push(line.trim());\n boundary = indentOf(line);\n }\n const wrapped = owners[0] === 'implementation';\n const offset = wrapped ? 1 : 0;\n return commandNamedRulePattern.test(owners[offset] ?? '') && owners[offset + 1] === 'validate' && /^command\\s/.test(owners[offset + 2] ?? '')\n ? wrapped ? 'implementation' : 'rule' : null;\n}\n", "// 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 { DocumentSymbols } from './symbols';\n\nconst exampleUuid = '\"0f8fad5b-d9cb-469f-a165-70867728950e\"';\n\nconst primitiveExamples: Record<string, string> = {\n Uuid: exampleUuid,\n String: '\"Example\"',\n Int: '1',\n Decimal: '1.5',\n Bool: 'true',\n Date: '\"2026-01-15\"',\n DateTime: '\"2026-01-15T10:00:00Z\"',\n};\n\n// An example value to write in a specification for a property of the given type, resolving concepts\n// down to the primitive they wrap. Collections and unknown types fall back to a quoted string.\nexport function exampleValueFor(type: string, symbols: DocumentSymbols): string {\n const bare = type.replace(/\\s+optional$/, '').replace(/\\?$/, '');\n if (bare.endsWith('[]')) return '\"Example\"';\n const primitive = symbols.concepts.find(concept => concept.name === bare)?.primitive ?? bare;\n return primitiveExamples[primitive] ?? '\"Example\"';\n}\n", "// 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 if (name && /^authorize\\b/.test(lines[index].trim())) authorized = true;\n }\n const symbol = symbols.commands.find(candidate => candidate.name === name);\n return symbol ? { symbol, authorized } : undefined;\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", "// 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", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { enclosingChain, enclosingHeaders, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { namedRuleContext } from './named-rule-context';\nimport { responseCompletions } from './response-completions';\nimport { DocumentSymbols, scanDocument } from './symbols';\nimport { structureCompletion } from './structure-completions';\nimport { getSubLanguage } from './sub-language-registry';\nimport * as items from './completion-items';\nimport * as scope from './scope-items';\nimport { CompletionEntry } from './completion-items';\n\n// Matches a validation rule line ending in \"rule <Name>\" (optionally followed by a\n// message clause) - both the command form (\"<property> rule <Name>\") and the\n// concept implied-subject form (\"rule <Name>\"). Its first word is the property\n// name, not \"rule\", so it can't be recognized through the chain[0] keyword switch\n// the way \"on <EventType>\" or \"handler\" are - hence the dedicated regex check.\nconst RULE_LINE_PATTERN = /(?:^|\\s)rule\\s+[A-Za-z_]\\w*(?:\\s+severity\\s+(?:information|warning|error))?(?:\\s+message\\s+.*)?$/;\n\nexport type CompletionPlan =\n | { kind: 'none' }\n | { kind: 'entries'; entries: CompletionEntry[] }\n | { kind: 'contextVariables'; replaceLength: number }\n | { kind: 'playFiles'; replaceLength: number }\n | { kind: 'policies' }\n | { kind: 'events' }\n | { kind: 'triggers' }\n | { kind: 'commands' }\n | { kind: 'producesTargets' }\n | { kind: 'screens' }\n | { kind: 'queries' }\n | { kind: 'types' };\n\n// What the position sits inside, beyond the keyword chain: the whole header of each enclosing block, so a\n// slice's type and a template's kind are known, and the document's own lines, so a declaration that may\n// appear once is not offered again.\nexport interface CompletionScope {\n headers: readonly string[];\n document: readonly string[];\n}\n\nconst declaredIn = (document: readonly string[], keyword: string) => document.some(line => new RegExp(`^${keyword}\\\\b`).test(line));\n\nfunction topLevelEntries(document: readonly string[]): CompletionEntry[] {\n return items.topLevelItems.filter(item => !(item.label === 'domain' && declaredIn(document, 'domain')) && !(item.label === 'authentication' && declaredIn(document, 'authentication')));\n}\n\nconst isTemplate = (header: string | undefined) => /^(?:screen|dialog)\\s+template\\b/.test(header ?? '');\n\n// A whole block as one completion entry. Continuation lines are indented relative to the line it is inserted on,\n// which is how the editors indent a multi-line snippet.\nfunction expansionEntry(text: string, indent: number): CompletionEntry {\n const relative = text.split('\\n').map((line, index) => (index === 0 ? line : line.slice(Math.min(indent, indentOf(line))))).join('\\n');\n const label = text.split('\\n')[0].trim();\n return { label, insertText: relative.replace(/[$}\\\\]/g, '\\\\$&'), documentation: 'Expands the whole block from what the command and its events declare.' };\n}\n\nexport function completionEntriesFor(chain: string[], where: CompletionScope = { headers: [], document: [] }): CompletionEntry[] {\n const construct = chain[0];\n if (construct === undefined || construct === 'domain') return topLevelEntries(where.document);\n const subLanguage = getSubLanguage(construct);\n if (subLanguage) return subLanguage.completions ?? [];\n const header = where.headers[0];\n switch (construct) {\n case 'module':\n return items.moduleItems;\n case 'feature':\n return items.featureItems;\n case 'slice':\n return items.sliceItemsFor(header?.split(/\\s+/)[1]);\n case 'concept':\n return items.conceptItems;\n case 'type':\n return items.typeItems;\n case 'command':\n return items.commandItems;\n case 'event':\n return items.eventItems;\n case 'readmodel':\n return scope.readModelItems;\n case 'reducer':\n return scope.reducerItems;\n case 'form':\n return scope.formItems;\n case 'contribute':\n return scope.contributeItems;\n case 'behavior':\n return scope.behaviorItems;\n case 'persona':\n return scope.personaItems;\n case 'authentication':\n return scope.authenticationItems;\n case 'seed':\n return scope.seedItems;\n case 'theme':\n return scope.themeItems;\n case 'ui':\n return scope.uiProfileItems;\n case 'on':\n case 'success':\n case 'failure':\n case 'confirm':\n return scope.outcomeItems;\n case 'layout':\n return scope.layoutItems;\n case 'system':\n return items.operationItems.filter(item => item.label === 'description');\n case 'operation':\n return items.operationItems;\n case 'execute':\n case 'compensate':\n return items.operationPhaseItems;\n case 'produces':\n return items.producesItems;\n case 'handler':\n return items.handlerItems;\n case 'implementation':\n return chain[1] === 'handler' ? items.implementationItems : ['execute', 'compensate'].includes(chain[1]) ? items.operationImplementationItems : [];\n case 'query':\n return items.queryItems;\n case 'performer':\n return items.performerItems;\n case 'constraint':\n return items.constraintItems;\n case 'reaction':\n return items.reactionItems;\n case 'trigger':\n return items.triggerItems;\n case 'when':\n case 'every':\n case 'at':\n return chain.includes('reaction') ? items.reactionTriggerItems : [];\n case 'specification':\n return items.specificationItems;\n case 'policy':\n return items.policyItems;\n case 'validate':\n return items.validateItems;\n case 'action':\n return items.actionItems;\n case 'table':\n case 'summary':\n return items.tableItems;\n case 'screen':\n return isTemplate(header) ? scope.templateItems : items.screenItems;\n case 'dialog':\n return scope.templateItems;\n default:\n if (isTemplate(where.headers.find(candidate => isTemplate(candidate)))) return scope.templateItems;\n // Sections inside a screen expose the screen vocabulary.\n if (chain.includes('screen') || construct === 'section') return items.screenItems;\n if (chain.includes('produces')) return items.producesItems;\n return [];\n }\n}\n\n// Decides what to complete at a position, without any editor dependency \u2014 the\n// Monaco service and the VSCode extension both materialize the plan into items.\nexport function planCompletions(\n lines: string[],\n lineIndex: number,\n textBefore: string,\n symbols: DocumentSymbols = scanDocument(lines),\n): CompletionPlan {\n const fences = fenceMap(lines);\n if (fences[lineIndex] || withoutComment(textBefore).length < textBefore.length) return { kind: 'none' };\n const responseEntries = responseCompletions(lines, lineIndex, textBefore, scanDocument(lines));\n if (responseEntries !== null) return { kind: 'entries', entries: responseEntries };\n\n // Inside the quotes of a file import, what is wanted is a path - replacing what has been typed so far.\n const importPath = textBefore.match(/^\\s*import\\s+\"([^\"]*)$/);\n if (importPath) {\n return { kind: 'playFiles', replaceLength: importPath[1].length };\n }\n\n // A quote or a slash only asks for a completion inside an import path.\n if (/[\"/]$/.test(textBefore)) return { kind: 'none' };\n\n const contextVariableMatch = textBefore.match(/\\$[\\w.]*$/);\n if (contextVariableMatch) {\n return { kind: 'contextVariables', replaceLength: contextVariableMatch[0].length };\n }\n\n const currentLine = lines[lineIndex] ?? '';\n const effectiveIndent =\n textBefore.trim().length === 0 ? textBefore.length : indentOf(currentLine);\n const chain = enclosingChain(lines, fences, lineIndex, effectiveIndent);\n const ruleContext = namedRuleContext(lines, lineIndex, effectiveIndent);\n if (ruleContext === 'implementation') return { kind: 'entries', entries: items.namedRuleImplementationItems };\n if (ruleContext === 'rule') return { kind: 'entries', entries: items.commandRuleItems };\n\n const propertyOwner = ['event', 'command', 'type', 'readmodel', 'trigger', 'when', 'every', 'at'].includes(chain[0]) ||\n (chain[0] === 'produces' && /^produces\\s+event\\b/.test(nearestEnclosingLine(lines, fences, lineIndex, effectiveIndent) ?? ''));\n const propertyName = textBefore.trimStart().split(/\\s+/)[0];\n const reservedProperty = (chain[0] === 'command' && ['reads', 'authorize', 'produces'].includes(propertyName)) ||\n (chain[0] === 'event' && propertyName === 'tag') ||\n (['trigger', 'when', 'every', 'at'].includes(chain[0]) && ['description', 'file', 'reads', 'produces', 'invokes'].includes(propertyName));\n const optionalPrefix = (match: RegExpMatchArray | null) => match !== null && 'optional'.startsWith(match[1]);\n const afterPropertyType = propertyOwner && !reservedProperty && optionalPrefix(textBefore.match(/^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+(\\w*)$/));\n const afterQueryType = (chain[0] === 'query' && optionalPrefix(textBefore.match(/^\\s*(?:by|filter)\\s+[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+(\\w*)$/))) ||\n optionalPrefix(textBefore.match(/^\\s*query\\s+[A-Za-z_]\\w*\\s*=>\\s*(?:observable\\s+)?[\\w.]+(?:\\[\\])?\\s+(\\w*)$/));\n if ((afterPropertyType || afterQueryType) && !/=>\\s*observable\\s+$/.test(textBefore)) return { kind: 'entries', entries: items.optionalTypeItems };\n\n if (/\\bauthorize\\s+[\\w\\s]*$/.test(textBefore) || chain[0] === 'authorize') {\n return { kind: 'policies' };\n }\n if (/\\bwhen\\s+\\w*$/.test(textBefore) && chain.includes('reaction')) {\n return { kind: 'triggers' };\n }\n if (/\\bon\\s+\\w*$/.test(textBefore) && chain.includes('constraint')) {\n return { kind: 'events' };\n }\n if (/\\binvokes\\s+\\w*$/.test(textBefore) && chain.includes('reaction')) {\n return { kind: 'commands' };\n }\n if (/\\b(?:on|unique\\s+event)\\s+\\w*$/.test(textBefore) && chain[0] === 'constraint') {\n return { kind: 'events' };\n }\n if (/\\bproduces\\s+\\w*$/.test(textBefore)) {\n return { kind: 'producesTargets' };\n }\n if (/\\bnavigate\\s+to\\s+\\w*$/.test(textBefore)) {\n return { kind: 'screens' };\n }\n if (chain[0] === 'specification') {\n if (/^\\s*when\\s+query\\s+[\\w.]*$/.test(textBefore)) return { kind: 'queries' };\n const step = textBefore.match(/^\\s*(given|when|then)\\s+\\w*$/);\n if (step) return { kind: 'entries', entries: items.specificationStepItems[step[1] as 'given' | 'when' | 'then'] };\n }\n if (/\\b(?:via|then)\\s+query\\s+[\\w.]*$/.test(textBefore)) {\n return { kind: 'queries' };\n }\n if (\n (chain[0] === 'event' || chain[0] === 'command' || chain[0] === 'type') &&\n /^\\s+[a-z_]\\w*\\s+[\\w[\\]?]*$/.test(textBefore)\n ) {\n return { kind: 'types' };\n }\n if (chain[0] === 'query' && /^\\s+(?:by|filter)\\s+[a-z_]\\w*\\s+[\\w[\\]?]*$/.test(textBefore)) {\n return { kind: 'types' };\n }\n\n const enclosingLine = nearestEnclosingLine(lines, fences, lineIndex, effectiveIndent);\n if (enclosingLine && /^produces\\s+operation\\b/.test(enclosingLine)) return { kind: 'entries', entries: items.operationItems };\n if (enclosingLine && /^produces\\s+event\\b/.test(enclosingLine)) {\n if (/^\\s+@?[a-z_]\\w*\\s+[\\w[\\]?]*$/.test(textBefore)) return { kind: 'types' };\n return { kind: 'entries', entries: items.inlineEventItems };\n }\n if (enclosingLine && RULE_LINE_PATTERN.test(enclosingLine)) {\n return { kind: 'entries', entries: items.ruleItems };\n }\n\n const headers = enclosingHeaders(lines, fences, lineIndex, effectiveIndent);\n if (chain[0] === 'for' && chain.includes('seed')) return { kind: 'events' };\n const entries = completionEntriesFor(chain, { headers, document: lines });\n const expansion = chain[0] === 'command' ? structureCompletion(lines, lineIndex, ' '.repeat(effectiveIndent), '', symbols) : null;\n return { kind: 'entries', entries: expansion ? [expansionEntry(expansion.text, effectiveIndent), ...entries] : entries };\n}\n", "// 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 } from 'monaco-editor';\nimport { typeReferenceSymbol, typeReferenceText } from './TypeReferenceSymbol';\nimport { Monaco, primitiveTypes } from './language';\nimport { DocumentSymbols, knownEventNames, knownTriggerNames, symbolsForBuffer } from './symbols';\nimport { responseCompletions } from './response-completions';\nimport { operationCompletions } from './operation-authoring';\nimport { eventSourceCompletions } from './event-source-authoring';\nimport { planCompletions } from './completion-planner';\nimport { contextVariableItems, producesItems, CompletionEntry } from './completion-items';\n\n// What a host knows beyond the one model the editor holds.\nexport interface CompletionOptions {\n // The paths a file import written in the model can name, relative to the model's folder - typically\n // importablePaths over the host's .play files. Without it, an import path is not completed.\n playFiles?: (model: editor.ITextModel) => readonly string[];\n application?: (model: editor.ITextModel) => DocumentSymbols;\n // Notify after changing application documents or placement, even when this buffer is unchanged.\n onDidChangeApplication?: (listener: () => void) => { dispose(): void };\n}\n\nexport function createCompletionProvider(monaco: Monaco, options: CompletionOptions = {}): languages.CompletionItemProvider {\n return {\n triggerCharacters: [' ', '$', '@', '.', '\"', '/'],\n\n provideCompletionItems(model, position) {\n const lines = model.getLinesContent();\n const lineIndex = position.lineNumber - 1;\n const currentLine = lines[lineIndex] ?? '';\n const textBefore = currentLine.substring(0, position.column - 1);\n const application = options.application?.(model);\n const symbols = symbolsForBuffer(lines, application);\n const responseEntries = eventSourceCompletions(lines, lineIndex, textBefore, symbols) ?? operationCompletions(lines, lineIndex, textBefore, symbols) ?? responseCompletions(lines, lineIndex, textBefore, symbols);\n const plan = responseEntries === null ? planCompletions(lines, lineIndex, textBefore, symbols) : { kind: 'entries' as const, entries: responseEntries };\n if (plan.kind === 'none') return { suggestions: [] };\n\n const word = model.getWordUntilPosition(position);\n const range = new monaco.Range(\n position.lineNumber,\n word.startColumn,\n position.lineNumber,\n word.endColumn,\n );\n const kinds = monaco.languages.CompletionItemKind;\n const asSnippet = monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet;\n\n const snippet = (entry: CompletionEntry): languages.CompletionItem => ({\n label: entry.label,\n kind: entry.insertText.includes('$') ? kinds.Snippet : kinds.Keyword,\n insertText: entry.insertText,\n insertTextRules: asSnippet,\n documentation: entry.documentation,\n range,\n });\n const symbolItem = (\n name: string,\n kind: languages.CompletionItemKind,\n detail: string,\n ): languages.CompletionItem => ({\n label: name,\n kind,\n insertText: name,\n detail,\n range,\n });\n const eventNames = () => {\n const inlineNames = new Set(symbols.events.filter(event => event.inline).map(event => event.name));\n return [...new Set(knownEventNames(symbols))].map((name) => symbolItem(name, kinds.Event, inlineNames.has(name) ? 'inline event' : 'event'));\n };\n\n switch (plan.kind) {\n case 'playFiles': {\n const pathRange = new monaco.Range(\n position.lineNumber,\n position.column - plan.replaceLength,\n position.lineNumber,\n position.column,\n );\n return {\n suggestions: (options.playFiles?.(model) ?? []).map((path) => ({\n label: path,\n kind: path.includes('*') ? kinds.Folder : kinds.File,\n insertText: path,\n range: pathRange,\n })),\n };\n }\n case 'contextVariables': {\n const variableRange = new monaco.Range(\n position.lineNumber,\n position.column - plan.replaceLength,\n position.lineNumber,\n word.endColumn,\n );\n return {\n suggestions: contextVariableItems.map((entry) => ({\n ...snippet(entry),\n range: variableRange,\n })),\n };\n }\n case 'policies':\n return {\n suggestions: symbols.policies.map((policy) =>\n symbolItem(policy.name, kinds.Reference, 'policy'),\n ),\n };\n case 'events':\n return { suggestions: eventNames() };\n case 'triggers':\n return {\n suggestions: [...new Set(knownTriggerNames(symbols))].map((name) =>\n symbolItem(name, kinds.Event, 'trigger'),\n ),\n };\n case 'commands':\n return {\n suggestions: symbols.commands.map((command) =>\n symbolItem(command.name, kinds.Method, 'command'),\n ),\n };\n case 'producesTargets':\n return { suggestions: [...producesItems.map(snippet), ...eventNames()] };\n case 'screens':\n return {\n suggestions: symbols.screens.map((screen) =>\n symbolItem(screen.name, kinds.Interface, 'screen'),\n ),\n };\n case 'queries':\n return {\n suggestions: symbols.queries.map((query) =>\n symbolItem(query.name, kinds.Function, `query => ${typeReferenceText(query.returnTypeReference ?? typeReferenceSymbol(query.returnType))}`),\n ),\n };\n case 'types':\n return {\n suggestions: [\n ...symbols.concepts.map((concept) =>\n symbolItem(\n concept.name,\n kinds.Class,\n `concept : ${concept.primitive}${concept.attributes.length ? ' ' + concept.attributes.join(' ') : ''}`,\n ),\n ),\n ...symbols.types.map((type) =>\n symbolItem(\n type.name,\n kinds.Struct,\n `type (${type.properties.length} properties)`,\n ),\n ),\n ...primitiveTypes.map((primitive) =>\n symbolItem(primitive, kinds.Struct, 'primitive'),\n ),\n ],\n };\n case 'entries':\n return { suggestions: plan.entries.map(snippet) };\n }\n },\n };\n}\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { languages } from 'monaco-editor';\nimport type { CompletionOptions } from './completions';\nimport { structureCompletion } from './structure-completions';\nimport { symbolsForBuffer } from './symbols';\n\n// Ghost text for the structure a block obviously needs next, from the compiler's own model.\nexport function createInlineCompletionProvider(options: CompletionOptions): languages.InlineCompletionsProvider {\n return {\n provideInlineCompletions(model, position) {\n const lines = model.getLinesContent();\n const lineIndex = position.lineNumber - 1;\n const line = lines[lineIndex] ?? '';\n const symbols = symbolsForBuffer(lines, options.application?.(model));\n const suggestion = structureCompletion(lines, lineIndex, line.substring(0, position.column - 1), line.substring(position.column - 1), symbols);\n if (!suggestion) return { items: [] };\n // The suggestion replaces the indentation before the cursor, so it starts with indentation of its own -\n // the editors take Tab as 'indent' rather than 'accept' for a suggestion that does not.\n return { items: [{ insertText: `${line.substring(0, position.column - 1)}${suggestion.text}`, range: { startLineNumber: position.lineNumber, startColumn: 1, endLineNumber: position.lineNumber, endColumn: position.column } }] };\n },\n disposeInlineCompletions() {},\n };\n}\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { responseAnalysis } from './response-analysis';\nimport { DocumentSymbols } from './symbols';\nimport { withoutComment } from './document-context';\n\nexport const responseTokenTypes = ['keyword', 'property', 'type'] as const;\n\n// Semantic overlays resolve the local returns ambiguity that a line-based grammar cannot.\nexport function responseTokens(lines: string[], symbols?: DocumentSymbols): { line: number; column: number; length: number; type: number }[] {\n const tokens: { line: number; column: number; length: number; type: number }[] = [];\n const add = (line: number, column: number, length: number, type: number) => {\n const source = lines[line - 1];\n if (source === undefined || column < 1 || length < 1) return;\n const start = column - 1 + (source[column - 1] === '@' ? 1 : 0);\n if (start + length <= source.length) tokens.push({ line: line - 1, column: start, length, type });\n };\n const path = symbols?.authoringPath ?? 'current.play';\n const analysis = responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources?.filter(source => source !== lines.join('\\n')) ?? [], symbols?.authoringPlacement, path, symbols?.authoringPlacementResolved);\n for (const source of analysis.eventSources.declarations.filter(source => source.location.path === path)) {\n add(source.location.line, source.location.column, 11, 0);\n if (source.identifier) add(source.identifier.location.line, source.identifier.location.column, source.identifier.name.length, 2);\n for (const stream of source.streams) {\n add(stream.location.line, stream.location.column, 6, 0);\n if (stream.streamId) add(stream.streamId.location.line, stream.streamId.location.column, stream.streamId.name.length, 2);\n }\n }\n for (const route of analysis.eventSources.routes) {\n add(route.location.line, route.location.column, 6, 0);\n if (route.referenceLocation) add(route.referenceLocation.line, route.referenceLocation.column, `${route.eventSource}.${route.stream}`.length, 2);\n if (route.streamId) add(route.streamId.location.line, route.streamId.location.column, 8, 0);\n }\n for (const command of analysis.commands.values()) {\n for (const property of command.properties) {\n if (!property.isGenerated) continue;\n const source = withoutComment(lines[property.location.line - 1] ?? '');\n add(property.location.line, source.lastIndexOf('generated') + 1, 9, 0);\n }\n const response = command.response;\n if (!response) continue;\n add(response.location.line, response.location.column, 7, 0);\n if (response.kind === 'ScalarCommandResponseSyntax') {\n add(response.source.location.line, response.source.location.column, response.source.property.length, 1);\n } else for (const field of response.fields) {\n add(field.location.line, field.location.column, field.name.length, 1);\n add(field.source.location.line, field.source.location.column, field.source.property.length, 1);\n if (field.type) add(field.type.location.line, field.type.location.column, field.type.name.length, 2);\n }\n }\n for (const specification of analysis.specifications.values()) {\n for (const event of specification.thenEvents ?? []) {\n if (event.noStream) add(event.noStream.location.line, event.noStream.location.column, 9, 0);\n }\n for (const fixture of specification.when?.generatedValues ?? []) {\n add(fixture.location.line, fixture.location.column, 9, 0);\n }\n if (specification.thenReturns) add(specification.thenReturns.location.line, (lines[specification.thenReturns.location.line - 1] ?? '').indexOf('returns') + 1, 7, 0);\n }\n for (const system of analysis.operations.systems.filter(system => system.location.path === path)) {\n add(system.location.line, system.location.column, 6, 0);\n }\n for (const operation of analysis.operations.declarations.filter(operation => operation.location.path === path)) {\n const header = withoutComment(lines[operation.location.line - 1] ?? '');\n const keyword = header.indexOf('operation', operation.location.column - 1);\n if (keyword >= 0) add(operation.location.line, keyword + 1, 9, 0);\n for (const input of operation.inputs) {\n add(input.location.line, input.location.column, input.name.length, 1);\n add(input.type.location.line, input.type.location.column, input.type.name.length, 2);\n }\n if (operation.usesLocation) add(operation.usesLocation.line, (lines[operation.usesLocation.line - 1] ?? '').indexOf('uses') + 1, 4, 0);\n for (const phase of [operation.execute, operation.compensate]) {\n if (!phase) continue;\n const name = withoutComment(lines[phase.location.line - 1] ?? '').trim();\n add(phase.location.line, phase.location.column, name.length, 0);\n if (phase.implementation) add(phase.implementation.location.line, phase.implementation.location.column, 14, 0);\n for (const hint of phase.implementation?.hints ?? []) add(hint.location.line, hint.location.column, 4, 0);\n }\n }\n // Overlays never overlap or duplicate a typed token, even with recovered malformed syntax.\n const ordered = tokens.sort((left, right) => left.line - right.line || left.column - right.column);\n return ordered.filter((token, index) => index === 0 || token.line !== ordered[index - 1].line || token.column >= ordered[index - 1].column + ordered[index - 1].length);\n}\n", "// 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 { eventContextPaths } from './event-context';\n\n// These words are contextual beneath a handler, never global property keywords.\nexport const handlerIntentDocs = {\n implementation: 'Handler-only intent with ordered hints and at most one file or tagged fence. No payload means pending. Handler execution is unsupported; this is not confirmation.',\n hint: 'One nonblank quoted implementation hint. Order and decoded text are retained; hints do not execute or confirm code.',\n};\n\nexport const keywordDocs: Record<string, string> = {\n domain: 'The domain the file belongs to \u2014 optional, at most one per file, before everything else.',\n import: 'Imports a type from another module by its qualified name \u2014 `import Module.Type` \u2014 making it available by its short name; or, quoted, other `.play` files by path or glob \u2014 `import \"Orders/**/*.play\"`, relative to this file\\'s folder. Written inside a module or feature, a file import places the imported files there: their top level is that module\\'s or feature\\'s body.',\n concept: 'A formalized value type wrapping a primitive. Attributes such as `@pii` travel with every usage, optionally with a `<attribute> reason \"...\"` line saying why.',\n type: 'A composite value type \u2014 a named shape built from several properties, referenced by events, commands and other types the same way a concept is.',\n reason: 'Records why a concept attribute applies \u2014 the purpose, the lawful basis, whose subject the value lives under. Written as `pii reason \"...\"` in the concept body.',\n optional: 'Allows a value to be absent. Write it after the type: `note String optional` or `lines InvoiceLine[] optional`. The collection itself may be absent; its items keep their declared type.',\n identifier: 'Marks the command property a runtime resolves the event source id from. At most one per command; without it a new Uuid is generated.',\n policy: 'A named authorization rule referenced by commands and queries. Multiple policies AND together.',\n persona: 'A named role interacting with the application, with an optional description and its associated policies.',\n authentication: 'Declares the identity providers of the application \u2014 at most one block per file.',\n provider: 'A named identity provider within `authentication`, with free-form `name value` settings.',\n description: 'A human-readable description of a module, feature, slice, persona, or command \u2014 the first body line, as a quoted single line or a fenced ```text block for multiple lines.',\n depends: 'Declares `depends on <Name>` on a module or feature. This opts only that container into checking counted explicit references against its own declarations; it does not change executable bytes.',\n module: 'The top-level namespace \u2014 maps to a bounded context.',\n layout: 'A reusable screen template with named slots.',\n template: 'Declares the named slots of a layout.',\n feature: 'A vertical slice grouping. Features nest arbitrarily deep.',\n slice: 'The atomic unit of behavior, aligned with Event Modeling. Has a type and a name.',\n event: 'An immutable, past-tense fact. Declare it in a slice or inline with `produces event <Name>` in a command. Inline properties are typed mappings; inline tags belong to the event type.',\n documentation: 'Authoring-only event documentation in a fenced ```markdown block. It does not change executable model bytes.',\n id: 'Preserves the previous persisted event name after a rename. Leave absent on new events; repeating the current name is redundant.',\n command: 'An imperative intent. Declares authorization, validation, and what events it produces \u2014 declaratively, or via a full handler.',\n query: 'A read-side entry point mapping to a return type, with an optional description, parameters and performer.',\n observable: 'Qualifies a query return type as a live read \u2014 `query <Name> => observable <ReadModel>` keeps pushing as the read model changes, instead of answering once.',\n performer: 'The code that performs a query \u2014 a `file <Path>` reference or an inline `csharp`/`sql` block. The query\\'s counterpart to a command handler.',\n from: 'Fills a query parameter from the query context instead of the caller, as in `filter tenantId TenantId from $context.tenant`.',\n projection: 'Declares how events project into a read model, using the embedded Projection Declaration Language (PDL).',\n capture: 'Converts external data into events, using the embedded Change Data Capture Language (CDL).',\n reaction: 'Behavior that runs when something happens. Lives inside Automation slices. A trigger with no body states intent on its own \u2014 `file`/code is optional realization metadata.',\n trigger: 'Declares a kind of occurrence a reaction can respond to, and the values it hands the reaction. What makes one occur belongs to whoever provides it, never to the compiler.',\n where: 'Narrows which occurrences actually run the reaction.',\n contains: 'Text comparison \u2014 true when the left string holds the right one anywhere.',\n every: 'Runs a reaction on an interval \u2014 `every 15 minutes`, `every 1 day`.',\n invokes: 'A command a reaction hands on. A command is asked for, not produced \u2014 it may still be rejected.',\n screen: 'A UI declaration. Supports intent, structure, and layout-with-code levels, or a full file reference.',\n constraint: 'A server-side rule enforced in the Chronicle kernel before events are committed.',\n authorize: 'References the policies that must all pass for the construct to execute.',\n validate: 'Declarative validation rules, or `validate` followed by ```csharp for imperative rules \u2014 on commands and concepts.',\n produces: 'References a declared event with `produces <Name>`, or declares one inline with `produces event <Name>`. An inline omitted `for` uses the command identifier only when all destinations are the same source; legacy plain omission allocates an identity.',\n reads: 'Declares a view consulted by a command or reaction trigger: `reads <View> [as <alias>] [by <value>]`. A reaction `by` names a value taken by its trigger; clock triggers cannot use `by`. Repeated views require unique aliases. Runtime binding is not yet supported for command or reaction reads.',\n as: 'Names an instance of a view in a command or reaction trigger reads declaration, for example `reads Account as source by sourceId`.',\n handler: 'A fully imperative command implementation \u2014 a `file <Path>` reference or an inline `csharp` block, instead of `produces`.',\n when: 'Guards a produced event or a capture append with a condition.',\n rule: 'Names a predicate. Bare, it states that a constraint exists without expressing what it computes \u2014 nothing resolves the name. Optionally followed by an indented `file <Path>` reference or inline `csharp` block giving it a body.',\n require: 'A policy condition: `authenticated`, `role \"...\"`, or `claim \"...\" matches ...`.',\n authenticated: 'Requires an authenticated caller.',\n role: 'Requires the caller to have the given role.',\n claim: 'Requires a claim on the caller to match a subject or value.',\n subject: 'The subject (identity) of the caller.',\n data: 'Binds a read model to a screen through a query.',\n action: 'Makes a command available as an action on a screen.',\n navigate: 'Navigates to a screen, optionally passing a parameter with `by`.',\n section: 'A named structural section of a screen.',\n table: 'A table widget over a read model or child collection.',\n summary: 'A summary widget showing labeled fields.',\n column: 'A table column bound to a property.',\n field: 'A summary field bound to a property.',\n title: 'The display title of a screen or section.',\n label: 'The display label of an action, column, or field.',\n unique: 'A uniqueness constraint \u2014 `unique <property> on <EventType>` or `unique event <EventType>`.',\n concurrency: 'The concurrency scope enforced when the command appends events \u2014 dimensions: `eventSource`, `sourceType`, `streamType`, `streamId`, `events`.',\n eventSource: 'Concurrency dimension \u2014 scope the check to the event source id of the command.',\n sourceType: 'Concurrency dimension \u2014 scope the check to an event source type.',\n streamType: 'Concurrency dimension \u2014 scope the check to an event stream type.',\n streamId: 'Concurrency dimension \u2014 scope the check to an event stream id.',\n tag: 'Attaches a tag to appended events \u2014 a static identifier or string, or a `$context.` expression resolved at append time.',\n seed: 'Declares events to seed into the event store per event source id \u2014 multiple blocks accumulate.',\n for: 'Names the event source of a production or seed group. Inside `produces event`, omission uses the command identifier unless another production targets a different source.',\n readmodel: 'Declares a read model \u2014 its name and properties \u2014 in a slice, or, in a specification, read model state: `given readmodel` establishes it, `then readmodel` asserts it, `then no readmodel <View> for <key>` asserts keyed absence.',\n reducer: 'Builds a read model from events with imperative code \u2014 `reducer <Name> => <ReadModel>` with an `on <EventType>` rule per event. Use it when a projection cannot express the transition.',\n specification: 'Given/when/then acceptance criteria for a slice: prior events and state, the command, query or appended event under test, and the events, state, results, errors or denials that follow.',\n dialog: 'A dialog opened over the shell, or with `dialog template` a reusable dialog shape.',\n form: 'A form bound to a command \u2014 `form <Name> for <Command>` with a `field` per input.',\n contribute: 'Contributes entries to a slot of the shell \u2014 `contribute to Navigation` with `navigate to`, `label` and `order`.',\n theme: 'A named theme and the component packages it is compatible with.',\n ui: 'A UI profile \u2014 `ui profile <Name>` binds a target platform and size to a layout, theme and packages.',\n behavior: 'A named interaction wiring of `on <interaction>` handlers, attached to a screen, form or dialog with `uses`.',\n system: 'An application-scoped external system that operations use.',\n eventsource: 'An application-owned event source with nested streams.',\n operation: 'A reusable operation intent that uses one external system.',\n no: 'A keyed absence assertion: `then no readmodel <View> for <key>`.',\n arguments: 'The values supplied to a query asserted by `then query`.',\n result: 'One expected result - `then result [exactly]` after `when query`, or a `result` block inside `then query`. Repeat it to assert several results in authored order.',\n clock: 'The instant a specification happens at - `given clock \"2026-10-05T08:00:00Z\"` fixes when everything occurs; `when clock \"<instant>\"` is the clock reaching it, as the action.',\n exactly: 'Requires every property to match, rather than only the ones asserted - on `then readmodel`, `then query` and `then result`.',\n file: 'Delegates the implementation to an external file; the Screenplay contract stays visible.',\n by: 'Introduces the identifying parameter.',\n via: 'Connects screen data to the query that supplies it.',\n filter: 'An optional query filter parameter.',\n on: 'The event a constraint applies to, the day a schedule narrows to, or a widget interaction such as `on row-click`.',\n message: 'The validation message reported when the rule fails.',\n matches: 'Matches a value against a regular expression or a named pattern such as `email`.',\n all: 'Applies a comparison to every element of a collection.',\n max: 'Maximum length or value.',\n min: 'Minimum length or value.',\n length: 'Constrains the exact length of a value.',\n today: 'The current date.',\n empty: 'Used with `not empty` \u2014 the value must be present.',\n not: 'Negates a validation condition, as in `not empty`.',\n and: 'Both conditions must hold.',\n or: 'Either condition may hold.',\n csharp: 'An inline C# block whose opening fence is ```csharp.',\n sql: 'An inline SQL block between triple backticks \u2014 a query performer written against a relational store.',\n typescript: 'An inline TypeScript block between triple backticks.',\n react: 'An inline React/TSX block; receives the surrounding data contract as `Props`.',\n html: 'An inline static HTML block.',\n StateChange: 'Slice type \u2014 a command \u2192 events flow; something that changes the system.',\n StateView: 'Slice type \u2014 a query + projection + screen; something that reads the system.',\n Automation: 'Slice type \u2014 a reaction or reducer; something that runs when something happens.',\n Translate: 'Slice type \u2014 a capture; converts external data into events.',\n Uuid: 'Primitive type \u2014 a universally unique identifier.',\n String: 'Primitive type \u2014 a string of characters.',\n Int: 'Primitive type \u2014 an integer number.',\n Decimal: 'Primitive type \u2014 a decimal number.',\n Bool: 'Primitive type \u2014 true or false.',\n Date: 'Primitive type \u2014 a date without time.',\n DateTime: 'Primitive type \u2014 a date and time.',\n Enum: 'An enumeration concept with a fixed set of values.',\n};\n\n// What the words of a specification's steps mean there - where 'trigger', 'capture' and 'query' name what the\n// scenario exercises rather than declare one.\nexport const specificationKeywordDocs: Record<string, string> = {\n clock: keywordDocs.clock,\n trigger: '`when trigger <Trigger>` - an application trigger fires, as the action, with the values on the lines beneath it.',\n capture: '`given capture <Capture>` - a record the capture\\'s source held before; `when capture <Capture>` - the record it sees now, as the action. The fields go on the lines beneath.',\n query: '`when query <Query>` - the query is performed, as the action, with its arguments on the lines beneath; assert what it returns with `then result` or `then no result`. `then query` instead asserts a query after another action.',\n result: '`then result [exactly]` - one result the query performed by `when query` returns, in order; `then no result` - it returns nothing.',\n};\n\nexport const attributeDocs: Record<string, string> = {\n pii: '`@pii` \u2014 the value is personally identifiable information; Chronicle manages and erases it automatically wherever the concept is used. Add `pii reason \"...\"` in the concept body to record why.',\n sensitive: '`@sensitive` \u2014 the value is sensitive; Chronicle applies its sensitivity rules automatically wherever the concept is used. Add `sensitive reason \"...\"` in the concept body to record why.',\n};\n\nexport const contextVariableDocs: Record<string, string> = {\n '$context.occurred': 'When the command or query was received.',\n '$context.tenant': 'The tenant the command or query is executing for.',\n '$context.command': 'The command being handled, shaped by its `command` declaration.',\n '$context.arguments': 'The arguments of the query being performed.',\n '$context.causedBy': 'The identity that caused the command or query \u2014 `subject`, `name`, `userName`.',\n '$context.causedBy.subject': 'The subject of the identity that caused the command or query.',\n '$context.causedBy.name': 'The display name of the identity that caused the command or query.',\n '$context.causedBy.userName': 'The user name of the identity that caused the command or query.',\n '$context.causation': 'What caused the command or query \u2014 `type`, `occurred`, `properties`.',\n '$context.causation.type': 'What caused the command or query \u2014 a command, a reactor, a schedule.',\n '$context.identity': 'The caller a decision is made about \u2014 `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`.',\n '$context.identity.id': 'The identifier of the caller from the auth token.',\n '$context.identity.name': 'The display name of the caller.',\n '$context.identity.userName': 'The user name of the caller.',\n '$context.identity.isAuthenticated': 'Whether the caller is authenticated.',\n '$context.identity.roles': 'The roles the caller holds.',\n '$context.identity.claims': 'The claims the caller carries \u2014 `$context.identity.claims.<name>` reads one.',\n '$env': 'An environment variable, e.g. `$env.SERVICE_NAME`.',\n '$secrets': 'An encrypted secret resolved at runtime, e.g. `$secrets.azureAdClientId` \u2014 stays symbolic in the compiled tree.',\n '$strings': 'A localized string resolved from the `.strings` file of the active locale, e.g. `$strings.invoices.title`.',\n // Every $eventContext path the event-context catalog lists, for projections.\n ...Object.fromEntries(eventContextPaths.map((path) => [`$eventContext.${path.path}`, path.description])),\n};\n", "// 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 { namedRuleContext } from './named-rule-context';\nimport { eventSourceHover } from './event-source-authoring';\nimport { operationHover } from './operation-authoring';\nimport { DocumentSymbols } from './symbols';\nimport { responseAnalysis, responseAvailability } from './response-analysis';\nimport { enclosingChain, fenceMap, indentOf, withoutComment } from './document-context';\nimport { directBody, propertyTypeReference, scanDocument } from './symbols';\nimport { typeReferenceText } from './TypeReferenceSymbol';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { getSubLanguage } from './sub-language-registry';\nimport { attributeDocs, contextVariableDocs, handlerIntentDocs, keywordDocs, specificationKeywordDocs } from './keyword-docs';\n\n// Produces the hover markdown for a word at a position, without any editor\n// dependency \u2014 the Monaco service and the VSCode extension share this content.\n// Columns are 1-based, matching both editors' word-at-position APIs.\nexport function hoverContent(\n lines: string[],\n lineIndex: number,\n word: string,\n startColumn: number,\n endColumn: number,\n application?: DocumentSymbols,\n): string | null {\n const fences = fenceMap(lines);\n if (fences[lineIndex]) return null;\n\n const line = lines[lineIndex] ?? '';\n if (endColumn - 1 > withoutComment(line).length) return null;\n let inString = false;\n let inTemplate = false;\n for (let index = 0; index < startColumn - 1; index++) {\n if (line[index] === '\\\\' && inString) index++;\n else if (line[index] === '\"' && !inTemplate) inString = !inString;\n else if (line[index] === '`' && !inString) inTemplate = !inTemplate;\n }\n if (inString || inTemplate) return null;\n const sourceHover = eventSourceHover(lines, lineIndex, startColumn, endColumn, application);\n if (sourceHover) return sourceHover;\n const operation = operationHover(lines, lineIndex, startColumn, endColumn, application);\n if (operation) return operation;\n const tokenAt = (column: number, name: string): boolean => {\n const start = column + (line[column - 1] === '@' ? 1 : 0);\n return word === name && startColumn === start && endColumn === start + name.length && line.slice(start - 1, endColumn - 1) === name;\n };\n const before = line.charAt(startColumn - 2);\n\n if (before === '@') {\n const doc = attributeDocs[word];\n if (doc) return doc;\n }\n if (before === '$' || before === '.') {\n const variable = line.substring(0, endColumn - 1).match(/\\$[\\w.]*$/)?.[0];\n if (variable) {\n const doc =\n contextVariableDocs[variable] ??\n (variable.startsWith('$env') ? contextVariableDocs['$env'] : undefined);\n if (doc) return doc;\n }\n }\n\n // Do not mistake a property/type named optional for the contextual modifier.\n const prefix = line.slice(0, startColumn - 1);\n // Commit to query-parameter context before matching the name and type.\n const followsPropertyType = /^\\s*(?:by|filter)\\s+/.test(prefix)\n ? /^\\s*(?:by|filter)\\s+[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+$/.test(prefix)\n : /^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+$/.test(prefix);\n const followsQueryType = /^\\s*query\\s+\\w+\\s*=>\\s*(?:observable\\s+)?[\\w.]+(?:\\[\\])?\\s+$/.test(prefix) &&\n !/^\\s*query\\s+\\w+\\s*=>\\s*observable\\s+$/.test(prefix);\n if (word === 'optional' && (followsPropertyType || followsQueryType)) {\n return `**optional** \u2014 ${keywordDocs.optional}`;\n }\n\n if (word === 'implementation' || word === 'hint') {\n const chain = enclosingChain(lines, fences, lineIndex, indentOf(line));\n const ruleContext = namedRuleContext(lines, lineIndex, indentOf(line));\n if ((word === 'implementation' && ruleContext === 'rule' && /^\\s*implementation\\s*$/.test(withoutComment(line))) ||\n (word === 'hint' && ruleContext === 'implementation' && /^\\s*hint\\s+\"/.test(line))) {\n return `**${word}** \u2014 Command named-rule guidance with at most one file or tagged fence. No payload means pending and fails binding (PLAY0268). Attached predicates keep their existing pure RuleContext contract; reference execution is unsupported, never confirmation.`;\n }\n if (word === 'implementation' && chain[0] === 'handler' && /^\\s*implementation\\s*$/.test(withoutComment(line))) {\n return `**implementation** \u2014 ${handlerIntentDocs.implementation}`;\n }\n if (word === 'hint' && chain[0] === 'implementation' && chain[1] === 'handler' && /^\\s*hint\\s+\"/.test(line)) {\n return `**hint** \u2014 ${handlerIntentDocs.hint}`;\n }\n }\n\n const symbols = scanDocument(lines);\n const owner = symbols.commands.filter(command => command.line < lineIndex).at(-1);\n const property = owner?.properties.find(property => property.name === word && property.line === lineIndex);\n if (property?.isGenerated || (word === 'generated' && owner?.properties.some(property => property.isGenerated && property.line === lineIndex) && followsPropertyType)) {\n return `**${property?.name ?? 'generated'}** \u2014 ${property ? typeReferenceText(propertyTypeReference(property)) + '. ' : ''}Generated value, not a request or form input. ${responseAvailability}`;\n }\n const response = owner?.response;\n if (response?.location.line === lineIndex + 1 && (tokenAt(response.location.column, 'returns') || (response.kind === 'ScalarCommandResponseSyntax' && tokenAt(response.source.location.column, response.source.property)))) {\n const source = response.kind === 'ScalarCommandResponseSyntax' ? owner?.properties.find(property => property.name === response.source.property) : undefined;\n return `**returns**${source ? ` \u2014 ${typeReferenceText(propertyTypeReference(source))}` : ' \u2014 unnamed record response'}. ${responseAvailability}`;\n }\n if (response?.kind === 'RecordCommandResponseSyntax') {\n const field = response.fields.find(field => field.location.line === lineIndex + 1 && (tokenAt(field.location.column, field.name) || tokenAt(field.source.location.column, field.source.property)));\n if (field) {\n const source = owner?.properties.find(property => property.name === field.source.property);\n const type = field.type ? typeReferenceText(field.type) : source ? typeReferenceText(propertyTypeReference(source)) : 'Unresolved type';\n return `**${field.name}** \u2014 ${type}${field.type ? ' (explicit)' : ' (inferred)'} = ${field.source.property}. ${source?.isGenerated ? 'Generated source, not request input. ' : ''}${responseAvailability}`;\n }\n }\n for (const specification of responseAnalysis(lines).specifications.values()) {\n if ((word === 'returns' && specification.thenReturns?.location.line === lineIndex + 1) || (word === 'generated' && specification.when?.generatedValues?.some(value => value.location.line === lineIndex + 1))) return responseAvailability;\n }\n\n const concept = symbols.concepts.find((candidate) => candidate.name === word);\n if (concept) {\n const attributes = concept.attributes.length ? ` ${concept.attributes.join(' ')}` : '';\n const values = concept.enumValues.length\n ? `\\n\\nValues: ${concept.enumValues.join(', ')}`\n : '';\n const reasons = Object.entries(concept.attributeReasons)\n .map(([attribute, reason]) => `\\n\\n**@${attribute}** \u2014 ${reason}`)\n .join('');\n return `\\`\\`\\`screenplay\\nconcept ${concept.name} : ${concept.primitive}${attributes}\\n\\`\\`\\`${reasons}${values}`;\n }\n\n const type = symbols.types.find((candidate) => candidate.name === word);\n if (type) {\n const properties = type.properties\n .map((property) => `${property.name} ${typeReferenceText(propertyTypeReference(property))}`)\n .join('\\n');\n return `\\`\\`\\`screenplay\\ntype ${type.name}\\n${properties}\\n\\`\\`\\``;\n }\n\n const policy = symbols.policies.find((candidate) => candidate.name === word);\n if (policy) {\n const body = policy.requires.length ? policy.requires.join('\\n') : '(custom C#)';\n return `\\`\\`\\`screenplay\\npolicy ${policy.name}\\n${body}\\n\\`\\`\\``;\n }\n\n const event = symbols.events.find((candidate) => candidate.name === word && candidate.line === lineIndex) ??\n symbols.events.filter((candidate) => candidate.name === word)\n .sort((left, right) => (right.generation ?? 1) - (left.generation ?? 1))[0];\n if (event) {\n const properties = event.properties\n .map((property) => `${property.name} ${typeReferenceText(propertyTypeReference(property))}`)\n .join('\\n');\n return `\\`\\`\\`screenplay\\nevent ${event.name}${event.generation !== undefined ? ` generation ${event.generation}` : ''}\\n${properties}\\n\\`\\`\\``;\n }\n\n const command = symbols.commands.find((candidate) => candidate.name === word);\n if (command && command.properties.length > 0) {\n const properties = command.properties\n .map(\n (property) =>\n `${property.name} ${typeReferenceText(propertyTypeReference(property))}${property.isGenerated ? ' generated' : ''}${property.isIdentifier ? ' identifier' : ''}`,\n )\n .join('\\n');\n return `\\`\\`\\`screenplay\\ncommand ${command.name}\\n${properties}\\n\\`\\`\\`${command.response || command.properties.some(property => property.isGenerated) ? `\\n\\n${responseAvailability}` : ''}`;\n }\n\n // Sub-language keywords take precedence inside their construct.\n const chain = enclosingChain(lines, fences, lineIndex, indentOf(line));\n for (const construct of [line.trim().split(/\\s+/)[0], ...chain]) {\n const subLanguage = getSubLanguage(construct ?? '');\n const doc = subLanguage?.hovers?.[word];\n if (doc) return doc;\n }\n\n if (word === 'reads' && (chain[0] === 'every' || chain[0] === 'at') && chain.includes('reaction')) {\n return '**reads** \u2014 Declares a whole view this clock trigger consults: `reads <View>`. Clock triggers take no values, so `by` is unavailable.';\n }\n\n const step = line.trim().match(/^(given|when|then)\\s+(?:no\\s+)?(\\w+)/);\n if (step && step[2] === word && chain[0] === 'specification' && specificationKeywordDocs[word]) {\n return `**${word}** \u2014 ${specificationKeywordDocs[word]}`;\n }\n\n if (word === 'id' || word === 'documentation') {\n const source = eventAnalysisSource(lines);\n const inEvent = symbols.events.some(event => directBody(source, fences, event.line, indentOf(source[event.line])).includes(lineIndex));\n const directive = word === 'id' ? /^\\s*id\\s+\"/.test(source[lineIndex]) : /^\\s*documentation\\s*$/.test(source[lineIndex]);\n if (!inEvent || !directive || startColumn !== indentOf(line) + 1) return null;\n }\n\n if (word === 'optional' || word === 'generated' || word === 'returns') return null;\n const keywordDoc = keywordDocs[word];\n if (keywordDoc) return `**${word}** \u2014 ${keywordDoc}`;\n\n return null;\n}\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { languages } from 'monaco-editor';\nimport { hoverContent } from './hover-content';\nimport { CompletionOptions } from './completions';\n\nexport function createHoverProvider(options: CompletionOptions = {}): languages.HoverProvider {\n return {\n provideHover(model, position) {\n const word = model.getWordAtPosition(position);\n if (!word) return null;\n\n const content = hoverContent(\n model.getLinesContent(),\n position.lineNumber - 1,\n word.word,\n word.startColumn,\n word.endColumn,\n options.application?.(model),\n );\n return content ? { contents: [{ value: content }] } : null;\n },\n };\n}\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { languages } from 'monaco-editor';\nimport { destinationHints } from './production-destinations';\nimport { CompletionOptions } from './completions';\n\nexport function createInlayHintsProvider(options: CompletionOptions = {}): languages.InlayHintsProvider {\n return {\n provideInlayHints(model, range) {\n const hints = destinationHints(model.getLinesContent(), options.application?.(model)).filter(hint => hint.line + 1 >= range.startLineNumber && hint.line + 1 <= range.endLineNumber);\n return {\n hints: hints.map(hint => ({ position: { lineNumber: hint.line + 1, column: hint.column }, label: hint.label, paddingLeft: true })),\n dispose() {},\n };\n },\n };\n}\n", "// 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, IRange, languages } from 'monaco-editor';\nimport { DiagnosticCodes, isQuickFixDiagnostic, prepareQuickFixes } from '@cratis/screenplay-compiler';\n\nconst migrateOptional = 'source.screenplay.migrateOptional';\nconst containsKind = (requested: string, kind: string) => requested === '' || requested === kind || kind.startsWith(`${requested}.`);\n\nfunction intersects(left: IRange, right: IRange): boolean {\n return (left.startLineNumber < right.endLineNumber || (left.startLineNumber === right.endLineNumber && left.startColumn <= right.endColumn)) &&\n (right.startLineNumber < left.endLineNumber || (right.startLineNumber === left.endLineNumber && right.startColumn <= left.endColumn));\n}\n\n// The compiler owns recipes and verification. The adapter only translates verified offsets and pins\n// edits to the analyzed buffer version, so future fixes need no editor-specific parsing or .NET bridge.\nexport function createCodeActionProvider(placement?: readonly string[]): languages.CodeActionProvider {\n const cache = new WeakMap<editor.ITextModel, { version: number; placement: string; fixes: ReturnType<typeof prepareQuickFixes> }>();\n return {\n provideCodeActions(model, range, context, token) {\n const migrationRequested = context.only !== undefined && containsKind(context.only, migrateOptional);\n const migrationOnly = context.only !== undefined && migrationRequested && !containsKind(context.only, 'quickfix');\n if (token.isCancellationRequested || (context.only !== undefined && !migrationRequested && !containsKind(context.only, 'quickfix'))) return { actions: [], dispose() {} };\n const diagnostics = context.markers.filter(marker => {\n const code = typeof marker.code === 'object' ? marker.code.value : marker.code;\n return isQuickFixDiagnostic(code) && intersects(marker, range);\n });\n if (!migrationRequested && diagnostics.length === 0) return { actions: [], dispose() {} };\n const version = model.getVersionId();\n const placementKey = JSON.stringify(placement) ?? '';\n let analysis = cache.get(model);\n if (analysis?.version !== version || analysis.placement !== placementKey) {\n analysis = { version, placement: placementKey, fixes: prepareQuickFixes(model.getValue(), { placement }) };\n cache.set(model, analysis);\n }\n const occurrences = migrationOnly ? [] : analysis.fixes(diagnostics.map(diagnostic => ({\n line: diagnostic.startLineNumber,\n diagnosticCode: String(typeof diagnostic.code === 'object' ? diagnostic.code.value : diagnostic.code),\n }))).filter(fix => fix.scope === 'occurrence');\n const requested = [...occurrences, ...(context.only === undefined || migrationRequested ? analysis.fixes(undefined, DiagnosticCodes.LegacyOptionalSuffix) : [])];\n const fixes = requested.filter(fix => context.only === undefined || containsKind(context.only, fix.scope === 'document' ? migrateOptional : 'quickfix'));\n if (token.isCancellationRequested || model.getVersionId() !== version) return { actions: [], dispose() {} };\n return {\n actions: fixes.map(fix => ({\n title: fix.title,\n kind: fix.scope === 'document' ? migrateOptional : 'quickfix',\n isPreferred: fix.scope === 'occurrence',\n edit: { edits: fix.edits.map(edit => {\n const start = model.getPositionAt(edit.start);\n const end = model.getPositionAt(edit.start + edit.length);\n return { resource: model.uri, versionId: version, textEdit: {\n range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column },\n text: edit.text,\n } };\n }) },\n })),\n dispose() {},\n };\n },\n };\n}\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { editor } from 'monaco-editor';\nimport { Monaco, languageId } from './language';\nimport { validateLines } from './validation';\nimport { CompletionOptions } from './completions';\nimport { symbolsForBuffer } from './symbols';\n\nconst owner = 'screenplay';\nconst validationDelay = 300;\n\nexport function validate(monaco: Monaco, model: editor.ITextModel, options: CompletionOptions = {}): editor.IMarkerData[] {\n const lines = model.getLinesContent();\n const application = symbolsForBuffer(lines, options.application?.(model));\n return validateLines(lines, { application, path: application.authoringPath, placement: application.authoringPlacement }).map((issue) => ({\n severity:\n issue.severity === 'error'\n ? monaco.MarkerSeverity.Error\n : issue.severity === 'information'\n ? monaco.MarkerSeverity.Info\n : monaco.MarkerSeverity.Warning,\n tags: issue.code === 'PLAY0479' ? [monaco.MarkerTag.Deprecated] : undefined,\n message: issue.message,\n code: issue.code,\n startLineNumber: issue.line + 1,\n startColumn: issue.startColumn,\n endLineNumber: issue.line + 1,\n endColumn: issue.endColumn,\n }));\n}\n\nfunction watch(monaco: Monaco, model: editor.ITextModel, options: CompletionOptions): void {\n let handle: ReturnType<typeof setTimeout> | undefined;\n\n const run = () => {\n if (model.isDisposed()) return;\n if (model.getLanguageId() !== languageId) {\n monaco.editor.setModelMarkers(model, owner, []);\n return;\n }\n monaco.editor.setModelMarkers(model, owner, validate(monaco, model, options));\n };\n const schedule = () => {\n if (handle !== undefined) clearTimeout(handle);\n handle = setTimeout(run, validationDelay);\n };\n\n const contextChange = options.onDidChangeApplication?.(run);\n model.onDidChangeContent(schedule);\n model.onDidChangeLanguage(run);\n model.onWillDispose(() => {\n contextChange?.dispose();\n if (handle !== undefined) clearTimeout(handle);\n });\n run();\n}\n\nexport function attachDiagnostics(monaco: Monaco, options: CompletionOptions = {}): void {\n monaco.editor.getModels().forEach((model) => watch(monaco, model, options));\n monaco.editor.onDidCreateModel((model) => watch(monaco, model, options));\n}\n", "// 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// Projection Declaration Language (PDL) \u2014 embedded inside `projection` blocks.\n// See https://www.cratis.io/chronicle/projections/projection-declaration-language/grammar/\nexport const pdl: SubLanguageDefinition = {\n tokens: [\n [\n /\\b(?:from|every|all|nested|join|children|identified|by|key|parent|with|remove|via|clear|on|sequence|automap|no|exclude|literal|set|increment|decrement|add|subtract|count)\\b/,\n 'keyword',\n ],\n ],\n completions: [\n {\n label: 'key',\n insertText: 'key ${1:property}',\n documentation: 'Declares which property identifies the read model instance.',\n },\n {\n label: 'from',\n insertText: 'from ${1:EventType}',\n documentation: 'Maps properties from an event onto the read model.',\n },\n {\n label: 'join',\n insertText: 'join ${1:property} on ${2:key}',\n documentation: 'Joins related state onto the read model by a key property.',\n },\n {\n label: 'children',\n insertText: 'children ${1:collection} identified by ${2:key}',\n documentation: 'Projects events into a child collection on the read model.',\n },\n {\n label: 'remove with',\n insertText: 'remove with ${1:EventType}',\n documentation: 'Removes the read model instance when the event occurs.',\n },\n {\n label: 'parent',\n insertText: 'parent ${1:property}',\n documentation: 'Declares the property that identifies the parent of a child.',\n },\n {\n label: 'clear',\n insertText: 'clear ${1:property}',\n documentation: 'Removes the value a property holds when the event occurs.',\n },\n {\n label: 'increment',\n insertText: 'increment ${1:property}',\n documentation: 'Increments a numeric property when the event occurs.',\n },\n {\n label: 'decrement',\n insertText: 'decrement ${1:property}',\n documentation: 'Decrements a numeric property when the event occurs.',\n },\n ],\n hovers: {\n from: 'PDL \u2014 maps properties from an event onto the read model.',\n every: 'PDL \u2014 applies property mappings for every event type in the projection.',\n join: 'PDL \u2014 joins related state onto the read model by a key property.',\n children: 'PDL \u2014 projects events into a child collection on the read model.',\n identified: 'PDL \u2014 introduces the identifying key of a child collection.',\n key: 'PDL \u2014 declares which property identifies the read model instance.',\n parent: 'PDL \u2014 declares the property that identifies the parent of a child.',\n remove: 'PDL \u2014 removes the read model instance when an event occurs.',\n clear: 'PDL \u2014 clear <property> removes the value a property holds; clear with <EventType> nulls a nested object.',\n increment: 'PDL \u2014 increments a numeric property when the event occurs.',\n decrement: 'PDL \u2014 decrements a numeric property when the event occurs.',\n },\n};\n", "// 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) \u2014 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)\\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 \u2014 declares where the captured data comes from.',\n api: 'CDL \u2014 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 \u2014 optional path appended to an API source\\'s External Service base URL.',\n poll: 'CDL \u2014 the polling interval for an API source, e.g. 5m.',\n path: 'CDL \u2014 the inbound path a webhook source listens on.',\n topic: 'CDL \u2014 the topic a message source subscribes to.',\n key: 'CDL \u2014 declares which source property identifies an instance.',\n map: 'CDL \u2014 maps and translates source values before events are appended.',\n translate: 'CDL \u2014 translates source values into Screenplay values.',\n append: 'CDL \u2014 appends an event when the source data changes.',\n when: 'CDL \u2014 the change condition: a property change, added, or removed.',\n added: 'CDL \u2014 matches items that appear in the source.',\n removed: 'CDL \u2014 matches items that disappear from the source.',\n children: 'CDL \u2014 captures changes in a child collection of the source data.',\n identified: 'CDL \u2014 introduces the identifying key of a child collection.',\n },\n};\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { editor } from 'monaco-editor';\n\nexport const screenplayDarkThemeName = 'screenplay-dark';\n\nexport const screenplayDark: editor.IStandaloneThemeData = {\n base: 'vs-dark',\n inherit: true,\n rules: [\n { token: 'keyword.play', foreground: 'C586C0' },\n { token: 'keyword.tag.play', foreground: '569CD6', fontStyle: 'italic' },\n { token: 'keyword.type.play', foreground: '4FC1FF', fontStyle: 'bold' },\n { token: 'type.play', foreground: '4EC9B0' },\n { token: 'type.identifier.play', foreground: '4EC9B0' },\n { token: 'identifier.play', foreground: '9CDCFE' },\n { token: 'annotation.play', foreground: 'DCDCAA' },\n { token: 'variable.predefined.play', foreground: 'D7BA7D' },\n { token: 'string.play', foreground: 'CE9178' },\n { token: 'string.link.play', foreground: 'CE9178', fontStyle: 'underline' },\n { token: 'string.invalid.play', foreground: 'F44747' },\n { token: 'string.quote.play', foreground: '6A9955' },\n { token: 'number.play', foreground: 'B5CEA8' },\n { token: 'number.float.play', foreground: 'B5CEA8' },\n { token: 'comment.play', foreground: '6A9955', fontStyle: 'italic' },\n { token: 'operator.play', foreground: 'D4D4D4' },\n { token: 'delimiter.play', foreground: 'CCCCCC' },\n ],\n colors: {\n 'editor.background': '#1E1E1E',\n },\n};\n", "// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { editor } from 'monaco-editor';\n\nexport const screenplayLightThemeName = 'screenplay-light';\n\nexport const screenplayLight: editor.IStandaloneThemeData = {\n base: 'vs',\n inherit: true,\n rules: [\n { token: 'keyword.play', foreground: 'AF00DB' },\n { token: 'keyword.tag.play', foreground: '0000FF', fontStyle: 'italic' },\n { token: 'keyword.type.play', foreground: '0070C1', fontStyle: 'bold' },\n { token: 'type.play', foreground: '267F99' },\n { token: 'type.identifier.play', foreground: '267F99' },\n { token: 'identifier.play', foreground: '001080' },\n { token: 'annotation.play', foreground: '795E26' },\n { token: 'variable.predefined.play', foreground: 'B45309' },\n { token: 'string.play', foreground: 'A31515' },\n { token: 'string.link.play', foreground: 'A31515', fontStyle: 'underline' },\n { token: 'string.invalid.play', foreground: 'CD3131' },\n { token: 'string.quote.play', foreground: '008000' },\n { token: 'number.play', foreground: '098658' },\n { token: 'number.float.play', foreground: '098658' },\n { token: 'comment.play', foreground: '008000', fontStyle: 'italic' },\n { token: 'operator.play', foreground: '000000' },\n { token: 'delimiter.play', foreground: '000000' },\n ],\n colors: {\n 'editor.background': '#FFFFFF',\n },\n};\n", "// 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 {\n Monaco,\n languageConfiguration,\n languageExtensionPoint,\n languageId,\n} from './language';\nimport { createTokensProvider } from './tokens';\nimport { CompletionOptions, createCompletionProvider } from './completions';\nimport { createInlineCompletionProvider } from './inline-completions';\nimport { responseTokens, responseTokenTypes } from './response-tokens';\nimport { createHoverProvider } from './hover';\nimport { createInlayHintsProvider } from './inlay-hints';\nimport { eventSourceIdentifier, eventSourceReferenceAt } from './event-source-authoring';\nimport { createCodeActionProvider } from './code-actions';\nimport { attachDiagnostics } from './diagnostics';\nimport {\n getSubLanguage,\n getSubLanguages,\n onSubLanguagesChanged,\n registerSubLanguage,\n} from './sub-language-registry';\nimport { pdl } from './sub-languages/pdl';\nimport { cdl } from './sub-languages/cdl';\nimport { screenplayDark, screenplayDarkThemeName } from './themes/screenplay-dark';\nimport { screenplayLight, screenplayLightThemeName } from './themes/screenplay-light';\n\nconst registeredInstances = new Set<Monaco>();\n\nfunction applyTokensProvider(monaco: Monaco): void {\n monaco.languages.setMonarchTokensProvider(languageId, createTokensProvider(getSubLanguages()));\n}\n\n// Sub-languages registered after register() recompose the tokenizer on the fly.\nonSubLanguagesChanged(() => registeredInstances.forEach(applyTokensProvider));\n\n// Registers the built-in PDL and CDL sub-languages. Hosts that do not go through\n// register() \u2014 such as the VSCode extension \u2014 call this before using the registry.\nexport function ensureBuiltInSubLanguages(): void {\n if (!getSubLanguage('projection')) registerSubLanguage('projection', pdl);\n if (!getSubLanguage('capture')) registerSubLanguage('capture', cdl);\n}\n\n// What a host can tell the language service beyond the models it holds.\nexport type LanguageServiceOptions = CompletionOptions;\n\nexport function register(monaco: Monaco, options: LanguageServiceOptions = {}): void {\n if (registeredInstances.has(monaco)) return;\n\n ensureBuiltInSubLanguages();\n\n registeredInstances.add(monaco);\n\n monaco.languages.register(languageExtensionPoint);\n monaco.languages.setLanguageConfiguration(languageId, languageConfiguration);\n applyTokensProvider(monaco);\n monaco.languages.registerCompletionItemProvider(languageId, createCompletionProvider(monaco, options));\n monaco.languages.registerInlineCompletionsProvider(languageId, createInlineCompletionProvider(options));\n monaco.languages.registerHoverProvider(languageId, createHoverProvider(options));\n monaco.languages.registerDefinitionProvider(languageId, {\n provideDefinition(model, position) {\n const word = model.getWordAtPosition(position);\n if (!word) return [];\n const symbols = options.application?.(model);\n const reference = eventSourceReferenceAt(model.getLinesContent(), position.lineNumber - 1, word.startColumn, word.endColumn, symbols);\n const target = reference?.target;\n if (!target) return [];\n const current = symbols?.authoringPath ?? 'current.play';\n const source = target.location.path === current ? model.getValue() : symbols?.authoringDocuments?.find(document => document.path === target.location.path)?.source;\n const location = source && eventSourceIdentifier(target.location, target.name, source);\n if (!location) return [];\n // Foreign navigation requires an actual host model, not a guessed path or merged line.\n const targetUri = target.location.path && model.uri.path.endsWith(`/${current}`)\n ? model.uri.with({ path: model.uri.path.slice(0, -current.length) + target.location.path }) : undefined;\n const targetModels = targetUri ? monaco.editor.getModels().filter(candidate => candidate.uri.toString() === targetUri.toString()) : [];\n const targetModel = target.location.path === current ? model : targetModels.length === 1 ? targetModels[0] : undefined;\n return targetModel ? [{ uri: targetModel.uri, range: new monaco.Range(location.line, location.column, location.line, location.column + target.name.length) }] : [];\n }\n });\n monaco.languages.registerDocumentSemanticTokensProvider(languageId, {\n getLegend: () => ({ tokenTypes: [...responseTokenTypes], tokenModifiers: [] }),\n provideDocumentSemanticTokens(model) {\n const data: number[] = [];\n let previousLine = 0;\n let previousColumn = 0;\n for (const token of responseTokens(model.getLinesContent(), options.application?.(model))) {\n data.push(token.line - previousLine, token.line === previousLine ? token.column - previousColumn : token.column, token.length, token.type, 0);\n previousLine = token.line;\n previousColumn = token.column;\n }\n return { data: new Uint32Array(data) };\n },\n releaseDocumentSemanticTokens() {},\n });\n monaco.languages.registerInlayHintsProvider(languageId, createInlayHintsProvider(options));\n monaco.languages.registerCodeActionProvider(languageId, createCodeActionProvider());\n monaco.editor.defineTheme(screenplayDarkThemeName, screenplayDark);\n monaco.editor.defineTheme(screenplayLightThemeName, screenplayLight);\n attachDiagnostics(monaco, options);\n}\n\nexport {\n causedByProperties,\n clauseKeywords,\n codeBlockTags,\n conceptAttributes,\n constructKeywords,\n contextRoots,\n languageId,\n primitiveTypes,\n sliceTypes,\n} from './language';\nexport type { Monaco } from './language';\nexport { getSubLanguage, getSubLanguages, registerSubLanguage } from './sub-language-registry';\nexport type {\n MonarchTokenRules,\n SubLanguage,\n SubLanguageCompletion,\n SubLanguageDefinition,\n} from './sub-language-registry';\nexport { pdl } from './sub-languages/pdl';\nexport { cdl } from './sub-languages/cdl';\nexport { screenplayDarkThemeName } from './themes/screenplay-dark';\nexport { screenplayLightThemeName } from './themes/screenplay-light';\nexport { enclosingChain, fenceMap, firstWord, indentOf, withoutComment } from './document-context';\nexport {\n fileReferenceKeyword,\n fileReferenceOn,\n fileReferences,\n isAbsoluteFileReferencePath,\n} from './file-references';\nexport type { FileReference } from './file-references';\nexport { fileImportOn, fileImports, importablePaths, isFileImportLine } from './file-imports';\nexport type { FileImport } from './file-imports';\nexport type { CompletionOptions } from './completions';\nexport { builtInTriggerNames, knownEventNames, knownTriggerNames, knownTypeNames, mergeSymbols, scanDocument, symbolsForBuffer } from './symbols';\nexport type {\n CommandSymbol,\n ConceptSymbol,\n DocumentSymbols,\n EventSymbol,\n ImportSymbol,\n NamedSymbol,\n PolicySymbol,\n PropertySymbol,\n ReadSymbol,\n QuerySymbol,\n TypeSymbol,\n} from './symbols';\nexport { attributeDocs, contextVariableDocs, keywordDocs, specificationKeywordDocs } from './keyword-docs';\nexport { eventContextMemberAt, eventContextMembers, eventContextMembersAfter, eventContextPaths, namesEventContextMember } from './event-context';\nexport type { EventContextMember, EventContextPath } from './event-context';\nexport { contextVariableItems, producesItems, specificationStepItems } from './completion-items';\nexport type { CompletionEntry } from './completion-items';\nexport { completionEntriesFor, planCompletions } from './completion-planner';\nexport type { CompletionPlan } from './completion-planner';\nexport { responseTokens, responseTokenTypes } from './response-tokens';\nexport { responseCompletions } from './response-completions';\nexport { structureCompletion } from './structure-completions';\nexport { blockHeaderPattern } from './language';\nexport type { StructureCompletion } from './structure-completions';\nexport { analyzeEventSources, eventSourceAvailability, eventSourceCompletions, eventSourceDetails, eventSourceHover, eventSourceIdentifier, eventSourceReferenceAt } from './event-source-authoring';\nexport type { EventSourceAnalysis } from './EventSourceAnalysis';\nexport type { AuthoredEventSource } from './AuthoredEventSource';\nexport type { AuthoredStream } from './AuthoredStream';\nexport type { AuthoredCommandRoute } from './AuthoredCommandRoute';\nexport type { AuthoredSpecificationEvent } from './AuthoredSpecificationEvent';\nexport { analyzeOperations, operationCompletions, operationDetails, operationAvailability, operationHover, operationReferenceAt, phaseState } from './operation-authoring';\nexport type { OperationAnalysis, OperationDeclaration, OperationInput, OperationPhase, OperationReference, SystemDeclaration } from './OperationAnalysis';\nexport { responseAvailability, responseAnalysis } from './response-analysis';\nexport { hoverContent } from './hover-content';\nexport { validateLines } from './validation';\nexport { destinationHints, productionDestinations } from './production-destinations';\nexport type { DestinationHint } from './DestinationHint';\nexport type { ProductionSymbol } from './ProductionSymbol';\nexport type { ValidationContext, ValidationIssue, ValidationSeverity } from './validation';\nexport { createCodeActionProvider } from './code-actions';\nexport { typeReferenceSymbol, typeReferenceText } from './TypeReferenceSymbol';\nexport type { TypeReferenceSymbol } from './TypeReferenceSymbol';\nexport { diagnosticCodes } from './diagnostic-codes';\nexport type { DiagnosticCode } from './diagnostic-codes';\n"],
5
+ "mappings": "+fAMA,IAAMA,GAAO,6BACPC,GAASC,EAACC,GAAkB,MAAMA,EAAM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AAS,OAASL,EAAO,KAAK,MAAM,CAAE,CAAC,EAAI,CAAC,CACrK,CACJ,CAAC,EACDtB,EAAO,UAAU,uCAAuCC,EAAY,CAChE,UAAWG,EAAA,KAAO,CAAE,WAAY,CAAC,GAAG6B,EAAkB,EAAG,eAAgB,CAAC,CAAE,GAAjE,aACX,8BAA8Bf,EAAO,CACjC,IAAMgB,EAAiB,CAAC,EACpBC,EAAe,EACfC,EAAiB,EACrB,QAAWC,KAASC,GAAepB,EAAM,gBAAgB,EAAGN,EAAQ,cAAcM,CAAK,CAAC,EACpFgB,EAAK,KAAKG,EAAM,KAAOF,EAAcE,EAAM,OAASF,EAAeE,EAAM,OAASD,EAAiBC,EAAM,OAAQA,EAAM,OAAQA,EAAM,KAAM,CAAC,EAC5IF,EAAeE,EAAM,KACrBD,EAAiBC,EAAM,OAE3B,MAAO,CAAE,KAAM,IAAI,YAAYH,CAAI,CAAE,CACzC,EACA,+BAAgC,CAAC,CACrC,CAAC,EACDlC,EAAO,UAAU,2BAA2BC,EAAYsC,GAAyB3B,CAAO,CAAC,EACzFZ,EAAO,UAAU,2BAA2BC,EAAYuC,GAAyB,CAAC,EAClFxC,EAAO,OAAO,YAAYyC,GAAyBC,EAAc,EACjE1C,EAAO,OAAO,YAAY2C,GAA0BC,EAAe,EACnEC,GAAkB7C,EAAQY,CAAO,EACrC,CArDgBR,EAAAO,GAAA",
6
+ "names": ["word", "escape", "__name", "value", "ranges", "result", "start", "bmpWordCharacters", "contextualConstructs", "embeddedLanguages", "subLanguageState", "keyword", "__name", "subLanguageExitRule", "subLanguages", "exitKeywords", "constructKeywords", "subLanguage", "commonTokenRules", "createTokensProvider", "tokenizer", "bmpWordCharacters", "codeBlockTags", "tag", "clauseKeywords", "sliceTypes", "primitiveTypes", "interactionItems", "moduleScopeItems", "featureScopeItems", "readModelItems", "reducerItems", "formItems", "contributeItems", "behaviorItems", "step", "__name", "label", "insertText", "documentation", "actionStepItems", "outcomeItems", "personaItems", "authenticationItems", "seedItems", "themeItems", "uiProfileItems", "layoutItems", "templateItems", "optionalTypeItems", "fenced", "__name", "tag", "topLevelItems", "operationItems", "operationImplementationItems", "language", "operationPhaseItems", "item", "conceptItems", "typeItems", "sliceItems", "commandItems", "eventItems", "inlineEventItems", "producesItems", "implementationItems", "handlerItems", "queryItems", "performerItems", "constraintItems", "reactionItems", "reactionTriggerItems", "triggerItems", "specificationItems", "specificationStepItems", "namedRuleImplementationItems", "commandRuleItems", "ruleItems", "policyItems", "validateItems", "screenItems", "actionItems", "tableItems", "contextVariableItems", "eventContextPaths", "path", "sliceMembers", "sliceItemsFor", "sliceType", "members", "responseCompletions", "lines", "line", "before", "symbols", "fences", "fenceMap", "withoutComment", "indent", "indentOf", "chain", "enclosingChain", "enclosing", "nearestEnclosingLine", "namedCommand", "__name", "name", "matches", "command", "entry", "property", "insertText", "typeReferenceText", "propertyTypeReference", "responseAvailability", "scanDocument", "modifier", "word", "concept", "optionalTypeItems", "type", "primitiveTypes", "specification", "responseAnalysis", "properties", "field", "source", "operationAvailability", "analyzeOperations", "lines", "symbols", "responseAnalysis", "source", "__name", "phaseState", "phase", "operationDetails", "operation", "inputs", "input", "typeReferenceText", "name", "value", "hint", "operationCompletions", "line", "before", "fences", "fenceMap", "withoutComment", "indent", "indentOf", "chain", "enclosingChain", "enclosing", "nearestEnclosingLine", "analysis", "operations", "context", "targets", "qualifiers", "target", "part", "index", "event", "ownedOperation", "system", "operationImplementationItems", "operationPhaseItems", "production", "targetLine", "inProductionBody", "mappedOperation", "rhs", "properties", "parts", "property", "types", "type", "concept", "operationItems", "declaration", "reference", "operationReferenceAt", "start", "end", "operationHover", "at", "location", "column", "equals", "command", "text", "header", "systems", "eventSourceAvailability", "specificationRouteAvailability", "routePrefix", "sourceStreamPattern", "keyPrefix", "identifierTypePrefix", "streamTypePrefix", "analyzeEventSources", "lines", "symbols", "symbolsForBuffer", "responseAnalysis", "source", "__name", "eventSourceDetails", "stream", "typeReferenceText", "eventSourceReferenceAt", "line", "start", "end", "analysis", "at", "route", "location", "name", "withoutComment", "candidate", "resolution", "sourcePart", "eventSourceIdentifier", "prefix", "eventSourceHover", "reference", "context", "declaration", "confidence", "mapping", "expression", "typed", "parts", "properties", "optional", "collection", "index", "part", "matches", "property", "types", "type", "indentOf", "eventSourceCompletions", "before", "fenceMap", "indent", "target", "primitive", "concept", "literal", "qualified", "isSourceStreamName", "matching", "entry", "names", "concepts", "ownsStream", "streamId", "isSourceStreamTypeName", "commandNamedRulePattern", "bmpWordCharacters", "namedRuleContext", "lines", "lineIndex", "indent", "fences", "fenceMap", "owners", "boundary", "index", "line", "withoutComment", "indentOf", "wrapped", "offset", "__name", "exampleUuid", "primitiveExamples", "exampleValueFor", "type", "symbols", "bare", "primitive", "concept", "__name", "lastIndexWhere", "lines", "matches", "index", "__name", "upperCamelWords", "name", "pastTense", "verb", "likelyEventName", "command", "symbols", "subject", "noun", "event", "indentUnit", "indented", "indentOf", "indent", "producesBlock", "unit", "eventName", "declared", "inner", "sources", "property", "mappings", "source", "identifier", "newCommandBlock", "identity", "concept", "identityLine", "properties", "propertyLines", "outcome", "line", "assignments", "exampleValueFor", "sliceCommand", "fences", "headerIndex", "sliceIndex", "authorized", "symbol", "candidate", "specificationBlock", "structureCompletion", "lineIndex", "textBefore", "textAfter", "fenceMap", "previous", "withoutComment", "previousLine", "opensEmptyBlock", "header", "nearestEnclosingLine", "headerIndent", "pad", "wrap", "block", "headerLine", "found", "form", "subLanguages", "listeners", "registerSubLanguage", "keyword", "definition", "listener", "__name", "getSubLanguages", "getSubLanguage", "onSubLanguagesChanged", "RULE_LINE_PATTERN", "declaredIn", "__name", "document", "keyword", "line", "topLevelEntries", "topLevelItems", "item", "isTemplate", "header", "expansionEntry", "text", "indent", "relative", "index", "indentOf", "completionEntriesFor", "chain", "where", "construct", "subLanguage", "getSubLanguage", "moduleScopeItems", "featureScopeItems", "sliceItemsFor", "conceptItems", "typeItems", "commandItems", "eventItems", "readModelItems", "reducerItems", "formItems", "contributeItems", "behaviorItems", "personaItems", "authenticationItems", "seedItems", "themeItems", "uiProfileItems", "outcomeItems", "layoutItems", "operationItems", "operationPhaseItems", "producesItems", "handlerItems", "implementationItems", "operationImplementationItems", "queryItems", "performerItems", "constraintItems", "reactionItems", "triggerItems", "reactionTriggerItems", "specificationItems", "policyItems", "validateItems", "actionItems", "tableItems", "templateItems", "screenItems", "candidate", "planCompletions", "lines", "lineIndex", "textBefore", "symbols", "scanDocument", "fences", "fenceMap", "withoutComment", "responseEntries", "responseCompletions", "importPath", "contextVariableMatch", "currentLine", "effectiveIndent", "enclosingChain", "ruleContext", "namedRuleContext", "namedRuleImplementationItems", "commandRuleItems", "propertyOwner", "nearestEnclosingLine", "propertyName", "reservedProperty", "optionalPrefix", "match", "afterPropertyType", "afterQueryType", "optionalTypeItems", "step", "specificationStepItems", "enclosingLine", "inlineEventItems", "ruleItems", "headers", "enclosingHeaders", "entries", "expansion", "structureCompletion", "createCompletionProvider", "monaco", "options", "model", "position", "lines", "lineIndex", "textBefore", "application", "symbols", "symbolsForBuffer", "responseEntries", "eventSourceCompletions", "operationCompletions", "responseCompletions", "plan", "planCompletions", "word", "range", "kinds", "asSnippet", "snippet", "__name", "entry", "symbolItem", "name", "kind", "detail", "eventNames", "inlineNames", "event", "knownEventNames", "pathRange", "path", "variableRange", "contextVariableItems", "policy", "knownTriggerNames", "command", "producesItems", "screen", "query", "typeReferenceText", "typeReferenceSymbol", "concept", "type", "primitiveTypes", "primitive", "createInlineCompletionProvider", "options", "model", "position", "lines", "lineIndex", "line", "symbols", "symbolsForBuffer", "suggestion", "structureCompletion", "__name", "responseTokenTypes", "responseTokens", "lines", "symbols", "tokens", "add", "__name", "line", "column", "length", "type", "source", "start", "path", "analysis", "responseAnalysis", "stream", "route", "command", "property", "withoutComment", "response", "field", "specification", "event", "fixture", "system", "operation", "keyword", "input", "phase", "name", "hint", "ordered", "left", "right", "token", "index", "handlerIntentDocs", "keywordDocs", "specificationKeywordDocs", "attributeDocs", "contextVariableDocs", "eventContextPaths", "path", "hoverContent", "lines", "lineIndex", "word", "startColumn", "endColumn", "application", "fences", "fenceMap", "line", "withoutComment", "inString", "inTemplate", "index", "sourceHover", "eventSourceHover", "operation", "operationHover", "tokenAt", "__name", "column", "name", "start", "before", "doc", "attributeDocs", "variable", "contextVariableDocs", "prefix", "followsPropertyType", "followsQueryType", "keywordDocs", "chain", "enclosingChain", "indentOf", "ruleContext", "namedRuleContext", "handlerIntentDocs", "symbols", "scanDocument", "owner", "command", "property", "typeReferenceText", "propertyTypeReference", "responseAvailability", "response", "source", "field", "type", "specification", "responseAnalysis", "value", "concept", "candidate", "attributes", "values", "reasons", "attribute", "reason", "properties", "policy", "body", "event", "left", "right", "construct", "getSubLanguage", "step", "specificationKeywordDocs", "eventAnalysisSource", "inEvent", "directBody", "directive", "keywordDoc", "createHoverProvider", "options", "model", "position", "word", "content", "hoverContent", "__name", "createInlayHintsProvider", "options", "model", "range", "destinationHints", "hint", "__name", "migrateOptional", "containsKind", "__name", "requested", "kind", "intersects", "left", "right", "createCodeActionProvider", "placement", "cache", "model", "range", "context", "token", "migrationRequested", "migrationOnly", "diagnostics", "marker", "code", "isQuickFixDiagnostic", "version", "placementKey", "analysis", "prepareQuickFixes", "fixes", "diagnostic", "fix", "DiagnosticCodes", "edit", "start", "end", "owner", "validationDelay", "validate", "monaco", "model", "options", "lines", "application", "symbolsForBuffer", "validateLines", "issue", "__name", "watch", "handle", "run", "languageId", "schedule", "contextChange", "attachDiagnostics", "pdl", "cdl", "screenplayDarkThemeName", "screenplayDark", "screenplayLightThemeName", "screenplayLight", "registeredInstances", "applyTokensProvider", "monaco", "languageId", "createTokensProvider", "getSubLanguages", "__name", "onSubLanguagesChanged", "ensureBuiltInSubLanguages", "getSubLanguage", "registerSubLanguage", "pdl", "cdl", "register", "options", "languageExtensionPoint", "languageConfiguration", "createCompletionProvider", "createInlineCompletionProvider", "createHoverProvider", "model", "position", "word", "symbols", "target", "eventSourceReferenceAt", "current", "source", "document", "location", "eventSourceIdentifier", "targetUri", "targetModels", "candidate", "targetModel", "responseTokenTypes", "data", "previousLine", "previousColumn", "token", "responseTokens", "createInlayHintsProvider", "createCodeActionProvider", "screenplayDarkThemeName", "screenplayDark", "screenplayLightThemeName", "screenplayLight", "attachDiagnostics"]
7
7
  }