@cratis/screenplay-language 4.78.0 → 4.79.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/chunk-7PEIIGGH.js +16 -0
- package/dist/bundles/chunk-7PEIIGGH.js.map +7 -0
- package/dist/bundles/index.js +2 -2
- package/dist/bundles/index.js.map +2 -2
- package/dist/bundles/sub-languages/projection/index.js +1 -1
- package/dist/diagnostic-codes.d.ts +6 -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/validation.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/bundles/chunk-2E5TT2R2.js +0 -16
- package/dist/bundles/chunk-2E5TT2R2.js.map +0 -7
package/dist/bundles/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as Wn,A as ft,B as yt,C as P,D as E,E as An,F as En,G as Ln,H as Pn,I as B,J as gt,K as U,L as qn,M as W,N as ke,O as Nn,P as Ce,Q as Rn,R as te,S as Mn,T as On,U as jn,V as zn,Y as Fn,Z as Se,_ as Bn,a as N,aa as Vn,b as lt,ba as _n,c as ae,ca as Un,d as xe,da as De,e as X,f as kn,g as Cn,h as Te,i as G,j as Sn,k as Dn,l as mt,m as we,n as D,o as ut,p as ee,q as se,r as pt,s as dt,t as ht,u as I,v as k,w as In,x as L,y as F,z as V}from"./chunk-2E5TT2R2.js";import{a as p}from"./chunk-AYDF3IFZ.js";var bt=/[\p{L}\p{Mn}\p{Nd}\p{Pc}]/u,$t=p(e=>`\\u${e.toString(16).padStart(4,"0")}`,"escape");function Hn(){let e="";for(let n=0;n<=65535;n++){if(!bt.test(String.fromCharCode(n)))continue;let t=n;for(;n<65535&&bt.test(String.fromCharCode(n+1));)n++;e+=$t(t)+(n>t?`-${$t(n)}`:"")}return e}p(Hn,"ranges");var Z=Hn();var xt=new Set(["operation","system","eventsource"]),Ie={csharp:"csharp",typescript:"typescript",react:"typescript",html:"html",sql:"sql"};function vt(e){return`subLanguage_${e}`}p(vt,"subLanguageState");function Gn(e){let n=[...ae.filter(t=>!xt.has(t)),...e.map(t=>t.keyword)];return[new RegExp(`^\\s*(?:${n.join("|")})\\b`),{token:"@rematch",next:"@pop"}]}p(Gn,"subLanguageExitRule");var Zn=[[/\/\/.*$/,"comment"],[/^(numbers)([ \t]+)(exact)(?=[ \t]*(?:(?:\/\/|#).*)?$)/,["keyword","white","keyword"]],[/\$(?:context|eventContext|eventSourceId|causedBy)(?:\.\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 Tt(e){let n={root:[[/^(eventsource)(\s+)([A-Za-z_]\w*)(?=\s*(?:\/\/.*)?$)/,["keyword","white","type.identifier"]],[/^(system)(\s+)([A-Z]\w*)(?=\s*(?:\/\/.*)?$)/,["keyword","white","type.identifier"]],[/^(\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))(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,["white","keyword","white","type.identifier"]],[new RegExp(`^(\\s*)(command)(\\s+)([A-Za-z_][${Z}]*)(?=\\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*(?: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"]],[/^(\s*)(given|when)(\s+)(clock|capture|trigger|query)\b/,["white","keyword","white","keyword"]],[/^(\s*)(then)(\s+)(result|no\s+result)\b/,["white","keyword","white","keyword"]],[/^(\s*)(import)(\s+)("[^"\\]*")/,["white","keyword","white","string.link"]],[/^(\s*)((?:produces\s+)?event)(\s+)([A-Za-z_]\w*)(\s+)(generation)(\s+)(\d+)(?=\s*(?:\/\/.*)?$)/,["white","keyword","white","type.identifier","white","keyword","white",{token:"number",next:"@eventBody.$1"}]],[/^(\s*)((?:produces\s+)?event)(\s+)([A-Za-z_]\w*)(?=\s*(?:\/\/.*)?$)/,["white","keyword","white",{token:"type.identifier",next:"@eventBody.$1"}]],...X.map(t=>[new RegExp(`^\\s*\\x60\\x60\\x60${t}\\s*$`),{token:"string.quote",next:`@codeBlock.${Ie[t]}`,nextEmbedded:Ie[t]}]),...X.map(t=>[new RegExp(`\\b${t}\\b(?=\\s*$)`),{token:"keyword.tag",next:`@codeBlockPending.${Ie[t]}`}]),...e.map(t=>[new RegExp(`\\b${t.keyword}\\b`),{token:"keyword",next:`@${vt(t.keyword)}`}]),[/\bdescription\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"}],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"}],[new RegExp(`^(\\s*)([${Z}.]+)(\\s+)(rule)(\\s+)([A-Za-z_][${Z}]*)(?=\\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:Zn,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 t of e)n[vt(t.keyword)]=[Gn(e),...t.tokens,{include:"@common"},[/[A-Z]\w*/,"type.identifier"],[/[a-z_]\w*/,"identifier"]];return{defaultToken:"",tokenPostfix:".play",ignoreCase:!1,keywords:[...ae.filter(t=>!xt.has(t)),...xe,...X],sliceTypes:Te,primitiveTypes:G,tokenizer:n}}p(Tt,"createTokensProvider");var Ae=[{label:"on",insertText:"on ${1|click,select,submit,change,load,unload,enter,leave|}\n ${2:execute command}",documentation:"Wires what happens on an interaction - a click, a submit, entering or leaving the screen."},{label:"uses",insertText:"uses ${1:Behavior}",documentation:"Attaches a named behavior declared at the top level."}],Ee=[{label:"description",insertText:'description "${1:what this module is for}"',documentation:"A human-readable description."},{label:"authorize",insertText:"authorize ${1:PolicyName}",documentation:"Policies that must pass for everything in the module."},{label:'import "\u2026"',insertText:'import "${1:*/*.play}"',documentation:"Imports `.play` files into this module \u2014 their top level is the module's body."},{label:"feature",insertText:"feature ${1:Name}\n ",documentation:"Groups related slices into a vertical feature."},{label:"screen",insertText:"screen ${1:Name}\n data ${2:ReadModel} via query ${3:QueryName}",documentation:"Declares a module-level UI screen."},{label:"screen template",insertText:"screen template ${1:Name}\n fits slot ${2:content}\n\n ${3:slot}",documentation:"Declares a reusable screen shape that fits a slot of the shell."},{label:"dialog template",insertText:"dialog template ${1:Name}\n ${2:body}\n ${3:actions}",documentation:"Declares a reusable dialog shape that opens over the shell."},{label:"form",insertText:'form ${1:Name} for ${2:Command}\n field ${3:property} label "${4:Label}"',documentation:"Declares a form bound to a command."},{label:"contribute",insertText:'contribute to ${1:Navigation}\n navigate to ${2:Screen}\n label "${3:Label}"',documentation:"Contributes an entry to a slot of the shell, such as navigation."},...Ae],Le=[{label:"description",insertText:'description "${1:what this feature is for}"',documentation:"A human-readable description."},{label:"authorize",insertText:"authorize ${1:PolicyName}",documentation:"Policies that must pass for everything in the feature."},{label:'import "\u2026"',insertText:'import "${1:*.play}"',documentation:"Imports `.play` files into this feature \u2014 their top level is the feature's body."},{label:"feature",insertText:"feature ${1:Name}\n ",documentation:"Declares a nested sub-feature."},{label:"slice StateChange",insertText:"slice StateChange ${1:Name}\n ",documentation:"A command \u2192 events flow; something that changes the system."},{label:"slice StateView",insertText:"slice StateView ${1:Name}\n ",documentation:"A query + projection + screen; something that reads the system."},{label:"slice Automation",insertText:"slice Automation ${1:Name}\n ",documentation:"A reaction or reducer; something that runs when something happens."},{label:"slice Translate",insertText:"slice Translate ${1:Name}\n ",documentation:"A capture; converts external data into events."},{label:"contribute",insertText:'contribute to ${1:Navigation}\n navigate to ${2:Screen}\n label "${3:Label}"',documentation:"Contributes an entry to a slot of the shell, such as navigation."},...Ae],wt=[{label:"description",insertText:'description "${1:what one instance holds}"',documentation:"A human-readable description."},{label:"file",insertText:"file ${1:Path}",documentation:"Names the file this read model is realized by."},{label:"property",insertText:"${1:property} ${2:Type}",documentation:"A property of the read model \u2014 a name and a type reference."}],kt=[{label:"description",insertText:'description "${1:what the reducer does}"',documentation:"A human-readable description."},{label:"on",insertText:"on ${1:EventType}\n ```csharp\n ${2}\n ```",documentation:"A rule applied when the event occurs, in code or from a file."}],Ct=[{label:"populate via query",insertText:"populate via query ${1:Query} by ${2:parameter}",documentation:"Fills the form from a query before it is shown."},{label:"populate from item",insertText:"populate from item",documentation:"Fills the form from the item the screen was opened for."},{label:"field",insertText:'field ${1:property} label "${2:Label}"',documentation:"A form field bound to a command property."},...Ae],St=[{label:"navigate to",insertText:"navigate to ${1:Screen}",documentation:"The screen the entry opens."},{label:"label",insertText:'label "${1:Label}"',documentation:"The text of the entry."},{label:"order",insertText:"order ${1:10}",documentation:"Where the entry sits among the others; lower comes first."}],Dt=[{label:"description",insertText:'description "${1:what the behavior does}"',documentation:"A human-readable description."},{label:"parameter",insertText:"parameter ${1:name} ${2:Type}",documentation:"A value the behavior is given where it is attached."},{label:"order",insertText:"order ${1:10}",documentation:"The order behaviors attached to the same element run in."},{label:"on",insertText:"on ${1|click,select,submit,change,load,unload,enter,leave|}\n ${2:execute command}",documentation:"Wires what happens on an interaction."}],j=p((e,n,t)=>({label:e,insertText:n,documentation:t}),"step"),Qn=[j("execute","execute ${1:command}","Runs a command."),j("navigate to","navigate to ${1:Screen}","Opens a screen."),j("open","open ${1:Dialog}","Opens a dialog."),j("close","close","Closes the dialog."),j("refresh","refresh ${1:query}","Reloads a query."),j("set","set ${1:name} ${2:value}","Sets a value."),j("notify",'notify ${1|info,warning,error|} "${2:message}"',"Shows a notification."),j("confirm","confirm ${1:message}\n on success\n ${2:execute command}","Asks before continuing."),j("raise","raise ${1:Trigger}","Raises a trigger.")],It=[j("on success",'on success\n ${1:notify info "Done"}',"What happens when it succeeds."),j("on failure",'on failure\n ${1:notify error "Failed"}',"What happens when it fails."),...Qn],At=[{label:"description",insertText:'description "${1:who they are}"',documentation:"A human-readable description."},{label:"policy",insertText:"policy ${1:PolicyName}",documentation:"A policy this persona holds."}],Et=[{label:"provider",insertText:"provider ${1:Name}",documentation:"An identity provider."},{label:"provider (named)",insertText:"provider ${1:Kind} name ${2:Name}",documentation:"An identity provider of a kind, under its own name."}],Lt=[{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."}],Pt=[{label:"compatible with",insertText:"compatible with ${1:Package}",documentation:"A component package the theme is compatible with."}],qt=[{label:"target platform",insertText:"target platform ${1:web}",documentation:"The platforms the profile is for."},{label:"target size",insertText:"target size ${1|compact,regular|}",documentation:"The screen sizes the profile is for."},{label:"packages",insertText:"packages\n ${1:Package}",documentation:"The component packages the profile uses."},{label:"layout",insertText:"layout ${1:Layout}",documentation:"The layout of the profile."},{label:"theme",insertText:"theme ${1:Theme}",documentation:"The theme of the profile."}],Pe=[{label:"slot",insertText:"${1:slot}",documentation:"A named slot of the shell."},{label:"slot contributes",insertText:"${1:slot} contributes ${2:Name}",documentation:"A slot other declarations contribute to, such as `navigation contributes Navigation`."},{label:"arrangement",insertText:`arrangement flow
|
|
1
|
+
import{$ as Wn,A as ft,B as yt,C as P,D as E,E as An,F as En,G as Ln,H as Pn,I as B,J as gt,K as U,L as qn,M as W,N as ke,O as Nn,P as Ce,Q as Rn,R as te,S as Mn,T as On,U as jn,V as zn,Y as Fn,Z as Se,_ as Bn,a as N,aa as Vn,b as lt,ba as _n,c as ae,ca as Un,d as xe,da as De,e as X,f as kn,g as Cn,h as Te,i as G,j as Sn,k as Dn,l as mt,m as we,n as D,o as ut,p as ee,q as se,r as pt,s as dt,t as ht,u as I,v as k,w as In,x as L,y as F,z as V}from"./chunk-7PEIIGGH.js";import{a as p}from"./chunk-AYDF3IFZ.js";var bt=/[\p{L}\p{Mn}\p{Nd}\p{Pc}]/u,$t=p(e=>`\\u${e.toString(16).padStart(4,"0")}`,"escape");function Hn(){let e="";for(let n=0;n<=65535;n++){if(!bt.test(String.fromCharCode(n)))continue;let t=n;for(;n<65535&&bt.test(String.fromCharCode(n+1));)n++;e+=$t(t)+(n>t?`-${$t(n)}`:"")}return e}p(Hn,"ranges");var Z=Hn();var xt=new Set(["operation","system","eventsource"]),Ie={csharp:"csharp",typescript:"typescript",react:"typescript",html:"html",sql:"sql"};function vt(e){return`subLanguage_${e}`}p(vt,"subLanguageState");function Gn(e){let n=[...ae.filter(t=>!xt.has(t)),...e.map(t=>t.keyword)];return[new RegExp(`^\\s*(?:${n.join("|")})\\b`),{token:"@rematch",next:"@pop"}]}p(Gn,"subLanguageExitRule");var Zn=[[/\/\/.*$/,"comment"],[/^(numbers)([ \t]+)(exact)(?=[ \t]*(?:(?:\/\/|#).*)?$)/,["keyword","white","keyword"]],[/\$(?:context|eventContext|eventSourceId|causedBy)(?:\.\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 Tt(e){let n={root:[[/^(eventsource)(\s+)([A-Za-z_]\w*)(?=\s*(?:\/\/.*)?$)/,["keyword","white","type.identifier"]],[/^(system)(\s+)([A-Z]\w*)(?=\s*(?:\/\/.*)?$)/,["keyword","white","type.identifier"]],[/^(\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))(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,["white","keyword","white","type.identifier"]],[new RegExp(`^(\\s*)(command)(\\s+)([A-Za-z_][${Z}]*)(?=\\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*(?: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"]],[/^(\s*)(given|when)(\s+)(clock|capture|trigger|query)\b/,["white","keyword","white","keyword"]],[/^(\s*)(then)(\s+)(result|no\s+result)\b/,["white","keyword","white","keyword"]],[/^(\s*)(import)(\s+)("[^"\\]*")/,["white","keyword","white","string.link"]],[/^(\s*)((?:produces\s+)?event)(\s+)([A-Za-z_]\w*)(\s+)(generation)(\s+)(\d+)(?=\s*(?:\/\/.*)?$)/,["white","keyword","white","type.identifier","white","keyword","white",{token:"number",next:"@eventBody.$1"}]],[/^(\s*)((?:produces\s+)?event)(\s+)([A-Za-z_]\w*)(?=\s*(?:\/\/.*)?$)/,["white","keyword","white",{token:"type.identifier",next:"@eventBody.$1"}]],...X.map(t=>[new RegExp(`^\\s*\\x60\\x60\\x60${t}\\s*$`),{token:"string.quote",next:`@codeBlock.${Ie[t]}`,nextEmbedded:Ie[t]}]),...X.map(t=>[new RegExp(`\\b${t}\\b(?=\\s*$)`),{token:"keyword.tag",next:`@codeBlockPending.${Ie[t]}`}]),...e.map(t=>[new RegExp(`\\b${t.keyword}\\b`),{token:"keyword",next:`@${vt(t.keyword)}`}]),[/\bdescription\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"}],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"}],[new RegExp(`^(\\s*)([${Z}.]+)(\\s+)(rule)(\\s+)([A-Za-z_][${Z}]*)(?=\\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:Zn,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 t of e)n[vt(t.keyword)]=[Gn(e),...t.tokens,{include:"@common"},[/[A-Z]\w*/,"type.identifier"],[/[a-z_]\w*/,"identifier"]];return{defaultToken:"",tokenPostfix:".play",ignoreCase:!1,keywords:[...ae.filter(t=>!xt.has(t)),...xe,...X],sliceTypes:Te,primitiveTypes:G,tokenizer:n}}p(Tt,"createTokensProvider");var Ae=[{label:"on",insertText:"on ${1|click,select,submit,change,load,unload,enter,leave|}\n ${2:execute command}",documentation:"Wires what happens on an interaction - a click, a submit, entering or leaving the screen."},{label:"uses",insertText:"uses ${1:Behavior}",documentation:"Attaches a named behavior declared at the top level."}],Ee=[{label:"description",insertText:'description "${1:what this module is for}"',documentation:"A human-readable description."},{label:"authorize",insertText:"authorize ${1:PolicyName}",documentation:"Policies that must pass for everything in the module."},{label:"depends on",insertText:"depends on ${1:Name}",documentation:"Declares an allowed module or feature dependency. Opts this container into independent explicit-reference checks."},{label:'import "\u2026"',insertText:'import "${1:*/*.play}"',documentation:"Imports `.play` files into this module \u2014 their top level is the module's body."},{label:"feature",insertText:"feature ${1:Name}\n ",documentation:"Groups related slices into a vertical feature."},{label:"screen",insertText:"screen ${1:Name}\n data ${2:ReadModel} via query ${3:QueryName}",documentation:"Declares a module-level UI screen."},{label:"screen template",insertText:"screen template ${1:Name}\n fits slot ${2:content}\n\n ${3:slot}",documentation:"Declares a reusable screen shape that fits a slot of the shell."},{label:"dialog template",insertText:"dialog template ${1:Name}\n ${2:body}\n ${3:actions}",documentation:"Declares a reusable dialog shape that opens over the shell."},{label:"form",insertText:'form ${1:Name} for ${2:Command}\n field ${3:property} label "${4:Label}"',documentation:"Declares a form bound to a command."},{label:"contribute",insertText:'contribute to ${1:Navigation}\n navigate to ${2:Screen}\n label "${3:Label}"',documentation:"Contributes an entry to a slot of the shell, such as navigation."},...Ae],Le=[{label:"description",insertText:'description "${1:what this feature is for}"',documentation:"A human-readable description."},{label:"authorize",insertText:"authorize ${1:PolicyName}",documentation:"Policies that must pass for everything in the feature."},{label:"depends on",insertText:"depends on ${1:Name}",documentation:"Declares an allowed module or feature dependency. Sibling feature names resolve before module names."},{label:'import "\u2026"',insertText:'import "${1:*.play}"',documentation:"Imports `.play` files into this feature \u2014 their top level is the feature's body."},{label:"feature",insertText:"feature ${1:Name}\n ",documentation:"Declares a nested sub-feature."},{label:"slice StateChange",insertText:"slice StateChange ${1:Name}\n ",documentation:"A command \u2192 events flow; something that changes the system."},{label:"slice StateView",insertText:"slice StateView ${1:Name}\n ",documentation:"A query + projection + screen; something that reads the system."},{label:"slice Automation",insertText:"slice Automation ${1:Name}\n ",documentation:"A reaction or reducer; something that runs when something happens."},{label:"slice Translate",insertText:"slice Translate ${1:Name}\n ",documentation:"A capture; converts external data into events."},{label:"contribute",insertText:'contribute to ${1:Navigation}\n navigate to ${2:Screen}\n label "${3:Label}"',documentation:"Contributes an entry to a slot of the shell, such as navigation."},...Ae],wt=[{label:"description",insertText:'description "${1:what one instance holds}"',documentation:"A human-readable description."},{label:"file",insertText:"file ${1:Path}",documentation:"Names the file this read model is realized by."},{label:"property",insertText:"${1:property} ${2:Type}",documentation:"A property of the read model \u2014 a name and a type reference."}],kt=[{label:"description",insertText:'description "${1:what the reducer does}"',documentation:"A human-readable description."},{label:"on",insertText:"on ${1:EventType}\n ```csharp\n ${2}\n ```",documentation:"A rule applied when the event occurs, in code or from a file."}],Ct=[{label:"populate via query",insertText:"populate via query ${1:Query} by ${2:parameter}",documentation:"Fills the form from a query before it is shown."},{label:"populate from item",insertText:"populate from item",documentation:"Fills the form from the item the screen was opened for."},{label:"field",insertText:'field ${1:property} label "${2:Label}"',documentation:"A form field bound to a command property."},...Ae],St=[{label:"navigate to",insertText:"navigate to ${1:Screen}",documentation:"The screen the entry opens."},{label:"label",insertText:'label "${1:Label}"',documentation:"The text of the entry."},{label:"order",insertText:"order ${1:10}",documentation:"Where the entry sits among the others; lower comes first."}],Dt=[{label:"description",insertText:'description "${1:what the behavior does}"',documentation:"A human-readable description."},{label:"parameter",insertText:"parameter ${1:name} ${2:Type}",documentation:"A value the behavior is given where it is attached."},{label:"order",insertText:"order ${1:10}",documentation:"The order behaviors attached to the same element run in."},{label:"on",insertText:"on ${1|click,select,submit,change,load,unload,enter,leave|}\n ${2:execute command}",documentation:"Wires what happens on an interaction."}],j=p((e,n,t)=>({label:e,insertText:n,documentation:t}),"step"),Qn=[j("execute","execute ${1:command}","Runs a command."),j("navigate to","navigate to ${1:Screen}","Opens a screen."),j("open","open ${1:Dialog}","Opens a dialog."),j("close","close","Closes the dialog."),j("refresh","refresh ${1:query}","Reloads a query."),j("set","set ${1:name} ${2:value}","Sets a value."),j("notify",'notify ${1|info,warning,error|} "${2:message}"',"Shows a notification."),j("confirm","confirm ${1:message}\n on success\n ${2:execute command}","Asks before continuing."),j("raise","raise ${1:Trigger}","Raises a trigger.")],It=[j("on success",'on success\n ${1:notify info "Done"}',"What happens when it succeeds."),j("on failure",'on failure\n ${1:notify error "Failed"}',"What happens when it fails."),...Qn],At=[{label:"description",insertText:'description "${1:who they are}"',documentation:"A human-readable description."},{label:"policy",insertText:"policy ${1:PolicyName}",documentation:"A policy this persona holds."}],Et=[{label:"provider",insertText:"provider ${1:Name}",documentation:"An identity provider."},{label:"provider (named)",insertText:"provider ${1:Kind} name ${2:Name}",documentation:"An identity provider of a kind, under its own name."}],Lt=[{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."}],Pt=[{label:"compatible with",insertText:"compatible with ${1:Package}",documentation:"A component package the theme is compatible with."}],qt=[{label:"target platform",insertText:"target platform ${1:web}",documentation:"The platforms the profile is for."},{label:"target size",insertText:"target size ${1|compact,regular|}",documentation:"The screen sizes the profile is for."},{label:"packages",insertText:"packages\n ${1:Package}",documentation:"The component packages the profile uses."},{label:"layout",insertText:"layout ${1:Layout}",documentation:"The layout of the profile."},{label:"theme",insertText:"theme ${1:Theme}",documentation:"The theme of the profile."}],Pe=[{label:"slot",insertText:"${1:slot}",documentation:"A named slot of the shell."},{label:"slot contributes",insertText:"${1:slot} contributes ${2:Name}",documentation:"A slot other declarations contribute to, such as `navigation contributes Navigation`."},{label:"arrangement",insertText:`arrangement flow
|
|
2
2
|
column
|
|
3
3
|
\${1:slot}`,documentation:"How the slots are placed."}],ce=[{label:"fits slot",insertText:"fits slot ${1:content}",documentation:"The slot of the shell the template fits."},...Pe,{label:"on",insertText:"on ${1|enter,leave,load,unload|}\n ${2:refresh query}",documentation:"Wires what happens on an interaction."}];var le=[{label:"optional",insertText:"optional",documentation:"Allows the complete value, including a collection, to be absent."}],R=p(e=>`\`\`\`${e}
|
|
4
4
|
\${1}
|
|
@@ -58,7 +58,7 @@ Physical ownership: ${m.state}. ${m.reasons.join(" ")}`)}}if(o?.route?.streamId&
|
|
|
58
58
|
`).map((i,l)=>l===0?i:i.slice(Math.min(n,k(i)))).join(`
|
|
59
59
|
`);return{label:e.split(`
|
|
60
60
|
`)[0].trim(),insertText:t.replace(/[$}\\]/g,"\\$&"),documentation:"Expands the whole block from what the command and its events declare."}}p(ho,"expansionEntry");function pn(e,n={headers:[],document:[]}){let t=e[0];if(t===void 0||t==="domain")return po(n.document);let r=H(t);if(r)return r.completions??[];let i=n.headers[0];switch(t){case"module":return Ee;case"feature":return Le;case"slice":return tn(i?.split(/\s+/)[1]);case"concept":return Mt;case"type":return Ot;case"command":return jt;case"event":return qe;case"readmodel":return wt;case"reducer":return kt;case"form":return Ct;case"contribute":return St;case"behavior":return Dt;case"persona":return At;case"authentication":return Et;case"seed":return Lt;case"theme":return Pt;case"ui":return qt;case"on":case"success":case"failure":case"confirm":return It;case"layout":return Pe;case"system":return K.filter(l=>l.label==="description");case"operation":return K;case"execute":case"compensate":return me;case"produces":return Y;case"handler":return Bt;case"implementation":return e[1]==="handler"?Ft:["execute","compensate"].includes(e[1])?ne:[];case"query":return Wt;case"performer":return Vt;case"constraint":return _t;case"reaction":return Ut;case"trigger":return Gt;case"when":case"every":case"at":return e.includes("reaction")?Ht:[];case"specification":return Zt;case"policy":return Yt;case"validate":return Jt;case"action":return Xt;case"table":case"summary":return en;case"screen":return Ge(i)?ce:Me;case"dialog":return ce;default:return Ge(n.headers.find(l=>Ge(l)))?ce:e.includes("screen")||t==="section"?Me:e.includes("produces")?Y:[]}}p(pn,"completionEntriesFor");function Ze(e,n,t,r=U(e)){let i=L(e);if(i[n]||I(t).length<t.length)return{kind:"none"};let l=oe(e,n,t,U(e));if(l!==null)return{kind:"entries",entries:l};let u=t.match(/^\s*import\s+"([^"]*)$/);if(u)return{kind:"playFiles",replaceLength:u[1].length};if(/["/]$/.test(t))return{kind:"none"};let o=t.match(/\$[\w.]*$/);if(o)return{kind:"contextVariables",replaceLength:o[0].length};let s=e[n]??"",c=t.trim().length===0?t.length:k(s),a=F(e,i,n,c),m=ye(e,n,c);if(m==="implementation")return{kind:"entries",entries:Re};if(m==="rule")return{kind:"entries",entries:Qt};let d=["event","command","type","readmodel","trigger","when","every","at"].includes(a[0])||a[0]==="produces"&&/^produces\s+event\b/.test(V(e,i,n,c)??""),g=t.trimStart().split(/\s+/)[0],h=a[0]==="command"&&["reads","authorize","produces"].includes(g)||a[0]==="event"&&g==="tag"||["trigger","when","every","at"].includes(a[0])&&["description","file","reads","produces","invokes"].includes(g),b=p(S=>S!==null&&"optional".startsWith(S[1]),"optionalPrefix"),C=d&&!h&&b(t.match(/^\s*@?[a-z_]\w*\s+[\w.]+(?:\[\])?\s+(\w*)$/)),v=a[0]==="query"&&b(t.match(/^\s*(?:by|filter)\s+[a-z_]\w*\s+[\w.]+(?:\[\])?\s+(\w*)$/))||b(t.match(/^\s*query\s+[A-Za-z_]\w*\s*=>\s*(?:observable\s+)?[\w.]+(?:\[\])?\s+(\w*)$/));if((C||v)&&!/=>\s*observable\s+$/.test(t))return{kind:"entries",entries:le};if(/\bauthorize\s+[\w\s]*$/.test(t)||a[0]==="authorize")return{kind:"policies"};if(/\bwhen\s+\w*$/.test(t)&&a.includes("reaction"))return{kind:"triggers"};if(/\bon\s+\w*$/.test(t)&&a.includes("constraint"))return{kind:"events"};if(/\binvokes\s+\w*$/.test(t)&&a.includes("reaction"))return{kind:"commands"};if(/\b(?:on|unique\s+event)\s+\w*$/.test(t)&&a[0]==="constraint")return{kind:"events"};if(/\bproduces\s+\w*$/.test(t))return{kind:"producesTargets"};if(/\bnavigate\s+to\s+\w*$/.test(t))return{kind:"screens"};if(a[0]==="specification"){if(/^\s*when\s+query\s+[\w.]*$/.test(t))return{kind:"queries"};let S=t.match(/^\s*(given|when|then)\s+\w*$/);if(S)return{kind:"entries",entries:Ne[S[1]]}}if(/\b(?:via|then)\s+query\s+[\w.]*$/.test(t))return{kind:"queries"};if((a[0]==="event"||a[0]==="command"||a[0]==="type")&&/^\s+[a-z_]\w*\s+[\w[\]?]*$/.test(t))return{kind:"types"};if(a[0]==="query"&&/^\s+(?:by|filter)\s+[a-z_]\w*\s+[\w[\]?]*$/.test(t))return{kind:"types"};let x=V(e,i,n,c);if(x&&/^produces\s+operation\b/.test(x))return{kind:"entries",entries:K};if(x&&/^produces\s+event\b/.test(x))return/^\s+@?[a-z_]\w*\s+[\w[\]?]*$/.test(t)?{kind:"types"}:{kind:"entries",entries:zt};if(x&&uo.test(x))return{kind:"entries",entries:Kt};let y=ft(e,i,n,c);if(a[0]==="for"&&a.includes("seed"))return{kind:"events"};let $=pn(a,{headers:y,document:e}),w=a[0]==="command"?re(e,n," ".repeat(c),"",r):null;return{kind:"entries",entries:w?[ho(w.text,c),...$]:$}}p(Ze,"planCompletions");function dn(e,n={}){return{triggerCharacters:[" ","$","@",".",'"',"/"],provideCompletionItems(t,r){let i=t.getLinesContent(),l=r.lineNumber-1,o=(i[l]??"").substring(0,r.column-1),s=n.application?.(t),c=W(i,s),a=We(i,l,o,c)??ze(i,l,o,c)??oe(i,l,o,c),m=a===null?Ze(i,l,o,c):{kind:"entries",entries:a};if(m.kind==="none")return{suggestions:[]};let d=t.getWordUntilPosition(r),g=new e.Range(r.lineNumber,d.startColumn,r.lineNumber,d.endColumn),h=e.languages.CompletionItemKind,b=e.languages.CompletionItemInsertTextRule.InsertAsSnippet,C=p(y=>({label:y.label,kind:y.insertText.includes("$")?h.Snippet:h.Keyword,insertText:y.insertText,insertTextRules:b,documentation:y.documentation,range:g}),"snippet"),v=p((y,$,w)=>({label:y,kind:$,insertText:y,detail:w,range:g}),"symbolItem"),x=p(()=>{let y=new Set(c.events.filter($=>$.inline).map($=>$.name));return[...new Set(ke(c))].map($=>v($,h.Event,y.has($)?"inline event":"event"))},"eventNames");switch(m.kind){case"playFiles":{let y=new e.Range(r.lineNumber,r.column-m.replaceLength,r.lineNumber,r.column);return{suggestions:(n.playFiles?.(t)??[]).map($=>({label:$,kind:$.includes("*")?h.Folder:h.File,insertText:$,range:y}))}}case"contextVariables":{let y=new e.Range(r.lineNumber,r.column-m.replaceLength,r.lineNumber,d.endColumn);return{suggestions:Oe.map($=>({...C($),range:y}))}}case"policies":return{suggestions:c.policies.map(y=>v(y.name,h.Reference,"policy"))};case"events":return{suggestions:x()};case"triggers":return{suggestions:[...new Set(Ce(c))].map(y=>v(y,h.Event,"trigger"))};case"commands":return{suggestions:c.commands.map(y=>v(y.name,h.Method,"command"))};case"producesTargets":return{suggestions:[...Y.map(C),...x()]};case"screens":return{suggestions:c.screens.map(y=>v(y.name,h.Interface,"screen"))};case"queries":return{suggestions:c.queries.map(y=>v(y.name,h.Function,`query => ${D(y.returnTypeReference??we(y.returnType))}`))};case"types":return{suggestions:[...c.concepts.map(y=>v(y.name,h.Class,`concept : ${y.primitive}${y.attributes.length?" "+y.attributes.join(" "):""}`)),...c.types.map(y=>v(y.name,h.Struct,`type (${y.properties.length} properties)`)),...G.map(y=>v(y,h.Struct,"primitive"))]};case"entries":return{suggestions:m.entries.map(C)}}}}}p(dn,"createCompletionProvider");function hn(e){return{provideInlineCompletions(n,t){let r=n.getLinesContent(),i=t.lineNumber-1,l=r[i]??"",u=W(r,e.application?.(n)),o=re(r,i,l.substring(0,t.column-1),l.substring(t.column-1),u);return o?{items:[{insertText:`${l.substring(0,t.column-1)}${o.text}`,range:{startLineNumber:t.lineNumber,startColumn:1,endLineNumber:t.lineNumber,endColumn:t.column}}]}:{items:[]}},disposeInlineCompletions(){}}}p(hn,"createInlineCompletionProvider");var Qe=["keyword","property","type"];function Ke(e,n){let t=[],r=p((o,s,c,a)=>{let m=e[o-1];if(m===void 0||s<1||c<1)return;let d=s-1+(m[s-1]==="@"?1:0);d+c<=m.length&&t.push({line:o-1,column:d,length:c,type:a})},"add"),i=n?.authoringPath??"current.play",l=E(e,n?.authoringDocuments??n?.authoringSources?.filter(o=>o!==e.join(`
|
|
61
|
-
`))??[],n?.authoringPlacement,i,n?.authoringPlacementResolved);for(let o of l.eventSources.declarations.filter(s=>s.location.path===i)){r(o.location.line,o.location.column,11,0),o.identifier&&r(o.identifier.location.line,o.identifier.location.column,o.identifier.name.length,2);for(let s of o.streams)r(s.location.line,s.location.column,6,0),s.streamId&&r(s.streamId.location.line,s.streamId.location.column,s.streamId.name.length,2)}for(let o of l.eventSources.routes)r(o.location.line,o.location.column,6,0),o.referenceLocation&&r(o.referenceLocation.line,o.referenceLocation.column,`${o.eventSource}.${o.stream}`.length,2),o.streamId&&r(o.streamId.location.line,o.streamId.location.column,8,0);for(let o of l.commands.values()){for(let c of o.properties){if(!c.isGenerated)continue;let a=I(e[c.location.line-1]??"");r(c.location.line,a.lastIndexOf("generated")+1,9,0)}let s=o.response;if(s)if(r(s.location.line,s.location.column,7,0),s.kind==="ScalarCommandResponseSyntax")r(s.source.location.line,s.source.location.column,s.source.property.length,1);else for(let c of s.fields)r(c.location.line,c.location.column,c.name.length,1),r(c.source.location.line,c.source.location.column,c.source.property.length,1),c.type&&r(c.type.location.line,c.type.location.column,c.type.name.length,2)}for(let o of l.specifications.values()){for(let s of o.when?.generatedValues??[])r(s.location.line,s.location.column,9,0);o.thenReturns&&r(o.thenReturns.location.line,(e[o.thenReturns.location.line-1]??"").indexOf("returns")+1,7,0)}for(let o of l.operations.systems.filter(s=>s.location.path===i))r(o.location.line,o.location.column,6,0);for(let o of l.operations.declarations.filter(s=>s.location.path===i)){let c=I(e[o.location.line-1]??"").indexOf("operation",o.location.column-1);c>=0&&r(o.location.line,c+1,9,0);for(let a of o.inputs)r(a.location.line,a.location.column,a.name.length,1),r(a.type.location.line,a.type.location.column,a.type.name.length,2);o.usesLocation&&r(o.usesLocation.line,(e[o.usesLocation.line-1]??"").indexOf("uses")+1,4,0);for(let a of[o.execute,o.compensate]){if(!a)continue;let m=I(e[a.location.line-1]??"").trim();r(a.location.line,a.location.column,m.length,0),a.implementation&&r(a.implementation.location.line,a.implementation.location.column,14,0);for(let d of a.implementation?.hints??[])r(d.location.line,d.location.column,4,0)}}let u=t.sort((o,s)=>o.line-s.line||o.column-s.column);return u.filter((o,s)=>s===0||o.line!==u[s-1].line||o.column>=u[s-1].column+u[s-1].length)}p(Ke,"responseTokens");var Ye={implementation:"Handler-only intent with ordered hints and at most one file or tagged fence. No payload means pending. Handler execution is unsupported; this is not confirmation.",hint:"One nonblank quoted implementation hint. Order and decoded text are retained; hints do not execute or confirm code."},ie={domain:"The domain the file belongs to \u2014 optional, at most one per file, before everything else.",import:"Imports a type from another module by its qualified name \u2014 `import Module.Type` \u2014 making it available by its short name; or, quoted, other `.play` files by path or glob \u2014 `import \"Orders/**/*.play\"`, relative to this file's folder. Written inside a module or feature, a file import places the imported files there: their top level is that module's or feature's body.",concept:'A formalized value type wrapping a primitive. Attributes such as `@pii` travel with every usage, optionally with a `<attribute> reason "..."` line saying why.',type:"A composite value type \u2014 a named shape built from several properties, referenced by events, commands and other types the same way a concept is.",reason:'Records why a concept attribute applies \u2014 the purpose, the lawful basis, whose subject the value lives under. Written as `pii reason "..."` in the concept body.',optional:"Allows a value to be absent. Write it after the type: `note String optional` or `lines InvoiceLine[] optional`. The collection itself may be absent; its items keep their declared type.",identifier:"Marks the command property a runtime resolves the event source id from. At most one per command; without it a new Uuid is generated.",policy:"A named authorization rule referenced by commands and queries. Multiple policies AND together.",persona:"A named role interacting with the application, with an optional description and its associated policies.",authentication:"Declares the identity providers of the application \u2014 at most one block per file.",provider:"A named identity provider within `authentication`, with free-form `name value` settings.",description:"A human-readable description of a module, feature, slice, persona, or command \u2014 the first body line, as a quoted single line or a fenced ```text block for multiple lines.",module:"The top-level namespace \u2014 maps to a bounded context.",layout:"A reusable screen template with named slots.",template:"Declares the named slots of a layout.",feature:"A vertical slice grouping. Features nest arbitrarily deep.",slice:"The atomic unit of behavior, aligned with Event Modeling. Has a type and a name.",event:"An immutable, past-tense fact. Declare it in a slice or inline with `produces event <Name>` in a command. Inline properties are typed mappings; inline tags belong to the event type.",documentation:"Authoring-only event documentation in a fenced ```markdown block. It does not change executable model bytes.",id:"Preserves the previous persisted event name after a rename. Leave absent on new events; repeating the current name is redundant.",command:"An imperative intent. Declares authorization, validation, and what events it produces \u2014 declaratively, or via a full handler.",query:"A read-side entry point mapping to a return type, with an optional description, parameters and performer.",observable:"Qualifies a query return type as a live read \u2014 `query <Name> => observable <ReadModel>` keeps pushing as the read model changes, instead of answering once.",performer:"The code that performs a query \u2014 a `file <Path>` reference or an inline `csharp`/`sql` block. The query's counterpart to a command handler.",from:"Fills a query parameter from the query context instead of the caller, as in `filter tenantId TenantId from $context.tenant`.",projection:"Declares how events project into a read model, using the embedded Projection Declaration Language (PDL).",capture:"Converts external data into events, using the embedded Change Data Capture Language (CDL).",reaction:"Behavior that runs when something happens. Lives inside Automation slices. A trigger with no body states intent on its own \u2014 `file`/code is optional realization metadata.",trigger:"Declares a kind of occurrence a reaction can respond to, and the values it hands the reaction. What makes one occur belongs to whoever provides it, never to the compiler.",where:"Narrows which occurrences actually run the reaction.",contains:"Text comparison \u2014 true when the left string holds the right one anywhere.",every:"Runs a reaction on an interval \u2014 `every 15 minutes`, `every 1 day`.",invokes:"A command a reaction hands on. A command is asked for, not produced \u2014 it may still be rejected.",screen:"A UI declaration. Supports intent, structure, and layout-with-code levels, or a full file reference.",constraint:"A server-side rule enforced in the Chronicle kernel before events are committed.",authorize:"References the policies that must all pass for the construct to execute.",validate:"Declarative validation rules, or `validate` followed by ```csharp for imperative rules \u2014 on commands and concepts.",produces:"References a declared event with `produces <Name>`, or declares one inline with `produces event <Name>`. An inline omitted `for` uses the command identifier only when all destinations are the same source; legacy plain omission allocates an identity.",reads:"Declares a view consulted by a command or reaction trigger: `reads <View> [as <alias>] [by <value>]`. A reaction `by` names a value taken by its trigger; clock triggers cannot use `by`. Repeated views require unique aliases. Runtime binding is not yet supported for command or reaction reads.",as:"Names an instance of a view in a command or reaction trigger reads declaration, for example `reads Account as source by sourceId`.",handler:"A fully imperative command implementation \u2014 a `file <Path>` reference or an inline `csharp` block, instead of `produces`.",when:"Guards a produced event or a capture append with a condition.",rule:"Names a predicate. Bare, it states that a constraint exists without expressing what it computes \u2014 nothing resolves the name. Optionally followed by an indented `file <Path>` reference or inline `csharp` block giving it a body.",require:'A policy condition: `authenticated`, `role "..."`, or `claim "..." matches ...`.',authenticated:"Requires an authenticated caller.",role:"Requires the caller to have the given role.",claim:"Requires a claim on the caller to match a subject or value.",subject:"The subject (identity) of the caller.",data:"Binds a read model to a screen through a query.",action:"Makes a command available as an action on a screen.",navigate:"Navigates to a screen, optionally passing a parameter with `by`.",section:"A named structural section of a screen.",table:"A table widget over a read model or child collection.",summary:"A summary widget showing labeled fields.",column:"A table column bound to a property.",field:"A summary field bound to a property.",title:"The display title of a screen or section.",label:"The display label of an action, column, or field.",unique:"A uniqueness constraint \u2014 `unique <property> on <EventType>` or `unique event <EventType>`.",concurrency:"The concurrency scope enforced when the command appends events \u2014 dimensions: `eventSource`, `sourceType`, `streamType`, `streamId`, `events`.",eventSource:"Concurrency dimension \u2014 scope the check to the event source id of the command.",sourceType:"Concurrency dimension \u2014 scope the check to an event source type.",streamType:"Concurrency dimension \u2014 scope the check to an event stream type.",streamId:"Concurrency dimension \u2014 scope the check to an event stream id.",tag:"Attaches a tag to appended events \u2014 a static identifier or string, or a `$context.` expression resolved at append time.",seed:"Declares events to seed into the event store per event source id \u2014 multiple blocks accumulate.",for:"Names the event source of a production or seed group. Inside `produces event`, omission uses the command identifier unless another production targets a different source.",readmodel:"Declares a read model \u2014 its name and properties \u2014 in a slice, or, in a specification, read model state: `given readmodel` establishes it, `then readmodel` asserts it, `then no readmodel <View> for <key>` asserts keyed absence.",reducer:"Builds a read model from events with imperative code \u2014 `reducer <Name> => <ReadModel>` with an `on <EventType>` rule per event. Use it when a projection cannot express the transition.",specification:"Given/when/then acceptance criteria for a slice: prior events and state, the command, query or appended event under test, and the events, state, results, errors or denials that follow.",dialog:"A dialog opened over the shell, or with `dialog template` a reusable dialog shape.",form:"A form bound to a command \u2014 `form <Name> for <Command>` with a `field` per input.",contribute:"Contributes entries to a slot of the shell \u2014 `contribute to Navigation` with `navigate to`, `label` and `order`.",theme:"A named theme and the component packages it is compatible with.",ui:"A UI profile \u2014 `ui profile <Name>` binds a target platform and size to a layout, theme and packages.",behavior:"A named interaction wiring of `on <interaction>` handlers, attached to a screen, form or dialog with `uses`.",system:"An application-scoped external system that operations use.",eventsource:"An application-owned event source with nested streams.",operation:"A reusable operation intent that uses one external system.",no:"A keyed absence assertion: `then no readmodel <View> for <key>`.",arguments:"The values supplied to a query asserted by `then query`.",result:"One expected result - `then result [exactly]` after `when query`, or a `result` block inside `then query`. Repeat it to assert several results in authored order.",clock:'The instant a specification happens at - `given clock "2026-10-05T08:00:00Z"` fixes when everything occurs; `when clock "<instant>"` is the clock reaching it, as the action.',exactly:"Requires every property to match, rather than only the ones asserted - on `then readmodel`, `then query` and `then result`.",file:"Delegates the implementation to an external file; the Screenplay contract stays visible.",by:"Introduces the identifying parameter.",via:"Connects screen data to the query that supplies it.",filter:"An optional query filter parameter.",on:"The event a constraint applies to, the day a schedule narrows to, or a widget interaction such as `on row-click`.",message:"The validation message reported when the rule fails.",matches:"Matches a value against a regular expression or a named pattern such as `email`.",all:"Applies a comparison to every element of a collection.",max:"Maximum length or value.",min:"Minimum length or value.",length:"Constrains the exact length of a value.",today:"The current date.",empty:"Used with `not empty` \u2014 the value must be present.",not:"Negates a validation condition, as in `not empty`.",and:"Both conditions must hold.",or:"Either condition may hold.",csharp:"An inline C# block whose opening fence is ```csharp.",sql:"An inline SQL block between triple backticks \u2014 a query performer written against a relational store.",typescript:"An inline TypeScript block between triple backticks.",react:"An inline React/TSX block; receives the surrounding data contract as `Props`.",html:"An inline static HTML block.",StateChange:"Slice type \u2014 a command \u2192 events flow; something that changes the system.",StateView:"Slice type \u2014 a query + projection + screen; something that reads the system.",Automation:"Slice type \u2014 a reaction or reducer; something that runs when something happens.",Translate:"Slice type \u2014 a capture; converts external data into events.",Uuid:"Primitive type \u2014 a universally unique identifier.",String:"Primitive type \u2014 a string of characters.",Int:"Primitive type \u2014 an integer number.",Decimal:"Primitive type \u2014 a decimal number.",Bool:"Primitive type \u2014 true or false.",Date:"Primitive type \u2014 a date without time.",DateTime:"Primitive type \u2014 a date and time.",Enum:"An enumeration concept with a fixed set of values."},be={clock:ie.clock,trigger:"`when trigger <Trigger>` - an application trigger fires, as the action, with the values on the lines beneath it.",capture:"`given capture <Capture>` - a record the capture's source held before; `when capture <Capture>` - the record it sees now, as the action. The fields go on the lines beneath.",query:"`when query <Query>` - the query is performed, as the action, with its arguments on the lines beneath; assert what it returns with `then result` or `then no result`. `then query` instead asserts a query after another action.",result:"`then result [exactly]` - one result the query performed by `when query` returns, in order; `then no result` - it returns nothing."},Je={pii:'`@pii` \u2014 the value is personally identifiable information; Chronicle manages and erases it automatically wherever the concept is used. Add `pii reason "..."` in the concept body to record why.',sensitive:'`@sensitive` \u2014 the value is sensitive; Chronicle applies its sensitivity rules automatically wherever the concept is used. Add `sensitive reason "..."` in the concept body to record why.'},$e={"$context.occurred":"When the command or query was received.","$context.tenant":"The tenant the command or query is executing for.","$context.command":"The command being handled, shaped by its `command` declaration.","$context.arguments":"The arguments of the query being performed.","$context.causedBy":"The identity that caused the command or query \u2014 `subject`, `name`, `userName`.","$context.causedBy.subject":"The subject of the identity that caused the command or query.","$context.causedBy.name":"The display name of the identity that caused the command or query.","$context.causedBy.userName":"The user name of the identity that caused the command or query.","$context.causation":"What caused the command or query \u2014 `type`, `occurred`, `properties`.","$context.causation.type":"What caused the command or query \u2014 a command, a reactor, a schedule.","$context.identity":"The caller a decision is made about \u2014 `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`.","$context.identity.id":"The identifier of the caller from the auth token.","$context.identity.name":"The display name of the caller.","$context.identity.userName":"The user name of the caller.","$context.identity.isAuthenticated":"Whether the caller is authenticated.","$context.identity.roles":"The roles the caller holds.","$context.identity.claims":"The claims the caller carries \u2014 `$context.identity.claims.<name>` reads one.",$env:"An environment variable, e.g. `$env.SERVICE_NAME`.",$secrets:"An encrypted secret resolved at runtime, e.g. `$secrets.azureAdClientId` \u2014 stays symbolic in the compiled tree.",$strings:"A localized string resolved from the `.strings` file of the active locale, e.g. `$strings.invoices.title`.",...Object.fromEntries(te.map(e=>[`$eventContext.${e.path}`,e.description]))};function Xe(e,n,t,r,i,l){let u=L(e);if(u[n])return null;let o=e[n]??"";if(i-1>I(o).length)return null;let s=!1,c=!1;for(let f=0;f<r-1;f++)o[f]==="\\"&&s?f++:o[f]==='"'&&!c?s=!s:o[f]==="`"&&!s&&(c=!c);if(s||c)return null;let a=Be(e,n,r,i,l);if(a)return a;let m=Fe(e,n,r,i,l);if(m)return m;let d=p((f,T)=>{let M=f+(o[f-1]==="@"?1:0);return t===T&&r===M&&i===M+T.length&&o.slice(M-1,i-1)===T},"tokenAt"),g=o.charAt(r-2);if(g==="@"){let f=Je[t];if(f)return f}if(g==="$"||g==="."){let f=o.substring(0,i-1).match(/\$[\w.]*$/)?.[0];if(f){let T=$e[f]??(f.startsWith("$env")?$e.$env:void 0);if(T)return T}}let h=o.slice(0,r-1),b=/^\s*(?:by|filter)\s+/.test(h)?/^\s*(?:by|filter)\s+[a-z_]\w*\s+[\w.]+(?:\[\])?\s+$/.test(h):/^\s*@?[a-z_]\w*\s+[\w.]+(?:\[\])?\s+$/.test(h),C=/^\s*query\s+\w+\s*=>\s*(?:observable\s+)?[\w.]+(?:\[\])?\s+$/.test(h)&&!/^\s*query\s+\w+\s*=>\s*observable\s+$/.test(h);if(t==="optional"&&(b||C))return`**optional** \u2014 ${ie.optional}`;if(t==="implementation"||t==="hint"){let f=F(e,u,n,k(o)),T=ye(e,n,k(o));if(t==="implementation"&&T==="rule"&&/^\s*implementation\s*$/.test(I(o))||t==="hint"&&T==="implementation"&&/^\s*hint\s+"/.test(o))return`**${t}** \u2014 Command named-rule guidance with at most one file or tagged fence. No payload means pending and fails binding (PLAY0268). Attached predicates keep their existing pure RuleContext contract; reference execution is unsupported, never confirmation.`;if(t==="implementation"&&f[0]==="handler"&&/^\s*implementation\s*$/.test(I(o)))return`**implementation** \u2014 ${Ye.implementation}`;if(t==="hint"&&f[0]==="implementation"&&f[1]==="handler"&&/^\s*hint\s+"/.test(o))return`**hint** \u2014 ${Ye.hint}`}let v=U(e),x=v.commands.filter(f=>f.line<n).at(-1),y=x?.properties.find(f=>f.name===t&&f.line===n);if(y?.isGenerated||t==="generated"&&x?.properties.some(f=>f.isGenerated&&f.line===n)&&b)return`**${y?.name??"generated"}** \u2014 ${y?D(B(y))+". ":""}Generated value, not a request or form input. ${P}`;let $=x?.response;if($?.location.line===n+1&&(d($.location.column,"returns")||$.kind==="ScalarCommandResponseSyntax"&&d($.source.location.column,$.source.property))){let f=$.kind==="ScalarCommandResponseSyntax"?x?.properties.find(T=>T.name===$.source.property):void 0;return`**returns**${f?` \u2014 ${D(B(f))}`:" \u2014 unnamed record response"}. ${P}`}if($?.kind==="RecordCommandResponseSyntax"){let f=$.fields.find(T=>T.location.line===n+1&&(d(T.location.column,T.name)||d(T.source.location.column,T.source.property)));if(f){let T=x?.properties.find(Q=>Q.name===f.source.property),M=f.type?D(f.type):T?D(B(T)):"Unresolved type";return`**${f.name}** \u2014 ${M}${f.type?" (explicit)":" (inferred)"} = ${f.source.property}. ${T?.isGenerated?"Generated source, not request input. ":""}${P}`}}for(let f of E(e).specifications.values())if(t==="returns"&&f.thenReturns?.location.line===n+1||t==="generated"&&f.when?.generatedValues?.some(T=>T.location.line===n+1))return P;let w=v.concepts.find(f=>f.name===t);if(w){let f=w.attributes.length?` ${w.attributes.join(" ")}`:"",T=w.enumValues.length?`
|
|
61
|
+
`))??[],n?.authoringPlacement,i,n?.authoringPlacementResolved);for(let o of l.eventSources.declarations.filter(s=>s.location.path===i)){r(o.location.line,o.location.column,11,0),o.identifier&&r(o.identifier.location.line,o.identifier.location.column,o.identifier.name.length,2);for(let s of o.streams)r(s.location.line,s.location.column,6,0),s.streamId&&r(s.streamId.location.line,s.streamId.location.column,s.streamId.name.length,2)}for(let o of l.eventSources.routes)r(o.location.line,o.location.column,6,0),o.referenceLocation&&r(o.referenceLocation.line,o.referenceLocation.column,`${o.eventSource}.${o.stream}`.length,2),o.streamId&&r(o.streamId.location.line,o.streamId.location.column,8,0);for(let o of l.commands.values()){for(let c of o.properties){if(!c.isGenerated)continue;let a=I(e[c.location.line-1]??"");r(c.location.line,a.lastIndexOf("generated")+1,9,0)}let s=o.response;if(s)if(r(s.location.line,s.location.column,7,0),s.kind==="ScalarCommandResponseSyntax")r(s.source.location.line,s.source.location.column,s.source.property.length,1);else for(let c of s.fields)r(c.location.line,c.location.column,c.name.length,1),r(c.source.location.line,c.source.location.column,c.source.property.length,1),c.type&&r(c.type.location.line,c.type.location.column,c.type.name.length,2)}for(let o of l.specifications.values()){for(let s of o.when?.generatedValues??[])r(s.location.line,s.location.column,9,0);o.thenReturns&&r(o.thenReturns.location.line,(e[o.thenReturns.location.line-1]??"").indexOf("returns")+1,7,0)}for(let o of l.operations.systems.filter(s=>s.location.path===i))r(o.location.line,o.location.column,6,0);for(let o of l.operations.declarations.filter(s=>s.location.path===i)){let c=I(e[o.location.line-1]??"").indexOf("operation",o.location.column-1);c>=0&&r(o.location.line,c+1,9,0);for(let a of o.inputs)r(a.location.line,a.location.column,a.name.length,1),r(a.type.location.line,a.type.location.column,a.type.name.length,2);o.usesLocation&&r(o.usesLocation.line,(e[o.usesLocation.line-1]??"").indexOf("uses")+1,4,0);for(let a of[o.execute,o.compensate]){if(!a)continue;let m=I(e[a.location.line-1]??"").trim();r(a.location.line,a.location.column,m.length,0),a.implementation&&r(a.implementation.location.line,a.implementation.location.column,14,0);for(let d of a.implementation?.hints??[])r(d.location.line,d.location.column,4,0)}}let u=t.sort((o,s)=>o.line-s.line||o.column-s.column);return u.filter((o,s)=>s===0||o.line!==u[s-1].line||o.column>=u[s-1].column+u[s-1].length)}p(Ke,"responseTokens");var Ye={implementation:"Handler-only intent with ordered hints and at most one file or tagged fence. No payload means pending. Handler execution is unsupported; this is not confirmation.",hint:"One nonblank quoted implementation hint. Order and decoded text are retained; hints do not execute or confirm code."},ie={domain:"The domain the file belongs to \u2014 optional, at most one per file, before everything else.",import:"Imports a type from another module by its qualified name \u2014 `import Module.Type` \u2014 making it available by its short name; or, quoted, other `.play` files by path or glob \u2014 `import \"Orders/**/*.play\"`, relative to this file's folder. Written inside a module or feature, a file import places the imported files there: their top level is that module's or feature's body.",concept:'A formalized value type wrapping a primitive. Attributes such as `@pii` travel with every usage, optionally with a `<attribute> reason "..."` line saying why.',type:"A composite value type \u2014 a named shape built from several properties, referenced by events, commands and other types the same way a concept is.",reason:'Records why a concept attribute applies \u2014 the purpose, the lawful basis, whose subject the value lives under. Written as `pii reason "..."` in the concept body.',optional:"Allows a value to be absent. Write it after the type: `note String optional` or `lines InvoiceLine[] optional`. The collection itself may be absent; its items keep their declared type.",identifier:"Marks the command property a runtime resolves the event source id from. At most one per command; without it a new Uuid is generated.",policy:"A named authorization rule referenced by commands and queries. Multiple policies AND together.",persona:"A named role interacting with the application, with an optional description and its associated policies.",authentication:"Declares the identity providers of the application \u2014 at most one block per file.",provider:"A named identity provider within `authentication`, with free-form `name value` settings.",description:"A human-readable description of a module, feature, slice, persona, or command \u2014 the first body line, as a quoted single line or a fenced ```text block for multiple lines.",depends:"Declares `depends on <Name>` on a module or feature. This opts only that container into checking counted explicit references against its own declarations; it does not change executable bytes.",module:"The top-level namespace \u2014 maps to a bounded context.",layout:"A reusable screen template with named slots.",template:"Declares the named slots of a layout.",feature:"A vertical slice grouping. Features nest arbitrarily deep.",slice:"The atomic unit of behavior, aligned with Event Modeling. Has a type and a name.",event:"An immutable, past-tense fact. Declare it in a slice or inline with `produces event <Name>` in a command. Inline properties are typed mappings; inline tags belong to the event type.",documentation:"Authoring-only event documentation in a fenced ```markdown block. It does not change executable model bytes.",id:"Preserves the previous persisted event name after a rename. Leave absent on new events; repeating the current name is redundant.",command:"An imperative intent. Declares authorization, validation, and what events it produces \u2014 declaratively, or via a full handler.",query:"A read-side entry point mapping to a return type, with an optional description, parameters and performer.",observable:"Qualifies a query return type as a live read \u2014 `query <Name> => observable <ReadModel>` keeps pushing as the read model changes, instead of answering once.",performer:"The code that performs a query \u2014 a `file <Path>` reference or an inline `csharp`/`sql` block. The query's counterpart to a command handler.",from:"Fills a query parameter from the query context instead of the caller, as in `filter tenantId TenantId from $context.tenant`.",projection:"Declares how events project into a read model, using the embedded Projection Declaration Language (PDL).",capture:"Converts external data into events, using the embedded Change Data Capture Language (CDL).",reaction:"Behavior that runs when something happens. Lives inside Automation slices. A trigger with no body states intent on its own \u2014 `file`/code is optional realization metadata.",trigger:"Declares a kind of occurrence a reaction can respond to, and the values it hands the reaction. What makes one occur belongs to whoever provides it, never to the compiler.",where:"Narrows which occurrences actually run the reaction.",contains:"Text comparison \u2014 true when the left string holds the right one anywhere.",every:"Runs a reaction on an interval \u2014 `every 15 minutes`, `every 1 day`.",invokes:"A command a reaction hands on. A command is asked for, not produced \u2014 it may still be rejected.",screen:"A UI declaration. Supports intent, structure, and layout-with-code levels, or a full file reference.",constraint:"A server-side rule enforced in the Chronicle kernel before events are committed.",authorize:"References the policies that must all pass for the construct to execute.",validate:"Declarative validation rules, or `validate` followed by ```csharp for imperative rules \u2014 on commands and concepts.",produces:"References a declared event with `produces <Name>`, or declares one inline with `produces event <Name>`. An inline omitted `for` uses the command identifier only when all destinations are the same source; legacy plain omission allocates an identity.",reads:"Declares a view consulted by a command or reaction trigger: `reads <View> [as <alias>] [by <value>]`. A reaction `by` names a value taken by its trigger; clock triggers cannot use `by`. Repeated views require unique aliases. Runtime binding is not yet supported for command or reaction reads.",as:"Names an instance of a view in a command or reaction trigger reads declaration, for example `reads Account as source by sourceId`.",handler:"A fully imperative command implementation \u2014 a `file <Path>` reference or an inline `csharp` block, instead of `produces`.",when:"Guards a produced event or a capture append with a condition.",rule:"Names a predicate. Bare, it states that a constraint exists without expressing what it computes \u2014 nothing resolves the name. Optionally followed by an indented `file <Path>` reference or inline `csharp` block giving it a body.",require:'A policy condition: `authenticated`, `role "..."`, or `claim "..." matches ...`.',authenticated:"Requires an authenticated caller.",role:"Requires the caller to have the given role.",claim:"Requires a claim on the caller to match a subject or value.",subject:"The subject (identity) of the caller.",data:"Binds a read model to a screen through a query.",action:"Makes a command available as an action on a screen.",navigate:"Navigates to a screen, optionally passing a parameter with `by`.",section:"A named structural section of a screen.",table:"A table widget over a read model or child collection.",summary:"A summary widget showing labeled fields.",column:"A table column bound to a property.",field:"A summary field bound to a property.",title:"The display title of a screen or section.",label:"The display label of an action, column, or field.",unique:"A uniqueness constraint \u2014 `unique <property> on <EventType>` or `unique event <EventType>`.",concurrency:"The concurrency scope enforced when the command appends events \u2014 dimensions: `eventSource`, `sourceType`, `streamType`, `streamId`, `events`.",eventSource:"Concurrency dimension \u2014 scope the check to the event source id of the command.",sourceType:"Concurrency dimension \u2014 scope the check to an event source type.",streamType:"Concurrency dimension \u2014 scope the check to an event stream type.",streamId:"Concurrency dimension \u2014 scope the check to an event stream id.",tag:"Attaches a tag to appended events \u2014 a static identifier or string, or a `$context.` expression resolved at append time.",seed:"Declares events to seed into the event store per event source id \u2014 multiple blocks accumulate.",for:"Names the event source of a production or seed group. Inside `produces event`, omission uses the command identifier unless another production targets a different source.",readmodel:"Declares a read model \u2014 its name and properties \u2014 in a slice, or, in a specification, read model state: `given readmodel` establishes it, `then readmodel` asserts it, `then no readmodel <View> for <key>` asserts keyed absence.",reducer:"Builds a read model from events with imperative code \u2014 `reducer <Name> => <ReadModel>` with an `on <EventType>` rule per event. Use it when a projection cannot express the transition.",specification:"Given/when/then acceptance criteria for a slice: prior events and state, the command, query or appended event under test, and the events, state, results, errors or denials that follow.",dialog:"A dialog opened over the shell, or with `dialog template` a reusable dialog shape.",form:"A form bound to a command \u2014 `form <Name> for <Command>` with a `field` per input.",contribute:"Contributes entries to a slot of the shell \u2014 `contribute to Navigation` with `navigate to`, `label` and `order`.",theme:"A named theme and the component packages it is compatible with.",ui:"A UI profile \u2014 `ui profile <Name>` binds a target platform and size to a layout, theme and packages.",behavior:"A named interaction wiring of `on <interaction>` handlers, attached to a screen, form or dialog with `uses`.",system:"An application-scoped external system that operations use.",eventsource:"An application-owned event source with nested streams.",operation:"A reusable operation intent that uses one external system.",no:"A keyed absence assertion: `then no readmodel <View> for <key>`.",arguments:"The values supplied to a query asserted by `then query`.",result:"One expected result - `then result [exactly]` after `when query`, or a `result` block inside `then query`. Repeat it to assert several results in authored order.",clock:'The instant a specification happens at - `given clock "2026-10-05T08:00:00Z"` fixes when everything occurs; `when clock "<instant>"` is the clock reaching it, as the action.',exactly:"Requires every property to match, rather than only the ones asserted - on `then readmodel`, `then query` and `then result`.",file:"Delegates the implementation to an external file; the Screenplay contract stays visible.",by:"Introduces the identifying parameter.",via:"Connects screen data to the query that supplies it.",filter:"An optional query filter parameter.",on:"The event a constraint applies to, the day a schedule narrows to, or a widget interaction such as `on row-click`.",message:"The validation message reported when the rule fails.",matches:"Matches a value against a regular expression or a named pattern such as `email`.",all:"Applies a comparison to every element of a collection.",max:"Maximum length or value.",min:"Minimum length or value.",length:"Constrains the exact length of a value.",today:"The current date.",empty:"Used with `not empty` \u2014 the value must be present.",not:"Negates a validation condition, as in `not empty`.",and:"Both conditions must hold.",or:"Either condition may hold.",csharp:"An inline C# block whose opening fence is ```csharp.",sql:"An inline SQL block between triple backticks \u2014 a query performer written against a relational store.",typescript:"An inline TypeScript block between triple backticks.",react:"An inline React/TSX block; receives the surrounding data contract as `Props`.",html:"An inline static HTML block.",StateChange:"Slice type \u2014 a command \u2192 events flow; something that changes the system.",StateView:"Slice type \u2014 a query + projection + screen; something that reads the system.",Automation:"Slice type \u2014 a reaction or reducer; something that runs when something happens.",Translate:"Slice type \u2014 a capture; converts external data into events.",Uuid:"Primitive type \u2014 a universally unique identifier.",String:"Primitive type \u2014 a string of characters.",Int:"Primitive type \u2014 an integer number.",Decimal:"Primitive type \u2014 a decimal number.",Bool:"Primitive type \u2014 true or false.",Date:"Primitive type \u2014 a date without time.",DateTime:"Primitive type \u2014 a date and time.",Enum:"An enumeration concept with a fixed set of values."},be={clock:ie.clock,trigger:"`when trigger <Trigger>` - an application trigger fires, as the action, with the values on the lines beneath it.",capture:"`given capture <Capture>` - a record the capture's source held before; `when capture <Capture>` - the record it sees now, as the action. The fields go on the lines beneath.",query:"`when query <Query>` - the query is performed, as the action, with its arguments on the lines beneath; assert what it returns with `then result` or `then no result`. `then query` instead asserts a query after another action.",result:"`then result [exactly]` - one result the query performed by `when query` returns, in order; `then no result` - it returns nothing."},Je={pii:'`@pii` \u2014 the value is personally identifiable information; Chronicle manages and erases it automatically wherever the concept is used. Add `pii reason "..."` in the concept body to record why.',sensitive:'`@sensitive` \u2014 the value is sensitive; Chronicle applies its sensitivity rules automatically wherever the concept is used. Add `sensitive reason "..."` in the concept body to record why.'},$e={"$context.occurred":"When the command or query was received.","$context.tenant":"The tenant the command or query is executing for.","$context.command":"The command being handled, shaped by its `command` declaration.","$context.arguments":"The arguments of the query being performed.","$context.causedBy":"The identity that caused the command or query \u2014 `subject`, `name`, `userName`.","$context.causedBy.subject":"The subject of the identity that caused the command or query.","$context.causedBy.name":"The display name of the identity that caused the command or query.","$context.causedBy.userName":"The user name of the identity that caused the command or query.","$context.causation":"What caused the command or query \u2014 `type`, `occurred`, `properties`.","$context.causation.type":"What caused the command or query \u2014 a command, a reactor, a schedule.","$context.identity":"The caller a decision is made about \u2014 `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`.","$context.identity.id":"The identifier of the caller from the auth token.","$context.identity.name":"The display name of the caller.","$context.identity.userName":"The user name of the caller.","$context.identity.isAuthenticated":"Whether the caller is authenticated.","$context.identity.roles":"The roles the caller holds.","$context.identity.claims":"The claims the caller carries \u2014 `$context.identity.claims.<name>` reads one.",$env:"An environment variable, e.g. `$env.SERVICE_NAME`.",$secrets:"An encrypted secret resolved at runtime, e.g. `$secrets.azureAdClientId` \u2014 stays symbolic in the compiled tree.",$strings:"A localized string resolved from the `.strings` file of the active locale, e.g. `$strings.invoices.title`.",...Object.fromEntries(te.map(e=>[`$eventContext.${e.path}`,e.description]))};function Xe(e,n,t,r,i,l){let u=L(e);if(u[n])return null;let o=e[n]??"";if(i-1>I(o).length)return null;let s=!1,c=!1;for(let f=0;f<r-1;f++)o[f]==="\\"&&s?f++:o[f]==='"'&&!c?s=!s:o[f]==="`"&&!s&&(c=!c);if(s||c)return null;let a=Be(e,n,r,i,l);if(a)return a;let m=Fe(e,n,r,i,l);if(m)return m;let d=p((f,T)=>{let M=f+(o[f-1]==="@"?1:0);return t===T&&r===M&&i===M+T.length&&o.slice(M-1,i-1)===T},"tokenAt"),g=o.charAt(r-2);if(g==="@"){let f=Je[t];if(f)return f}if(g==="$"||g==="."){let f=o.substring(0,i-1).match(/\$[\w.]*$/)?.[0];if(f){let T=$e[f]??(f.startsWith("$env")?$e.$env:void 0);if(T)return T}}let h=o.slice(0,r-1),b=/^\s*(?:by|filter)\s+/.test(h)?/^\s*(?:by|filter)\s+[a-z_]\w*\s+[\w.]+(?:\[\])?\s+$/.test(h):/^\s*@?[a-z_]\w*\s+[\w.]+(?:\[\])?\s+$/.test(h),C=/^\s*query\s+\w+\s*=>\s*(?:observable\s+)?[\w.]+(?:\[\])?\s+$/.test(h)&&!/^\s*query\s+\w+\s*=>\s*observable\s+$/.test(h);if(t==="optional"&&(b||C))return`**optional** \u2014 ${ie.optional}`;if(t==="implementation"||t==="hint"){let f=F(e,u,n,k(o)),T=ye(e,n,k(o));if(t==="implementation"&&T==="rule"&&/^\s*implementation\s*$/.test(I(o))||t==="hint"&&T==="implementation"&&/^\s*hint\s+"/.test(o))return`**${t}** \u2014 Command named-rule guidance with at most one file or tagged fence. No payload means pending and fails binding (PLAY0268). Attached predicates keep their existing pure RuleContext contract; reference execution is unsupported, never confirmation.`;if(t==="implementation"&&f[0]==="handler"&&/^\s*implementation\s*$/.test(I(o)))return`**implementation** \u2014 ${Ye.implementation}`;if(t==="hint"&&f[0]==="implementation"&&f[1]==="handler"&&/^\s*hint\s+"/.test(o))return`**hint** \u2014 ${Ye.hint}`}let v=U(e),x=v.commands.filter(f=>f.line<n).at(-1),y=x?.properties.find(f=>f.name===t&&f.line===n);if(y?.isGenerated||t==="generated"&&x?.properties.some(f=>f.isGenerated&&f.line===n)&&b)return`**${y?.name??"generated"}** \u2014 ${y?D(B(y))+". ":""}Generated value, not a request or form input. ${P}`;let $=x?.response;if($?.location.line===n+1&&(d($.location.column,"returns")||$.kind==="ScalarCommandResponseSyntax"&&d($.source.location.column,$.source.property))){let f=$.kind==="ScalarCommandResponseSyntax"?x?.properties.find(T=>T.name===$.source.property):void 0;return`**returns**${f?` \u2014 ${D(B(f))}`:" \u2014 unnamed record response"}. ${P}`}if($?.kind==="RecordCommandResponseSyntax"){let f=$.fields.find(T=>T.location.line===n+1&&(d(T.location.column,T.name)||d(T.source.location.column,T.source.property)));if(f){let T=x?.properties.find(Q=>Q.name===f.source.property),M=f.type?D(f.type):T?D(B(T)):"Unresolved type";return`**${f.name}** \u2014 ${M}${f.type?" (explicit)":" (inferred)"} = ${f.source.property}. ${T?.isGenerated?"Generated source, not request input. ":""}${P}`}}for(let f of E(e).specifications.values())if(t==="returns"&&f.thenReturns?.location.line===n+1||t==="generated"&&f.when?.generatedValues?.some(T=>T.location.line===n+1))return P;let w=v.concepts.find(f=>f.name===t);if(w){let f=w.attributes.length?` ${w.attributes.join(" ")}`:"",T=w.enumValues.length?`
|
|
62
62
|
|
|
63
63
|
Values: ${w.enumValues.join(", ")}`:"",M=Object.entries(w.attributeReasons).map(([Q,wn])=>`
|
|
64
64
|
|