@cratis/screenplay-language 4.96.0 → 4.98.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/ExampleAnalysis.d.ts +2 -0
- package/dist/ExampleAnalysis.d.ts.map +1 -1
- package/dist/bundles/chunk-AWX6REFE.js +33 -0
- package/dist/bundles/chunk-AWX6REFE.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/example-analysis.d.ts.map +1 -1
- package/dist/response-analysis.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/bundles/chunk-7OCZJATM.js +0 -33
- package/dist/bundles/chunk-7OCZJATM.js.map +0 -7
package/dist/bundles/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as te,$a as eo,A as H,Aa as en,B as gt,Ba as tn,C as yt,Ca as nn,D as Ae,Da as on,E as jn,Ea as Re,F as zn,Fa as rn,G as Fn,Ga as q,H as _n,Ha as R,Ia as Bn,Ja as Wn,K as vt,Ka as Un,L as bt,La as Hn,M as wt,Ma as B,N as $t,Na as he,O as xt,Oa as V,P as kt,Pa as Vn,Q as St,Qa as N,R as Ct,Ra as Ee,S as Tt,Sa as Zn,T as It,Ta as qe,U as Dt,Ua as Gn,V as At,Va as Kn,W as Lt,Wa as Me,X as Pt,Xa as Yn,Y as ue,Ya as Qn,Z as pe,Za as Jn,_ as Rt,_a as Xn,a as j,aa as de,ab as Ne,b as lt,ba as fe,c as le,ca as Et,d as Te,da as qt,e as re,ea as Mt,f as En,fa as Nt,g as qn,ga as Ot,h as Ie,ha as ne,i as Q,ia as jt,j as Mn,ja as zt,k as Nn,ka as Ft,l as ut,la as _t,m as Z,ma as Bt,n as De,na as Wt,o as D,oa as Ut,p as pt,pa as Ht,q as J,qa as Vt,r as X,ra as Zt,s as dt,sa as Gt,t as ft,ta as Le,u as ht,ua as Kt,v as I,va as Yt,w as k,wa as Qt,x as On,xa as Jt,y as P,ya as Xt,z as _,za as Pe}from"./chunk-7OCZJATM.js";import{a as d}from"./chunk-AYDF3IFZ.js";var sn=new Set(["operation","system","eventsource"]),Oe={csharp:"csharp",typescript:"typescript",react:"typescript",html:"html",sql:"sql"};function an(t){return`subLanguage_${t}`}d(an,"subLanguageState");function to(t){let n=[...le.filter(e=>!sn.has(e)),...t.map(e=>e.keyword)];return[new RegExp(`^\\s*(?:${n.join("|")})\\b`),{token:"@rematch",next:"@pop"}]}d(to,"subLanguageExitRule");var no=[[/\/\/.*$/,"comment"],[/\$(?:context|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 cn(t){let n={root:[[new RegExp(`^(\\s*)(example)(\\s+)([A-Z][${Z}]*)(\\s*)(:)(\\s*)([A-Z][${Z}.]*)(?=\\s*(?://.*)?$)`),["white","keyword","white","type.identifier","white","operator","white","type.identifier"]],[/^(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*)(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|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*)(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\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"}]],...re.map(e=>[new RegExp(`^\\s*\\x60\\x60\\x60${e}\\s*$`),{token:"string.quote",next:`@codeBlock.${Oe[e]}`,nextEmbedded:Oe[e]}]),...re.map(e=>[new RegExp(`\\b${e}\\b(?=\\s*$)`),{token:"keyword.tag",next:`@codeBlockPending.${Oe[e]}`}]),...t.map(e=>[new RegExp(`\\b${e.keyword}\\b`),{token:"keyword",next:`@${an(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*)(execute)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,["white","keyword","white","type.identifier"]],{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"}],[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:no,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 t)n[an(e.keyword)]=[to(t),...e.tokens,{include:"@common"},[/[A-Z]\w*/,"type.identifier"],[/[a-z_]\w*/,"identifier"]];return{defaultToken:"",tokenPostfix:".play",ignoreCase:!1,keywords:[...le.filter(e=>!sn.has(e)),...Te,...re],sliceTypes:Ie,primitiveTypes:Q,tokenizer:n}}d(cn,"createTokensProvider");function ie(t,n,e,r){let i=P(t);if(i[n]||I(e).length<e.length)return null;let a=e.trim()===""?e.length:k(t[n]),p=_(t,i,n,a),o=H(t,i,n,a),c=d(u=>{let l=r.commands.filter(s=>s.name===u);return l.length===1?l[0]:void 0},"namedCommand"),m=d((u,l=u.name)=>({label:u.name,insertText:l,documentation:`${D(B(u))}${u.isGenerated?" \u2014 generated, not request/form input":""}. ${q}`}),"entry");if(p.includes("command")){let u=V(t).commands.filter(l=>l.line<n).at(-1);if(!u)return null;if(p[0]==="command"){if(/^\s*returns\s+@?\w*$/.test(e))return!/returns\s+@/.test(e)&&u.properties.some(s=>s.name==="returns"&&s.line===n)?null:u.properties.map(s=>m(s,`${/returns\s+@/.test(e)?"":"@"}${s.name}`));let l=e.match(/^\s*@?[a-z_]\w*\s+([\w.]+)\s+(\w*)$/);if(l&&["generated","identifier"].some(s=>s.startsWith(l[2]))&&r.concepts.find(y=>y.name===l[1])?.primitive==="Uuid")return[..."optional".startsWith(l[2])?pe:[],{label:"generated",insertText:"generated",documentation:`Required scalar Uuid concept with no validation rules; not a request/form input. ${q}`},{label:"generated identifier",insertText:"generated identifier",documentation:`Specification fixture uses an indented for value. ${q}`},{label:"identifier",insertText:"identifier",documentation:"Names the event source identifier."}];if(/^\s*@?[a-z_]\w*\s+[\w.]+\s+generated\s+\w*$/.test(e))return[{label:"identifier",insertText:"identifier",documentation:q}]}if(p[0]==="returns")return/=\s*@?\w*$/.test(e)?u.properties.map(l=>m(l)):/^\s*@?[a-z_]\w*\s+[\w.]*$/.test(e)?[...r.concepts.map(l=>l.name),...r.types.map(l=>l.name),...Q].map(l=>({label:l,insertText:l,documentation:`Explicit response type must exactly match the source. ${q}`})):u.properties.map(l=>m(l,`${l.name} = ${l.name}`))}if(p[0]==="form"&&o&&(/^\s*field\s+\w*$/.test(e)||e.trim()==="")){let u=c(o.match(/\bfor\s+([\w.]+)$/)?.[1]);if(u)return u.properties.filter(l=>!l.isGenerated).map(l=>m(l,e.trim()===""?`field ${l.name}`:l.name))}if(p.includes("specification")){if(p[0]==="when"&&o){let u=o.match(/^when\s+([\w.]+)$/)?.[1],l=c(u);if(!l)return null;if(/^\s*generated\s+\w*$/.test(e))return l.properties.filter(s=>s.isGenerated&&!s.isIdentifier).map(s=>m(s,`${s.name} = "\${1:uuid}"`));if(e.trim()==="")return[...l.properties.filter(s=>!s.isGenerated).map(s=>m(s,`${s.name} = \${1:value}`)),...l.properties.filter(s=>s.isGenerated&&!s.isIdentifier).map(s=>({...m(s,`generated ${s.name} = "\${1:uuid}"`),label:`generated ${s.name}`})),...l.properties.some(s=>s.isGenerated&&s.isIdentifier)?[{label:"for",insertText:'for "${1:uuid}"',documentation:`Generated identifier fixture, not request input. ${q}`}]:[]]}if(p[0]==="then"&&/^then\s+returns$/.test(o??"")){let u=[...R(t).specifications.values()].filter(s=>s.location.line-1<n).at(-1),l=c(u?.when?.commandType);if(l?.response?.kind==="RecordCommandResponseSyntax"){let s=new Map(l.properties.map(y=>[y.name,y]));return l.response.fields.map(y=>{let h=s.get(y.source.property),b=y.type??(h?B(h):void 0);return{label:y.name,insertText:`${y.name} = \${1:value}`,documentation:`${b?D(b):"Unresolved type"}. ${q}`}})}}}return null}d(ie,"responseCompletions");function mn(t,n){let e=N(t,n);return R(t,e.authoringDocuments??e.authoringSources?.filter(r=>r!==t.join(`
|
|
1
|
+
import{$ as te,$a as eo,A as H,Aa as en,B as gt,Ba as tn,C as yt,Ca as nn,D as Ae,Da as on,E as jn,Ea as Re,F as zn,Fa as rn,G as Fn,Ga as q,H as _n,Ha as R,Ia as Bn,Ja as Wn,K as vt,Ka as Un,L as bt,La as Hn,M as wt,Ma as B,N as $t,Na as he,O as xt,Oa as V,P as kt,Pa as Vn,Q as St,Qa as N,R as Ct,Ra as Ee,S as Tt,Sa as Zn,T as It,Ta as qe,U as Dt,Ua as Gn,V as At,Va as Kn,W as Lt,Wa as Me,X as Pt,Xa as Yn,Y as ue,Ya as Qn,Z as pe,Za as Jn,_ as Rt,_a as Xn,a as j,aa as de,ab as Ne,b as lt,ba as fe,c as le,ca as Et,d as Te,da as qt,e as re,ea as Mt,f as En,fa as Nt,g as qn,ga as Ot,h as Ie,ha as ne,i as Q,ia as jt,j as Mn,ja as zt,k as Nn,ka as Ft,l as ut,la as _t,m as Z,ma as Bt,n as De,na as Wt,o as D,oa as Ut,p as pt,pa as Ht,q as J,qa as Vt,r as X,ra as Zt,s as dt,sa as Gt,t as ft,ta as Le,u as ht,ua as Kt,v as I,va as Yt,w as k,wa as Qt,x as On,xa as Jt,y as P,ya as Xt,z as _,za as Pe}from"./chunk-AWX6REFE.js";import{a as d}from"./chunk-AYDF3IFZ.js";var sn=new Set(["operation","system","eventsource"]),Oe={csharp:"csharp",typescript:"typescript",react:"typescript",html:"html",sql:"sql"};function an(t){return`subLanguage_${t}`}d(an,"subLanguageState");function to(t){let n=[...le.filter(e=>!sn.has(e)),...t.map(e=>e.keyword)];return[new RegExp(`^\\s*(?:${n.join("|")})\\b`),{token:"@rematch",next:"@pop"}]}d(to,"subLanguageExitRule");var no=[[/\/\/.*$/,"comment"],[/\$(?:context|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 cn(t){let n={root:[[new RegExp(`^(\\s*)(example)(\\s+)([A-Z][${Z}]*)(\\s*)(:)(\\s*)([A-Z][${Z}.]*)(?=\\s*(?://.*)?$)`),["white","keyword","white","type.identifier","white","operator","white","type.identifier"]],[/^(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*)(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|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*)(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\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"}]],...re.map(e=>[new RegExp(`^\\s*\\x60\\x60\\x60${e}\\s*$`),{token:"string.quote",next:`@codeBlock.${Oe[e]}`,nextEmbedded:Oe[e]}]),...re.map(e=>[new RegExp(`\\b${e}\\b(?=\\s*$)`),{token:"keyword.tag",next:`@codeBlockPending.${Oe[e]}`}]),...t.map(e=>[new RegExp(`\\b${e.keyword}\\b`),{token:"keyword",next:`@${an(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*)(execute)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,["white","keyword","white","type.identifier"]],{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"}],[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:no,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 t)n[an(e.keyword)]=[to(t),...e.tokens,{include:"@common"},[/[A-Z]\w*/,"type.identifier"],[/[a-z_]\w*/,"identifier"]];return{defaultToken:"",tokenPostfix:".play",ignoreCase:!1,keywords:[...le.filter(e=>!sn.has(e)),...Te,...re],sliceTypes:Ie,primitiveTypes:Q,tokenizer:n}}d(cn,"createTokensProvider");function ie(t,n,e,r){let i=P(t);if(i[n]||I(e).length<e.length)return null;let a=e.trim()===""?e.length:k(t[n]),p=_(t,i,n,a),o=H(t,i,n,a),c=d(u=>{let l=r.commands.filter(s=>s.name===u);return l.length===1?l[0]:void 0},"namedCommand"),m=d((u,l=u.name)=>({label:u.name,insertText:l,documentation:`${D(B(u))}${u.isGenerated?" \u2014 generated, not request/form input":""}. ${q}`}),"entry");if(p.includes("command")){let u=V(t).commands.filter(l=>l.line<n).at(-1);if(!u)return null;if(p[0]==="command"){if(/^\s*returns\s+@?\w*$/.test(e))return!/returns\s+@/.test(e)&&u.properties.some(s=>s.name==="returns"&&s.line===n)?null:u.properties.map(s=>m(s,`${/returns\s+@/.test(e)?"":"@"}${s.name}`));let l=e.match(/^\s*@?[a-z_]\w*\s+([\w.]+)\s+(\w*)$/);if(l&&["generated","identifier"].some(s=>s.startsWith(l[2]))&&r.concepts.find(y=>y.name===l[1])?.primitive==="Uuid")return[..."optional".startsWith(l[2])?pe:[],{label:"generated",insertText:"generated",documentation:`Required scalar Uuid concept with no validation rules; not a request/form input. ${q}`},{label:"generated identifier",insertText:"generated identifier",documentation:`Specification fixture uses an indented for value. ${q}`},{label:"identifier",insertText:"identifier",documentation:"Names the event source identifier."}];if(/^\s*@?[a-z_]\w*\s+[\w.]+\s+generated\s+\w*$/.test(e))return[{label:"identifier",insertText:"identifier",documentation:q}]}if(p[0]==="returns")return/=\s*@?\w*$/.test(e)?u.properties.map(l=>m(l)):/^\s*@?[a-z_]\w*\s+[\w.]*$/.test(e)?[...r.concepts.map(l=>l.name),...r.types.map(l=>l.name),...Q].map(l=>({label:l,insertText:l,documentation:`Explicit response type must exactly match the source. ${q}`})):u.properties.map(l=>m(l,`${l.name} = ${l.name}`))}if(p[0]==="form"&&o&&(/^\s*field\s+\w*$/.test(e)||e.trim()==="")){let u=c(o.match(/\bfor\s+([\w.]+)$/)?.[1]);if(u)return u.properties.filter(l=>!l.isGenerated).map(l=>m(l,e.trim()===""?`field ${l.name}`:l.name))}if(p.includes("specification")){if(p[0]==="when"&&o){let u=o.match(/^when\s+([\w.]+)$/)?.[1],l=c(u);if(!l)return null;if(/^\s*generated\s+\w*$/.test(e))return l.properties.filter(s=>s.isGenerated&&!s.isIdentifier).map(s=>m(s,`${s.name} = "\${1:uuid}"`));if(e.trim()==="")return[...l.properties.filter(s=>!s.isGenerated).map(s=>m(s,`${s.name} = \${1:value}`)),...l.properties.filter(s=>s.isGenerated&&!s.isIdentifier).map(s=>({...m(s,`generated ${s.name} = "\${1:uuid}"`),label:`generated ${s.name}`})),...l.properties.some(s=>s.isGenerated&&s.isIdentifier)?[{label:"for",insertText:'for "${1:uuid}"',documentation:`Generated identifier fixture, not request input. ${q}`}]:[]]}if(p[0]==="then"&&/^then\s+returns$/.test(o??"")){let u=[...R(t).specifications.values()].filter(s=>s.location.line-1<n).at(-1),l=c(u?.when?.commandType);if(l?.response?.kind==="RecordCommandResponseSyntax"){let s=new Map(l.properties.map(y=>[y.name,y]));return l.response.fields.map(y=>{let h=s.get(y.source.property),b=y.type??(h?B(h):void 0);return{label:y.name,insertText:`${y.name} = \${1:value}`,documentation:`${b?D(b):"Unresolved type"}. ${q}`}})}}}return null}d(ie,"responseCompletions");function mn(t,n){let e=N(t,n);return R(t,e.authoringDocuments??e.authoringSources?.filter(r=>r!==t.join(`
|
|
2
2
|
`))??[],e.authoringPlacement,e.authoringPath,e.authoringPlacementResolved).examples}d(mn,"analyze");function ae(t,n,e,r){return P(t)[n]||I(e).length<e.length?null:mn(t,r).completions(n,e)}d(ae,"exampleCompletions");function je(t,n,e,r,i){return mn(t,i).hover(n,e,r)}d(je,"exampleHover");var O="Syntax-only; not admitted by any supported executable model (ESM) version yet (PLAY0268) (#301). No semantic or requirement identity is assigned.";function ln(t,n){return R(t,n?.authoringDocuments??n?.authoringSources?.filter(e=>e!==t.join(`
|
|
3
3
|
`))??[],n?.authoringPlacement,n?.authoringPath).operations}d(ln,"analyzeOperations");function ze(t){return t?t.file?`file ${t.file.path}`:t.code?`inline ${t.code.language}`:"pending":"not declared"}d(ze,"phaseState");function ge(t){let n=t.inputs.map(r=>`${r.name} ${D(r.type)}`).join(`
|
|
4
4
|
`),e=d((r,i)=>`${r}: ${r==="compensate"&&!i?"not declared":ze(i)}${i?.description?` \u2014 ${i.description}`:""}${i?.implementation?.hints.map(a=>`
|
|
@@ -71,7 +71,7 @@ ${f[0].properties.map(S=>`${S.name} ${D(B(S))}`).join(`
|
|
|
71
71
|
`)}
|
|
72
72
|
\`\`\``:null;return{name:c,content:w,target:null}}}let b=[...s.flatMap(v=>v.symbols.imports),...i?.authoringDocuments===void 0?i?.imports??[]:[]].filter(v=>v.shortName===c);if(b.length>0)return{name:c,content:b.length===1?`\`\`\`screenplay
|
|
73
73
|
import ${b[0].qualifiedName}
|
|
74
|
-
\`\`\``:null,target:null};let x=s.flatMap(v=>v.symbols.triggers.filter($=>$.name===c).map($=>({document:v,declaration:$})));return h(x)}d(me,"reactionReferenceAt");var Je={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."},oe={example:"One typed, possibly partial fixture: `example <Name> : <EventOrCommandOrReadModel>`. Use its name in a matching specification step; assignments override example values without changing matching or supplying defaults.",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, including the rule or case a specification witnesses, 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 reasoning on a module, feature, slice, command, event, read model or reaction in one nonempty 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`.",refused:"Ordered invocation refusal branch: first match wins. Bare `on refused` covers validation and constraints, not authorization. Syntax-only, not yet executable (PLAY0268).",acknowledge:"A refusal branch acknowledges alone, or produces events instead. Syntax-only, not yet executable (PLAY0268).",validation:"In `on refused by validation`, selects property, concept and require refusals. Syntax-only, not yet executable (PLAY0268).",authorization:"In `on refused by authorization`, explicitly selects unauthorized results, never Unsupported. Syntax-only, not yet executable (PLAY0268).",redelivered:"`when redelivered <Event> to <Reaction>` selects exactly one given occurrence by optional for and stated values, without appending it again. Syntax-only, not yet executable (PLAY0268).",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. In a labeled screen action, `when item.<field> == <literal> execute <Command>` selects the first matching alternative.",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 ...`. Unary `not` negates a condition or group; precedence is not, and, or.',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 on a screen. `action "Label"` declares one button with ordered `when \u2026 execute` alternatives over the nearest data item or selected row. No subject hides it; commands still enforce authorization and validation.',otherwise:"The last fallback of a guarded action: `otherwise hidden` (the default) or `otherwise execute <Command>`. Authorization never falls through to a different alternative.",hidden:"Hides a guarded action when no condition matches. Without a subject the action is always hidden, even with an execute fallback.",execute:"Executes a command. A guarded screen action selects it by the first matching condition; explicit `with \u2026 from` bindings precede same-name item fields, its declared form and renderer input.",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."},ke={clock:oe.clock,redelivered:oe.redelivered,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.",events:"`then no events` - asserts no new events after a non-append action. Syntax-only, not yet executable (PLAY0268). Cannot accompany event, event-order, error or denial expectations.",result:"`then result [exactly]` - one result the query performed by `when query` returns, in order; `then no result` - it returns nothing."},Xe={pii:'`@pii` \u2014 the value is personally identifiable information; C# providers render `[PII]`, so Chronicle manages it and can erase it for GDPR compliance wherever the concept is used. Add `pii reason "..."` in the concept body to record why.',sensitive:'`@sensitive` \u2014 Operational secret, not personal data: encrypted at rest without erasure and withheld from the causation chain. C# providers render `[Encrypted]` + `[NotAudited]`, or `[PII]` only when combined with `@pii`. Cannot be used as identity (PLAY0515). Add `sensitive reason "..."` in the concept body to record why.'},Se={"$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(Ae.map(t=>[`$eventContext.${t.path}`,t.description]))};function et(t,n,e,r,i,a){let p=P(t);if(p[n])return null;let o=t[n]??"";if(i-1>I(o).length)return null;let c=!1,m=!1;for(let g=0;g<r-1;g++)o[g]==="\\"&&c?g++:o[g]==='"'&&!m?c=!c:o[g]==="`"&&!c&&(m=!m);if(c||m)return null;let u=me(t,n,r,i,a);if(u)return u.content;let l=je(t,n,r,i,a);if(l)return l;let s=Be(t,n,r,i,a);if(s)return s;let y=_e(t,n,r,i,a);if(y)return y;let h=d((g,C)=>{let M=g+(o[g-1]==="@"?1:0);return e===C&&r===M&&i===M+C.length&&o.slice(M-1,i-1)===C},"tokenAt"),b=o.charAt(r-2);if(b==="@"){let g=Xe[e];if(g)return g}if(b==="$"||b==="."){let g=o.substring(0,i-1).match(/\$[\w.]*$/)?.[0];if(g){if(g.startsWith("$refusal")){let M=we(t,n,k(o)),K=g.substring(9),Y={reason:"Refusal kind as a String: validation, constraint or authorization.",message:"Rejection details verbatim, including unresolved $strings keys.",constraint:"Violated constraint name as a String, only in a by constraint branch."};return M!==void 0&&Y[K]!==void 0?`**${g}** \u2014 ${Y[K]} Syntax-only, not yet executable (PLAY0268).`:null}let C=Se[g]??(g.startsWith("$env")?Se.$env:void 0);if(C)return C}}let x=o.slice(0,r-1),v=/^\s*(?:by|filter)\s+/.test(x)?/^\s*(?:by|filter)\s+[a-z_]\w*\s+[\w.]+(?:\[\])?\s+$/.test(x):/^\s*@?[a-z_]\w*\s+[\w.]+(?:\[\])?\s+$/.test(x),$=/^\s*query\s+\w+\s*=>\s*(?:observable\s+)?[\w.]+(?:\[\])?\s+$/.test(x)&&!/^\s*query\s+\w+\s*=>\s*observable\s+$/.test(x);if(e==="optional"&&(v||$))return`**optional** \u2014 ${oe.optional}`;if(e==="implementation"||e==="hint"){let g=_(t,p,n,k(o)),C=$e(t,n,k(o));if(e==="implementation"&&C==="rule"&&/^\s*implementation\s*$/.test(I(o))||e==="hint"&&C==="implementation"&&/^\s*hint\s+"/.test(o))return`**${e}** \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(e==="implementation"&&g[0]==="handler"&&/^\s*implementation\s*$/.test(I(o)))return`**implementation** \u2014 ${Je.implementation}`;if(e==="hint"&&g[0]==="implementation"&&g[1]==="handler"&&/^\s*hint\s+"/.test(o))return`**hint** \u2014 ${Je.hint}`}let f=V(t),w=f.commands.filter(g=>g.line<n).at(-1),S=w?.properties.find(g=>g.name===e&&g.line===n);if(S?.isGenerated||e==="generated"&&w?.properties.some(g=>g.isGenerated&&g.line===n)&&v)return`**${S?.name??"generated"}** \u2014 ${S?D(B(S))+". ":""}Generated value, not a request or form input. ${q}`;let T=w?.response;if(T?.location.line===n+1&&(h(T.location.column,"returns")||T.kind==="ScalarCommandResponseSyntax"&&h(T.source.location.column,T.source.property))){let g=T.kind==="ScalarCommandResponseSyntax"?w?.properties.find(C=>C.name===T.source.property):void 0;return`**returns**${g?` \u2014 ${D(B(g))}`:" \u2014 unnamed record response"}. ${q}`}if(T?.kind==="RecordCommandResponseSyntax"){let g=T.fields.find(C=>C.location.line===n+1&&(h(C.location.column,C.name)||h(C.source.location.column,C.source.property)));if(g){let C=w?.properties.find(K=>K.name===g.source.property),M=g.type?D(g.type):C?D(B(C)):"Unresolved type";return`**${g.name}** \u2014 ${M}${g.type?" (explicit)":" (inferred)"} = ${g.source.property}. ${C?.isGenerated?"Generated source, not request input. ":""}${q}`}}for(let g of R(t).specifications.values())if(e==="returns"&&g.thenReturns?.location.line===n+1||e==="generated"&&g.when?.generatedValues?.some(C=>C.location.line===n+1))return q;let A=f.concepts.find(g=>g.name===e);if(A){let g=A.attributes.length?` ${A.attributes.join(" ")}`:"",C=A.enumValues.length?`
|
|
74
|
+
\`\`\``:null,target:null};let x=s.flatMap(v=>v.symbols.triggers.filter($=>$.name===c).map($=>({document:v,declaration:$})));return h(x)}d(me,"reactionReferenceAt");var Je={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."},oe={example:"One typed, possibly partial fixture: `example <Name> : <EventOrCommandOrReadModel>`. Use its name in a matching specification step; assignments override example values without changing matching or supplying defaults. Event examples may carry stream or no stream; a step replaces that route as a whole.",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, including the rule or case a specification witnesses, 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 reasoning on a module, feature, slice, command, event, read model or reaction in one nonempty 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`.",refused:"Ordered invocation refusal branch: first match wins. Bare `on refused` covers validation and constraints, not authorization. Syntax-only, not yet executable (PLAY0268).",acknowledge:"A refusal branch acknowledges alone, or produces events instead. Syntax-only, not yet executable (PLAY0268).",validation:"In `on refused by validation`, selects property, concept and require refusals. Syntax-only, not yet executable (PLAY0268).",authorization:"In `on refused by authorization`, explicitly selects unauthorized results, never Unsupported. Syntax-only, not yet executable (PLAY0268).",redelivered:"`when redelivered <Event> to <Reaction>` selects exactly one effective given occurrence by optional for, stated values and stream or no stream, without appending it again. Syntax-only, not yet executable (PLAY0268).",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. In a labeled screen action, `when item.<field> == <literal> execute <Command>` selects the first matching alternative.",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 ...`. Unary `not` negates a condition or group; precedence is not, and, or.',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 on a screen. `action "Label"` declares one button with ordered `when \u2026 execute` alternatives over the nearest data item or selected row. No subject hides it; commands still enforce authorization and validation.',otherwise:"The last fallback of a guarded action: `otherwise hidden` (the default) or `otherwise execute <Command>`. Authorization never falls through to a different alternative.",hidden:"Hides a guarded action when no condition matches. Without a subject the action is always hidden, even with an execute fallback.",execute:"Executes a command. A guarded screen action selects it by the first matching condition; explicit `with \u2026 from` bindings precede same-name item fields, its declared form and renderer input.",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."},ke={clock:oe.clock,redelivered:oe.redelivered,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.",events:"`then no events` - asserts no new events after a non-append action. Syntax-only, not yet executable (PLAY0268). Cannot accompany event, event-order, error or denial expectations.",result:"`then result [exactly]` - one result the query performed by `when query` returns, in order; `then no result` - it returns nothing."},Xe={pii:'`@pii` \u2014 the value is personally identifiable information; C# providers render `[PII]`, so Chronicle manages it and can erase it for GDPR compliance wherever the concept is used. Add `pii reason "..."` in the concept body to record why.',sensitive:'`@sensitive` \u2014 Operational secret, not personal data: encrypted at rest without erasure and withheld from the causation chain. C# providers render `[Encrypted]` + `[NotAudited]`, or `[PII]` only when combined with `@pii`. Cannot be used as identity (PLAY0515). Add `sensitive reason "..."` in the concept body to record why.'},Se={"$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(Ae.map(t=>[`$eventContext.${t.path}`,t.description]))};function et(t,n,e,r,i,a){let p=P(t);if(p[n])return null;let o=t[n]??"";if(i-1>I(o).length)return null;let c=!1,m=!1;for(let g=0;g<r-1;g++)o[g]==="\\"&&c?g++:o[g]==='"'&&!m?c=!c:o[g]==="`"&&!c&&(m=!m);if(c||m)return null;let u=me(t,n,r,i,a);if(u)return u.content;let l=je(t,n,r,i,a);if(l)return l;let s=Be(t,n,r,i,a);if(s)return s;let y=_e(t,n,r,i,a);if(y)return y;let h=d((g,C)=>{let M=g+(o[g-1]==="@"?1:0);return e===C&&r===M&&i===M+C.length&&o.slice(M-1,i-1)===C},"tokenAt"),b=o.charAt(r-2);if(b==="@"){let g=Xe[e];if(g)return g}if(b==="$"||b==="."){let g=o.substring(0,i-1).match(/\$[\w.]*$/)?.[0];if(g){if(g.startsWith("$refusal")){let M=we(t,n,k(o)),K=g.substring(9),Y={reason:"Refusal kind as a String: validation, constraint or authorization.",message:"Rejection details verbatim, including unresolved $strings keys.",constraint:"Violated constraint name as a String, only in a by constraint branch."};return M!==void 0&&Y[K]!==void 0?`**${g}** \u2014 ${Y[K]} Syntax-only, not yet executable (PLAY0268).`:null}let C=Se[g]??(g.startsWith("$env")?Se.$env:void 0);if(C)return C}}let x=o.slice(0,r-1),v=/^\s*(?:by|filter)\s+/.test(x)?/^\s*(?:by|filter)\s+[a-z_]\w*\s+[\w.]+(?:\[\])?\s+$/.test(x):/^\s*@?[a-z_]\w*\s+[\w.]+(?:\[\])?\s+$/.test(x),$=/^\s*query\s+\w+\s*=>\s*(?:observable\s+)?[\w.]+(?:\[\])?\s+$/.test(x)&&!/^\s*query\s+\w+\s*=>\s*observable\s+$/.test(x);if(e==="optional"&&(v||$))return`**optional** \u2014 ${oe.optional}`;if(e==="implementation"||e==="hint"){let g=_(t,p,n,k(o)),C=$e(t,n,k(o));if(e==="implementation"&&C==="rule"&&/^\s*implementation\s*$/.test(I(o))||e==="hint"&&C==="implementation"&&/^\s*hint\s+"/.test(o))return`**${e}** \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(e==="implementation"&&g[0]==="handler"&&/^\s*implementation\s*$/.test(I(o)))return`**implementation** \u2014 ${Je.implementation}`;if(e==="hint"&&g[0]==="implementation"&&g[1]==="handler"&&/^\s*hint\s+"/.test(o))return`**hint** \u2014 ${Je.hint}`}let f=V(t),w=f.commands.filter(g=>g.line<n).at(-1),S=w?.properties.find(g=>g.name===e&&g.line===n);if(S?.isGenerated||e==="generated"&&w?.properties.some(g=>g.isGenerated&&g.line===n)&&v)return`**${S?.name??"generated"}** \u2014 ${S?D(B(S))+". ":""}Generated value, not a request or form input. ${q}`;let T=w?.response;if(T?.location.line===n+1&&(h(T.location.column,"returns")||T.kind==="ScalarCommandResponseSyntax"&&h(T.source.location.column,T.source.property))){let g=T.kind==="ScalarCommandResponseSyntax"?w?.properties.find(C=>C.name===T.source.property):void 0;return`**returns**${g?` \u2014 ${D(B(g))}`:" \u2014 unnamed record response"}. ${q}`}if(T?.kind==="RecordCommandResponseSyntax"){let g=T.fields.find(C=>C.location.line===n+1&&(h(C.location.column,C.name)||h(C.source.location.column,C.source.property)));if(g){let C=w?.properties.find(K=>K.name===g.source.property),M=g.type?D(g.type):C?D(B(C)):"Unresolved type";return`**${g.name}** \u2014 ${M}${g.type?" (explicit)":" (inferred)"} = ${g.source.property}. ${C?.isGenerated?"Generated source, not request input. ":""}${q}`}}for(let g of R(t).specifications.values())if(e==="returns"&&g.thenReturns?.location.line===n+1||e==="generated"&&g.when?.generatedValues?.some(C=>C.location.line===n+1))return q;let A=f.concepts.find(g=>g.name===e);if(A){let g=A.attributes.length?` ${A.attributes.join(" ")}`:"",C=A.enumValues.length?`
|
|
75
75
|
|
|
76
76
|
Values: ${A.enumValues.join(", ")}`:"",M=Object.entries(A.attributeReasons).map(([K,Y])=>`
|
|
77
77
|
|