@cratis/screenplay-language 5.2.0 → 5.3.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.
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayFolderMerge.js +1 -1
- package/dist/bundles/compiler/Files/PlayFolderMerge.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ApplicationContextParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ApplicationContextParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/DeclarationParsers.js +1 -1
- package/dist/bundles/compiler/Parsing/DeclarationParsers.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ExpressionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ExpressionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ScreenplayParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ScreenplayParser.js.map +1 -1
- package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js +1 -1
- package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js.map +1 -1
- package/dist/bundles/compiler/Syntax/Structure.js.map +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxCollections.js +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxCollections.js.map +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxJson.js +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxJson.js.map +1 -1
- package/dist/bundles/completion-items.js +18 -17
- package/dist/bundles/completion-items.js.map +1 -1
- package/dist/bundles/completion-planner.js +2 -2
- package/dist/bundles/completion-planner.js.map +1 -1
- package/dist/bundles/diagnostic-codes.js +1 -1
- package/dist/bundles/diagnostic-codes.js.map +1 -1
- package/dist/bundles/keyword-docs.js +1 -1
- package/dist/bundles/keyword-docs.js.map +1 -1
- package/dist/bundles/language.js +1 -1
- package/dist/bundles/language.js.map +1 -1
- package/dist/bundles/response-analysis.js +1 -1
- package/dist/bundles/response-analysis.js.map +1 -1
- package/dist/bundles/scope-items.js +1 -1
- package/dist/bundles/scope-items.js.map +1 -1
- package/dist/bundles/tokens.js +1 -1
- package/dist/bundles/tokens.js.map +1 -1
- package/dist/bundles/validation.js +1 -1
- package/dist/bundles/validation.js.map +1 -1
- package/dist/completion-items.d.ts +1 -0
- package/dist/completion-items.d.ts.map +1 -1
- package/dist/completion-planner.d.ts.map +1 -1
- package/dist/diagnostic-codes.d.ts +5 -0
- package/dist/diagnostic-codes.d.ts.map +1 -1
- package/dist/keyword-docs.d.ts.map +1 -1
- package/dist/language.d.ts.map +1 -1
- package/dist/scope-items.d.ts.map +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-items.js","names":["interactionItems","moduleScopeItems","purposeReferenceItem","documentationItem","exampleDeclarationItems","featureScopeItems","readModelItems","reducerItems","formItems","contributeItems","behaviorItems","actionStepItems","outcomeItems","personaItems","authenticationItems","onboardingItems","inviteMemberItems","legalTermsItems","emailItems","seedItems","themeItems","uiProfileItems","profileRootTemplateItems","profileAppearanceItems","profileIdentityItems","profileSampleDataItems","sampleDataItems","sampleShapeItems","layoutItems","toolbarItems","navigationItems","templateItems"],"sources":["../../scope-items.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { CompletionEntry } from './completion-items';\nimport { exampleDeclarationItems } from './example-declaration-items';\nimport { documentationItem } from './documentation-item';\nimport { purposeReferenceItem } from './purpose-items';\n\nconst interactions = ['click', 'double click', 'select', 'submit', 'change', 'load', 'unload', 'enter', 'leave'];\n\nconst interactionItems: CompletionEntry[] = [\n { label: 'on', insertText: 'on ${1|click,select,submit,change,load,unload,enter,leave|}\\n ${2:execute command}', documentation: 'Wires what happens on an interaction - a click, a submit, entering or leaving the screen.' },\n { label: 'uses', insertText: 'uses ${1:Behavior}', documentation: 'Attaches a named behavior declared at the top level.' },\n];\n\nexport const moduleScopeItems: CompletionEntry[] = [\n purposeReferenceItem,\n documentationItem,\n ...exampleDeclarationItems,\n { label: 'description', insertText: 'description \"${1:what this module is for}\"', documentation: 'A human-readable description.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'Policies that must pass for everything in the module.' },\n { label: 'depends on', insertText: 'depends on ${1:Name}', documentation: 'Declares an allowed module or feature dependency. Opts this container into independent explicit-reference checks.' },\n { label: 'import \"…\"', insertText: 'import \"${1:*/*.play}\"', documentation: 'Imports `.play` files into this module — their top level is the module\\'s body.' },\n { label: 'feature', insertText: 'feature ${1:Name}\\n ', documentation: 'Groups related slices into a vertical feature.' },\n { label: 'screen', insertText: 'screen ${1:Name}\\n data ${2:ReadModel} via query ${3:QueryName}', documentation: 'Declares a module-level UI screen.' },\n { label: 'screen template', insertText: 'screen template ${1:Name}\\n fits slot ${2:content}\\n\\n ${3:slot}', documentation: 'Declares a reusable screen shape that fits a slot of the shell.' },\n { label: 'dialog template', insertText: 'dialog template ${1:Name}\\n ${2:body}\\n ${3:actions}', documentation: 'Declares a reusable dialog shape that opens over the shell.' },\n { label: 'form', insertText: 'form ${1:Name} for ${2:Command}\\n field ${3:property} label \"${4:Label}\"', documentation: 'Declares a form bound to a command.' },\n { label: 'contribute', insertText: 'contribute to ${1:Navigation}\\n navigate to ${2:Screen}\\n label \"${3:Label}\"', documentation: 'Contributes an entry to a slot of the shell, such as navigation.' },\n { label: 'navigation sidebar extends', insertText: 'navigation ${1|sidebar,topbar|} ${2|extends,overrides,inherits|}\\n item ${3:id} title \"${4:Title}\" target ${5:Module.Feature}', documentation: 'Changes a navigation region for this module: `extends` adds items after the application\\'s, `overrides` replaces them, `inherits` shows the application\\'s.' },\n ...interactionItems,\n];\n\nexport const featureScopeItems: CompletionEntry[] = [\n purposeReferenceItem,\n documentationItem,\n ...exampleDeclarationItems,\n { label: 'description', insertText: 'description \"${1:what this feature is for}\"', documentation: 'A human-readable description.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'Policies that must pass for everything in the feature.' },\n { label: 'depends on', insertText: 'depends on ${1:Name}', documentation: 'Declares an allowed module or feature dependency. Sibling feature names resolve before module names.' },\n { label: 'import \"…\"', insertText: 'import \"${1:*.play}\"', documentation: 'Imports `.play` files into this feature — their top level is the feature\\'s body.' },\n { label: 'feature', insertText: 'feature ${1:Name}\\n ', documentation: 'Declares a nested sub-feature.' },\n { label: 'slice StateChange', insertText: 'slice StateChange ${1:Name}\\n ', documentation: 'A command → events flow; something that changes the system.' },\n { label: 'slice StateView', insertText: 'slice StateView ${1:Name}\\n ', documentation: 'A query + projection + screen; something that reads the system.' },\n { label: 'slice Automation', insertText: 'slice Automation ${1:Name}\\n ', documentation: 'A reaction or reducer; something that runs when something happens.' },\n { label: 'slice Translate', insertText: 'slice Translate ${1:Name}\\n ', documentation: 'A capture; converts external data into events.' },\n { label: 'contribute', insertText: 'contribute to ${1:Navigation}\\n navigate to ${2:Screen}\\n label \"${3:Label}\"', documentation: 'Contributes an entry to a slot of the shell, such as navigation.' },\n ...interactionItems,\n];\n\nexport const readModelItems: CompletionEntry[] = [\n documentationItem,\n { label: 'description', insertText: 'description \"${1:what one instance holds}\"', documentation: 'A human-readable description.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the file this read model is realized by.' },\n { label: 'property', insertText: '${1:property} ${2:Type}', documentation: 'A property of the read model — a name and a type reference.' },\n];\n\nexport const reducerItems: CompletionEntry[] = [\n { label: 'from', insertText: 'from ${1:Source.Stream}', documentation: 'Observe matching routed facts only, without filtering stream ids. ESM v10.' },\n { label: 'description', insertText: 'description \"${1:what the reducer does}\"', documentation: 'A human-readable description.' },\n { label: 'on', insertText: 'on ${1:EventType}\\n ```csharp\\n ${2}\\n ```', documentation: 'A rule applied when the event occurs, in code or from a file.' },\n];\n\nexport const formItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:input surface intent}\"', documentation: 'Report-only description of the form.' },\n { label: 'populate via query', insertText: 'populate via query ${1:Query} by ${2:parameter}', documentation: 'Fills the form from a query before it is shown.' },\n { label: 'populate from item', insertText: 'populate from item', documentation: 'Fills the form from the item the screen was opened for.' },\n { label: 'field', insertText: 'field ${1:property} label \"${2:Label}\"', documentation: 'A form field bound to a command property.' },\n ...interactionItems,\n];\n\nexport const contributeItems: CompletionEntry[] = [\n { label: 'navigate to', insertText: 'navigate to ${1:Screen}', documentation: 'The screen the entry opens.' },\n { label: 'label', insertText: 'label \"${1:Label}\"', documentation: 'The text of the entry.' },\n { label: 'order', insertText: 'order ${1:10}', documentation: 'Where the entry sits among the others; lower comes first.' },\n];\n\nexport const behaviorItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:what the behavior does}\"', documentation: 'A human-readable description.' },\n { label: 'parameter', insertText: 'parameter ${1:name} ${2:Type}', documentation: 'A value the behavior is given where it is attached.' },\n { label: 'order', insertText: 'order ${1:10}', documentation: 'The order behaviors attached to the same element run in.' },\n { label: 'on', insertText: 'on ${1|click,select,submit,change,load,unload,enter,leave|}\\n ${2:execute command}', documentation: 'Wires what happens on an interaction.' },\n];\n\nconst step = (label: string, insertText: string, documentation: string): CompletionEntry => ({ label, insertText, documentation });\n\n// What an interaction does, and what can follow an action's outcome.\nexport const actionStepItems: CompletionEntry[] = [\n step('execute', 'execute ${1:command}', 'Runs a command.'),\n step('navigate to', 'navigate to ${1:Screen}', 'Opens a screen.'),\n step('open', 'open ${1:Dialog}', 'Opens a dialog.'),\n step('close', 'close', 'Closes the dialog.'),\n step('refresh', 'refresh ${1:query}', 'Reloads a query.'),\n step('set', 'set ${1:name} ${2:value}', 'Sets a value.'),\n step('notify', 'notify ${1|info,warning,error|} \"${2:message}\"', 'Shows a notification.'),\n step('confirm', 'confirm ${1:message}\\n on success\\n ${2:execute command}', 'Asks before continuing.'),\n step('raise', 'raise ${1:Trigger}', 'Raises a trigger.'),\n];\n\nexport const outcomeItems: CompletionEntry[] = [\n step('on success', 'on success\\n ${1:notify info \"Done\"}', 'What happens when it succeeds.'),\n step('on failure', 'on failure\\n ${1:notify error \"Failed\"}', 'What happens when it fails.'),\n ...actionStepItems,\n];\n\nexport const personaItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:who they are}\"', documentation: 'A human-readable description.' },\n { label: 'goal', insertText: 'goal \"${1:what they want to achieve}\"', documentation: 'A goal of this persona.' },\n { label: 'policy', insertText: 'policy ${1:PolicyName}', documentation: 'A policy this persona holds.' },\n { label: 'position', insertText: 'position ${1:0} ${2:0}', documentation: 'Where the persona sits on the personas canvas.' },\n { label: 'size', insertText: 'size ${1:300} ${2:180}', documentation: 'How big the persona is on the personas canvas.' },\n];\n\nexport const authenticationItems: CompletionEntry[] = [\n { label: 'provider', insertText: 'provider ${1:Name}', documentation: 'An identity provider.' },\n { label: 'provider (named)', insertText: 'provider ${1:Kind} name ${2:Name}', documentation: 'An identity provider of a kind, under its own name.' },\n];\n\nexport const onboardingItems: CompletionEntry[] = [\n { label: 'signup (creates tenant)', insertText: 'signup open creates tenant', documentation: 'Turns self-signup on; a sign-up creates a tenant for the person signing up.' },\n { label: 'signup (joins tenant)', insertText: 'signup open joins tenant', documentation: 'Turns self-signup on; a sign-up asks to join an existing tenant.' },\n { label: 'invite tenant', insertText: 'invite tenant as ${1:Persona}', documentation: 'An invitation that creates a tenant for the invitee, who becomes the persona.' },\n { label: 'invite member', insertText: 'invite member\\n by ${1:Persona}\\n grant ${2:Persona}', documentation: 'An invitation into an existing tenant: who may send it and which personas it grants.' },\n { label: 'legal terms', insertText: 'legal terms\\n file ${1:Legal/terms-of-service.md}', documentation: 'The documents a newcomer must accept, as files relative to the repository root.' },\n { label: 'offering', insertText: 'offering ${1:Name}', documentation: 'The offering a new tenant starts on. The name is opaque to the model.' },\n { label: 'emails', insertText: 'emails\\n invitation file ${1:Emails/invitation.html}\\n welcome file ${2:Emails/welcome.html}\\n images ${3:Emails/Images}', documentation: 'A template file per onboarding email and the folder holding their images.' },\n];\n\nexport const inviteMemberItems: CompletionEntry[] = [\n { label: 'by', insertText: 'by ${1:Persona}', documentation: 'The personas that may send the invitation.' },\n { label: 'grant', insertText: 'grant ${1:Persona}', documentation: 'The personas the invitation gives the invitee.' },\n];\n\nexport const legalTermsItems: CompletionEntry[] = [\n { label: 'file', insertText: 'file ${1:Legal/terms-of-service.md}', documentation: 'A document the newcomer must accept, relative to the repository root.' },\n];\n\nexport const emailItems: CompletionEntry[] = [\n { label: 'invitation', insertText: 'invitation file ${1:Emails/invitation.html}', documentation: 'The template of the invitation email.' },\n { label: 'welcome', insertText: 'welcome file ${1:Emails/welcome.html}', documentation: 'The template of the welcome email.' },\n { label: 'signupDeclined', insertText: 'signupDeclined file ${1:Emails/signup-declined.html}', documentation: 'The template of the email sent when a sign-up is declined.' },\n { label: 'images', insertText: 'images ${1:Emails/Images}', documentation: 'The folder, relative to the repository root, holding the images the templates use.' },\n];\n\nexport const seedItems: CompletionEntry[] = [\n { label: 'for', insertText: 'for ${1:\"event-source-id\"}\\n ${2:EventType}\\n ${3:property} = ${4:value}', documentation: 'Events to seed for one event source id.' },\n { label: 'position', insertText: 'position ${1:0} ${2:0}', documentation: 'Where the seed data sits on the seed data canvas.' },\n];\n\nexport const themeItems: CompletionEntry[] = [\n { label: 'compatible with', insertText: 'compatible with ${1:Package}', documentation: 'A component package the theme is compatible with.' },\n];\n\nexport const uiProfileItems: CompletionEntry[] = [\n { label: 'target platform', insertText: 'target platform ${1:web}', documentation: 'The platforms the profile is for.' },\n { label: 'target size', insertText: 'target size ${1|compact,regular|}', documentation: 'The screen sizes the profile is for.' },\n { label: 'packages', insertText: 'packages\\n ${1:Package}', documentation: 'The component packages the profile uses.' },\n { label: 'layout', insertText: 'layout ${1:Layout}', documentation: 'The layout of the profile. Older form of `root template`; prefer `root template`.' },\n { label: 'theme', insertText: 'theme ${1:Theme}', documentation: 'The theme of the profile, named by a declared theme\\'s identifier.' },\n { label: 'theme (package-provided)', insertText: 'theme \"${1:Scene Default Light}\"', documentation: 'The theme of the profile, named by the quoted display name of a theme a component package provides.' },\n { label: 'root template', insertText: 'root template ${1:Template}\\n option ${2:navigationMode} ${3:slim}', documentation: 'The template the whole application is drawn in: an own template, or `blueprint <Blueprint> <Name> [version \"<range>\"]`, with the options the shell exposes.' },\n { label: 'root template blueprint', insertText: 'root template blueprint ${1:Blueprint} ${2:Template} version \"${3:^1.0}\"', documentation: 'A root template a blueprint package ships, pinned to a semver range.' },\n { label: 'identity', insertText: 'identity\\n name \"${1:Name}\"\\n logo ${2|initials \"AB\",icon box,image \"data:image/svg+xml;base64,...\"|}\\n show name ${3|true,false|}', documentation: 'What the application calls itself and the mark it wears: `name`, `logo initials|icon|image` and `show name`.' },\n { label: 'appearance', insertText: 'appearance\\n color scheme ${1|light,dark,system|}\\n accent \"${2:#4f46e5}\"\\n corners ${3|sharp,default,round|}\\n font ${4:inter}', documentation: 'How the application looks regardless of the shell: colour scheme, accent colour, corners and font.' },\n { label: 'new screens use template', insertText: 'new screens use template ${1:Template}', documentation: 'The template a new screen starts from in the designer.' },\n { label: 'sample data', insertText: 'sample data\\n active ${1:Pack}', documentation: 'The sample data the whole application previews with, chosen once here.' },\n];\n\nexport const profileRootTemplateItems: CompletionEntry[] = [\n { label: 'option', insertText: 'option ${1:name} ${2:value}', documentation: 'Sets one of the shell\\'s own options, for example `option navigationMode slim`. The value is a word, a quoted string, a number, `true` or `false`.' },\n];\n\nexport const profileAppearanceItems: CompletionEntry[] = [\n { label: 'color scheme', insertText: 'color scheme ${1|light,dark,system|}', documentation: 'The colour scheme of the application: light, dark or follow the system.' },\n { label: 'accent', insertText: 'accent \"${1:#4f46e5}\"', documentation: 'The accent colour of the application.' },\n { label: 'corners', insertText: 'corners ${1|sharp,default,round|}', documentation: 'How rounded the application\\'s corners are: sharp, default or round.' },\n { label: 'font', insertText: 'font ${1|inter,ibm-plex-sans,source-serif-4,system-ui|}', documentation: 'The font of the application, an id from Scene\\'s font catalog.' },\n];\n\nexport const profileIdentityItems: CompletionEntry[] = [\n { label: 'name', insertText: 'name \"${1:Name}\"', documentation: 'What the application calls itself in its shell; leave it out to take the application\\'s own name.' },\n { label: 'logo initials', insertText: 'logo initials \"${1:AB}\"', documentation: 'A logo drawn from one or two characters.' },\n { label: 'logo icon', insertText: 'logo icon ${1|box,layers,home,users,receipt,package,database,palette|}', documentation: 'A logo drawn from one of Scene\\'s logo icons.' },\n { label: 'logo image', insertText: 'logo image \"data:image/svg+xml;base64,${1}\"', documentation: 'A logo image (PNG, JPG, SVG or WebP, up to 400 KB) as a base64 data URI.' },\n { label: 'show name', insertText: 'show name ${1|true,false|}', documentation: 'Whether the name is drawn beside the logo.' },\n];\n\nexport const profileSampleDataItems: CompletionEntry[] = [\n { label: 'active', insertText: 'active ${1:Pack}', documentation: 'The active sample data pack of the whole application: one declared in the document, or `blueprint <id>`.' },\n { label: 'shape maps to', insertText: 'shape ${1:Shape} maps to ${2:ReadModel}', documentation: 'Maps a sample data shape to the read model it supplies rows for.' },\n { label: 'bind', insertText: 'bind ${1:ReadModel} to ${2:Pack}', documentation: 'A rare override: binds one read model to a pack.' },\n];\n\nexport const sampleDataItems: CompletionEntry[] = [\n { label: 'title', insertText: 'title \"${1:Title}\"', documentation: 'The display title of the pack.' },\n { label: 'locale', insertText: 'locale ${1:en-GB}', documentation: 'The BCP 47 locale tag of the data.' },\n { label: 'shape', insertText: 'shape ${1:ReadModel}\\n row\\n ${2:field} = ${3:\"value\"}', documentation: 'The rows for one shape: the read model of the same name, or the one a ui profile maps it to.' },\n];\n\nexport const sampleShapeItems: CompletionEntry[] = [\n { label: 'row', insertText: 'row\\n ${1:field} = ${2:\"value\"}', documentation: 'One row of the shape.' },\n];\n\nexport const layoutItems: CompletionEntry[] = [\n { label: 'slot', insertText: '${1:slot}', documentation: 'A named slot of the shell.' },\n { label: 'slot contributes', insertText: '${1:slot} contributes ${2:Name}', documentation: 'A slot other declarations contribute to, such as `navigation contributes Navigation`.' },\n { label: 'navigation topbar', insertText: 'navigation ${1|topbar,sidebar|}\\n logo image \"${2:/logo.svg}\" title \"${3:Application}\"\\n item ${4:id} title \"${5:Title}\" target ${6:Module}', documentation: 'The application\\'s navigation region: a logo and items that target a module or feature.' },\n { label: 'arrangement', insertText: 'arrangement flow\\n column\\n ${1:slot}', documentation: 'How the slots are placed.' },\n];\n\nexport const toolbarItems: CompletionEntry[] = [\n { label: 'button', insertText: 'button ${1:id} title \"${2:Title}\" slice ${3:Module.Feature.Slice}', documentation: 'A button that invokes a State Change slice. The slice names the command and the dialog it opens over the page.' },\n { label: 'button (with emphasis)', insertText: 'button ${1:id} title \"${2:Title}\" slice ${3:Module.Feature.Slice} emphasis ${4|primary,secondary,quiet|} icon ${5:icon}', documentation: 'A toolbar button with an emphasis and an icon.' },\n { label: 'item action', insertText: 'item ${1:name} action ${2:Command}', documentation: 'A toolbar entry that runs a command.' },\n { label: 'item navigate', insertText: 'item ${1:name} navigate to ${2:Screen}', documentation: 'A toolbar entry that navigates to a screen.' },\n];\n\nexport const navigationItems: CompletionEntry[] = [\n { label: 'logo', insertText: 'logo image \"${1:/logo.svg}\" title \"${2:Application}\"', documentation: 'The application logo. Declared once, in a layout.' },\n { label: 'item', insertText: 'item ${1:id} title \"${2:Title}\" target ${3:Module.Feature}', documentation: 'A navigation item with a title, an optional `icon`, a `target` module or feature and an optional rendering `slot`. Sidebar items may nest `item` lines.' },\n { label: 'item (with slot)', insertText: 'item ${1:id} title \"${2:Title}\" icon ${3:icon} target ${4:Module.Feature} slot ${5:content}', documentation: 'A navigation item that renders its target into a named layout slot.' },\n];\n\nexport const templateItems: CompletionEntry[] = [\n { label: 'fits slot', insertText: 'fits slot ${1:content}', documentation: 'The slot of the shell the template fits.' },\n ...layoutItems,\n { label: 'on', insertText: 'on ${1|enter,leave,load,unload|}\\n ${2:refresh query}', documentation: 'Wires what happens on an interaction.' },\n];\n\nexport const interactionNames = interactions;\n"],"mappings":"gPA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C1C,CAAE,MAAO,OAAQ,WAAY,YAAa,cAAe,4BAA6B,EACtF,CAAE,MAAO,mBAAoB,WAAY,kCAAmC,cAAe,uFAAwF,EACnL,CAAE,MAAO,oBAAqB,WAAY,oJAAqJ,cAAe,wFAA0F,EACxS,CAAE,MAAO,cAAe,WAAY;;oBAAmD,cAAe,2BAA4B,CACtI,EAEaC,EAAkC,CAC3C,CAAE,MAAO,SAAU,WAAY,oEAAqE,cAAe,gHAAiH,EACpO,CAAE,MAAO,yBAA0B,WAAY,0HAA2H,cAAe,gDAAiD,EAC1O,CAAE,MAAO,cAAe,WAAY,qCAAsC,cAAe,sCAAuC,EAChI,CAAE,MAAO,gBAAiB,WAAY,yCAA0C,cAAe,6CAA8C,CACjJ,EAEaC,EAAqC,CAC9C,CAAE,MAAO,OAAQ,WAAY,uDAAwD,cAAe,mDAAoD,EACxJ,CAAE,MAAO,OAAQ,WAAY,6DAA8D,cAAe,yJAA0J,EACpQ,CAAE,MAAO,mBAAoB,WAAY,8FAA+F,cAAe,qEAAsE,CACjO,EAEaC,EAAmC,CAC5C,CAAE,MAAO,YAAa,WAAY,yBAA0B,cAAe,0CAA2C,EACtH,GAAGH,EACH,CAAE,MAAO,KAAM,WAAY,2DAA4D,cAAe,uCAAwC,CAClJ"}
|
|
1
|
+
{"version":3,"file":"scope-items.js","names":["interactionItems","moduleScopeItems","purposeReferenceItem","documentationItem","exampleDeclarationItems","featureScopeItems","readModelItems","reducerItems","formItems","contributeItems","behaviorItems","actionStepItems","outcomeItems","personaItems","authenticationItems","onboardingItems","inviteMemberItems","legalTermsItems","emailItems","seedItems","themeItems","uiProfileItems","profileRootTemplateItems","profileAppearanceItems","profileIdentityItems","profileSampleDataItems","sampleDataItems","sampleShapeItems","layoutItems","toolbarItems","navigationItems","templateItems"],"sources":["../../scope-items.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { CompletionEntry } from './completion-items';\nimport { exampleDeclarationItems } from './example-declaration-items';\nimport { documentationItem } from './documentation-item';\nimport { purposeReferenceItem } from './purpose-items';\n\nconst interactions = ['click', 'double click', 'select', 'submit', 'change', 'load', 'unload', 'enter', 'leave'];\n\nconst interactionItems: CompletionEntry[] = [\n { label: 'on', insertText: 'on ${1|click,select,submit,change,load,unload,enter,leave|}\\n ${2:execute command}', documentation: 'Wires what happens on an interaction - a click, a submit, entering or leaving the screen.' },\n { label: 'uses', insertText: 'uses ${1:Behavior}', documentation: 'Attaches a named behavior declared at the top level.' },\n];\n\nexport const moduleScopeItems: CompletionEntry[] = [\n purposeReferenceItem,\n documentationItem,\n ...exampleDeclarationItems,\n { label: 'description', insertText: 'description \"${1:what this module is for}\"', documentation: 'A human-readable description.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'Policies that must pass for everything in the module.' },\n { label: 'depends on', insertText: 'depends on ${1:Name}', documentation: 'Declares an allowed module or feature dependency. Opts this container into independent explicit-reference checks.' },\n { label: 'import \"…\"', insertText: 'import \"${1:*/*.play}\"', documentation: 'Imports `.play` files into this module — their top level is the module\\'s body.' },\n { label: 'feature', insertText: 'feature ${1:Name}\\n ', documentation: 'Groups related slices into a vertical feature.' },\n { label: 'screen', insertText: 'screen ${1:Name}\\n data ${2:ReadModel} via query ${3:QueryName}', documentation: 'Declares a module-level UI screen.' },\n { label: 'screen template', insertText: 'screen template ${1:Name}\\n fits slot ${2:content}\\n\\n ${3:slot}', documentation: 'Declares a reusable screen shape that fits a slot of the shell.' },\n { label: 'dialog template', insertText: 'dialog template ${1:Name}\\n ${2:body}\\n ${3:actions}', documentation: 'Declares a reusable dialog shape that opens over the shell.' },\n { label: 'form', insertText: 'form ${1:Name} for ${2:Command}\\n field ${3:property} label \"${4:Label}\"', documentation: 'Declares a form bound to a command.' },\n { label: 'contribute', insertText: 'contribute to ${1:Navigation}\\n navigate to ${2:Screen}\\n label \"${3:Label}\"', documentation: 'Contributes an entry to a slot of the shell, such as navigation.' },\n { label: 'navigation sidebar extends', insertText: 'navigation ${1|sidebar,topbar|} ${2|extends,overrides,inherits|}\\n item ${3:id} title \"${4:Title}\" target ${5:Module.Feature}', documentation: 'Changes a navigation region for this module: `extends` adds items after the application\\'s, `overrides` replaces them, `inherits` shows the application\\'s.' },\n ...interactionItems,\n];\n\nexport const featureScopeItems: CompletionEntry[] = [\n purposeReferenceItem,\n documentationItem,\n ...exampleDeclarationItems,\n { label: 'description', insertText: 'description \"${1:what this feature is for}\"', documentation: 'A human-readable description.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'Policies that must pass for everything in the feature.' },\n { label: 'depends on', insertText: 'depends on ${1:Name}', documentation: 'Declares an allowed module or feature dependency. Sibling feature names resolve before module names.' },\n { label: 'import \"…\"', insertText: 'import \"${1:*.play}\"', documentation: 'Imports `.play` files into this feature — their top level is the feature\\'s body.' },\n { label: 'feature', insertText: 'feature ${1:Name}\\n ', documentation: 'Declares a nested sub-feature.' },\n { label: 'slice StateChange', insertText: 'slice StateChange ${1:Name}\\n ', documentation: 'A command → events flow; something that changes the system.' },\n { label: 'slice StateView', insertText: 'slice StateView ${1:Name}\\n ', documentation: 'A query + projection + screen; something that reads the system.' },\n { label: 'slice Automation', insertText: 'slice Automation ${1:Name}\\n ', documentation: 'A reaction or reducer; something that runs when something happens.' },\n { label: 'slice Translate', insertText: 'slice Translate ${1:Name}\\n ', documentation: 'A capture; converts external data into events.' },\n { label: 'contribute', insertText: 'contribute to ${1:Navigation}\\n navigate to ${2:Screen}\\n label \"${3:Label}\"', documentation: 'Contributes an entry to a slot of the shell, such as navigation.' },\n ...interactionItems,\n];\n\nexport const readModelItems: CompletionEntry[] = [\n documentationItem,\n { label: 'passive', insertText: 'passive', documentation: 'Opts into replay on demand for command decisions, not materialization. Default active, never inferred; queries and screens cannot observe this model.' },\n { label: 'description', insertText: 'description \"${1:what one instance holds}\"', documentation: 'A human-readable description.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the file this read model is realized by.' },\n { label: 'property', insertText: '${1:property} ${2:Type}', documentation: 'A property of the read model — a name and a type reference.' },\n];\n\nexport const reducerItems: CompletionEntry[] = [\n { label: 'from', insertText: 'from ${1:Source.Stream}', documentation: 'Observe matching routed facts only, without filtering stream ids. ESM v10.' },\n { label: 'description', insertText: 'description \"${1:what the reducer does}\"', documentation: 'A human-readable description.' },\n { label: 'on', insertText: 'on ${1:EventType}\\n ```csharp\\n ${2}\\n ```', documentation: 'A rule applied when the event occurs, in code or from a file.' },\n];\n\nexport const formItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:input surface intent}\"', documentation: 'Report-only description of the form.' },\n { label: 'populate via query', insertText: 'populate via query ${1:Query} by ${2:parameter}', documentation: 'Fills the form from a query before it is shown.' },\n { label: 'populate from item', insertText: 'populate from item', documentation: 'Fills the form from the item the screen was opened for.' },\n { label: 'field', insertText: 'field ${1:property} label \"${2:Label}\"', documentation: 'A form field bound to a command property.' },\n ...interactionItems,\n];\n\nexport const contributeItems: CompletionEntry[] = [\n { label: 'navigate to', insertText: 'navigate to ${1:Screen}', documentation: 'The screen the entry opens.' },\n { label: 'label', insertText: 'label \"${1:Label}\"', documentation: 'The text of the entry.' },\n { label: 'order', insertText: 'order ${1:10}', documentation: 'Where the entry sits among the others; lower comes first.' },\n];\n\nexport const behaviorItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:what the behavior does}\"', documentation: 'A human-readable description.' },\n { label: 'parameter', insertText: 'parameter ${1:name} ${2:Type}', documentation: 'A value the behavior is given where it is attached.' },\n { label: 'order', insertText: 'order ${1:10}', documentation: 'The order behaviors attached to the same element run in.' },\n { label: 'on', insertText: 'on ${1|click,select,submit,change,load,unload,enter,leave|}\\n ${2:execute command}', documentation: 'Wires what happens on an interaction.' },\n];\n\nconst step = (label: string, insertText: string, documentation: string): CompletionEntry => ({ label, insertText, documentation });\n\n// What an interaction does, and what can follow an action's outcome.\nexport const actionStepItems: CompletionEntry[] = [\n step('execute', 'execute ${1:command}', 'Runs a command.'),\n step('navigate to', 'navigate to ${1:Screen}', 'Opens a screen.'),\n step('open', 'open ${1:Dialog}', 'Opens a dialog.'),\n step('close', 'close', 'Closes the dialog.'),\n step('refresh', 'refresh ${1:query}', 'Reloads a query.'),\n step('set', 'set ${1:name} ${2:value}', 'Sets a value.'),\n step('notify', 'notify ${1|info,warning,error|} \"${2:message}\"', 'Shows a notification.'),\n step('confirm', 'confirm ${1:message}\\n on success\\n ${2:execute command}', 'Asks before continuing.'),\n step('raise', 'raise ${1:Trigger}', 'Raises a trigger.'),\n];\n\nexport const outcomeItems: CompletionEntry[] = [\n step('on success', 'on success\\n ${1:notify info \"Done\"}', 'What happens when it succeeds.'),\n step('on failure', 'on failure\\n ${1:notify error \"Failed\"}', 'What happens when it fails.'),\n ...actionStepItems,\n];\n\nexport const personaItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:who they are}\"', documentation: 'A human-readable description.' },\n { label: 'goal', insertText: 'goal \"${1:what they want to achieve}\"', documentation: 'A goal of this persona.' },\n { label: 'policy', insertText: 'policy ${1:PolicyName}', documentation: 'A policy this persona holds.' },\n { label: 'position', insertText: 'position ${1:0} ${2:0}', documentation: 'Where the persona sits on the personas canvas.' },\n { label: 'size', insertText: 'size ${1:300} ${2:180}', documentation: 'How big the persona is on the personas canvas.' },\n];\n\nexport const authenticationItems: CompletionEntry[] = [\n { label: 'provider', insertText: 'provider ${1:Name}', documentation: 'An identity provider.' },\n { label: 'provider (named)', insertText: 'provider ${1:Kind} name ${2:Name}', documentation: 'An identity provider of a kind, under its own name.' },\n];\n\nexport const onboardingItems: CompletionEntry[] = [\n { label: 'signup (creates tenant)', insertText: 'signup open creates tenant', documentation: 'Turns self-signup on; a sign-up creates a tenant for the person signing up.' },\n { label: 'signup (joins tenant)', insertText: 'signup open joins tenant', documentation: 'Turns self-signup on; a sign-up asks to join an existing tenant.' },\n { label: 'invite tenant', insertText: 'invite tenant as ${1:Persona}', documentation: 'An invitation that creates a tenant for the invitee, who becomes the persona.' },\n { label: 'invite member', insertText: 'invite member\\n by ${1:Persona}\\n grant ${2:Persona}', documentation: 'An invitation into an existing tenant: who may send it and which personas it grants.' },\n { label: 'legal terms', insertText: 'legal terms\\n file ${1:Legal/terms-of-service.md}', documentation: 'The documents a newcomer must accept, as files relative to the repository root.' },\n { label: 'offering', insertText: 'offering ${1:Name}', documentation: 'The offering a new tenant starts on. The name is opaque to the model.' },\n { label: 'emails', insertText: 'emails\\n invitation file ${1:Emails/invitation.html}\\n welcome file ${2:Emails/welcome.html}\\n images ${3:Emails/Images}', documentation: 'A template file per onboarding email and the folder holding their images.' },\n];\n\nexport const inviteMemberItems: CompletionEntry[] = [\n { label: 'by', insertText: 'by ${1:Persona}', documentation: 'The personas that may send the invitation.' },\n { label: 'grant', insertText: 'grant ${1:Persona}', documentation: 'The personas the invitation gives the invitee.' },\n];\n\nexport const legalTermsItems: CompletionEntry[] = [\n { label: 'file', insertText: 'file ${1:Legal/terms-of-service.md}', documentation: 'A document the newcomer must accept, relative to the repository root.' },\n];\n\nexport const emailItems: CompletionEntry[] = [\n { label: 'invitation', insertText: 'invitation file ${1:Emails/invitation.html}', documentation: 'The template of the invitation email.' },\n { label: 'welcome', insertText: 'welcome file ${1:Emails/welcome.html}', documentation: 'The template of the welcome email.' },\n { label: 'signupDeclined', insertText: 'signupDeclined file ${1:Emails/signup-declined.html}', documentation: 'The template of the email sent when a sign-up is declined.' },\n { label: 'images', insertText: 'images ${1:Emails/Images}', documentation: 'The folder, relative to the repository root, holding the images the templates use.' },\n];\n\nexport const seedItems: CompletionEntry[] = [\n { label: 'for', insertText: 'for ${1:\"event-source-id\"}\\n ${2:EventType}\\n ${3:property} = ${4:value}', documentation: 'Events to seed for one event source id.' },\n { label: 'position', insertText: 'position ${1:0} ${2:0}', documentation: 'Where the seed data sits on the seed data canvas.' },\n];\n\nexport const themeItems: CompletionEntry[] = [\n { label: 'compatible with', insertText: 'compatible with ${1:Package}', documentation: 'A component package the theme is compatible with.' },\n];\n\nexport const uiProfileItems: CompletionEntry[] = [\n { label: 'target platform', insertText: 'target platform ${1:web}', documentation: 'The platforms the profile is for.' },\n { label: 'target size', insertText: 'target size ${1|compact,regular|}', documentation: 'The screen sizes the profile is for.' },\n { label: 'packages', insertText: 'packages\\n ${1:Package}', documentation: 'The component packages the profile uses.' },\n { label: 'layout', insertText: 'layout ${1:Layout}', documentation: 'The layout of the profile. Older form of `root template`; prefer `root template`.' },\n { label: 'theme', insertText: 'theme ${1:Theme}', documentation: 'The theme of the profile, named by a declared theme\\'s identifier.' },\n { label: 'theme (package-provided)', insertText: 'theme \"${1:Scene Default Light}\"', documentation: 'The theme of the profile, named by the quoted display name of a theme a component package provides.' },\n { label: 'root template', insertText: 'root template ${1:Template}\\n option ${2:navigationMode} ${3:slim}', documentation: 'The template the whole application is drawn in: an own template, or `blueprint <Blueprint> <Name> [version \"<range>\"]`, with the options the shell exposes.' },\n { label: 'root template blueprint', insertText: 'root template blueprint ${1:Blueprint} ${2:Template} version \"${3:^1.0}\"', documentation: 'A root template a blueprint package ships, pinned to a semver range.' },\n { label: 'identity', insertText: 'identity\\n name \"${1:Name}\"\\n logo ${2|initials \"AB\",icon box,image \"data:image/svg+xml;base64,...\"|}\\n show name ${3|true,false|}', documentation: 'What the application calls itself and the mark it wears: `name`, `logo initials|icon|image` and `show name`.' },\n { label: 'appearance', insertText: 'appearance\\n color scheme ${1|light,dark,system|}\\n accent \"${2:#4f46e5}\"\\n corners ${3|sharp,default,round|}\\n font ${4:inter}', documentation: 'How the application looks regardless of the shell: colour scheme, accent colour, corners and font.' },\n { label: 'new screens use template', insertText: 'new screens use template ${1:Template}', documentation: 'The template a new screen starts from in the designer.' },\n { label: 'sample data', insertText: 'sample data\\n active ${1:Pack}', documentation: 'The sample data the whole application previews with, chosen once here.' },\n];\n\nexport const profileRootTemplateItems: CompletionEntry[] = [\n { label: 'option', insertText: 'option ${1:name} ${2:value}', documentation: 'Sets one of the shell\\'s own options, for example `option navigationMode slim`. The value is a word, a quoted string, a number, `true` or `false`.' },\n];\n\nexport const profileAppearanceItems: CompletionEntry[] = [\n { label: 'color scheme', insertText: 'color scheme ${1|light,dark,system|}', documentation: 'The colour scheme of the application: light, dark or follow the system.' },\n { label: 'accent', insertText: 'accent \"${1:#4f46e5}\"', documentation: 'The accent colour of the application.' },\n { label: 'corners', insertText: 'corners ${1|sharp,default,round|}', documentation: 'How rounded the application\\'s corners are: sharp, default or round.' },\n { label: 'font', insertText: 'font ${1|inter,ibm-plex-sans,source-serif-4,system-ui|}', documentation: 'The font of the application, an id from Scene\\'s font catalog.' },\n];\n\nexport const profileIdentityItems: CompletionEntry[] = [\n { label: 'name', insertText: 'name \"${1:Name}\"', documentation: 'What the application calls itself in its shell; leave it out to take the application\\'s own name.' },\n { label: 'logo initials', insertText: 'logo initials \"${1:AB}\"', documentation: 'A logo drawn from one or two characters.' },\n { label: 'logo icon', insertText: 'logo icon ${1|box,layers,home,users,receipt,package,database,palette|}', documentation: 'A logo drawn from one of Scene\\'s logo icons.' },\n { label: 'logo image', insertText: 'logo image \"data:image/svg+xml;base64,${1}\"', documentation: 'A logo image (PNG, JPG, SVG or WebP, up to 400 KB) as a base64 data URI.' },\n { label: 'show name', insertText: 'show name ${1|true,false|}', documentation: 'Whether the name is drawn beside the logo.' },\n];\n\nexport const profileSampleDataItems: CompletionEntry[] = [\n { label: 'active', insertText: 'active ${1:Pack}', documentation: 'The active sample data pack of the whole application: one declared in the document, or `blueprint <id>`.' },\n { label: 'shape maps to', insertText: 'shape ${1:Shape} maps to ${2:ReadModel}', documentation: 'Maps a sample data shape to the read model it supplies rows for.' },\n { label: 'bind', insertText: 'bind ${1:ReadModel} to ${2:Pack}', documentation: 'A rare override: binds one read model to a pack.' },\n];\n\nexport const sampleDataItems: CompletionEntry[] = [\n { label: 'title', insertText: 'title \"${1:Title}\"', documentation: 'The display title of the pack.' },\n { label: 'locale', insertText: 'locale ${1:en-GB}', documentation: 'The BCP 47 locale tag of the data.' },\n { label: 'shape', insertText: 'shape ${1:ReadModel}\\n row\\n ${2:field} = ${3:\"value\"}', documentation: 'The rows for one shape: the read model of the same name, or the one a ui profile maps it to.' },\n];\n\nexport const sampleShapeItems: CompletionEntry[] = [\n { label: 'row', insertText: 'row\\n ${1:field} = ${2:\"value\"}', documentation: 'One row of the shape.' },\n];\n\nexport const layoutItems: CompletionEntry[] = [\n { label: 'slot', insertText: '${1:slot}', documentation: 'A named slot of the shell.' },\n { label: 'slot contributes', insertText: '${1:slot} contributes ${2:Name}', documentation: 'A slot other declarations contribute to, such as `navigation contributes Navigation`.' },\n { label: 'navigation topbar', insertText: 'navigation ${1|topbar,sidebar|}\\n logo image \"${2:/logo.svg}\" title \"${3:Application}\"\\n item ${4:id} title \"${5:Title}\" target ${6:Module}', documentation: 'The application\\'s navigation region: a logo and items that target a module or feature.' },\n { label: 'arrangement', insertText: 'arrangement flow\\n column\\n ${1:slot}', documentation: 'How the slots are placed.' },\n];\n\nexport const toolbarItems: CompletionEntry[] = [\n { label: 'button', insertText: 'button ${1:id} title \"${2:Title}\" slice ${3:Module.Feature.Slice}', documentation: 'A button that invokes a State Change slice. The slice names the command and the dialog it opens over the page.' },\n { label: 'button (with emphasis)', insertText: 'button ${1:id} title \"${2:Title}\" slice ${3:Module.Feature.Slice} emphasis ${4|primary,secondary,quiet|} icon ${5:icon}', documentation: 'A toolbar button with an emphasis and an icon.' },\n { label: 'item action', insertText: 'item ${1:name} action ${2:Command}', documentation: 'A toolbar entry that runs a command.' },\n { label: 'item navigate', insertText: 'item ${1:name} navigate to ${2:Screen}', documentation: 'A toolbar entry that navigates to a screen.' },\n];\n\nexport const navigationItems: CompletionEntry[] = [\n { label: 'logo', insertText: 'logo image \"${1:/logo.svg}\" title \"${2:Application}\"', documentation: 'The application logo. Declared once, in a layout.' },\n { label: 'item', insertText: 'item ${1:id} title \"${2:Title}\" target ${3:Module.Feature}', documentation: 'A navigation item with a title, an optional `icon`, a `target` module or feature and an optional rendering `slot`. Sidebar items may nest `item` lines.' },\n { label: 'item (with slot)', insertText: 'item ${1:id} title \"${2:Title}\" icon ${3:icon} target ${4:Module.Feature} slot ${5:content}', documentation: 'A navigation item that renders its target into a named layout slot.' },\n];\n\nexport const templateItems: CompletionEntry[] = [\n { label: 'fits slot', insertText: 'fits slot ${1:content}', documentation: 'The slot of the shell the template fits.' },\n ...layoutItems,\n { label: 'on', insertText: 'on ${1|enter,leave,load,unload|}\\n ${2:refresh query}', documentation: 'Wires what happens on an interaction.' },\n];\n\nexport const interactionNames = interactions;\n"],"mappings":"gPAUA,MAAMA,EAAsC,CACxC,CAAE,MAAO,KAAM,WAAY,wFAAyF,cAAe,2FAA4F,EAC/N,CAAE,MAAO,OAAQ,WAAY,qBAAsB,cAAe,sDAAuD,CAC7H,EAEaC,EAAsC,CAC/CC,EACAC,EACA,GAAGC,EACH,CAAE,MAAO,cAAe,WAAY,6CAA8C,cAAe,+BAAgC,EACjI,CAAE,MAAO,YAAa,WAAY,4BAA6B,cAAe,uDAAwD,EACtI,CAAE,MAAO,aAAc,WAAY,uBAAwB,cAAe,mHAAoH,EAC9L,CAAE,MAAO,aAAc,WAAY,yBAA0B,cAAe,gFAAkF,EAC9J,CAAE,MAAO,UAAW,WAAY;MAA2B,cAAe,gDAAiD,EAC3H,CAAE,MAAO,SAAU,WAAY,qEAAsE,cAAe,oCAAqC,EACzJ,CAAE,MAAO,kBAAmB,WAAY;;;gBAA0E,cAAe,iEAAkE,EACnM,CAAE,MAAO,kBAAmB,WAAY,6DAA8D,cAAe,6DAA8D,EACnL,CAAE,MAAO,OAAQ,WAAY,8EAA+E,cAAe,qCAAsC,EACjK,CAAE,MAAO,aAAc,WAAY,qFAAsF,cAAe,kEAAmE,EAC3M,CAAE,MAAO,6BAA8B,WAAY,mIAAoI,cAAe,2JAA8J,EACpW,GAAGJ,CACP,EAEaK,EAAuC,CAChDH,EACAC,EACA,GAAGC,EACH,CAAE,MAAO,cAAe,WAAY,8C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ens.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./_virtual/_virtual/_rolldown/runtime.js";import{clauseKeywords as e,codeBlockTags as t,constructKeywords as n,primitiveTypes as r,sliceTypes as i}from"./language.js";import{bmpWordCharacters as a}from"./bmp-word-characters.js";const o=/* @__PURE__ */ new Set([`operation`,`system`,`eventsource`,`purpose`,`runs`,`time`,`statemachine`,`workflow`]),s={csharp:`csharp`,java:`java`,typescript:`typescript`,react:`typescript`,html:`html`,sql:`sql`};function subLanguageState(e){return`subLanguage_${e}`}function subLanguageExitRule(e){let t=[...n.filter(e=>!o.has(e)),...e.map(e=>e.keyword)];return[RegExp(`^\\s*(?:${t.join(`|`)})\\b`),{token:`@rematch`,next:`@pop`}]}const c=[[/\/\/.*$/,`comment`],[/\$(?:context|identity|eventContext|eventSourceId|causedBy|refusal)(?:\.\w+)*/,`variable.predefined`],[/\$(?:env|secrets|strings)\.[\w.]+/,`variable.predefined`],[/\$\.[\w.]*/,`variable.predefined`],[/"(?:[^"\\]|\\.)*"/,`string`],[/"(?:[^"\\]|\\.)*$/,`string.invalid`],[/\d+(?:ms|s|m|h|d)\b/,`number`],[/-?\d+\.\d+/,`number.float`],[/-?\d+/,`number`],[/=>|==|!=|>=|<=|[><=:?]/,`operator`],[/[[\](),.]/,`delimiter`],[/\s+/,`white`]];function createTokensProvider(l){let u={root:[[RegExp(`^(\\s*)(example)(\\s+)([A-Z][${a}]*)(\\s*)(:)(\\s*)([A-Z][${a}.]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,`type.identifier`,`white`,`operator`,`white`,`type.identifier`]],[/^(time)(\s+)(zone)(\s+)(configurable\s+default\s+)?(?=")/,[`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(calendar)(\s+)(?="|from\s+\$context\.)/,[`white`,`keyword`,`white`]],[/^(\s*)(given)(\s+)(time)(\s+)(zone)(?=\s+")/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(direction)(\s+)(inbound|outbound)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`]],[RegExp(`^()(purpose)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@purposeBody.$1`}]],[/^(\s*)(parameter)(\s+)([a-z_]\w*)(\s+)([\w.]+(?:\[\])?(?:\s+optional)?)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`identifier`,`white`,`type.identifier`]],[/^(\s*)(case)(\s+)([A-Za-z_]\w*)(?=\s*(?:[a-z_]\w*\s*=|\/\/|$))/,[`white`,`keyword`,`white`,`type.identifier`]],[/\b(case)(\.)([a-z_]\w*)\b/,[`keyword`,`delimiter`,`identifier`]],[/^(\s*)(concept)(\s+)([^\s:]+)(\s*:\s*)(\w+)((?:\s+(?:@?pii|personal|@?sensitive|secret))*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`,`operator`,{token:`type.identifier`,next:`@conceptBody.$1`},`keyword`]],[/^(command)(\s+)(reads)(\s+)(protected)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(reaction)(\s+)(batches)(\s+)(atomic)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(numbers)([ \t]+)(exact)(?=[ \t]*(?:(?:\/\/|#).*)?$)/,[`keyword`,`white`,`keyword`]],[/^(eventsource)(\s+)([A-Za-z_]\w*)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,`type.identifier`]],[/^(system)(\s+)([A-Z]\w*)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,`type.identifier`]],[/^(\s*)(runs)(\s+)(as)(\s+)(system)\b/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(produces\s+operation)(\s+)([A-Z]\w*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@operationBody.$1`}]],[/^(\s*)(given\s+operation)(\s+)([\w.]+)(\s+)(fails)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`]],[/^(\s*)(then\s+(?:operation|compensated|invokes))(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`]],[RegExp(`^(\\s*)(command)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@commandBody.$1`}]],[/^(\s*)(handler)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@handlerBody.$1`}]],[/^(\s*@?[a-z_]\w*\s+)([\w.]+(?:\[\])?(?:\?|\s+optional)?)(\s+)(generated)(\s+identifier|)(?=\s*(?:\/\/.*)?$)/,[`identifier`,`type.identifier`,`white`,`keyword`,`keyword`]],[/^(\s*)(generated)(\s+)([a-z_]\w*)(\s*=(?!=|>))/,[`white`,`keyword`,`white`,`identifier`,`operator`]],[/^(\s*)(then)(\s+)(returns)\b/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(returns)(?=\s*(?:\/\/.*)?$|\s+@\w+\s*(?:\/\/.*)?$)/,[`white`,`keyword`]],[/^(\s*@?[a-z_]\w*\s+)([\w.]+)(\s+)(key)(?=\s*(?:\/\/.*)?$)/,[`identifier`,`type.identifier`,`white`,`keyword`]],[/^(\s*(?:by|filter)\s+[a-z_]\w*\s+)([\w.]+(?:\[\])?)(\s+)(optional)\b(?=\s*(?:from\b|\/\/|$))/,[`identifier`,`type.identifier`,`white`,`keyword`]],[/^(?!\s*(?:by|filter)\s+)(\s*@?[a-z_]\w*\s+)([\w.]+(?:\[\])?)(\s+)(optional)\b(?=\s*(?:identifier\b|from\b|=(?!=|>)|\/\/|$))/,[`identifier`,`type.identifier`,`white`,`keyword`]],[/^(\s*query\s+[A-Za-z_]\w*\s*=>\s*(?!observable\s+optional\s*(?:\/\/.*)?$)(?:observable\s+)?)([\w.]+(?:\[\])?)(\s+)(optional)\b(?=\s*(?:\/\/.*)?$)/,[`keyword`,`type.identifier`,`white`,`keyword`]],[RegExp(`^(\\s*)(given)(\\s+)(caller)(\\s+)(as)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(given|when)(\s+)(clock|capture|trigger|query)\b/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(then)(\s+)(result|no\s+(?:result|events))\b/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(then)(\s+)(events)(\s+)(in any order)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(when)(\s+)(redelivered)(\s+)([\w.]+)(\s+)(to)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(action)(\s+)("(?:[^"\\]|\\.)*"|\$strings\.[\w.]+)(\s+)(for)(\s+)(item|screen)\b/,[`white`,`keyword`,`white`,`string`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(action)(\s+)([\w.]+)(\s+)(for)(\s+)(item|screen)\b/,[`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(item)(\s+)(\w+)(\s+)(action)(\s+)([\w.]+)(\s+)(for)(\s+)(item|screen)\b/,[`white`,`keyword`,`white`,`identifier`,`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(otherwise)(\s+)(hidden)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(otherwise)(\s+)(execute)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(when)(\s+)(?=.+\s+execute\s+[\w.]+\s*(?:\/\/.*)?$)/,[`white`,`keyword`,{token:`white`,next:`@guardedActionCondition`}]],[/^(\s*)(behavior)(\s+)([A-Za-z_]\w*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@behaviorBody.$1`}]],[/^(\s*)(on)(\s+)(refused)(\s+)(by)(\s+)(validation|constraint|authorization)\b/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(on)(\s+)(refused)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(on)(\s+)([\w-]+)\b/,[`white`,`keyword`,`white`,{token:`keyword`,next:`@interactionBody.$1`}]],[/^(\s*)(acknowledge)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`]],[/^(\s*)(import)(\s+)("[^"\\]*")/,[`white`,`keyword`,`white`,`string.link`]],[/^(\s*)((?:(?:produces|public)\s+)?event)(\s+)([A-Za-z_]\w*)(\s+)(generation)(\s+)(\d+)(?=\s*(?:from\s+"(?:[^"\\]|\\.)*"\s*)?(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`,`white`,{token:`number`,next:`@eventBody.$1`}]],[/^(\s*)((?:(?:produces|public)\s+)?event)(\s+)([A-Za-z_]\w*)(?=\s*(?:from\s+"(?:[^"\\]|\\.)*"\s*)?(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@eventBody.$1`}]],...t.map(e=>[RegExp(`^\\s*\\x60\\x60\\x60${e}\\s*$`),{token:`string.quote`,next:`@codeBlock.${s[e]}`,nextEmbedded:s[e]}]),...t.map(e=>[RegExp(`\\b${e}\\b(?=\\s*$)`),{token:`keyword.tag`,next:`@codeBlockPending.${s[e]}`}]),...l.map(e=>[RegExp(`\\b${e.keyword}\\b`),{token:`keyword`,next:`@${subLanguageState(e.keyword)}`}]),[/^(\s*)(documentation)(?=\s+[\w.]+(?:\[\])?(?:\?|\s+optional)?\s*(?:identifier\b|generated\b|=(?!=|>)|\/\/|$))/,[`white`,`identifier`]],[/\b(?:description|documentation)\b(?=\s*(?:\/\/.*)?$)/,{token:`keyword`,next:`@descriptionBlockPending`}],[/\brow-click\b/,`keyword`],[/^\s*@[a-z_]\w*/,`identifier`],[/@\w+/,`annotation`],[/[A-Z]\w*/,{cases:{"@sliceTypes":`keyword.type`,"@primitiveTypes":`type`,"@default":`type.identifier`}}],[/[a-z_]\w*/,{cases:{"@keywords":`keyword`,"@default":`identifier`}}],{include:`@common`}],guardedActionCondition:[[/(execute)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,{token:`type.identifier`,next:`@pop`}]],{include:`@root`}],behaviorBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],{include:`@root`}],interactionBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(otherwise)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`]],[/^(\s*)(when)(\s+)(?=item\.|\()/,[`white`,`keyword`,`white`]],[/^(\s*)(execute)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`]],{include:`@root`}],purposeBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(basis|interest|condition|authorization|subjects|retention|recipient|transfer|erasure)(\s+)/,[`white`,`keyword`,`white`]],[/\b(safeguard|exception)\b/,`keyword`],{include:`@root`}],generationLine:[[/^/,{token:`@rematch`,next:`@pop`}],[/\b(prefix|case|alphabet|checksum|base64url|hex|base32|lower|upper|luhn|mod11|mod97)\b/,`keyword`],{include:`@common`}],conceptBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(validate)(\s+)(checksum)(\s+)(luhn|mod11|mod97)\b/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(checksum)(\s+)(luhn|mod11|mod97)\b/,[`white`,`keyword`,`white`,`keyword`]],[RegExp(`^(\\s*)(@?[a-z_][${a}]*)(\\s*)(=)(\\s*)(-?(?:0|[1-9][0-9]*))(?=\\s*(?://.*)?$)`),[`white`,`identifier`,`white`,`operator`,`white`,`number`]],[/^(\s*)(@?pii|personal|@?sensitive|secret)(\s+)(reason|scope|special|criminal)\b/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(generate)(\s+)(uuidv7|uuid|ulid|typeid|nanoid|bytes|pattern|random|rule|sequence)\b/,[`white`,`keyword`,`white`,{token:`keyword`,next:`@generationLine`}]],{include:`@root`}],commandBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(validate)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@commandValidation.$1`}]],{include:`@root`}],commandValidation:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[RegExp(`^(\\s*)([${a}.]+)(\\s+)(rule)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?:severity\\s+\\w+|message\\s+.*|//.*|$))`),[`white`,`identifier`,`white`,`keyword`,`white`,{token:`type.identifier`,next:`@namedRuleBody.$1`}]],{include:`@root`}],namedRuleBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(implementation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@implementationBody.$1`}]],{include:`@root`}],operationBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(execute|compensate)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@operationPhase.$1`}]],[/^(\s*)(uses)(\s+)([A-Z]\w*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(@?[a-z_]\w*)(\s+)([\w.]+(?:\[\])?(?:\?|\s+optional)?)(?=\s*(?:=(?!=|>)|\/\/|$))/,[`white`,`identifier`,`white`,`type.identifier`]],{include:`@root`}],operationPhase:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(implementation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@implementationBody.$1`}]],{include:`@root`}],handlerBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(implementation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@implementationBody.$1`}]],{include:`@root`}],implementationBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(hint)(?=\s+")/,[`white`,`keyword`]],{include:`@root`}],eventBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(id)(?=\s+")/,[`white`,`keyword`]],[/^(\s*)(documentation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@descriptionBlockPending`}]],{include:`@root`}],common:c,codeBlockPending:[[/^\s*```\s*$/,{token:`string.quote`,switchTo:`@codeBlock.$S2`,nextEmbedded:`$S2`}],[/^\s*[^\s`].*$/,{token:`@rematch`,next:`@pop`}],[/\s+/,`white`]],codeBlock:[[/^\s*```\s*$/,{token:`string.quote`,next:`@pop`,nextEmbedded:`@pop`}],[/[^`]+/,``],[/`/,``]],descriptionBlockPending:[[/\/\/.*$/,`comment`],[/^\s*```(?:text|markdown)?\s*$/,{token:`string.quote`,switchTo:`@descriptionBlock`}],[/^\s*[^\s`].*$/,{token:`@rematch`,next:`@pop`}],[/\s+/,`white`]],descriptionBlock:[[/^\s*```\s*$/,{token:`string.quote`,next:`@pop`}],[/.+/,`string`]]};for(let e of l)u[subLanguageState(e.keyword)]=[subLanguageExitRule(l),...e.tokens,{include:`@common`},[/[A-Z]\w*/,`type.identifier`],[/[a-z_]\w*/,`identifier`]];return{defaultToken:``,tokenPostfix:`.play`,ignoreCase:!1,keywords:[...n.filter(e=>!o.has(e)),...e,...t],sliceTypes:i,primitiveTypes:r,tokenizer:u}}export{c as commonTokenRules,createTokensProvider};
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{clauseKeywords as e,codeBlockTags as t,constructKeywords as n,primitiveTypes as r,sliceTypes as i}from"./language.js";import{bmpWordCharacters as a}from"./bmp-word-characters.js";const o=/* @__PURE__ */ new Set([`operation`,`system`,`eventsource`,`purpose`,`context`,`runs`,`time`,`statemachine`,`workflow`]),s={csharp:`csharp`,java:`java`,typescript:`typescript`,react:`typescript`,html:`html`,sql:`sql`};function subLanguageState(e){return`subLanguage_${e}`}function subLanguageExitRule(e){let t=[...n.filter(e=>!o.has(e)),...e.map(e=>e.keyword)];return[RegExp(`^\\s*(?:${t.join(`|`)})\\b`),{token:`@rematch`,next:`@pop`}]}const c=[[/\/\/.*$/,`comment`],[/\$(?:context|identity|eventContext|eventSourceId|causedBy|refusal)(?:\.\w+)*/,`variable.predefined`],[/\$(?:env|secrets|strings)\.[\w.]+/,`variable.predefined`],[/\$\.[\w.]*/,`variable.predefined`],[/"(?:[^"\\]|\\.)*"/,`string`],[/"(?:[^"\\]|\\.)*$/,`string.invalid`],[/\d+(?:ms|s|m|h|d)\b/,`number`],[/-?\d+\.\d+/,`number.float`],[/-?\d+/,`number`],[/=>|==|!=|>=|<=|[><=:?]/,`operator`],[/[[\](),.]/,`delimiter`],[/\s+/,`white`]];function createTokensProvider(l){let u={root:[[RegExp(`^(\\s*)(example)(\\s+)([A-Z][${a}]*)(\\s*)(:)(\\s*)([A-Z][${a}.]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,`type.identifier`,`white`,`operator`,`white`,`type.identifier`]],[/^(time)(\s+)(zone)(\s+)(configurable\s+default\s+)?(?=")/,[`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(calendar)(\s+)(?="|from\s+\$context\.)/,[`white`,`keyword`,`white`]],[/^(\s*)(given)(\s+)(time)(\s+)(zone)(?=\s+")/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(direction)(\s+)(inbound|outbound)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`]],[RegExp(`^()(purpose)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@purposeBody.$1`}]],[/^(\s*)(parameter)(\s+)([a-z_]\w*)(\s+)([\w.]+(?:\[\])?(?:\s+optional)?)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`identifier`,`white`,`type.identifier`]],[/^(\s*)(case)(\s+)([A-Za-z_]\w*)(?=\s*(?:[a-z_]\w*\s*=|\/\/|$))/,[`white`,`keyword`,`white`,`type.identifier`]],[/\b(case)(\.)([a-z_]\w*)\b/,[`keyword`,`delimiter`,`identifier`]],[/^(\s*)(concept)(\s+)([^\s:]+)(\s*:\s*)(\w+)((?:\s+(?:@?pii|personal|@?sensitive|secret))*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`,`operator`,{token:`type.identifier`,next:`@conceptBody.$1`},`keyword`]],[/^()(context)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@applicationContextBody.$1`}]],[/^(\s*)(context)(\s+)(from)\b/,[`white`,`keyword`,`white`,`keyword`]],[/^(command)(\s+)(reads)(\s+)(protected)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(reaction)(\s+)(batches)(\s+)(atomic)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(numbers)([ \t]+)(exact)(?=[ \t]*(?:(?:\/\/|#).*)?$)/,[`keyword`,`white`,`keyword`]],[/^(eventsource)(\s+)([A-Za-z_]\w*)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,`type.identifier`]],[/^(system)(\s+)([A-Z]\w*)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,`type.identifier`]],[/^(\s*)(runs)(\s+)(as)(\s+)(system)\b/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(produces\s+operation)(\s+)([A-Z]\w*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@operationBody.$1`}]],[/^(\s*)(given\s+operation)(\s+)([\w.]+)(\s+)(fails)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`]],[/^(\s*)(then\s+(?:operation|compensated|invokes))(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`]],[RegExp(`^(\\s*)(command)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@commandBody.$1`}]],[/^(\s*)(handler)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@handlerBody.$1`}]],[/^(\s*@?[a-z_]\w*\s+)([\w.]+(?:\[\])?(?:\?|\s+optional)?)(\s+)(generated)(\s+identifier|)(?=\s*(?:\/\/.*)?$)/,[`identifier`,`type.identifier`,`white`,`keyword`,`keyword`]],[/^(\s*)(generated)(\s+)([a-z_]\w*)(\s*=(?!=|>))/,[`white`,`keyword`,`white`,`identifier`,`operator`]],[/^(\s*)(then)(\s+)(returns)\b/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(returns)(?=\s*(?:\/\/.*)?$|\s+@\w+\s*(?:\/\/.*)?$)/,[`white`,`keyword`]],[/^(\s*@?[a-z_]\w*\s+)([\w.]+)(\s+)(key)(?=\s*(?:\/\/.*)?$)/,[`identifier`,`type.identifier`,`white`,`keyword`]],[/^(\s*(?:by|filter)\s+[a-z_]\w*\s+)([\w.]+(?:\[\])?)(\s+)(optional)\b(?=\s*(?:from\b|\/\/|$))/,[`identifier`,`type.identifier`,`white`,`keyword`]],[/^(?!\s*(?:by|filter)\s+)(\s*@?[a-z_]\w*\s+)([\w.]+(?:\[\])?)(\s+)(optional)\b(?=\s*(?:identifier\b|from\b|=(?!=|>)|\/\/|$))/,[`identifier`,`type.identifier`,`white`,`keyword`]],[/^(\s*query\s+[A-Za-z_]\w*\s*=>\s*(?!observable\s+optional\s*(?:\/\/.*)?$)(?:observable\s+)?)([\w.]+(?:\[\])?)(\s+)(optional)\b(?=\s*(?:\/\/.*)?$)/,[`keyword`,`type.identifier`,`white`,`keyword`]],[RegExp(`^(\\s*)(given)(\\s+)(caller)(\\s+)(as)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(given|when)(\s+)(clock|capture|trigger|query)\b/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(then)(\s+)(result|no\s+(?:result|events))\b/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(then)(\s+)(events)(\s+)(in any order)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(when)(\s+)(redelivered)(\s+)([\w.]+)(\s+)(to)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(action)(\s+)("(?:[^"\\]|\\.)*"|\$strings\.[\w.]+)(\s+)(for)(\s+)(item|screen)\b/,[`white`,`keyword`,`white`,`string`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(action)(\s+)([\w.]+)(\s+)(for)(\s+)(item|screen)\b/,[`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(item)(\s+)(\w+)(\s+)(action)(\s+)([\w.]+)(\s+)(for)(\s+)(item|screen)\b/,[`white`,`keyword`,`white`,`identifier`,`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(otherwise)(\s+)(hidden)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(otherwise)(\s+)(execute)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(when)(\s+)(?=.+\s+execute\s+[\w.]+\s*(?:\/\/.*)?$)/,[`white`,`keyword`,{token:`white`,next:`@guardedActionCondition`}]],[/^(\s*)(behavior)(\s+)([A-Za-z_]\w*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@behaviorBody.$1`}]],[/^(\s*)(on)(\s+)(refused)(\s+)(by)(\s+)(validation|constraint|authorization)\b/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(on)(\s+)(refused)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(on)(\s+)([\w-]+)\b/,[`white`,`keyword`,`white`,{token:`keyword`,next:`@interactionBody.$1`}]],[/^(\s*)(acknowledge)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`]],[/^(\s*)(import)(\s+)("[^"\\]*")/,[`white`,`keyword`,`white`,`string.link`]],[/^(\s*)((?:(?:produces|public)\s+)?event)(\s+)([A-Za-z_]\w*)(\s+)(generation)(\s+)(\d+)(?=\s*(?:from\s+"(?:[^"\\]|\\.)*"\s*)?(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`,`white`,{token:`number`,next:`@eventBody.$1`}]],[/^(\s*)((?:(?:produces|public)\s+)?event)(\s+)([A-Za-z_]\w*)(?=\s*(?:from\s+"(?:[^"\\]|\\.)*"\s*)?(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@eventBody.$1`}]],...t.map(e=>[RegExp(`^\\s*\\x60\\x60\\x60${e}\\s*$`),{token:`string.quote`,next:`@codeBlock.${s[e]}`,nextEmbedded:s[e]}]),...t.map(e=>[RegExp(`\\b${e}\\b(?=\\s*$)`),{token:`keyword.tag`,next:`@codeBlockPending.${s[e]}`}]),...l.map(e=>[RegExp(`\\b${e.keyword}\\b`),{token:`keyword`,next:`@${subLanguageState(e.keyword)}`}]),[/^(\s*)(documentation)(?=\s+[\w.]+(?:\[\])?(?:\?|\s+optional)?\s*(?:identifier\b|generated\b|=(?!=|>)|\/\/|$))/,[`white`,`identifier`]],[/\b(?:description|documentation)\b(?=\s*(?:\/\/.*)?$)/,{token:`keyword`,next:`@descriptionBlockPending`}],[/\brow-click\b/,`keyword`],[/^\s*@[a-z_]\w*/,`identifier`],[/@\w+/,`annotation`],[/[A-Z]\w*/,{cases:{"@sliceTypes":`keyword.type`,"@primitiveTypes":`type`,"@default":`type.identifier`}}],[/[a-z_]\w*/,{cases:{"@keywords":`keyword`,"@default":`identifier`}}],{include:`@common`}],guardedActionCondition:[[/(execute)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,{token:`type.identifier`,next:`@pop`}]],{include:`@root`}],behaviorBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],{include:`@root`}],interactionBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(otherwise)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`]],[/^(\s*)(when)(\s+)(?=item\.|\()/,[`white`,`keyword`,`white`]],[/^(\s*)(execute)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`]],{include:`@root`}],applicationContextBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(@?[a-z_]\w*)(\s+)(time)(\s+)(zone)(?=\s*(?:\/\/.*)?$)/,[`white`,`identifier`,`white`,`type.identifier`,`white`,`type.identifier`]],{include:`@root`}],purposeBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(basis|interest|condition|authorization|subjects|retention|recipient|transfer|erasure)(\s+)/,[`white`,`keyword`,`white`]],[/\b(safeguard|exception)\b/,`keyword`],{include:`@root`}],generationLine:[[/^/,{token:`@rematch`,next:`@pop`}],[/\b(prefix|case|alphabet|checksum|base64url|hex|base32|lower|upper|luhn|mod11|mod97)\b/,`keyword`],{include:`@common`}],conceptBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(validate)(\s+)(checksum)(\s+)(luhn|mod11|mod97)\b/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(checksum)(\s+)(luhn|mod11|mod97)\b/,[`white`,`keyword`,`white`,`keyword`]],[RegExp(`^(\\s*)(@?[a-z_][${a}]*)(\\s*)(=)(\\s*)(-?(?:0|[1-9][0-9]*))(?=\\s*(?://.*)?$)`),[`white`,`identifier`,`white`,`operator`,`white`,`number`]],[/^(\s*)(@?pii|personal|@?sensitive|secret)(\s+)(reason|scope|special|criminal)\b/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(generate)(\s+)(uuidv7|uuid|ulid|typeid|nanoid|bytes|pattern|random|rule|sequence)\b/,[`white`,`keyword`,`white`,{token:`keyword`,next:`@generationLine`}]],{include:`@root`}],commandBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(validate)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@commandValidation.$1`}]],{include:`@root`}],commandValidation:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[RegExp(`^(\\s*)([${a}.]+)(\\s+)(rule)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?:severity\\s+\\w+|message\\s+.*|//.*|$))`),[`white`,`identifier`,`white`,`keyword`,`white`,{token:`type.identifier`,next:`@namedRuleBody.$1`}]],{include:`@root`}],namedRuleBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(implementation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@implementationBody.$1`}]],{include:`@root`}],operationBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(execute|compensate)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@operationPhase.$1`}]],[/^(\s*)(uses)(\s+)([A-Z]\w*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(@?[a-z_]\w*)(\s+)([\w.]+(?:\[\])?(?:\?|\s+optional)?)(?=\s*(?:=(?!=|>)|\/\/|$))/,[`white`,`identifier`,`white`,`type.identifier`]],{include:`@root`}],operationPhase:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(implementation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@implementationBody.$1`}]],{include:`@root`}],handlerBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(implementation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@implementationBody.$1`}]],{include:`@root`}],implementationBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(hint)(?=\s+")/,[`white`,`keyword`]],{include:`@root`}],eventBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(id)(?=\s+")/,[`white`,`keyword`]],[/^(\s*)(documentation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@descriptionBlockPending`}]],{include:`@root`}],common:c,codeBlockPending:[[/^\s*```\s*$/,{token:`string.quote`,switchTo:`@codeBlock.$S2`,nextEmbedded:`$S2`}],[/^\s*[^\s`].*$/,{token:`@rematch`,next:`@pop`}],[/\s+/,`white`]],codeBlock:[[/^\s*```\s*$/,{token:`string.quote`,next:`@pop`,nextEmbedded:`@pop`}],[/[^`]+/,``],[/`/,``]],descriptionBlockPending:[[/\/\/.*$/,`comment`],[/^\s*```(?:text|markdown)?\s*$/,{token:`string.quote`,switchTo:`@descriptionBlock`}],[/^\s*[^\s`].*$/,{token:`@rematch`,next:`@pop`}],[/\s+/,`white`]],descriptionBlock:[[/^\s*```\s*$/,{token:`string.quote`,next:`@pop`}],[/.+/,`string`]]};for(let e of l)u[subLanguageState(e.keyword)]=[subLanguageExitRule(l),...e.tokens,{include:`@common`},[/[A-Z]\w*/,`type.identifier`],[/[a-z_]\w*/,`identifier`]];return{defaultToken:``,tokenPostfix:`.play`,ignoreCase:!1,keywords:[...n.filter(e=>!o.has(e)),...e.filter(e=>e!==`context`),...t],sliceTypes:i,primitiveTypes:r,tokenizer:u}}export{c as commonTokenRules,createTokensProvider};
|
|
2
2
|
//# sourceMappingURL=tokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","names":["contextualConstructs","embeddedLanguages","keyword","exitKeywords","constructKeywords","subLanguages","subLanguage","commonTokenRules","tokenizer","bmpWordCharacters","codeBlockTags","tag","clauseKeywords"],"sources":["../../tokens.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { languages } from 'monaco-editor';\nimport {\n clauseKeywords,\n codeBlockTags,\n constructKeywords,\n primitiveTypes,\n sliceTypes,\n} from './language';\nimport { MonarchTokenRules, SubLanguage } from './sub-language-registry';\nimport { bmpWordCharacters } from './bmp-word-characters';\n\n// Maps a Screenplay inline code tag to the Monaco language id used for embedded highlighting.\n// Declaration registration must not globally reserve existing property names.\n// Ambiguous standalone operation headers are supplied by typed semantic tokens.\nconst contextualConstructs = new Set(['operation', 'system', 'eventsource', 'purpose', 'runs', 'time', 'statemachine', 'workflow']);\n\nconst embeddedLanguages: Record<string, string> = {\n csharp: 'csharp',\n java: 'java',\n typescript: 'typescript',\n react: 'typescript',\n html: 'html',\n sql: 'sql',\n};\n\nfunction subLanguageState(keyword: string): string {\n return `subLanguage_${keyword}`;\n}\n\n// A construct keyword at the start of a line ends any indented sub-language block.\nfunction subLanguageExitRule(subLanguages: SubLanguage[]): MonarchTokenRules[number] {\n const exitKeywords = [...constructKeywords.filter(keyword => !contextualConstructs.has(keyword)), ...subLanguages.map((subLanguage) => subLanguage.keyword)];\n return [\n new RegExp(`^\\\\s*(?:${exitKeywords.join('|')})\\\\b`),\n { token: '@rematch', next: '@pop' },\n ];\n}\n\n// Shared across the composite `.play` tokenizer and every standalone sub-language tokenizer\n// (comments, `$`-prefixed context variables, strings, numbers, operators, delimiters, whitespace).\nexport const commonTokenRules: MonarchTokenRules = [\n [/\\/\\/.*$/, 'comment'],\n [/\\$(?:context|identity|eventContext|eventSourceId|causedBy|refusal)(?:\\.\\w+)*/, 'variable.predefined'],\n [/\\$(?:env|secrets|strings)\\.[\\w.]+/, 'variable.predefined'],\n [/\\$\\.[\\w.]*/, 'variable.predefined'],\n [/\"(?:[^\"\\\\]|\\\\.)*\"/, 'string'],\n [/\"(?:[^\"\\\\]|\\\\.)*$/, 'string.invalid'],\n [/\\d+(?:ms|s|m|h|d)\\b/, 'number'],\n [/-?\\d+\\.\\d+/, 'number.float'],\n [/-?\\d+/, 'number'],\n [/=>|==|!=|>=|<=|[><=:?]/, 'operator'],\n [/[[\\](),.]/, 'delimiter'],\n [/\\s+/, 'white'],\n];\n\nexport function createTokensProvider(subLanguages: SubLanguage[]): languages.IMonarchLanguage {\n const tokenizer: Record<string, MonarchTokenRules> = {\n root: [\n [new RegExp(`^(\\\\s*)(example)(\\\\s+)([A-Z][${bmpWordCharacters}]*)(\\\\s*)(:)(\\\\s*)([A-Z][${bmpWordCharacters}.]*)(?=\\\\s*(?://.*)?$)`),\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'operator', 'white', 'type.identifier']],\n [/^(time)(\\s+)(zone)(\\s+)(configurable\\s+default\\s+)?(?=\")/, ['keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(calendar)(\\s+)(?=\"|from\\s+\\$context\\.)/, ['white', 'keyword', 'white']],\n [/^(\\s*)(given)(\\s+)(time)(\\s+)(zone)(?=\\s+\")/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(direction)(\\s+)(inbound|outbound)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword']],\n [new RegExp(`^()(purpose)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?://.*)?$)`), ['white', 'keyword', 'white', { token: 'type.identifier', next: '@purposeBody.$1' }]],\n [/^(\\s*)(parameter)(\\s+)([a-z_]\\w*)(\\s+)([\\w.]+(?:\\[\\])?(?:\\s+optional)?)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'identifier', 'white', 'type.identifier']],\n [/^(\\s*)(case)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:[a-z_]\\w*\\s*=|\\/\\/|$))/, ['white', 'keyword', 'white', 'type.identifier']],\n [/\\b(case)(\\.)([a-z_]\\w*)\\b/, ['keyword', 'delimiter', 'identifier']],\n [/^(\\s*)(concept)(\\s+)([^\\s:]+)(\\s*:\\s*)(\\w+)((?:\\s+(?:@?pii|personal|@?sensitive|secret))*)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'type.identifier', 'operator', { token: 'type.identifier', next: '@conceptBody.$1' }, 'keyword']],\n [/^(command)(\\s+)(reads)(\\s+)(protected)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(reaction)(\\s+)(batches)(\\s+)(atomic)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(numbers)([ \\t]+)(exact)(?=[ \\t]*(?:(?:\\/\\/|#).*)?$)/, ['keyword', 'white', 'keyword']],\n [/^(eventsource)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'type.identifier']],\n [/^(system)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'type.identifier']],\n // 'runs' is contextual: only a reaction's identity line is a keyword; a property called runs keeps its name.\n [/^(\\s*)(runs)(\\s+)(as)(\\s+)(system)\\b/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(produces\\s+operation)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@operationBody.$1' }]],\n [/^(\\s*)(given\\s+operation)(\\s+)([\\w.]+)(\\s+)(fails)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword']],\n [/^(\\s*)(then\\s+(?:operation|compensated|invokes))(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier']],\n [new RegExp(`^(\\\\s*)(command)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?://.*)?$)`), ['white', 'keyword', 'white', { token: 'type.identifier', next: '@commandBody.$1' }]],\n [/^(\\s*)(handler)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@handlerBody.$1' }]],\n [/^(\\s*@?[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(\\s+)(generated)(\\s+identifier|)(?=\\s*(?:\\/\\/.*)?$)/,\n ['identifier', 'type.identifier', 'white', 'keyword', 'keyword']],\n [/^(\\s*)(generated)(\\s+)([a-z_]\\w*)(\\s*=(?!=|>))/, ['white', 'keyword', 'white', 'identifier', 'operator']],\n [/^(\\s*)(then)(\\s+)(returns)\\b/, ['white', 'keyword', 'white', 'keyword']],\n // Only unambiguous response headers: two-token property declarations keep their names.\n [/^(\\s*)(returns)(?=\\s*(?:\\/\\/.*)?$|\\s+@\\w+\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword']],\n [/^(\\s*@?[a-z_]\\w*\\s+)([\\w.]+)(\\s+)(key)(?=\\s*(?:\\/\\/.*)?$)/, ['identifier', 'type.identifier', 'white', 'keyword']],\n // A modifier only after a complete type; names called optional remain ordinary names.\n [/^(\\s*(?:by|filter)\\s+[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:from\\b|\\/\\/|$))/,\n ['identifier', 'type.identifier', 'white', 'keyword']],\n // Query prefixes cannot fall back to being property names.\n [/^(?!\\s*(?:by|filter)\\s+)(\\s*@?[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:identifier\\b|from\\b|=(?!=|>)|\\/\\/|$))/,\n ['identifier', 'type.identifier', 'white', 'keyword']],\n [/^(\\s*query\\s+[A-Za-z_]\\w*\\s*=>\\s*(?!observable\\s+optional\\s*(?:\\/\\/.*)?$)(?:observable\\s+)?)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:\\/\\/.*)?$)/,\n ['keyword', 'type.identifier', 'white', 'keyword']],\n [new RegExp(`^(\\\\s*)(given)(\\\\s+)(caller)(\\\\s+)(as)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?://.*)?$)`),\n ['white', 'keyword', 'white', 'keyword', 'white', 'keyword', 'white', 'type.identifier']],\n // A specification's clock, trigger, capture and query steps - matched before a sub-language keyword\n // can claim 'capture' and read the rest of the specification as change data capture.\n [/^(\\s*)(given|when)(\\s+)(clock|capture|trigger|query)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(then)(\\s+)(result|no\\s+(?:result|events))\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(then)(\\s+)(events)(\\s+)(in any order)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(when)(\\s+)(redelivered)(\\s+)([\\w.]+)(\\s+)(to)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', 'type.identifier']],\n // Action subjects are header clauses, not new reserved property names.\n [/^(\\s*)(action)(\\s+)(\"(?:[^\"\\\\]|\\\\.)*\"|\\$strings\\.[\\w.]+)(\\s+)(for)(\\s+)(item|screen)\\b/,\n ['white', 'keyword', 'white', 'string', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(action)(\\s+)([\\w.]+)(\\s+)(for)(\\s+)(item|screen)\\b/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(item)(\\s+)(\\w+)(\\s+)(action)(\\s+)([\\w.]+)(\\s+)(for)(\\s+)(item|screen)\\b/,\n ['white', 'keyword', 'white', 'identifier', 'white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', 'keyword']],\n // Guarded-action words are contextual; property names keep their ordinary meaning.\n [/^(\\s*)(otherwise)(\\s+)(hidden)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(otherwise)(\\s+)(execute)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'keyword', 'white', 'type.identifier']],\n [/^(\\s*)(when)(\\s+)(?=.+\\s+execute\\s+[\\w.]+\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', { token: 'white', next: '@guardedActionCondition' }]],\n [/^(\\s*)(behavior)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@behaviorBody.$1' }]],\n [/^(\\s*)(on)(\\s+)(refused)(\\s+)(by)(\\s+)(validation|constraint|authorization)\\b/,\n ['white', 'keyword', 'white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(on)(\\s+)(refused)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(on)(\\s+)([\\w-]+)\\b/, ['white', 'keyword', 'white', { token: 'keyword', next: '@interactionBody.$1' }]],\n [/^(\\s*)(acknowledge)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword']],\n // A quoted import names .play files rather than a qualified name - the path reads as a link.\n [/^(\\s*)(import)(\\s+)(\"[^\"\\\\]*\")/, ['white', 'keyword', 'white', 'string.link']],\n // Retain the header indent so event metadata stops at the enclosing block boundary.\n [/^(\\s*)((?:(?:produces|public)\\s+)?event)(\\s+)([A-Za-z_]\\w*)(\\s+)(generation)(\\s+)(\\d+)(?=\\s*(?:from\\s+\"(?:[^\"\\\\]|\\\\.)*\"\\s*)?(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', { token: 'number', next: '@eventBody.$1' }]],\n [/^(\\s*)((?:(?:produces|public)\\s+)?event)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:from\\s+\"(?:[^\"\\\\]|\\\\.)*\"\\s*)?(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@eventBody.$1' }]],\n // A tagged opening fence carries the embedded language; legacy tag lines still highlight.\n ...codeBlockTags.map(\n (tag): MonarchTokenRules[number] => [\n new RegExp(`^\\\\s*\\\\x60\\\\x60\\\\x60${tag}\\\\s*$`),\n { token: 'string.quote', next: `@codeBlock.${embeddedLanguages[tag]}`, nextEmbedded: embeddedLanguages[tag] },\n ],\n ),\n // Inline code block tags at end of line open an embedded code block.\n ...codeBlockTags.map(\n (tag): MonarchTokenRules[number] => [\n new RegExp(`\\\\b${tag}\\\\b(?=\\\\s*$)`),\n { token: 'keyword.tag', next: `@codeBlockPending.${embeddedLanguages[tag]}` },\n ],\n ),\n // Sub-language constructs switch to the registered sub-language's token rules.\n ...subLanguages.map(\n (subLanguage): MonarchTokenRules[number] => [\n new RegExp(`\\\\b${subLanguage.keyword}\\\\b`),\n { token: 'keyword', next: `@${subLanguageState(subLanguage.keyword)}` },\n ],\n ),\n // Typed documentation names are properties, not metadata directives.\n [/^(\\s*)(documentation)(?=\\s+[\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?\\s*(?:identifier\\b|generated\\b|=(?!=|>)|\\/\\/|$))/,\n ['white', 'identifier']],\n // A bare description or documentation keyword opens a fenced prose block.\n [/\\b(?:description|documentation)\\b(?=\\s*(?:\\/\\/.*)?$)/, { token: 'keyword', next: '@descriptionBlockPending' }],\n [/\\brow-click\\b/, 'keyword'],\n // A leading @ escapes a name that collides with a directive keyword - it is a name, not an attribute.\n [/^\\s*@[a-z_]\\w*/, 'identifier'],\n [/@\\w+/, 'annotation'],\n [\n /[A-Z]\\w*/,\n {\n cases: {\n '@sliceTypes': 'keyword.type',\n '@primitiveTypes': 'type',\n '@default': 'type.identifier',\n },\n },\n ],\n [\n /[a-z_]\\w*/,\n {\n cases: {\n '@keywords': 'keyword',\n '@default': 'identifier',\n },\n },\n ],\n { include: '@common' },\n ],\n\n guardedActionCondition: [\n [/(execute)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', { token: 'type.identifier', next: '@pop' }]],\n { include: '@root' },\n ],\n\n behaviorBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n { include: '@root' },\n ],\n\n interactionBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(otherwise)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword']],\n [/^(\\s*)(when)(\\s+)(?=item\\.|\\()/, ['white', 'keyword', 'white']],\n [/^(\\s*)(execute)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'type.identifier']],\n { include: '@root' },\n ],\n\n purposeBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(basis|interest|condition|authorization|subjects|retention|recipient|transfer|erasure)(\\s+)/, ['white', 'keyword', 'white']],\n [/\\b(safeguard|exception)\\b/, 'keyword'],\n { include: '@root' },\n ],\n\n generationLine: [\n [/^/, { token: '@rematch', next: '@pop' }],\n [/\\b(prefix|case|alphabet|checksum|base64url|hex|base32|lower|upper|luhn|mod11|mod97)\\b/, 'keyword'],\n { include: '@common' },\n ],\n\n conceptBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(validate)(\\s+)(checksum)(\\s+)(luhn|mod11|mod97)\\b/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(checksum)(\\s+)(luhn|mod11|mod97)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [new RegExp(`^(\\\\s*)(@?[a-z_][${bmpWordCharacters}]*)(\\\\s*)(=)(\\\\s*)(-?(?:0|[1-9][0-9]*))(?=\\\\s*(?://.*)?$)`), ['white', 'identifier', 'white', 'operator', 'white', 'number']],\n [/^(\\s*)(@?pii|personal|@?sensitive|secret)(\\s+)(reason|scope|special|criminal)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(generate)(\\s+)(uuidv7|uuid|ulid|typeid|nanoid|bytes|pattern|random|rule|sequence)\\b/, ['white', 'keyword', 'white', { token: 'keyword', next: '@generationLine' }]],\n { include: '@root' },\n ],\n\n commandBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(validate)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@commandValidation.$1' }]],\n { include: '@root' },\n ],\n\n commandValidation: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [new RegExp(`^(\\\\s*)([${bmpWordCharacters}.]+)(\\\\s+)(rule)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?:severity\\\\s+\\\\w+|message\\\\s+.*|//.*|$))`),\n ['white', 'identifier', 'white', 'keyword', 'white', { token: 'type.identifier', next: '@namedRuleBody.$1' }]],\n { include: '@root' },\n ],\n\n namedRuleBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n operationBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(execute|compensate)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@operationPhase.$1' }]],\n [/^(\\s*)(uses)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'type.identifier']],\n [/^(\\s*)(@?[a-z_]\\w*)(\\s+)([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(?=\\s*(?:=(?!=|>)|\\/\\/|$))/,\n ['white', 'identifier', 'white', 'type.identifier']],\n { include: '@root' },\n ],\n\n operationPhase: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n handlerBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n implementationBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(hint)(?=\\s+\")/, ['white', 'keyword']],\n { include: '@root' },\n ],\n\n eventBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(id)(?=\\s+\")/, ['white', 'keyword']],\n [/^(\\s*)(documentation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@descriptionBlockPending' }]],\n { include: '@root' },\n ],\n\n common: commonTokenRules,\n\n // After a code tag, the only thing allowed before the opening fence is whitespace.\n codeBlockPending: [\n [\n /^\\s*```\\s*$/,\n { token: 'string.quote', switchTo: '@codeBlock.$S2', nextEmbedded: '$S2' },\n ],\n [/^\\s*[^\\s`].*$/, { token: '@rematch', next: '@pop' }],\n [/\\s+/, 'white'],\n ],\n\n codeBlock: [\n [/^\\s*```\\s*$/, { token: 'string.quote', next: '@pop', nextEmbedded: '@pop' }],\n [/[^`]+/, ''],\n [/`/, ''],\n ],\n\n // After a bare description, the only thing allowed before the opening fence is whitespace.\n descriptionBlockPending: [\n [/\\/\\/.*$/, 'comment'],\n [/^\\s*```(?:text|markdown)?\\s*$/, { token: 'string.quote', switchTo: '@descriptionBlock' }],\n [/^\\s*[^\\s`].*$/, { token: '@rematch', next: '@pop' }],\n [/\\s+/, 'white'],\n ],\n\n descriptionBlock: [\n [/^\\s*```\\s*$/, { token: 'string.quote', next: '@pop' }],\n [/.+/, 'string'],\n ],\n };\n\n for (const subLanguage of subLanguages) {\n tokenizer[subLanguageState(subLanguage.keyword)] = [\n subLanguageExitRule(subLanguages),\n ...subLanguage.tokens,\n { include: '@common' },\n [/[A-Z]\\w*/, 'type.identifier'],\n [/[a-z_]\\w*/, 'identifier'],\n ];\n }\n\n return {\n defaultToken: '',\n tokenPostfix: '.play',\n ignoreCase: false,\n keywords: [...constructKeywords.filter(keyword => !contextualConstructs.has(keyword)), ...clauseKeywords, ...codeBlockTags],\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AO,WAAY,KAAM,MAAO,CAAC,EACrD,CAAC,MAAO,OAAO,CACnB,EAEA,iBAAkB,CACd,CAAC,cAAe,CAAE,MAAO,eAAgB,KAAM,MAAO,CAAC,EACvD,CAAC,KAAM,QAAQ,CACnB,CACJ,EAEA,IAAK,IAAMD,KAAeD,EACtB,EAAU,iBAAiBC,EAAY,OAAO,GAAK,CAC/C,oBAAoBD,CAAY,EAChC,GAAGC,EAAY,OACf,CAAE,QAAS,SAAU,EACrB,CAAC,WAAY,iBAAiB,EAC9B,CAAC,YAAa,YAAY,CAC9B,EAGJ,MAAO,CACH,aAAc,GACd,aAAc,QACd,WAAY,GACZ,SAAU,CAAC,GAAGF,EAAkB,OAAO,GAAW,CAACJ,EAAqB,IAAIE,CAAO,CAAC,EAAG,GAAGU,EAAgB,GAAGF,CAAa,EAC1H,aACA,iBACA,WACJ,CACJ"}
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["contextualConstructs","embeddedLanguages","keyword","exitKeywords","constructKeywords","subLanguages","subLanguage","commonTokenRules","tokenizer","bmpWordCharacters","codeBlockTags","tag","clauseKeywords"],"sources":["../../tokens.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { languages } from 'monaco-editor';\nimport {\n clauseKeywords,\n codeBlockTags,\n constructKeywords,\n primitiveTypes,\n sliceTypes,\n} from './language';\nimport { MonarchTokenRules, SubLanguage } from './sub-language-registry';\nimport { bmpWordCharacters } from './bmp-word-characters';\n\n// Maps a Screenplay inline code tag to the Monaco language id used for embedded highlighting.\n// Declaration registration must not globally reserve existing property names.\n// Ambiguous standalone operation headers are supplied by typed semantic tokens.\nconst contextualConstructs = new Set(['operation', 'system', 'eventsource', 'purpose', 'context', 'runs', 'time', 'statemachine', 'workflow']);\n\nconst embeddedLanguages: Record<string, string> = {\n csharp: 'csharp',\n java: 'java',\n typescript: 'typescript',\n react: 'typescript',\n html: 'html',\n sql: 'sql',\n};\n\nfunction subLanguageState(keyword: string): string {\n return `subLanguage_${keyword}`;\n}\n\n// A construct keyword at the start of a line ends any indented sub-language block.\nfunction subLanguageExitRule(subLanguages: SubLanguage[]): MonarchTokenRules[number] {\n const exitKeywords = [...constructKeywords.filter(keyword => !contextualConstructs.has(keyword)), ...subLanguages.map((subLanguage) => subLanguage.keyword)];\n return [\n new RegExp(`^\\\\s*(?:${exitKeywords.join('|')})\\\\b`),\n { token: '@rematch', next: '@pop' },\n ];\n}\n\n// Shared across the composite `.play` tokenizer and every standalone sub-language tokenizer\n// (comments, `$`-prefixed context variables, strings, numbers, operators, delimiters, whitespace).\nexport const commonTokenRules: MonarchTokenRules = [\n [/\\/\\/.*$/, 'comment'],\n [/\\$(?:context|identity|eventContext|eventSourceId|causedBy|refusal)(?:\\.\\w+)*/, 'variable.predefined'],\n [/\\$(?:env|secrets|strings)\\.[\\w.]+/, 'variable.predefined'],\n [/\\$\\.[\\w.]*/, 'variable.predefined'],\n [/\"(?:[^\"\\\\]|\\\\.)*\"/, 'string'],\n [/\"(?:[^\"\\\\]|\\\\.)*$/, 'string.invalid'],\n [/\\d+(?:ms|s|m|h|d)\\b/, 'number'],\n [/-?\\d+\\.\\d+/, 'number.float'],\n [/-?\\d+/, 'number'],\n [/=>|==|!=|>=|<=|[><=:?]/, 'operator'],\n [/[[\\](),.]/, 'delimiter'],\n [/\\s+/, 'white'],\n];\n\nexport function createTokensProvider(subLanguages: SubLanguage[]): languages.IMonarchLanguage {\n const tokenizer: Record<string, MonarchTokenRules> = {\n root: [\n [new RegExp(`^(\\\\s*)(example)(\\\\s+)([A-Z][${bmpWordCharacters}]*)(\\\\s*)(:)(\\\\s*)([A-Z][${bmpWordCharacters}.]*)(?=\\\\s*(?://.*)?$)`),\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'operator', 'white', 'type.identifier']],\n [/^(time)(\\s+)(zone)(\\s+)(configurable\\s+default\\s+)?(?=\")/, ['keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(calendar)(\\s+)(?=\"|from\\s+\\$context\\.)/, ['white', 'keyword', 'white']],\n [/^(\\s*)(given)(\\s+)(time)(\\s+)(zone)(?=\\s+\")/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(direction)(\\s+)(inbound|outbound)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword']],\n [new RegExp(`^()(purpose)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?://.*)?$)`), ['white', 'keyword', 'white', { token: 'type.identifier', next: '@purposeBody.$1' }]],\n [/^(\\s*)(parameter)(\\s+)([a-z_]\\w*)(\\s+)([\\w.]+(?:\\[\\])?(?:\\s+optional)?)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'identifier', 'white', 'type.identifier']],\n [/^(\\s*)(case)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:[a-z_]\\w*\\s*=|\\/\\/|$))/, ['white', 'keyword', 'white', 'type.identifier']],\n [/\\b(case)(\\.)([a-z_]\\w*)\\b/, ['keyword', 'delimiter', 'identifier']],\n [/^(\\s*)(concept)(\\s+)([^\\s:]+)(\\s*:\\s*)(\\w+)((?:\\s+(?:@?pii|personal|@?sensitive|secret))*)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'type.identifier', 'operator', { token: 'type.identifier', next: '@conceptBody.$1' }, 'keyword']],\n [/^()(context)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@applicationContextBody.$1' }]],\n [/^(\\s*)(context)(\\s+)(from)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(command)(\\s+)(reads)(\\s+)(protected)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(reaction)(\\s+)(batches)(\\s+)(atomic)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(numbers)([ \\t]+)(exact)(?=[ \\t]*(?:(?:\\/\\/|#).*)?$)/, ['keyword', 'white', 'keyword']],\n [/^(eventsource)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'type.identifier']],\n [/^(system)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', 'type.identifier']],\n // 'runs' is contextual: only a reaction's identity line is a keyword; a property called runs keeps its name.\n [/^(\\s*)(runs)(\\s+)(as)(\\s+)(system)\\b/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(produces\\s+operation)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@operationBody.$1' }]],\n [/^(\\s*)(given\\s+operation)(\\s+)([\\w.]+)(\\s+)(fails)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword']],\n [/^(\\s*)(then\\s+(?:operation|compensated|invokes))(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier']],\n [new RegExp(`^(\\\\s*)(command)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?://.*)?$)`), ['white', 'keyword', 'white', { token: 'type.identifier', next: '@commandBody.$1' }]],\n [/^(\\s*)(handler)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@handlerBody.$1' }]],\n [/^(\\s*@?[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(\\s+)(generated)(\\s+identifier|)(?=\\s*(?:\\/\\/.*)?$)/,\n ['identifier', 'type.identifier', 'white', 'keyword', 'keyword']],\n [/^(\\s*)(generated)(\\s+)([a-z_]\\w*)(\\s*=(?!=|>))/, ['white', 'keyword', 'white', 'identifier', 'operator']],\n [/^(\\s*)(then)(\\s+)(returns)\\b/, ['white', 'keyword', 'white', 'keyword']],\n // Only unambiguous response headers: two-token property declarations keep their names.\n [/^(\\s*)(returns)(?=\\s*(?:\\/\\/.*)?$|\\s+@\\w+\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword']],\n [/^(\\s*@?[a-z_]\\w*\\s+)([\\w.]+)(\\s+)(key)(?=\\s*(?:\\/\\/.*)?$)/, ['identifier', 'type.identifier', 'white', 'keyword']],\n // A modifier only after a complete type; names called optional remain ordinary names.\n [/^(\\s*(?:by|filter)\\s+[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:from\\b|\\/\\/|$))/,\n ['identifier', 'type.identifier', 'white', 'keyword']],\n // Query prefixes cannot fall back to being property names.\n [/^(?!\\s*(?:by|filter)\\s+)(\\s*@?[a-z_]\\w*\\s+)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:identifier\\b|from\\b|=(?!=|>)|\\/\\/|$))/,\n ['identifier', 'type.identifier', 'white', 'keyword']],\n [/^(\\s*query\\s+[A-Za-z_]\\w*\\s*=>\\s*(?!observable\\s+optional\\s*(?:\\/\\/.*)?$)(?:observable\\s+)?)([\\w.]+(?:\\[\\])?)(\\s+)(optional)\\b(?=\\s*(?:\\/\\/.*)?$)/,\n ['keyword', 'type.identifier', 'white', 'keyword']],\n [new RegExp(`^(\\\\s*)(given)(\\\\s+)(caller)(\\\\s+)(as)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?://.*)?$)`),\n ['white', 'keyword', 'white', 'keyword', 'white', 'keyword', 'white', 'type.identifier']],\n // A specification's clock, trigger, capture and query steps - matched before a sub-language keyword\n // can claim 'capture' and read the rest of the specification as change data capture.\n [/^(\\s*)(given|when)(\\s+)(clock|capture|trigger|query)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(then)(\\s+)(result|no\\s+(?:result|events))\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(then)(\\s+)(events)(\\s+)(in any order)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(when)(\\s+)(redelivered)(\\s+)([\\w.]+)(\\s+)(to)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', 'type.identifier']],\n // Action subjects are header clauses, not new reserved property names.\n [/^(\\s*)(action)(\\s+)(\"(?:[^\"\\\\]|\\\\.)*\"|\\$strings\\.[\\w.]+)(\\s+)(for)(\\s+)(item|screen)\\b/,\n ['white', 'keyword', 'white', 'string', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(action)(\\s+)([\\w.]+)(\\s+)(for)(\\s+)(item|screen)\\b/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(item)(\\s+)(\\w+)(\\s+)(action)(\\s+)([\\w.]+)(\\s+)(for)(\\s+)(item|screen)\\b/,\n ['white', 'keyword', 'white', 'identifier', 'white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', 'keyword']],\n // Guarded-action words are contextual; property names keep their ordinary meaning.\n [/^(\\s*)(otherwise)(\\s+)(hidden)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(otherwise)(\\s+)(execute)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'keyword', 'white', 'type.identifier']],\n [/^(\\s*)(when)(\\s+)(?=.+\\s+execute\\s+[\\w.]+\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', { token: 'white', next: '@guardedActionCondition' }]],\n [/^(\\s*)(behavior)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@behaviorBody.$1' }]],\n [/^(\\s*)(on)(\\s+)(refused)(\\s+)(by)(\\s+)(validation|constraint|authorization)\\b/,\n ['white', 'keyword', 'white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(on)(\\s+)(refused)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(on)(\\s+)([\\w-]+)\\b/, ['white', 'keyword', 'white', { token: 'keyword', next: '@interactionBody.$1' }]],\n [/^(\\s*)(acknowledge)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword']],\n // A quoted import names .play files rather than a qualified name - the path reads as a link.\n [/^(\\s*)(import)(\\s+)(\"[^\"\\\\]*\")/, ['white', 'keyword', 'white', 'string.link']],\n // Retain the header indent so event metadata stops at the enclosing block boundary.\n [/^(\\s*)((?:(?:produces|public)\\s+)?event)(\\s+)([A-Za-z_]\\w*)(\\s+)(generation)(\\s+)(\\d+)(?=\\s*(?:from\\s+\"(?:[^\"\\\\]|\\\\.)*\"\\s*)?(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', 'type.identifier', 'white', 'keyword', 'white', { token: 'number', next: '@eventBody.$1' }]],\n [/^(\\s*)((?:(?:produces|public)\\s+)?event)(\\s+)([A-Za-z_]\\w*)(?=\\s*(?:from\\s+\"(?:[^\"\\\\]|\\\\.)*\"\\s*)?(?:\\/\\/.*)?$)/,\n ['white', 'keyword', 'white', { token: 'type.identifier', next: '@eventBody.$1' }]],\n // A tagged opening fence carries the embedded language; legacy tag lines still highlight.\n ...codeBlockTags.map(\n (tag): MonarchTokenRules[number] => [\n new RegExp(`^\\\\s*\\\\x60\\\\x60\\\\x60${tag}\\\\s*$`),\n { token: 'string.quote', next: `@codeBlock.${embeddedLanguages[tag]}`, nextEmbedded: embeddedLanguages[tag] },\n ],\n ),\n // Inline code block tags at end of line open an embedded code block.\n ...codeBlockTags.map(\n (tag): MonarchTokenRules[number] => [\n new RegExp(`\\\\b${tag}\\\\b(?=\\\\s*$)`),\n { token: 'keyword.tag', next: `@codeBlockPending.${embeddedLanguages[tag]}` },\n ],\n ),\n // Sub-language constructs switch to the registered sub-language's token rules.\n ...subLanguages.map(\n (subLanguage): MonarchTokenRules[number] => [\n new RegExp(`\\\\b${subLanguage.keyword}\\\\b`),\n { token: 'keyword', next: `@${subLanguageState(subLanguage.keyword)}` },\n ],\n ),\n // Typed documentation names are properties, not metadata directives.\n [/^(\\s*)(documentation)(?=\\s+[\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?\\s*(?:identifier\\b|generated\\b|=(?!=|>)|\\/\\/|$))/,\n ['white', 'identifier']],\n // A bare description or documentation keyword opens a fenced prose block.\n [/\\b(?:description|documentation)\\b(?=\\s*(?:\\/\\/.*)?$)/, { token: 'keyword', next: '@descriptionBlockPending' }],\n [/\\brow-click\\b/, 'keyword'],\n // A leading @ escapes a name that collides with a directive keyword - it is a name, not an attribute.\n [/^\\s*@[a-z_]\\w*/, 'identifier'],\n [/@\\w+/, 'annotation'],\n [\n /[A-Z]\\w*/,\n {\n cases: {\n '@sliceTypes': 'keyword.type',\n '@primitiveTypes': 'type',\n '@default': 'type.identifier',\n },\n },\n ],\n [\n /[a-z_]\\w*/,\n {\n cases: {\n '@keywords': 'keyword',\n '@default': 'identifier',\n },\n },\n ],\n { include: '@common' },\n ],\n\n guardedActionCondition: [\n [/(execute)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/, ['keyword', 'white', { token: 'type.identifier', next: '@pop' }]],\n { include: '@root' },\n ],\n\n behaviorBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n { include: '@root' },\n ],\n\n interactionBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(otherwise)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword']],\n [/^(\\s*)(when)(\\s+)(?=item\\.|\\()/, ['white', 'keyword', 'white']],\n [/^(\\s*)(execute)(\\s+)([\\w.]+)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'type.identifier']],\n { include: '@root' },\n ],\n\n applicationContextBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(@?[a-z_]\\w*)(\\s+)(time)(\\s+)(zone)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'identifier', 'white', 'type.identifier', 'white', 'type.identifier']],\n { include: '@root' },\n ],\n\n purposeBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(basis|interest|condition|authorization|subjects|retention|recipient|transfer|erasure)(\\s+)/, ['white', 'keyword', 'white']],\n [/\\b(safeguard|exception)\\b/, 'keyword'],\n { include: '@root' },\n ],\n\n generationLine: [\n [/^/, { token: '@rematch', next: '@pop' }],\n [/\\b(prefix|case|alphabet|checksum|base64url|hex|base32|lower|upper|luhn|mod11|mod97)\\b/, 'keyword'],\n { include: '@common' },\n ],\n\n conceptBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(validate)(\\s+)(checksum)(\\s+)(luhn|mod11|mod97)\\b/, ['white', 'keyword', 'white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(checksum)(\\s+)(luhn|mod11|mod97)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [new RegExp(`^(\\\\s*)(@?[a-z_][${bmpWordCharacters}]*)(\\\\s*)(=)(\\\\s*)(-?(?:0|[1-9][0-9]*))(?=\\\\s*(?://.*)?$)`), ['white', 'identifier', 'white', 'operator', 'white', 'number']],\n [/^(\\s*)(@?pii|personal|@?sensitive|secret)(\\s+)(reason|scope|special|criminal)\\b/, ['white', 'keyword', 'white', 'keyword']],\n [/^(\\s*)(generate)(\\s+)(uuidv7|uuid|ulid|typeid|nanoid|bytes|pattern|random|rule|sequence)\\b/, ['white', 'keyword', 'white', { token: 'keyword', next: '@generationLine' }]],\n { include: '@root' },\n ],\n\n commandBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(validate)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@commandValidation.$1' }]],\n { include: '@root' },\n ],\n\n commandValidation: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [new RegExp(`^(\\\\s*)([${bmpWordCharacters}.]+)(\\\\s+)(rule)(\\\\s+)([A-Za-z_][${bmpWordCharacters}]*)(?=\\\\s*(?:severity\\\\s+\\\\w+|message\\\\s+.*|//.*|$))`),\n ['white', 'identifier', 'white', 'keyword', 'white', { token: 'type.identifier', next: '@namedRuleBody.$1' }]],\n { include: '@root' },\n ],\n\n namedRuleBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n operationBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(execute|compensate)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@operationPhase.$1' }]],\n [/^(\\s*)(uses)(\\s+)([A-Z]\\w*)(?=\\s*(?:\\/\\/.*)?$)/, ['white', 'keyword', 'white', 'type.identifier']],\n [/^(\\s*)(@?[a-z_]\\w*)(\\s+)([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(?=\\s*(?:=(?!=|>)|\\/\\/|$))/,\n ['white', 'identifier', 'white', 'type.identifier']],\n { include: '@root' },\n ],\n\n operationPhase: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n handlerBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(implementation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@implementationBody.$1' }]],\n { include: '@root' },\n ],\n\n implementationBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(hint)(?=\\s+\")/, ['white', 'keyword']],\n { include: '@root' },\n ],\n\n eventBody: [\n [/^(?!$S2[ \\t]+|\\s*$)/, { token: '@rematch', next: '@pop' }],\n [/^(\\s*)(id)(?=\\s+\")/, ['white', 'keyword']],\n [/^(\\s*)(documentation)(?=\\s*(?:\\/\\/.*)?$)/, ['white', { token: 'keyword', next: '@descriptionBlockPending' }]],\n { include: '@root' },\n ],\n\n common: commonTokenRules,\n\n // After a code tag, the only thing allowed before the opening fence is whitespace.\n codeBlockPending: [\n [\n /^\\s*```\\s*$/,\n { token: 'string.quote', switchTo: '@codeBlock.$S2', nextEmbedded: '$S2' },\n ],\n [/^\\s*[^\\s`].*$/, { token: '@rematch', next: '@pop' }],\n [/\\s+/, 'white'],\n ],\n\n codeBlock: [\n [/^\\s*```\\s*$/, { token: 'string.quote', next: '@pop', nextEmbedded: '@pop' }],\n [/[^`]+/, ''],\n [/`/, ''],\n ],\n\n // After a bare description, the only thing allowed before the opening fence is whitespace.\n descriptionBlockPending: [\n [/\\/\\/.*$/, 'comment'],\n [/^\\s*```(?:text|markdown)?\\s*$/, { token: 'string.quote', switchTo: '@descriptionBlock' }],\n [/^\\s*[^\\s`].*$/, { token: '@rematch', next: '@pop' }],\n [/\\s+/, 'white'],\n ],\n\n descriptionBlock: [\n [/^\\s*```\\s*$/, { token: 'string.quote', next: '@pop' }],\n [/.+/, 'string'],\n ],\n };\n\n for (const subLanguage of subLanguages) {\n tokenizer[subLanguageState(subLanguage.keyword)] = [\n subLanguageExitRule(subLanguages),\n ...subLanguage.tokens,\n { include: '@common' },\n [/[A-Z]\\w*/, 'type.identifier'],\n [/[a-z_]\\w*/, 'identifier'],\n ];\n }\n\n return {\n defaultToken: '',\n tokenPostfix: '.play',\n ignoreCase: false,\n keywords: [...constructKeywords.filter(keyword => !contextualConstructs.has(keyword)), ...clauseKeywords.filter(keyword => keyword !== 'context'), ...codeBlockTags],\n sliceTypes,\n primitiveTypes,\n tokenizer,\n } as languages.IMonarchLanguage;\n}\n"],"mappings":"2OAiBA,MAAMA,kBAAuB,IAAI,IAAI,CAAC,YAAa,SAAU,cAAe,UAAW,UAAW,OAAQ,OAAQ,eAAgB,UAAU,CAAC,EAEvIC,EAA4C,CAC9C,OAAQ,SACR,KAAM,OACN,WAAY,aACZ,MAAO,aACP,KAAM,OACN,IAAK,KACT,EAEA,SAAS,iBAAiB,EAAyB,CAC/C,MAAO,eAAeC,GAC1B,CAGA,SAAS,oBAAoB,EAAwD,CACjF,IAAMC,EAAe,CAAC,GAAGC,EAAkB,OAAO,GAAW,CAACJ,EAAqB,IAAIE,CAAO,CAAC,EAAG,GAAGG,EAAa,IAAK,GAAgBC,EAAY,OAAO,CAAC,EAC3J,MAAO,CACC,OAAO,WAAWH,EAAa,KAAK,GAAG,EAAE,KAAK,EAClD,CAAE,MAAO,WAAY,KAAM,MAAO,CACtC,CACJ,CAIA,MAAaI,EAAsC,CAC/C,CAAC,UAAW,SAAS,EACrB,CAAC,+EAAgF,qBAAqB,EACtG,CAAC,oCAAqC,qBAAqB,EAC3D,CAAC,aAAc,qBAAqB,EACpC,CAAC,oBAAqB,QAAQ,EAC9B,CAAC,oBAAqB,gBAAgB,EACtC,CAAC,sBAAuB,QAAQ,EAChC,CAAC,aAAc,cAAc,EAC7B,CAAC,QAAS,QAAQ,EAClB,CAAC,yBAA0B,UAAU,EACrC,CAAC,YAAa,WAAW,EACzB,CAAC,MAAO,OAAO,CACnB,EAEA,SAAgB,qBAAqB,EAAyD,CAC1F,IAAMC,EAA+C,CACjD,KAAM,CACF,CAAK,OA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CAAC,QAAS,CAAE,MAAO,UAAW,KAAM,0BAA2B,CAAC,CAAC,EAC9G,CAAE,QAAS,OAAQ,CACvB,EAEA,OAAQF,EAGR,iBAAkB,CACd,CACI,cACA,CAAE,MAAO,eAAgB,SAAU,iBAAkB,aAAc,KAAM,CAC7E,EACA,CAAC,gBAAiB,CAAE,MAAO,WAAY,KAAM,MAAO,CAAC,EACrD,CAAC,MAAO,OAAO,CACnB,EAEA,UAAW,CACP,CAAC,cAAe,CAAE,MAAO,eAAgB,KAAM,OAAQ,aAAc,MAAO,CAAC,EAC7E,CAAC,QAAS,EAAE,EACZ,CAAC,IAAK,EAAE,CACZ,EAGA,wBAAyB,CACrB,CAAC,UAAW,SAAS,EACrB,CAAC,gCAAiC,CAAE,MAAO,eAAgB,SAAU,mBAAoB,CAAC,EAC1F,CAAC,gBAAiB,CAAE,MAAO,WAAY,KAAM,MAAO,CAAC,EACrD,CAAC,MAAO,OAAO,CACnB,EAEA,iBAAkB,CACd,CAAC,cAAe,CAAE,MAAO,eAAgB,KAAM,MAAO,CAAC,EACvD,CAAC,KAAM,QAAQ,CACnB,CACJ,EAEA,IAAK,IAAMD,KAAeD,EACtB,EAAU,iBAAiBC,EAAY,OAAO,GAAK,CAC/C,oBAAoBD,CAAY,EAChC,GAAGC,EAAY,OACf,CAAE,QAAS,SAAU,EACrB,CAAC,WAAY,iBAAiB,EAC9B,CAAC,YAAa,YAAY,CAC9B,EAGJ,MAAO,CACH,aAAc,GACd,aAAc,QACd,WAAY,GACZ,SAAU,CAAC,GAAGF,EAAkB,OAAO,GAAW,CAACJ,EAAqB,IAAIE,CAAO,CAAC,EAAG,GAAGU,EAAe,OAAO,GAAWV,IAAY,SAAS,EAAG,GAAGQ,CAAa,EACnK,aACA,iBACA,WACJ,CACJ"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import"./_virtual/_virtual/_rolldown/runtime.js";import{causedByProperties as e,contextRoots as t,identityProperties as n,primitiveTypes as r,sliceTypes as i}from"./language.js";import{DiagnosticCodes as a}from"./compiler/Diagnostics/DiagnosticCodes.js";import{legacyOptionalTypeLength as o}from"./compiler/Authoring/QuickFixes.js";import"./compiler/index.js";import{enclosingChain as s,fenceMap as c,indentOf as l}from"./document-context.js";import{eventAnalysisSource as u}from"./event-analysis-source.js";import{resolveEventContextPath as d}from"./event-context.js";import{responseAnalysis as f}from"./response-analysis.js";import{knownEventNames as p,knownTypeNames as m,mergeSymbols as h,propertyTypeReference as g,scanDocument as _,symbolsForBuffer as v}from"./symbols.js";import{diagnosticCodes as y}from"./diagnostic-codes.js";import{validateInlineEvents as b}from"./inline-event-validation.js";import{fileImportOn as x,isFileImportLine as S}from"./file-imports.js";function issue(e,t,n,r,i,a){return{severity:e,message:i,line:t,startColumn:n,endColumn:n+r,code:a}}function tokenIssue(e,t,n,r,i,a){return issue(e,t,n.indexOf(r)+1,r.length,i,a)}function validateDeclarations(e,t,n){let i=[],a=/* @__PURE__ */ new Set([...m(t,r),...m(n,[])]),checkProperties=(e,t)=>{for(let n of e.filter(e=>!a.has(g(e).name))){let e=g(n).name;i.push(issue(`warning`,n.line,n.sourceType.startColumn,n.sourceType.text.length,e===`optional`?`Unknown type 'optional' on '${n.name}' of ${t} — did you forget the type before 'optional'?`:`Unknown type '${e}' on '${n.name}' of ${t} — declare it with 'concept ${e} : <Primitive>' or 'type ${e}'.`,y.unknownType))}};for(let e of t.types)checkProperties(e.properties,`type '${e.name}'`);for(let e of t.events)checkProperties(e.properties,`event '${e.name}'`);for(let e of t.queries)checkProperties(e.parameters,`query '${e.name}'`);for(let n of t.commands){checkProperties(n.properties,`command '${n.name}'`);let t=n.properties.filter(e=>e.isIdentifier);for(let r of t.slice(1))i.push(tokenIssue(`error`,r.line,e[r.line],`identifier`,`Command '${n.name}' already marks '${t[0].name}' as identifier — only one property can be the identifier.`,y.duplicateCommandIdentifier))}let o=/* @__PURE__ */ new Map;for(let n of[...t.concepts,...t.types])o.get(n.name)===void 0?o.set(n.name,n.line):i.push(tokenIssue(`error`,n.line,e[n.line],n.name,`Duplicate declaration of '${n.name}' — concept and type names must be unique.`,y.duplicateDeclaration));return i}const C=/* @__PURE__ */ new Set([`and`,`or`,`not`]),w=/^(?:(?:and|or|not)\s+|\()*[A-Z]\w*\)*(?:\s+(?:(?:and|or|not)\s+|\()*[A-Z]\w*\)*)*$/;function policyNames(e){return(e.match(/[A-Za-z_]\w*/g)??[]).filter(e=>!C.has(e))}function validateLines(s,u={}){let d=c(s),m=_(s),g=u.application??h(),x=v(s,{...g,authoringPath:u.path??g.authoringPath,authoringPlacement:u.placement??g.authoringPlacement}),S=f(s,x.authoringDocuments??x.authoringSources?.filter(e=>e!==s.join(`
|
|
2
|
-
`)),x.authoringPlacement,x.authoringPath,x.authoringPlacementResolved),C=new Set(S.eventSources.routes.map(e=>e.location.line-1)),T={...m,commands:m.commands.map(e=>({...e,properties:e.properties.filter(e=>!C.has(e.line)),produces:e.produces?.filter(e=>!S.operationProductionLines?.has(e.line)),productionHeaders:e.productionHeaders?.filter(e=>!S.operationProductionLines?.has(e))}))},E=/* @__PURE__ */ new Set([...p(T),...p(g)]),D=new Set([...T.policies,...g.policies].map(e=>e.name)),O=validateDeclarations(s,T,g);O.push(...validateProductionDestinations(s,T));let k=/* @__PURE__ */ new Set([a.UnknownGenerationStrategy,a.InvalidGenerationArgument,a.InvalidGenerationModifier,a.DuplicateGenerationModifier,a.DuplicateGeneration,a.InvalidGenerationPrimitive,a.InvalidGenerationPrefix,a.InvalidGenerationAlphabet,a.InvalidTypeIdPrefix,a.GenerationSizeOutsideRange,a.ReservedSequenceGeneration,a.LowGenerationEntropy,a.LowGeneratedIdentifierEntropy,a.RefutedGeneratedConceptRule,a.UnprovenGeneratedConceptRule,a.GenerationSupportBudgetExceeded,a.EmptyGenerationSupport]),A=/* @__PURE__ */ new Set([a.MixedEnumerationNumbering,a.DuplicateEnumerationNumber,a.EnumerationNumberOutsideInt32,a.MalformedEnumerationNumber,a.UnpinnedStoredEnumeration]),j=/* @__PURE__ */ new Set([a.LegacyOptionalSuffix,a.InvalidOptionalModifierOrder,a.OptionalReadsNotSupported]),M=/* @__PURE__ */ new Set([a.UnexpectedTokenInPolicyCondition,a.ExpectedPolicyCondition,a.UnclosedPolicyConditionGroup,a.ExpectedRoleName,a.ExpectedClaimName,a.ExpectedClaimMatches,a.ExpectedClaimMatchTarget,a.AnonymousPolicyCombined,a.NegatedAnonymousPolicy]),N=/* @__PURE__ */ new Set([a.UnknownEvent,a.UnknownReadModelProperty,a.PiiNotSupportedOnIdentifier]),P=/* @__PURE__ */ new Set([a.EventFromLaterSlice,a.TimelineCycleGroup]),F=/* @__PURE__ */ new Set([a.UndeclaredDependency,a.UnusedDependencyDeclaration,a.InvalidDependencyTarget,a.RepeatedDependencyDeclaration,a.MutualDependencyDeclarations,a.AmbiguousReference]),I=/* @__PURE__ */ new Set([a.InvalidSpecificationInvocation,a.InvalidActionSubjectClause,a.InferredActionSubject,a.ChangedActionSubject,a.AmbiguousActionInputBinding,a.UnsupportedActionSubjectContext,a.InvalidTimeZoneDeclaration,a.InvalidCommandCalendar,a.InvalidSpecificationTimeZone,a.InvalidCommandReadsDeclaration,a.UnknownMatchPattern,a.InvalidMatchPattern,a.PatternOutsidePortableMatchDialect,a.AmbiguousMatchPattern,a.DeprecatedStudioTextRulePattern,a.MismatchedSpecificationQueryResult,a.DirectionlessTranslationReactsToOwnCapture,a.CaptureEventsFromSeveralOrigins,a.CaptureEventsKeyNotRequired,a.CaptureEventsRecordFixture,a.CaptureEventSourceKeyOutsideEvents,a.EventIdPinNotCarriedToRenderers,a.ResponseNameUsedOnFailure,a.InvalidEventDeclaration,a.InvalidImportDeclaration,a.InvalidSliceDeclaration,a.InvalidDescription,a.DuplicateDescription,a.EmptyDescription,a.DuplicateEventSubject,a.InvalidSubjectType,a.ProtectedSubjectType,a.InvalidSubjectOwner,a.ReadModelSubjectNotSupported,a.InvalidSubjectModifierOrder,a.UnsupportedInteractionAlternatives,a.MixedInteractionAlternatives,a.InteractionAlternativeWithoutActions,a.InlineInteractionAlternative,a.LegacyInteractionWhere,a.InvalidSpecificationParameter,a.InvalidSpecificationCase,a.DuplicateSpecificationParameter,a.DuplicateSpecificationCase,a.IncompleteSpecificationTable,a.InvalidSpecificationCaseAssignment,a.InvalidSpecificationCaseValue,a.InvalidSpecificationCaseReference,a.OptionalSpecificationParameterTarget,a.SpecificationCaseNameCollision,a.IncompatibleSpecificationParameterType,a.UnusedSpecificationParameter,a.SingularSpecificationTableExpansion,a.InvalidSpecificationCallerPersona,a.UnsynthesizablePersonaCaller,a.PersonaWithoutGate,a.GateWithoutPersona,a.AmbiguousPersonaCaller,a.InvalidDocumentation,a.ConflictingDocumentationAcrossFiles,a.InvalidAbsentReadModelStep,a.UnknownConstraintProperty,a.OmittedProductionDestination,a.InvalidSpecificationExample,a.DuplicateSpecificationAssignment,a.InvalidReactionBatchesDeclaration,a.DescribedCommandNotImplemented,a.DescribedCommandWithoutProductions,a.DescribedCommandCardinalityNotAdmitted,a.CommandHandlerRequiresAttachment,a.PendingIntentWithOtherHandler,a.DuplicateEventInProjectionScope,a.ReservedStoredName,a.ContextSourcedPerformedQueryArgument,a.RedundantCompositeKeyBraces,a.ImplicitAuthorizationConjunction]),L=/* @__PURE__ */ new Set([a.InvalidPurposeDeclaration,a.InvalidPurposeVocabulary,a.DuplicatePurposeField,a.DuplicatePurposeDeclaration,a.UnknownPurpose,a.PurposeInterestMismatch,a.PersonalDataWithoutPurpose,a.SpecialDataWithoutCondition,a.CriminalDataWithoutAuthorization,a.PurposeWithoutBasis,a.UnusedPurpose,a.UnknownConceptDirective,a.AttributeReasonWithoutAttribute,a.DuplicateAttributeReason,a.LegacyComplianceMarker,a.DuplicateComplianceMarker,a.UnknownComplianceMarker,a.InvalidSecretScope,a.DuplicateSecretScope,a.SecretScopeIgnoredForPii,a.InvalidPersonalDataQualifier,a.DuplicateSpecialCategory]),R=/* @__PURE__ */ new Set,z=/* @__PURE__ */ new Set;for(let e of u.compilerDiagnostics??S.diagnostics){let t=e.code===a.UnknownType&&(S.identityDetails??[]).some(t=>t.line===e.location.line-1),n=e.code===a.InvalidSemanticBinding&&e.message.startsWith(`Read model '`)&&e.message.includes(`' references unsupported type '`);n&&z.add(e.location.line-1);let r=e.code===a.RepeatedSingularDeclarationAcrossFiles&&e.message.includes(`identity block`);if(!(e.code===a.DuplicateDeclaration&&e.message.startsWith(`Duplicate declaration of policy `))&&!t&&!n&&!r&&!k.has(e.code)&&!A.has(e.code)&&!L.has(e.code)&&!j.has(e.code)&&!M.has(e.code)&&!N.has(e.code)&&!P.has(e.code)&&!F.has(e.code)&&!I.has(e.code)&&e.code!==a.ReducerIdentityMismatch&&e.code!==a.InvalidSpecificationExampleBody&&e.code!==a.UnknownRuleImplementationDirective&&e.code!==a.InvalidValidationRule&&e.code!==a.RepeatedDeclarationAcrossFiles&&!/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$|^PLAY060[7-9]$|^PLAY061[0-9]$|^PLAY0620$|^PLAY062[1-9]$|^PLAY063[0-9]$|^PLAY064[0-9]$|^PLAY065[0-2]$|^PLAY065[4-6]$|^PLAY066[0-6]$|^PLAY072[0-2]$/.test(e.code))continue;let i=e.location.line-1;if(e.code===a.OmittedProductionDestination&&O.some(t=>t.code===e.code&&t.line===i))continue;if(e.code===a.UnknownEvent){if(R.has(i))continue;R.add(i)}let c=o(s[i],e)||s[i].length-e.location.column+1;O.push(issue(e.severity,i,e.location.column,c,e.message,e.code))}let checkEvent=(e,t,n)=>{!E.has(n)&&!R.has(e)&&O.push(tokenIssue(`warning`,e,t,n,`Unknown event type '${n}' — declare it in a slice or import it.`,y.unknownEvent))},B=-1;for(let a=0;a<s.length;a++){let o=s[a],c=o.trim();if(d[a]||c.length===0)continue;let u=o.match(/^[ ]*(\t+)/);if(u&&O.push(issue(`warning`,a,u[0].length-u[1].length+1,u[1].length,`Screenplay is indentation-based — use spaces, not tabs.`,y.tabIndentation)),B>=0){if(l(o)>B&&w.test(c)){for(let e of policyNames(c))D.has(e)||O.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy));continue}B=-1}let f=validateImport(s,d,a);f&&O.push(f);let p=c.match(/^slice\s+(\w+)/);p&&!i.includes(p[1])&&O.push(tokenIssue(`error`,a,o,p[1],`Unknown slice type '${p[1]}' — expected ${i.join(`, `)}.`,y.unknownSliceType));let m=c.match(/^concept\s+\w+\s*:\s*(\w+)/);m&&m[1]!==`Enum`&&!r.includes(m[1])&&O.push(tokenIssue(`error`,a,o,m[1],`Unknown primitive type '${m[1]}' — expected ${r.join(`, `)} or Enum.`,y.unknownPrimitiveType));let h=c.match(/^authorize\s+(.*)$/);if(h){B=l(o);for(let e of policyNames(h[1]))D.has(e)||O.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy))}let g=c.match(/^on\s+([A-Z]\w*)\s*$/);g&&checkEvent(a,o,g[1]);let _=c.match(/^produces\s+([A-Z]\w*)\s*$/);if(_&&!S.operationProductionLines?.has(a)&&checkEvent(a,o,_[1]),/^produces\s+when\b/.test(c)&&!S.operationProductionLines?.has(a))for(let e=a+1;e<s.length;e++){let t=s[e];if(!(d[e]||t.trim().length===0)){if(l(t)>l(o)){let n=t.trim().match(/^([A-Z]\w*)\s*$/);n&&checkEvent(e,t,n[1])}break}}let v=c.match(/^unique\s+event\s+([A-Z]\w*)/);v&&checkEvent(a,o,v[1]);let b=c.match(/^unique\s+[a-z_]\w*\s+on\s+([A-Z]\w*)/);b&&checkEvent(a,o,b[1]);for(let e of o.match(/\$identity\.[\w.]+/g)??[]){let t=e.substring(10).split(`.`)[0],r=[...n,...(S.identityDetails??[]).map(e=>e.name)];r.includes(t)||O.push(tokenIssue(`warning`,a,o,e,`Unknown $identity property '${t}' — expected ${r.join(`, `)}.`,y.unknownContextIdentityProperty))}for(let r of o.match(/\$context\.[\w.]+/g)??[]){let i=r.substring(9).split(`.`);t.includes(i[0])?i[0]===`causedBy`&&i.length>1&&!e.includes(i[1])?O.push(tokenIssue(`warning`,a,o,r,`Unknown $context.causedBy property '${i[1]}' — expected ${e.join(`, `)}.`,y.unknownContextCausedByProperty)):i[0]===`identity`&&i.length>1&&!n.includes(i[1])&&O.push(tokenIssue(`warning`,a,o,r,`Unknown $context.identity property '${i[1]}' — expected ${n.join(`, `)}.`,y.unknownContextIdentityProperty)):O.push(tokenIssue(`warning`,a,o,r,`Unknown $context path '${i.join(`.`)}' — expected one of ${t.join(`, `)}.`,y.unknownContextPath))}}O.push(...validateEventContextPaths(s,d)),O.push(...b(s,T,g,S.operationProductionLines));let V=s.map((e,t)=>({line:e,index:t})).filter(({line:e})=>/^\s*```(?:[a-z]+)?\s*$/.test(e));if(V.length%2==1){let e=V[V.length-1];O.push(issue(`error`,e.index,1,e.line.length+1,"Unclosed inline code block — expected a closing ``` line.",y.unclosedCodeBlock))}return O.filter(e=>e.code!==y.unknownType||!z.has(e.line))}function validateProductionDestinations(e,t){let n=[];e=u(e);for(let r of t.commands){let t=r.properties.filter(e=>e.isIdentifier&&!g(e).isOptional&&!g(e).isCollection);if(t.length===1)for(let i of r.produces??[]){if(i.inline||i.conditional||i.target!==void 0)continue;let r=i.line;n.push(issue(`information`,r,l(e[r])+1,e[r].trim().length,`Plain 'produces ${i.name}' omits its destination — use 'for ${t[0].name}' to explicitly select the command's identifier.`,y.omittedProductionDestination))}}return n}function validateImport(e,t,n){let r=e[n],i=r.trim().replace(/\s*\/\/.*$/,``);if(!/^import\b/.test(i)||x(r,n))return;let a=l(r);if(a>0&&[`module`,`feature`].includes(s(e,t,n,a)[0])||S(r))return issue(`error`,n,a+1,i.length,`Invalid import '${i}' — inside a module or feature, import names files: 'import "<path or glob>"'.`,y.invalidFileImport)}const T=/^(?:(?:increment|decrement|count|clear|add|subtract|set)\s+)?@?([$\w.]+)(?=\s|=|$)/;function validateEventContextPaths(e,t){let n=[],names=e=>e.map(e=>e.name).join(`, `);for(let r=0;r<e.length;r++){let i=e[r];if(t[r])continue;for(let e of i.matchAll(/(\.)?\$eventContext((?:\.(?:\w+(?:\(\))?)?)*)/g)){let t=e[0].substring(e[1]?.length??0),i=e[2];if(i.length===0){e[1]&&n.push(issue(`error`,r,(e.index??0)+2,t.length,`'$eventContext' names no member - expected one of ${names(d(``).expected)}.`,y.missingEventContextPath));continue}let a=i.substring(1),o=d(a),s=(e.index??0)+(e[1]?.length??0)+1;switch(o.status){case`missing`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' names no member - expected one of ${names(o.expected)}.`,y.missingEventContextPath));break;case`unknownMember`:n.push(issue(`warning`,r,s,t.length,`Unknown event context member '${o.segment}' in '$eventContext.${a}' - expected one of ${names(o.expected)}.`,y.unknownEventContextMember));break;case`unknownSubPath`:{let e=o.expected.length===0?`no members to address`:`members ${names(o.expected)}`;n.push(issue(`warning`,r,s,t.length,`Unknown event context path '$eventContext.${a}' - '${o.member?.name}' (${o.member?.type}) has ${e}.`,y.unknownEventContextPath));break}case`belowCollection`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' cannot resolve - '${o.member?.name}' is a collection (${o.member?.type}) and cannot be addressed below.`,y.eventContextPathBelowCollection))}}let a=i.trim().match(T)?.[1],o=a?.match(/\.\$(\w+)/)?.[1];a&&o&&o!==`eventContext`&&n.push(tokenIssue(`warning`,r,i,a,`Dynamic dictionary key '$${o}' in '${a}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${o}' becomes the key.`,y.unresolvedDynamicKeySource))}return n}export{validateEventContextPaths,validateLines};
|
|
2
|
+
`)),x.authoringPlacement,x.authoringPath,x.authoringPlacementResolved),C=new Set(S.eventSources.routes.map(e=>e.location.line-1)),T={...m,commands:m.commands.map(e=>({...e,properties:e.properties.filter(e=>!C.has(e.line)),produces:e.produces?.filter(e=>!S.operationProductionLines?.has(e.line)),productionHeaders:e.productionHeaders?.filter(e=>!S.operationProductionLines?.has(e))}))},E=/* @__PURE__ */ new Set([...p(T),...p(g)]),D=new Set([...T.policies,...g.policies].map(e=>e.name)),O=validateDeclarations(s,T,g);O.push(...validateProductionDestinations(s,T));let k=/* @__PURE__ */ new Set([a.UnknownGenerationStrategy,a.InvalidGenerationArgument,a.InvalidGenerationModifier,a.DuplicateGenerationModifier,a.DuplicateGeneration,a.InvalidGenerationPrimitive,a.InvalidGenerationPrefix,a.InvalidGenerationAlphabet,a.InvalidTypeIdPrefix,a.GenerationSizeOutsideRange,a.ReservedSequenceGeneration,a.LowGenerationEntropy,a.LowGeneratedIdentifierEntropy,a.RefutedGeneratedConceptRule,a.UnprovenGeneratedConceptRule,a.GenerationSupportBudgetExceeded,a.EmptyGenerationSupport]),A=/* @__PURE__ */ new Set([a.MixedEnumerationNumbering,a.DuplicateEnumerationNumber,a.EnumerationNumberOutsideInt32,a.MalformedEnumerationNumber,a.UnpinnedStoredEnumeration]),j=/* @__PURE__ */ new Set([a.LegacyOptionalSuffix,a.InvalidOptionalModifierOrder,a.OptionalReadsNotSupported]),M=/* @__PURE__ */ new Set([a.UnexpectedTokenInPolicyCondition,a.ExpectedPolicyCondition,a.UnclosedPolicyConditionGroup,a.ExpectedRoleName,a.ExpectedClaimName,a.ExpectedClaimMatches,a.ExpectedClaimMatchTarget,a.AnonymousPolicyCombined,a.NegatedAnonymousPolicy]),N=/* @__PURE__ */ new Set([a.UnknownEvent,a.UnknownReadModelProperty,a.PiiNotSupportedOnIdentifier]),P=/* @__PURE__ */ new Set([a.EventFromLaterSlice,a.TimelineCycleGroup]),F=/* @__PURE__ */ new Set([a.UndeclaredDependency,a.UnusedDependencyDeclaration,a.InvalidDependencyTarget,a.RepeatedDependencyDeclaration,a.MutualDependencyDeclarations,a.AmbiguousReference]),I=/* @__PURE__ */ new Set([a.InvalidContextDeclaration,a.UnknownContextMemberType,a.DuplicateContextMember,a.ReservedContextMemberName,a.InvalidSpecificationInvocation,a.InvalidActionSubjectClause,a.InferredActionSubject,a.ChangedActionSubject,a.AmbiguousActionInputBinding,a.UnsupportedActionSubjectContext,a.InvalidTimeZoneDeclaration,a.InvalidCommandCalendar,a.InvalidSpecificationTimeZone,a.InvalidCommandReadsDeclaration,a.UnknownMatchPattern,a.InvalidMatchPattern,a.PatternOutsidePortableMatchDialect,a.AmbiguousMatchPattern,a.DeprecatedStudioTextRulePattern,a.MismatchedSpecificationQueryResult,a.DirectionlessTranslationReactsToOwnCapture,a.CaptureEventsFromSeveralOrigins,a.CaptureEventsKeyNotRequired,a.CaptureEventsRecordFixture,a.CaptureEventSourceKeyOutsideEvents,a.EventIdPinNotCarriedToRenderers,a.ResponseNameUsedOnFailure,a.InvalidEventDeclaration,a.InvalidImportDeclaration,a.InvalidSliceDeclaration,a.InvalidDescription,a.DuplicateDescription,a.EmptyDescription,a.DuplicateEventSubject,a.InvalidSubjectType,a.ProtectedSubjectType,a.InvalidSubjectOwner,a.ReadModelSubjectNotSupported,a.InvalidSubjectModifierOrder,a.UnsupportedInteractionAlternatives,a.MixedInteractionAlternatives,a.InteractionAlternativeWithoutActions,a.InlineInteractionAlternative,a.LegacyInteractionWhere,a.InvalidSpecificationParameter,a.InvalidSpecificationCase,a.DuplicateSpecificationParameter,a.DuplicateSpecificationCase,a.IncompleteSpecificationTable,a.InvalidSpecificationCaseAssignment,a.InvalidSpecificationCaseValue,a.InvalidSpecificationCaseReference,a.OptionalSpecificationParameterTarget,a.SpecificationCaseNameCollision,a.IncompatibleSpecificationParameterType,a.UnusedSpecificationParameter,a.SingularSpecificationTableExpansion,a.InvalidSpecificationCallerPersona,a.UnsynthesizablePersonaCaller,a.PersonaWithoutGate,a.GateWithoutPersona,a.AmbiguousPersonaCaller,a.InvalidDocumentation,a.ConflictingDocumentationAcrossFiles,a.InvalidAbsentReadModelStep,a.UnknownConstraintProperty,a.OmittedProductionDestination,a.InvalidSpecificationExample,a.DuplicateSpecificationAssignment,a.InvalidReactionBatchesDeclaration,a.DescribedCommandNotImplemented,a.DescribedCommandWithoutProductions,a.DescribedCommandCardinalityNotAdmitted,a.CommandHandlerRequiresAttachment,a.PendingIntentWithOtherHandler,a.DuplicateEventInProjectionScope,a.ReservedStoredName,a.ContextSourcedPerformedQueryArgument,a.RedundantCompositeKeyBraces,a.ImplicitAuthorizationConjunction,a.RepeatedPassiveDirective]),L=/* @__PURE__ */ new Set([a.InvalidPurposeDeclaration,a.InvalidPurposeVocabulary,a.DuplicatePurposeField,a.DuplicatePurposeDeclaration,a.UnknownPurpose,a.PurposeInterestMismatch,a.PersonalDataWithoutPurpose,a.SpecialDataWithoutCondition,a.CriminalDataWithoutAuthorization,a.PurposeWithoutBasis,a.UnusedPurpose,a.UnknownConceptDirective,a.AttributeReasonWithoutAttribute,a.DuplicateAttributeReason,a.LegacyComplianceMarker,a.DuplicateComplianceMarker,a.UnknownComplianceMarker,a.InvalidSecretScope,a.DuplicateSecretScope,a.SecretScopeIgnoredForPii,a.InvalidPersonalDataQualifier,a.DuplicateSpecialCategory]),R=/* @__PURE__ */ new Set,z=/* @__PURE__ */ new Set;for(let e of u.compilerDiagnostics??S.diagnostics){let t=e.code===a.UnknownType&&(S.identityDetails??[]).some(t=>t.line===e.location.line-1),n=e.code===a.InvalidSemanticBinding&&e.message.startsWith(`Read model '`)&&e.message.includes(`' references unsupported type '`);n&&z.add(e.location.line-1);let r=e.code===a.RepeatedSingularDeclarationAcrossFiles&&(e.message.includes(`identity block`)||e.message.includes(`context block`));if(!(e.code===a.DuplicateDeclaration&&e.message.startsWith(`Duplicate declaration of policy `))&&!t&&!n&&!r&&!k.has(e.code)&&!A.has(e.code)&&!L.has(e.code)&&!j.has(e.code)&&!M.has(e.code)&&!N.has(e.code)&&!P.has(e.code)&&!F.has(e.code)&&!I.has(e.code)&&e.code!==a.ReducerIdentityMismatch&&e.code!==a.InvalidSpecificationExampleBody&&e.code!==a.UnknownRuleImplementationDirective&&e.code!==a.InvalidValidationRule&&e.code!==a.RepeatedDeclarationAcrossFiles&&!/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$|^PLAY060[7-9]$|^PLAY061[0-9]$|^PLAY0620$|^PLAY062[1-9]$|^PLAY063[0-9]$|^PLAY064[0-9]$|^PLAY065[0-2]$|^PLAY065[4-6]$|^PLAY066[0-6]$|^PLAY072[0-2]$/.test(e.code))continue;let i=e.location.line-1;if(e.code===a.OmittedProductionDestination&&O.some(t=>t.code===e.code&&t.line===i))continue;if(e.code===a.UnknownEvent){if(R.has(i))continue;R.add(i)}let c=o(s[i],e)||s[i].length-e.location.column+1;O.push(issue(e.severity,i,e.location.column,c,e.message,e.code))}let checkEvent=(e,t,n)=>{!E.has(n)&&!R.has(e)&&O.push(tokenIssue(`warning`,e,t,n,`Unknown event type '${n}' — declare it in a slice or import it.`,y.unknownEvent))},B=-1;for(let a=0;a<s.length;a++){let o=s[a],c=o.trim();if(d[a]||c.length===0)continue;let u=o.match(/^[ ]*(\t+)/);if(u&&O.push(issue(`warning`,a,u[0].length-u[1].length+1,u[1].length,`Screenplay is indentation-based — use spaces, not tabs.`,y.tabIndentation)),B>=0){if(l(o)>B&&w.test(c)){for(let e of policyNames(c))D.has(e)||O.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy));continue}B=-1}let f=validateImport(s,d,a);f&&O.push(f);let p=c.match(/^slice\s+(\w+)/);p&&!i.includes(p[1])&&O.push(tokenIssue(`error`,a,o,p[1],`Unknown slice type '${p[1]}' — expected ${i.join(`, `)}.`,y.unknownSliceType));let m=c.match(/^concept\s+\w+\s*:\s*(\w+)/);m&&m[1]!==`Enum`&&!r.includes(m[1])&&O.push(tokenIssue(`error`,a,o,m[1],`Unknown primitive type '${m[1]}' — expected ${r.join(`, `)} or Enum.`,y.unknownPrimitiveType));let h=c.match(/^authorize\s+(.*)$/);if(h){B=l(o);for(let e of policyNames(h[1]))D.has(e)||O.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy))}let g=c.match(/^on\s+([A-Z]\w*)\s*$/);g&&checkEvent(a,o,g[1]);let _=c.match(/^produces\s+([A-Z]\w*)\s*$/);if(_&&!S.operationProductionLines?.has(a)&&checkEvent(a,o,_[1]),/^produces\s+when\b/.test(c)&&!S.operationProductionLines?.has(a))for(let e=a+1;e<s.length;e++){let t=s[e];if(!(d[e]||t.trim().length===0)){if(l(t)>l(o)){let n=t.trim().match(/^([A-Z]\w*)\s*$/);n&&checkEvent(e,t,n[1])}break}}let v=c.match(/^unique\s+event\s+([A-Z]\w*)/);v&&checkEvent(a,o,v[1]);let b=c.match(/^unique\s+[a-z_]\w*\s+on\s+([A-Z]\w*)/);b&&checkEvent(a,o,b[1]);for(let e of o.match(/\$identity\.[\w.]+/g)??[]){let t=e.substring(10).split(`.`)[0],r=[...n,...(S.identityDetails??[]).map(e=>e.name)];r.includes(t)||O.push(tokenIssue(`warning`,a,o,e,`Unknown $identity property '${t}' — expected ${r.join(`, `)}.`,y.unknownContextIdentityProperty))}for(let r of o.match(/\$context\.[\w.]+/g)??[]){let i=r.substring(9).split(`.`);t.includes(i[0])?i[0]===`causedBy`&&i.length>1&&!e.includes(i[1])?O.push(tokenIssue(`warning`,a,o,r,`Unknown $context.causedBy property '${i[1]}' — expected ${e.join(`, `)}.`,y.unknownContextCausedByProperty)):i[0]===`identity`&&i.length>1&&!n.includes(i[1])&&O.push(tokenIssue(`warning`,a,o,r,`Unknown $context.identity property '${i[1]}' — expected ${n.join(`, `)}.`,y.unknownContextIdentityProperty)):O.push(tokenIssue(`warning`,a,o,r,`Unknown $context path '${i.join(`.`)}' — expected one of ${t.join(`, `)}.`,y.unknownContextPath))}}O.push(...validateEventContextPaths(s,d)),O.push(...b(s,T,g,S.operationProductionLines));let V=s.map((e,t)=>({line:e,index:t})).filter(({line:e})=>/^\s*```(?:[a-z]+)?\s*$/.test(e));if(V.length%2==1){let e=V[V.length-1];O.push(issue(`error`,e.index,1,e.line.length+1,"Unclosed inline code block — expected a closing ``` line.",y.unclosedCodeBlock))}return O.filter(e=>e.code!==y.unknownType||!z.has(e.line))}function validateProductionDestinations(e,t){let n=[];e=u(e);for(let r of t.commands){let t=r.properties.filter(e=>e.isIdentifier&&!g(e).isOptional&&!g(e).isCollection);if(t.length===1)for(let i of r.produces??[]){if(i.inline||i.conditional||i.target!==void 0)continue;let r=i.line;n.push(issue(`information`,r,l(e[r])+1,e[r].trim().length,`Plain 'produces ${i.name}' omits its destination — use 'for ${t[0].name}' to explicitly select the command's identifier.`,y.omittedProductionDestination))}}return n}function validateImport(e,t,n){let r=e[n],i=r.trim().replace(/\s*\/\/.*$/,``);if(!/^import\b/.test(i)||x(r,n))return;let a=l(r);if(a>0&&[`module`,`feature`].includes(s(e,t,n,a)[0])||S(r))return issue(`error`,n,a+1,i.length,`Invalid import '${i}' — inside a module or feature, import names files: 'import "<path or glob>"'.`,y.invalidFileImport)}const T=/^(?:(?:increment|decrement|count|clear|add|subtract|set)\s+)?@?([$\w.]+)(?=\s|=|$)/;function validateEventContextPaths(e,t){let n=[],names=e=>e.map(e=>e.name).join(`, `);for(let r=0;r<e.length;r++){let i=e[r];if(t[r])continue;for(let e of i.matchAll(/(\.)?\$eventContext((?:\.(?:\w+(?:\(\))?)?)*)/g)){let t=e[0].substring(e[1]?.length??0),i=e[2];if(i.length===0){e[1]&&n.push(issue(`error`,r,(e.index??0)+2,t.length,`'$eventContext' names no member - expected one of ${names(d(``).expected)}.`,y.missingEventContextPath));continue}let a=i.substring(1),o=d(a),s=(e.index??0)+(e[1]?.length??0)+1;switch(o.status){case`missing`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' names no member - expected one of ${names(o.expected)}.`,y.missingEventContextPath));break;case`unknownMember`:n.push(issue(`warning`,r,s,t.length,`Unknown event context member '${o.segment}' in '$eventContext.${a}' - expected one of ${names(o.expected)}.`,y.unknownEventContextMember));break;case`unknownSubPath`:{let e=o.expected.length===0?`no members to address`:`members ${names(o.expected)}`;n.push(issue(`warning`,r,s,t.length,`Unknown event context path '$eventContext.${a}' - '${o.member?.name}' (${o.member?.type}) has ${e}.`,y.unknownEventContextPath));break}case`belowCollection`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' cannot resolve - '${o.member?.name}' is a collection (${o.member?.type}) and cannot be addressed below.`,y.eventContextPathBelowCollection))}}let a=i.trim().match(T)?.[1],o=a?.match(/\.\$(\w+)/)?.[1];a&&o&&o!==`eventContext`&&n.push(tokenIssue(`warning`,r,i,a,`Dynamic dictionary key '$${o}' in '${a}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${o}' becomes the key.`,y.unresolvedDynamicKeySource))}return n}export{validateEventContextPaths,validateLines};
|
|
3
3
|
//# sourceMappingURL=validation.js.map
|