@cratis/screenplay-language 4.81.4 → 4.81.5
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/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as Q,$a as Yn,A as _,Aa as Qt,B as dt,Ba as Jt,C as ft,Ca as Xt,D as Te,Da as en,E as qn,Ea as Ie,F as Nn,Fa as tn,G as Mn,Ga as E,H as On,Ha as L,Ia as jn,Ja as zn,K as ht,Ka as Fn,L as gt,La as Bn,M as yt,Ma as W,N as vt,Na as nn,O as bt,Oa as V,P as wt,Pa as _n,Q as $t,Qa as j,R as xt,Ra as Le,S as kt,Sa as Wn,T as St,Ta as Pe,U as Ct,Ua as Hn,V as Tt,Va as Un,W as Dt,Wa as Re,X as At,Xa as Vn,Y as le,Ya as Zn,Z as me,Za as Gn,_ as It,_a as Kn,a as M,aa as ue,ab as Ee,b as st,ba as pe,c as ce,ca as Lt,d as ke,da as Pt,e as te,ea as Rt,f as In,fa as Et,g as Ln,ga as qt,h as Se,ha as J,i as G,ia as Nt,j as Pn,ja as Mt,k as Rn,ka as Ot,l as ct,la as jt,m as U,ma as zt,n as Ce,na as Ft,o as I,oa as Bt,p as lt,pa as _t,q as ne,qa as Wt,r as Y,ra as Ht,s as mt,sa as Ut,t as ut,ta as De,u as pt,ua as Vt,v as A,va as Zt,w as $,wa as Gt,x as En,xa as Kt,y as P,ya as Yt,z as B,za as Ae}from"./chunk-RDOQXE7Y.js";import{a as d}from"./chunk-AYDF3IFZ.js";var rn=new Set(["operation","system","eventsource"]),qe={csharp:"csharp",typescript:"typescript",react:"typescript",html:"html",sql:"sql"};function on(t){return`subLanguage_${t}`}d(on,"subLanguageState");function Qn(t){let n=[...ce.filter(e=>!rn.has(e)),...t.map(e=>e.keyword)];return[new RegExp(`^\\s*(?:${n.join("|")})\\b`),{token:"@rematch",next:"@pop"}]}d(Qn,"subLanguageExitRule");var Jn=[[/\/\/.*$/,"comment"],[/^(numbers)([ \t]+)(exact)(?=[ \t]*(?:(?:\/\/|#).*)?$)/,["keyword","white","keyword"]],[/\$(?: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 an(t){let n={root:[[new RegExp(`^(\\s*)(example)(\\s+)([A-Z][${U}]*)(\\s*)(:)(\\s*)([A-Z][${U}.]*)(?=\\s*(?://.*)?$)`),["white","keyword","white","type.identifier","white","operator","white","type.identifier"]],[/^(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_][${U}]*)(?=\\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"}]],...te.map(e=>[new RegExp(`^\\s*\\x60\\x60\\x60${e}\\s*$`),{token:"string.quote",next:`@codeBlock.${qe[e]}`,nextEmbedded:qe[e]}]),...te.map(e=>[new RegExp(`\\b${e}\\b(?=\\s*$)`),{token:"keyword.tag",next:`@codeBlockPending.${qe[e]}`}]),...t.map(e=>[new RegExp(`\\b${e.keyword}\\b`),{token:"keyword",next:`@${on(e.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"}],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*)([${U}.]+)(\\s+)(rule)(\\s+)([A-Za-z_][${U}]*)(?=\\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:Jn,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[on(e.keyword)]=[Qn(t),...e.tokens,{include:"@common"},[/[A-Z]\w*/,"type.identifier"],[/[a-z_]\w*/,"identifier"]];return{defaultToken:"",tokenPostfix:".play",ignoreCase:!1,keywords:[...ce.filter(e=>!rn.has(e)),...ke,...te],sliceTypes:Se,primitiveTypes:G,tokenizer:n}}d(an,"createTokensProvider");function oe(t,n,e,r){let i=P(t);if(i[n]||A(e).length<e.length)return null;let s=e.trim()===""?e.length:$(t[n]),u=B(t,i,n,s),o=_(t,i,n,s),c=d(m=>{let a=r.commands.filter(p=>p.name===m);return a.length===1?a[0]:void 0},"namedCommand"),l=d((m,a=m.name)=>({label:m.name,insertText:a,documentation:`${I(W(m))}${m.isGenerated?" \u2014 generated, not request/form input":""}. ${E}`}),"entry");if(u.includes("command")){let m=V(t).commands.filter(a=>a.line<n).at(-1);if(!m)return null;if(u[0]==="command"){if(/^\s*returns\s+@?\w*$/.test(e))return!/returns\s+@/.test(e)&&m.properties.some(p=>p.name==="returns"&&p.line===n)?null:m.properties.map(p=>l(p,`${/returns\s+@/.test(e)?"":"@"}${p.name}`));let a=e.match(/^\s*@?[a-z_]\w*\s+([\w.]+)\s+(\w*)$/);if(a&&["generated","identifier"].some(p=>p.startsWith(a[2]))&&r.concepts.find(y=>y.name===a[1])?.primitive==="Uuid")return[..."optional".startsWith(a[2])?me:[],{label:"generated",insertText:"generated",documentation:`Required scalar Uuid concept with no validation rules; not a request/form input. ${E}`},{label:"generated identifier",insertText:"generated identifier",documentation:`Specification fixture uses an indented for value. ${E}`},{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:E}]}if(u[0]==="returns")return/=\s*@?\w*$/.test(e)?m.properties.map(a=>l(a)):/^\s*@?[a-z_]\w*\s+[\w.]*$/.test(e)?[...r.concepts.map(a=>a.name),...r.types.map(a=>a.name),...G].map(a=>({label:a,insertText:a,documentation:`Explicit response type must exactly match the source. ${E}`})):m.properties.map(a=>l(a,`${a.name} = ${a.name}`))}if(u[0]==="form"&&o&&(/^\s*field\s+\w*$/.test(e)||e.trim()==="")){let m=c(o.match(/\bfor\s+([\w.]+)$/)?.[1]);if(m)return m.properties.filter(a=>!a.isGenerated).map(a=>l(a,e.trim()===""?`field ${a.name}`:a.name))}if(u.includes("specification")){if(u[0]==="when"&&o){let m=o.match(/^when\s+([\w.]+)$/)?.[1],a=c(m);if(!a)return null;if(/^\s*generated\s+\w*$/.test(e))return a.properties.filter(p=>p.isGenerated&&!p.isIdentifier).map(p=>l(p,`${p.name} = "\${1:uuid}"`));if(e.trim()==="")return[...a.properties.filter(p=>!p.isGenerated).map(p=>l(p,`${p.name} = \${1:value}`)),...a.properties.filter(p=>p.isGenerated&&!p.isIdentifier).map(p=>({...l(p,`generated ${p.name} = "\${1:uuid}"`),label:`generated ${p.name}`})),...a.properties.some(p=>p.isGenerated&&p.isIdentifier)?[{label:"for",insertText:'for "${1:uuid}"',documentation:`Generated identifier fixture, not request input. ${E}`}]:[]]}if(u[0]==="then"&&/^then\s+returns$/.test(o??"")){let m=[...L(t).specifications.values()].filter(p=>p.location.line-1<n).at(-1),a=c(m?.when?.commandType);if(a?.response?.kind==="RecordCommandResponseSyntax"){let p=new Map(a.properties.map(y=>[y.name,y]));return a.response.fields.map(y=>{let f=p.get(y.source.property),v=y.type??(f?W(f):void 0);return{label:y.name,insertText:`${y.name} = \${1:value}`,documentation:`${v?I(v):"Unresolved type"}. ${E}`}})}}}return null}d(oe,"responseCompletions");function sn(t,n){let e=j(t,n);return L(t,e.authoringDocuments??e.authoringSources?.filter(r=>r!==t.join(`
|
|
1
|
+
import{$ as Q,$a as Yn,A as _,Aa as Qt,B as dt,Ba as Jt,C as ft,Ca as Xt,D as Te,Da as en,E as qn,Ea as Ie,F as Nn,Fa as tn,G as Mn,Ga as E,H as On,Ha as L,Ia as jn,Ja as zn,K as ht,Ka as Fn,L as gt,La as Bn,M as yt,Ma as W,N as vt,Na as nn,O as bt,Oa as V,P as wt,Pa as _n,Q as $t,Qa as j,R as xt,Ra as Le,S as kt,Sa as Wn,T as St,Ta as Pe,U as Ct,Ua as Hn,V as Tt,Va as Un,W as Dt,Wa as Re,X as At,Xa as Vn,Y as le,Ya as Zn,Z as me,Za as Gn,_ as It,_a as Kn,a as M,aa as ue,ab as Ee,b as st,ba as pe,c as ce,ca as Lt,d as ke,da as Pt,e as te,ea as Rt,f as In,fa as Et,g as Ln,ga as qt,h as Se,ha as J,i as G,ia as Nt,j as Pn,ja as Mt,k as Rn,ka as Ot,l as ct,la as jt,m as U,ma as zt,n as Ce,na as Ft,o as I,oa as Bt,p as lt,pa as _t,q as ne,qa as Wt,r as Y,ra as Ht,s as mt,sa as Ut,t as ut,ta as De,u as pt,ua as Vt,v as A,va as Zt,w as $,wa as Gt,x as En,xa as Kt,y as P,ya as Yt,z as B,za as Ae}from"./chunk-RDOQXE7Y.js";import{a as d}from"./chunk-AYDF3IFZ.js";var rn=new Set(["operation","system","eventsource"]),qe={csharp:"csharp",typescript:"typescript",react:"typescript",html:"html",sql:"sql"};function on(t){return`subLanguage_${t}`}d(on,"subLanguageState");function Qn(t){let n=[...ce.filter(e=>!rn.has(e)),...t.map(e=>e.keyword)];return[new RegExp(`^\\s*(?:${n.join("|")})\\b`),{token:"@rematch",next:"@pop"}]}d(Qn,"subLanguageExitRule");var Jn=[[/\/\/.*$/,"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 an(t){let n={root:[[new RegExp(`^(\\s*)(example)(\\s+)([A-Z][${U}]*)(\\s*)(:)(\\s*)([A-Z][${U}.]*)(?=\\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_][${U}]*)(?=\\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"}]],...te.map(e=>[new RegExp(`^\\s*\\x60\\x60\\x60${e}\\s*$`),{token:"string.quote",next:`@codeBlock.${qe[e]}`,nextEmbedded:qe[e]}]),...te.map(e=>[new RegExp(`\\b${e}\\b(?=\\s*$)`),{token:"keyword.tag",next:`@codeBlockPending.${qe[e]}`}]),...t.map(e=>[new RegExp(`\\b${e.keyword}\\b`),{token:"keyword",next:`@${on(e.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"}],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*)([${U}.]+)(\\s+)(rule)(\\s+)([A-Za-z_][${U}]*)(?=\\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:Jn,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[on(e.keyword)]=[Qn(t),...e.tokens,{include:"@common"},[/[A-Z]\w*/,"type.identifier"],[/[a-z_]\w*/,"identifier"]];return{defaultToken:"",tokenPostfix:".play",ignoreCase:!1,keywords:[...ce.filter(e=>!rn.has(e)),...ke,...te],sliceTypes:Se,primitiveTypes:G,tokenizer:n}}d(an,"createTokensProvider");function oe(t,n,e,r){let i=P(t);if(i[n]||A(e).length<e.length)return null;let s=e.trim()===""?e.length:$(t[n]),u=B(t,i,n,s),o=_(t,i,n,s),c=d(m=>{let a=r.commands.filter(p=>p.name===m);return a.length===1?a[0]:void 0},"namedCommand"),l=d((m,a=m.name)=>({label:m.name,insertText:a,documentation:`${I(W(m))}${m.isGenerated?" \u2014 generated, not request/form input":""}. ${E}`}),"entry");if(u.includes("command")){let m=V(t).commands.filter(a=>a.line<n).at(-1);if(!m)return null;if(u[0]==="command"){if(/^\s*returns\s+@?\w*$/.test(e))return!/returns\s+@/.test(e)&&m.properties.some(p=>p.name==="returns"&&p.line===n)?null:m.properties.map(p=>l(p,`${/returns\s+@/.test(e)?"":"@"}${p.name}`));let a=e.match(/^\s*@?[a-z_]\w*\s+([\w.]+)\s+(\w*)$/);if(a&&["generated","identifier"].some(p=>p.startsWith(a[2]))&&r.concepts.find(y=>y.name===a[1])?.primitive==="Uuid")return[..."optional".startsWith(a[2])?me:[],{label:"generated",insertText:"generated",documentation:`Required scalar Uuid concept with no validation rules; not a request/form input. ${E}`},{label:"generated identifier",insertText:"generated identifier",documentation:`Specification fixture uses an indented for value. ${E}`},{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:E}]}if(u[0]==="returns")return/=\s*@?\w*$/.test(e)?m.properties.map(a=>l(a)):/^\s*@?[a-z_]\w*\s+[\w.]*$/.test(e)?[...r.concepts.map(a=>a.name),...r.types.map(a=>a.name),...G].map(a=>({label:a,insertText:a,documentation:`Explicit response type must exactly match the source. ${E}`})):m.properties.map(a=>l(a,`${a.name} = ${a.name}`))}if(u[0]==="form"&&o&&(/^\s*field\s+\w*$/.test(e)||e.trim()==="")){let m=c(o.match(/\bfor\s+([\w.]+)$/)?.[1]);if(m)return m.properties.filter(a=>!a.isGenerated).map(a=>l(a,e.trim()===""?`field ${a.name}`:a.name))}if(u.includes("specification")){if(u[0]==="when"&&o){let m=o.match(/^when\s+([\w.]+)$/)?.[1],a=c(m);if(!a)return null;if(/^\s*generated\s+\w*$/.test(e))return a.properties.filter(p=>p.isGenerated&&!p.isIdentifier).map(p=>l(p,`${p.name} = "\${1:uuid}"`));if(e.trim()==="")return[...a.properties.filter(p=>!p.isGenerated).map(p=>l(p,`${p.name} = \${1:value}`)),...a.properties.filter(p=>p.isGenerated&&!p.isIdentifier).map(p=>({...l(p,`generated ${p.name} = "\${1:uuid}"`),label:`generated ${p.name}`})),...a.properties.some(p=>p.isGenerated&&p.isIdentifier)?[{label:"for",insertText:'for "${1:uuid}"',documentation:`Generated identifier fixture, not request input. ${E}`}]:[]]}if(u[0]==="then"&&/^then\s+returns$/.test(o??"")){let m=[...L(t).specifications.values()].filter(p=>p.location.line-1<n).at(-1),a=c(m?.when?.commandType);if(a?.response?.kind==="RecordCommandResponseSyntax"){let p=new Map(a.properties.map(y=>[y.name,y]));return a.response.fields.map(y=>{let f=p.get(y.source.property),v=y.type??(f?W(f):void 0);return{label:y.name,insertText:`${y.name} = \${1:value}`,documentation:`${v?I(v):"Unresolved type"}. ${E}`}})}}}return null}d(oe,"responseCompletions");function sn(t,n){let e=j(t,n);return L(t,e.authoringDocuments??e.authoringSources?.filter(r=>r!==t.join(`
|
|
2
2
|
`))??[],e.authoringPlacement,e.authoringPath,e.authoringPlacementResolved).examples}d(sn,"analyze");function re(t,n,e,r){return P(t)[n]||A(e).length<e.length?null:sn(t,r).completions(n,e)}d(re,"exampleCompletions");function Ne(t,n,e,r,i){return sn(t,i).hover(n,e,r)}d(Ne,"exampleHover");var N="Syntax-only; not admitted by any supported executable model (ESM) version yet (PLAY0268) (#301). No semantic or requirement identity is assigned.";function cn(t,n){return L(t,n?.authoringDocuments??n?.authoringSources?.filter(e=>e!==t.join(`
|
|
3
3
|
`))??[],n?.authoringPlacement,n?.authoringPath).operations}d(cn,"analyzeOperations");function Me(t){return t?t.file?`file ${t.file.path}`:t.code?`inline ${t.code.language}`:"pending":"not declared"}d(Me,"phaseState");function de(t){let n=t.inputs.map(r=>`${r.name} ${I(r.type)}`).join(`
|
|
4
4
|
`),e=d((r,i)=>`${r}: ${r==="compensate"&&!i?"not declared":Me(i)}${i?.description?` \u2014 ${i.description}`:""}${i?.implementation?.hints.map(s=>`
|