@cratis/screenplay-language 4.55.1 → 4.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/AnalysisCommand.d.ts +16 -0
  2. package/dist/AnalysisCommand.d.ts.map +1 -0
  3. package/dist/AnalysisDiagnostic.d.ts +8 -0
  4. package/dist/AnalysisDiagnostic.d.ts.map +1 -0
  5. package/dist/AnalysisLocation.d.ts +6 -0
  6. package/dist/AnalysisLocation.d.ts.map +1 -0
  7. package/dist/AnalysisSpecification.d.ts +16 -0
  8. package/dist/AnalysisSpecification.d.ts.map +1 -0
  9. package/dist/AnalysisType.d.ts +6 -0
  10. package/dist/AnalysisType.d.ts.map +1 -0
  11. package/dist/AuthoringDocument.d.ts +6 -0
  12. package/dist/AuthoringDocument.d.ts.map +1 -0
  13. package/dist/CommandResponseSymbol.d.ts +13 -0
  14. package/dist/CommandResponseSymbol.d.ts.map +1 -0
  15. package/dist/ResponseAnalysis.d.ts +9 -0
  16. package/dist/ResponseAnalysis.d.ts.map +1 -0
  17. package/dist/ResponseFieldSymbol.d.ts +10 -0
  18. package/dist/ResponseFieldSymbol.d.ts.map +1 -0
  19. package/dist/ResponseSourceSymbol.d.ts +6 -0
  20. package/dist/ResponseSourceSymbol.d.ts.map +1 -0
  21. package/dist/bundles/chunk-IZGYM33T.js +14 -0
  22. package/dist/bundles/chunk-IZGYM33T.js.map +7 -0
  23. package/dist/bundles/index.js +18 -1362
  24. package/dist/bundles/index.js.map +4 -4
  25. package/dist/bundles/sub-languages/capture/index.js +35 -672
  26. package/dist/bundles/sub-languages/capture/index.js.map +1 -1
  27. package/dist/bundles/sub-languages/projection/index.js +53 -1625
  28. package/dist/bundles/sub-languages/projection/index.js.map +1 -1
  29. package/dist/completion-items.d.ts +1 -0
  30. package/dist/completion-items.d.ts.map +1 -1
  31. package/dist/completion-planner.d.ts.map +1 -1
  32. package/dist/completions.d.ts +2 -0
  33. package/dist/completions.d.ts.map +1 -1
  34. package/dist/diagnostic-codes.d.ts +14 -0
  35. package/dist/diagnostic-codes.d.ts.map +1 -1
  36. package/dist/hover-content.d.ts.map +1 -1
  37. package/dist/index.d.ts +3 -0
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/keyword-docs.d.ts +4 -0
  40. package/dist/keyword-docs.d.ts.map +1 -1
  41. package/dist/response-analysis.d.ts +15 -0
  42. package/dist/response-analysis.d.ts.map +1 -0
  43. package/dist/response-completions.d.ts +4 -0
  44. package/dist/response-completions.d.ts.map +1 -0
  45. package/dist/response-tokens.d.ts +8 -0
  46. package/dist/response-tokens.d.ts.map +1 -0
  47. package/dist/symbols.d.ts +11 -0
  48. package/dist/symbols.d.ts.map +1 -1
  49. package/dist/tokens.d.ts.map +1 -1
  50. package/dist/validation.d.ts +3 -0
  51. package/dist/validation.d.ts.map +1 -1
  52. package/package.json +1 -1
  53. package/dist/bundles/chunk-LXM5L4YK.js +0 -4893
  54. package/dist/bundles/chunk-LXM5L4YK.js.map +0 -7
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../tokens.ts", "../../sub-language-registry.ts", "../../completion-items.ts", "../../completion-planner.ts", "../../completions.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\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';\n\n// Maps a Screenplay inline code tag to the Monaco language id used for embedded highlighting.\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, ...subLanguages.map((subLanguage) => subLanguage.keyword)];\n return [\n new RegExp(`^\\\\s*(?:${exitKeywords.join('|')})\\\\b`),\n { token: '@rematch', next: '@pop' },\n ];\n}\n\n// Shared across the composite `.play` tokenizer and every standalone sub-language tokenizer\n// (comments, `$`-prefixed context variables, strings, numbers, operators, delimiters, whitespace).\nexport const commonTokenRules: MonarchTokenRules = [\n [/\\/\\/.*$/, 'comment'],\n [/\\$(?:context|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 // 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 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, ...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 { 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 { 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: '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];\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\nexport const moduleItems: CompletionEntry[] = [\n { label: 'import \"\u2026\"', insertText: 'import \"${1:*/*.play}\"', documentation: 'Imports `.play` files into this module \u2014 their top level is the module\\'s body, so they hold features and module members without restating the module.' },\n { label: 'layout', insertText: 'layout ${1:Name}\\n template\\n ${2:slot}', documentation: 'Declares a reusable screen template with named slots.' },\n { label: 'feature', insertText: 'feature ${1:Name}\\n ', documentation: 'Groups related slices into a vertical feature.' },\n];\n\nexport const featureItems: CompletionEntry[] = [\n { label: 'import \"\u2026\"', insertText: 'import \"${1:*.play}\"', documentation: 'Imports `.play` files into this feature \u2014 their top level is the feature\\'s body, so they hold slices and nested features without restating where they belong.' },\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];\n\nexport const sliceItems: 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: '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: '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: '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: '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: '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 handlerItems: CompletionEntry[] = [\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: '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: '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: '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 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", "// 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 } from './document-context';\nimport { getSubLanguage } from './sub-language-registry';\nimport * as items from './completion-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+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\nexport function completionEntriesFor(chain: string[]): CompletionEntry[] {\n const construct = chain[0];\n if (construct === undefined) return items.topLevelItems;\n const subLanguage = getSubLanguage(construct);\n if (subLanguage) return subLanguage.completions ?? [];\n switch (construct) {\n case 'module':\n return items.moduleItems;\n case 'feature':\n return items.featureItems;\n case 'slice':\n return items.sliceItems;\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 'produces':\n return items.producesItems;\n case 'handler':\n return items.handlerItems;\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 default:\n // Layout slots and sections inside a screen expose the screen vocabulary.\n if (chain.includes('screen') || construct === 'section' || construct === 'layout') {\n return items.screenItems;\n }\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): CompletionPlan {\n const fences = fenceMap(lines);\n if (fences[lineIndex]) return { kind: 'none' };\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\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+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 return { kind: 'entries', entries: completionEntriesFor(chain) };\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 { knownEventNames, knownTriggerNames, scanDocument } from './symbols';\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}\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 plan = planCompletions(lines, lineIndex, textBefore);\n if (plan.kind === 'none') return { suggestions: [] };\n\n const symbols = scanDocument(lines);\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 { eventContextPaths } from './event-context';\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: 'Read model state in a specification \u2014 `given readmodel` establishes it, `then readmodel` asserts it, `then no readmodel <View> for <key>` asserts keyed absence.',\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 { enclosingChain, fenceMap, indentOf } 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, 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): string | null {\n const fences = fenceMap(lines);\n if (fences[lineIndex]) return null;\n\n const line = lines[lineIndex] ?? '';\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 const symbols = scanDocument(lines);\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.isIdentifier ? ' identifier' : ''}`,\n )\n .join('\\n');\n return `\\`\\`\\`screenplay\\ncommand ${command.name}\\n${properties}\\n\\`\\`\\``;\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') 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';\n\nexport function createHoverProvider(): 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 );\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';\n\nexport function createInlayHintsProvider(): languages.InlayHintsProvider {\n return {\n provideInlayHints(model, range) {\n const hints = destinationHints(model.getLinesContent()).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';\n\nconst owner = 'screenplay';\nconst validationDelay = 300;\n\nexport function validate(monaco: Monaco, model: editor.ITextModel): editor.IMarkerData[] {\n return validateLines(model.getLinesContent()).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): 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));\n };\n const schedule = () => {\n if (handle !== undefined) clearTimeout(handle);\n handle = setTimeout(run, validationDelay);\n };\n\n model.onDidChangeContent(schedule);\n model.onDidChangeLanguage(run);\n model.onWillDispose(() => {\n if (handle !== undefined) clearTimeout(handle);\n });\n run();\n}\n\nexport function attachDiagnostics(monaco: Monaco): void {\n monaco.editor.getModels().forEach((model) => watch(monaco, model));\n monaco.editor.onDidCreateModel((model) => watch(monaco, model));\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 { createHoverProvider } from './hover';\nimport { createInlayHintsProvider } from './inlay-hints';\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.registerHoverProvider(languageId, createHoverProvider());\n monaco.languages.registerInlayHintsProvider(languageId, createInlayHintsProvider());\n monaco.languages.registerCodeActionProvider(languageId, createCodeActionProvider());\n monaco.editor.defineTheme(screenplayDarkThemeName, screenplayDark);\n monaco.editor.defineTheme(screenplayLightThemeName, screenplayLight);\n attachDiagnostics(monaco);\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 } 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 } 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 { 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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,IAAM,oBAA4C;AAAA,EAC9C,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,MAAM;AAAA,EACN,KAAK;AACT;AAEA,SAAS,iBAAiB,SAAyB;AAC/C,SAAO,eAAe,OAAO;AACjC;AAGA,SAAS,oBAAoBA,eAAwD;AACjF,QAAM,eAAe,CAAC,GAAG,mBAAmB,GAAGA,cAAa,IAAI,CAAC,gBAAgB,YAAY,OAAO,CAAC;AACrG,SAAO;AAAA,IACH,IAAI,OAAO,WAAW,aAAa,KAAK,GAAG,CAAC,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gB,UAAkC,CAAC,GAAS;AACjF,MAAI,oBAAoB,IAAI,MAAM,EAAG;AAErC,4BAA0B;AAE1B,sBAAoB,IAAI,MAAM;AAE9B,SAAO,UAAU,SAAS,sBAAsB;AAChD,SAAO,UAAU,yBAAyB,YAAY,qBAAqB;AAC3E,sBAAoB,MAAM;AAC1B,SAAO,UAAU,+BAA+B,YAAY,yBAAyB,QAAQ,OAAO,CAAC;AACrG,SAAO,UAAU,sBAAsB,YAAY,oBAAoB,CAAC;AACxE,SAAO,UAAU,2BAA2B,YAAY,yBAAyB,CAAC;AAClF,SAAO,UAAU,2BAA2B,YAAY,yBAAyB,CAAC;AAClF,SAAO,OAAO,YAAY,yBAAyB,cAAc;AACjE,SAAO,OAAO,YAAY,0BAA0B,eAAe;AACnE,oBAAkB,MAAM;AAC5B;",
6
- "names": ["subLanguages", "event"]
3
+ "sources": ["../../tokens.ts", "../../completion-items.ts", "../../response-completions.ts", "../../sub-language-registry.ts", "../../completion-planner.ts", "../../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\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';\n\n// Maps a Screenplay inline code tag to the Monaco language id used for embedded highlighting.\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, ...subLanguages.map((subLanguage) => subLanguage.keyword)];\n return [\n new RegExp(`^\\\\s*(?:${exitKeywords.join('|')})\\\\b`),\n { token: '@rematch', next: '@pop' },\n ];\n}\n\n// Shared across the composite `.play` tokenizer and every standalone sub-language tokenizer\n// (comments, `$`-prefixed context variables, strings, numbers, operators, delimiters, whitespace).\nexport const commonTokenRules: MonarchTokenRules = [\n [/\\/\\/.*$/, 'comment'],\n [/\\$(?:context|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 [/^(\\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 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, ...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 { 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: '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];\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\nexport const moduleItems: CompletionEntry[] = [\n { label: 'import \"\u2026\"', insertText: 'import \"${1:*/*.play}\"', documentation: 'Imports `.play` files into this module \u2014 their top level is the module\\'s body, so they hold features and module members without restating the module.' },\n { label: 'layout', insertText: 'layout ${1:Name}\\n template\\n ${2:slot}', documentation: 'Declares a reusable screen template with named slots.' },\n { label: 'feature', insertText: 'feature ${1:Name}\\n ', documentation: 'Groups related slices into a vertical feature.' },\n];\n\nexport const featureItems: CompletionEntry[] = [\n { label: 'import \"\u2026\"', insertText: 'import \"${1:*.play}\"', documentation: 'Imports `.play` files into this feature \u2014 their top level is the feature\\'s body, so they hold slices and nested features without restating where they belong.' },\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];\n\nexport const sliceItems: 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: '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: '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: 'returns property', insertText: 'returns @${1:property}', documentation: 'Syntax-only scalar response from a direct command property; execution unavailable until ESM v8 (PLAY0268).' },\n { label: 'returns block', insertText: 'returns\\n ${1:field} = ${2:property}', documentation: 'Syntax-only unnamed record response with inferred or explicit field types; execution unavailable until ESM v8 (PLAY0268). No response type is emitted.' },\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: '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: '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: '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: '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: 'returns value', insertText: 'returns ${1:value}', documentation: 'Syntax-only scalar response expectation. Execution unavailable until ESM v8 (PLAY0268).' },\n { label: 'returns block', insertText: 'returns\\n ${1:field} = ${2:value}', documentation: 'Syntax-only nonempty subset of response fields. Execution unavailable until ESM v8 (PLAY0268).' },\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 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", "// 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; 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 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, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { responseCompletions } from './response-completions';\nimport { scanDocument } from './symbols';\nimport { getSubLanguage } from './sub-language-registry';\nimport * as items from './completion-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+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\nexport function completionEntriesFor(chain: string[]): CompletionEntry[] {\n const construct = chain[0];\n if (construct === undefined) return items.topLevelItems;\n const subLanguage = getSubLanguage(construct);\n if (subLanguage) return subLanguage.completions ?? [];\n switch (construct) {\n case 'module':\n return items.moduleItems;\n case 'feature':\n return items.featureItems;\n case 'slice':\n return items.sliceItems;\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 'produces':\n return items.producesItems;\n case 'handler':\n return items.handlerItems;\n case 'implementation':\n return chain[1] === 'handler' ? items.implementationItems : [];\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 default:\n // Layout slots and sections inside a screen expose the screen vocabulary.\n if (chain.includes('screen') || construct === 'section' || construct === 'layout') {\n return items.screenItems;\n }\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): 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\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+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 return { kind: 'entries', entries: completionEntriesFor(chain) };\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, mergeSymbols, scanDocument } from './symbols';\nimport { responseCompletions } from './response-completions';\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}\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 symbols = mergeSymbols(scanDocument(lines), options.application?.(model) ?? mergeSymbols());\n const responseEntries = responseCompletions(lines, lineIndex, textBefore, symbols);\n const plan = responseEntries === null ? planCompletions(lines, lineIndex, textBefore) : { 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 { responseAnalysis } from './response-analysis';\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[]): { 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 if (line > 0 && length > 0) tokens.push({ line: line - 1, column: column - 1 + (lines[line - 1][column - 1] === '@' ? 1 : 0), length, type });\n };\n const analysis = responseAnalysis(lines);\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 return tokens.sort((left, right) => left.line - right.line || left.column - right.column);\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: 'Read model state in a specification \u2014 `given readmodel` establishes it, `then readmodel` asserts it, `then no readmodel <View> for <key>` asserts keyed absence.',\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 { 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): 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 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 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';\n\nexport function createHoverProvider(): 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 );\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';\n\nexport function createInlayHintsProvider(): languages.InlayHintsProvider {\n return {\n provideInlayHints(model, range) {\n const hints = destinationHints(model.getLinesContent()).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';\n\nconst owner = 'screenplay';\nconst validationDelay = 300;\n\nexport function validate(monaco: Monaco, model: editor.ITextModel): editor.IMarkerData[] {\n return validateLines(model.getLinesContent()).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): 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));\n };\n const schedule = () => {\n if (handle !== undefined) clearTimeout(handle);\n handle = setTimeout(run, validationDelay);\n };\n\n model.onDidChangeContent(schedule);\n model.onDidChangeLanguage(run);\n model.onWillDispose(() => {\n if (handle !== undefined) clearTimeout(handle);\n });\n run();\n}\n\nexport function attachDiagnostics(monaco: Monaco): void {\n monaco.editor.getModels().forEach((model) => watch(monaco, model));\n monaco.editor.onDidCreateModel((model) => watch(monaco, model));\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 { responseTokens, responseTokenTypes } from './response-tokens';\nimport { createHoverProvider } from './hover';\nimport { createInlayHintsProvider } from './inlay-hints';\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.registerHoverProvider(languageId, createHoverProvider());\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())) {\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());\n monaco.languages.registerCodeActionProvider(languageId, createCodeActionProvider());\n monaco.editor.defineTheme(screenplayDarkThemeName, screenplayDark);\n monaco.editor.defineTheme(screenplayLightThemeName, screenplayLight);\n attachDiagnostics(monaco);\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 } 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 } 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 { 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": "s3BAcA,IAAM,kBAA4C,CAC9C,OAAQ,SACR,WAAY,aACZ,MAAO,aACP,KAAM,OACN,IAAK,KACT,EAEA,SAAS,iBAAiB,QAAyB,CAC/C,MAAO,eAAe,OAAO,EACjC,CAGA,SAAS,oBAAoBA,cAAwD,CACjF,IAAM,aAAe,CAAC,GAAG,kBAAmB,GAAGA,cAAa,IAAK,aAAgB,YAAY,OAAO,CAAC,EACrG,MAAO,CACH,IAAI,OAAO,WAAW,aAAa,KAAK,GAAG,CAAC,MAAM,EAClD,CAAE,MAAO,WAAY,KAAM,MAAO,CACtC,CACJ,CAIO,IAAM,iBAAsC,CAC/C,CAAC,UAAW,SAAS,EACrB,CAAC,8DAA+D,qBAAqB,EACrF,CAAC,oCAAqC,qBAAqB,EAC3D,CAAC,aAAc,qBAAqB,EACpC,CAAC,oBAAqB,QAAQ,EAC9B,CAAC,oBAAqB,gBAAgB,EACtC,CAAC,sBAAuB,QAAQ,EAChC,CAAC,aAAc,cAAc,EAC7B,CAAC,QAAS,QAAQ,EAClB,CAAC,yBAA0B,UAAU,EACrC,CAAC,YAAa,WAAW,EACzB,CAAC,MAAO,OAAO,CACnB,EAEO,SAAS,qBAAqBA,cAAyD,CAC1F,IAAM,UAA+C,CACjD,KAAM,CACF,CAAC,qCAAsC,CAAC,QAAS,CAAE,MAAO,UAAW,KAAM,iBAAkB,CAAC,CAAC,EAC/F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AAe,MAAM,gBAAgB,CAAC,EACtD,KAAK,KAAK,MAAM,KAAO,aAAc,MAAM,OAAS,aAAe,MAAM,OAAS,eAAiB,MAAM,OAAQ,MAAM,OAAQ,MAAM,KAAM,CAAC,EAC5I,aAAe,MAAM,KACrB,eAAiB,MAAM,OAE3B,MAAO,CAAE,KAAM,IAAI,YAAY,IAAI,CAAE,CACzC,EACA,+BAAgC,CAAC,CACrC,CAAC,EACD,OAAO,UAAU,2BAA2B,WAAY,yBAAyB,CAAC,EAClF,OAAO,UAAU,2BAA2B,WAAY,yBAAyB,CAAC,EAClF,OAAO,OAAO,YAAY,wBAAyB,cAAc,EACjE,OAAO,OAAO,YAAY,yBAA0B,eAAe,EACnE,kBAAkB,MAAM,EAC5B",
6
+ "names": ["subLanguages", "command", "concept", "specification", "chain", "owner", "command", "property", "field", "type", "event"]
7
7
  }