@cratis/screenplay-language 4.100.0 → 4.101.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.
@@ -4,7 +4,7 @@ import{a as l}from"./chunk-AYDF3IFZ.js";var Cs="screenplay",Wu={id:Cs,extensions
4
4
  column
5
5
  \${1:slot}`,documentation:"How the slots are placed."}],Em=[{label:"fits slot",insertText:"fits slot ${1:content}",documentation:"The slot of the shell the template fits."},...Ts,{label:"on",insertText:"on ${1|enter,leave,load,unload|}\n ${2:refresh query}",documentation:"Wires what happens on an interaction."}];var Im=[{label:"optional",insertText:"optional",documentation:"Allows the complete value, including a collection, to be absent."}],be=l(t=>`\`\`\`${t}
6
6
  \${1}
7
- \`\`\``,"fenced"),Tm=[...gt,{label:"eventsource",insertText:"eventsource ${1:Name}\n identifier ${2:Type}\n stream ${3:Name}",documentation:"Application-owned source with nested streams; not admitted by any supported executable model (ESM) version yet (PLAY0268)."},{label:"system",insertText:'system ${1:Name}\n description "${2:external system}"',documentation:"Application-scoped external system; not admitted by any supported executable model (ESM) version yet."},{label:"import",insertText:"import ${1:Module}.${2:Type}",documentation:"Imports a type from another module by its qualified name."},{label:'import "\u2026"',insertText:'import "${1:**/*.play}"',documentation:"Imports other `.play` files by path or glob, relative to this file's folder, as whole documents of the application."},{label:"concept",insertText:"concept ${1:Name} : ${2|Uuid,String,Int,Decimal,Bool,Date,DateTime|}",documentation:"Declares a formalized value type wrapping a primitive."},{label:"concept (enum)",insertText:"concept ${1:Name} : Enum\n ${2:value}",documentation:"Declares an enumeration concept with a fixed set of values."},{label:"concept (pii with reason)",insertText:'concept ${1:Name} : ${2|String,Uuid,Int,Decimal,Bool,Date,DateTime|} pii\n pii reason "${3:why this value is personal data}"',documentation:"Declares a personal-data concept together with the reason it is personal data."},{label:"type",insertText:"type ${1:Name}\n ${2:property} ${3:Type}",documentation:"Declares a composite value type \u2014 a named shape built from several properties."},{label:"policy",insertText:"policy ${1:Name}\n require ${2:authenticated}",documentation:"Declares a named authorization rule for commands and queries."},{label:"module",insertText:"module ${1:Name}\n ",documentation:"Declares the top-level namespace \u2014 maps to a bounded context."},{label:"domain",insertText:"domain ${1:Name}",documentation:"The domain the file belongs to \u2014 optional, at most one per file, before everything else."},{label:"persona",insertText:'persona ${1:Name}\n description "${2:who they are}"',documentation:"A named role interacting with the application, with the policies it holds."},{label:"authentication",insertText:"authentication\n provider ${1:Name}\n ${2:setting} ${3:value}",documentation:"Declares the identity providers of the application \u2014 at most one block per file."},{label:"seed",insertText:"seed\n for ${1:EventSourceId}\n ${2:EventType}",documentation:"Declares events to seed into the event store per event source id."},{label:"layout",insertText:"layout ${1:Name}\n ${2:slot}",documentation:"Declares the application shell with named slots."},{label:"theme",insertText:"theme ${1:Name}\n compatible with ${2:Package}",documentation:"Declares a theme and the component packages it is compatible with."},{label:"ui profile",insertText:"ui profile ${1:Name}\n target platform ${2:web}\n layout ${3:Layout}\n theme ${4:Theme}",documentation:"Binds a target platform and size to a layout, theme and component packages."},{label:"behavior",insertText:"behavior ${1:Name}\n on ${2:click}\n ${3:execute command}",documentation:"A named interaction wiring, attached to a screen, form or dialog with `uses`."},{label:"trigger",insertText:"trigger ${1:Name}\n ${2:property} ${3:Type}",documentation:"Declares an integration signal a reaction can run on."}],Rm=[{label:"uses",insertText:"uses ${1:System}",documentation:"Exactly one application-scoped external system."},{label:"description",insertText:'description "${1:intent}"',documentation:"Describes operation intent, without requiring code."},{label:"input",insertText:"${1:input} ${2:Type}",documentation:"Typed operation input; no identifier or generated modifier."},{label:"execute",insertText:'execute\n description "${1:effect}"',documentation:"Optional execution intent; not admitted by any supported executable model (ESM) version yet."},{label:"compensate",insertText:'compensate\n description "${1:undo intent}"',documentation:"Optional compensation intent; not admitted by any supported executable model (ESM) version yet."}],Rs=[{label:"hint",insertText:'hint "${1:implementation guidance}"',documentation:"Ordered authoring guidance; not an executable implementation role."},{label:"file",insertText:"file ${1:Path}",documentation:"Selects the phase\u2019s sole source attachment."},...["csharp","typescript","react","html","sql"].map(t=>({label:t,insertText:be(t),documentation:"Selects the phase\u2019s sole inline source; not admitted by any supported executable model (ESM) version yet."}))],Dm=[{label:"description",insertText:'description "${1:phase intent}"',documentation:"A description-only phase is valid, pending intent."},{label:"implementation",insertText:'implementation\n hint "${1:guidance}"',documentation:"Hints with optional source; phase owns File/Code, wrapper owns hints only."},...Rs.filter(t=>t.label!=="hint")],Mm=[{label:"file",insertText:"file ${1:Path}",documentation:"Names the repository relative file this declaration is realized by, so the document can be navigated back to the code."},{label:"pii reason",insertText:'pii reason "${1:why this value is personal data}"',documentation:"A free-text concept note, not a lawful basis."},{label:"secret reason",insertText:'secret reason "${1:why this value is an operational secret}"',documentation:"Records why the secret marker applies."},{label:"secret scope",insertText:"secret scope ${1|subject,namespace,global|}",documentation:"Explicit encryption scope; omitted scope keeps Chronicle\u2019s Subject default."},{label:"pii special",insertText:"pii special ${1|racialOrEthnicOrigin,politicalOpinions,religiousOrPhilosophicalBeliefs,tradeUnionMembership,genetic,biometric,health,sexLifeOrSexualOrientation|}",documentation:"GDPR Art. 9(1) special category of personal data."},{label:"pii criminal",insertText:"pii criminal",documentation:"Personal data relating to criminal convictions and offenses (GDPR Art. 10)."},{label:"validate",insertText:'validate\n ${1:not empty} message "${2:message}"',documentation:"Validation rules that travel with the value everywhere it appears."}],Nm=[{label:"file",insertText:"file ${1:Path}",documentation:"Names the repository relative file this declaration is realized by, so the document can be navigated back to the code."},{label:"description",insertText:'description "${1:what this shape represents}"',documentation:"A human-readable description of the type."},{label:"property",insertText:"${1:property} ${2:Type}",documentation:"A property of the type \u2014 a name and a type reference."}],no=[rt,...gt,{label:"operation",insertText:"operation ${1:Name}\n uses ${2:System}\n ${3:input} ${4:Type}",documentation:"Reusable slice-owned operation intent; not admitted by any supported executable model (ESM) version yet."},{label:"file",insertText:"file ${1:Path}",documentation:"Names the repository relative file this declaration is realized by, so the document can be navigated back to the code."},{label:"event",insertText:"event ${1:Name}\n ${2:property} ${3:Type}",documentation:"Declares an event type \u2014 an immutable, past-tense fact."},{label:"event generation",insertText:"event ${1:Name} generation ${2:2}\n ${3:property} ${4:Type}",documentation:"Declares a complete numbered event generation; start at 1 and do not skip a number."},{label:"command",insertText:"command ${1:Name}\n ${2:property} ${3:Type}",documentation:"Declares a command \u2014 an imperative intent that produces events."},{label:"query",insertText:"query ${1:Name} => ${2:ReadModel}",documentation:"Declares a read-side entry point mapping to a return type."},{label:"query observable",insertText:"query ${1:Name} => observable ${2:ReadModel}",documentation:"Declares a live read \u2014 the query keeps pushing as the read model changes, instead of answering once."},{label:"readmodel",insertText:"readmodel ${1:Name}\n ${2:property} ${3:Type}",documentation:"Declares the shape of a read model \u2014 its properties \u2014 that a projection, reducer or query fills and returns."},{label:"reducer",insertText:"reducer ${1:Name} => ${2:ReadModel}\n on ${3:EventType}\n ```csharp\n ${4}\n ```",documentation:"Declares a reducer building a read model from events with imperative code, for what a projection cannot express."},{label:"specification",insertText:"specification ${1:Name}\n given ${2:EventType}\n when ${3:Command}\n then ${4:EventType}",documentation:"Given/when/then acceptance criteria for the slice."},{label:"projection",insertText:"projection ${1:Name} => ${2:ReadModel}\n from ${3:EventType}",documentation:"Declares how events project into a read model (PDL)."},{label:"capture",insertText:"capture ${1:Name}\n source ${2:api}",documentation:"Declares a change data capture converting external data into events (CDL)."},{label:"reaction",insertText:"reaction ${1:Name}\n when ${2:Trigger}",documentation:"Declares behavior that runs when something happens."},{label:"screen",insertText:"screen ${1:Name}\n data ${2:ReadModel} via query ${3:QueryName}",documentation:"Declares a UI screen."},{label:"constraint",insertText:"constraint ${1:Name}\n unique ${2:property} on ${3:EventType}",documentation:"Declares a server-side rule enforced before events are committed."}],jm=[rt,{label:"property",insertText:"${1:property} ${2:Type}",documentation:"An input of the command \u2014 a name and a type reference."},{label:"produces operation",insertText:"produces operation ${1:Name}\n uses ${2:System}\n ${3:input} ${4:Type} = ${5:source}",documentation:"Declares ordered operation intent; not admitted by any supported executable model (ESM) version yet (PLAY0268)."},{label:"returns property",insertText:"returns @${1:property}",documentation:"Scalar response from a direct command property, only on acceptance. Executable as ESM v7."},{label:"returns block",insertText:"returns\n ${1:field} = ${2:property}",documentation:"Unnamed record response with inferred or explicit field types, only on acceptance. Executable as ESM v7."},{label:"produces event",insertText:"produces event ${1:Name}\n ${2:property} ${3:Type} = ${4:source}",documentation:"Declares a slice-owned generation-1 event and maps its properties. An omitted for uses the command identifier."},{label:"identifier property",insertText:"${1:property} ${2:Type} identifier",documentation:"Marks the property a runtime resolves the event source id from. At most one per command."},{label:"authorize",insertText:"authorize ${1:PolicyName}",documentation:"References the policies that must pass for the command to execute."},{label:"reads",insertText:"reads ${1:View} by ${2:property}",documentation:"Declares a view the command consults. Executable binding is not yet supported."},{label:"reads as",insertText:"reads ${1:View} as ${2:alias} by ${3:property}",documentation:"Names one instance of a view; every instance needs a unique alias when reading the same view more than once."},{label:"validate",insertText:'validate\n ${1:property} not empty message "${2:message}"',documentation:"Declarative validation rules with messages."},{label:"validate csharp",insertText:`validate
7
+ \`\`\``,"fenced"),Tm=[...gt,{label:"eventsource",insertText:"eventsource ${1:Name}\n identifier ${2:Type}\n stream ${3:Name}",documentation:"Application-owned source with nested streams, admitted by ESM v8. Pin the stored name before renaming a source with stored events; Default is reserved."},{label:"system",insertText:'system ${1:Name}\n description "${2:external system}"',documentation:"Application-scoped external system; not admitted by any supported executable model (ESM) version yet."},{label:"import",insertText:"import ${1:Module}.${2:Type}",documentation:"Imports a type from another module by its qualified name."},{label:'import "\u2026"',insertText:'import "${1:**/*.play}"',documentation:"Imports other `.play` files by path or glob, relative to this file's folder, as whole documents of the application."},{label:"concept",insertText:"concept ${1:Name} : ${2|Uuid,String,Int,Decimal,Bool,Date,DateTime|}",documentation:"Declares a formalized value type wrapping a primitive."},{label:"concept (enum)",insertText:"concept ${1:Name} : Enum\n ${2:value}",documentation:"Declares an enumeration concept with a fixed set of values."},{label:"concept (pii with reason)",insertText:'concept ${1:Name} : ${2|String,Uuid,Int,Decimal,Bool,Date,DateTime|} pii\n pii reason "${3:why this value is personal data}"',documentation:"Declares a personal-data concept together with the reason it is personal data."},{label:"type",insertText:"type ${1:Name}\n ${2:property} ${3:Type}",documentation:"Declares a composite value type \u2014 a named shape built from several properties."},{label:"policy",insertText:"policy ${1:Name}\n require ${2:authenticated}",documentation:"Declares a named authorization rule for commands and queries."},{label:"module",insertText:"module ${1:Name}\n ",documentation:"Declares the top-level namespace \u2014 maps to a bounded context."},{label:"domain",insertText:"domain ${1:Name}",documentation:"The domain the file belongs to \u2014 optional, at most one per file, before everything else."},{label:"persona",insertText:'persona ${1:Name}\n description "${2:who they are}"',documentation:"A named role interacting with the application, with the policies it holds."},{label:"authentication",insertText:"authentication\n provider ${1:Name}\n ${2:setting} ${3:value}",documentation:"Declares the identity providers of the application \u2014 at most one block per file."},{label:"seed",insertText:"seed\n for ${1:EventSourceId}\n ${2:EventType}",documentation:"Declares events to seed into the event store per event source id."},{label:"layout",insertText:"layout ${1:Name}\n ${2:slot}",documentation:"Declares the application shell with named slots."},{label:"theme",insertText:"theme ${1:Name}\n compatible with ${2:Package}",documentation:"Declares a theme and the component packages it is compatible with."},{label:"ui profile",insertText:"ui profile ${1:Name}\n target platform ${2:web}\n layout ${3:Layout}\n theme ${4:Theme}",documentation:"Binds a target platform and size to a layout, theme and component packages."},{label:"behavior",insertText:"behavior ${1:Name}\n on ${2:click}\n ${3:execute command}",documentation:"A named interaction wiring, attached to a screen, form or dialog with `uses`."},{label:"trigger",insertText:"trigger ${1:Name}\n ${2:property} ${3:Type}",documentation:"Declares an integration signal a reaction can run on."}],Rm=[{label:"uses",insertText:"uses ${1:System}",documentation:"Exactly one application-scoped external system."},{label:"description",insertText:'description "${1:intent}"',documentation:"Describes operation intent, without requiring code."},{label:"input",insertText:"${1:input} ${2:Type}",documentation:"Typed operation input; no identifier or generated modifier."},{label:"execute",insertText:'execute\n description "${1:effect}"',documentation:"Optional execution intent; not admitted by any supported executable model (ESM) version yet."},{label:"compensate",insertText:'compensate\n description "${1:undo intent}"',documentation:"Optional compensation intent; not admitted by any supported executable model (ESM) version yet."}],Rs=[{label:"hint",insertText:'hint "${1:implementation guidance}"',documentation:"Ordered authoring guidance; not an executable implementation role."},{label:"file",insertText:"file ${1:Path}",documentation:"Selects the phase\u2019s sole source attachment."},...["csharp","typescript","react","html","sql"].map(t=>({label:t,insertText:be(t),documentation:"Selects the phase\u2019s sole inline source; not admitted by any supported executable model (ESM) version yet."}))],Dm=[{label:"description",insertText:'description "${1:phase intent}"',documentation:"A description-only phase is valid, pending intent."},{label:"implementation",insertText:'implementation\n hint "${1:guidance}"',documentation:"Hints with optional source; phase owns File/Code, wrapper owns hints only."},...Rs.filter(t=>t.label!=="hint")],Mm=[{label:"file",insertText:"file ${1:Path}",documentation:"Names the repository relative file this declaration is realized by, so the document can be navigated back to the code."},{label:"pii reason",insertText:'pii reason "${1:why this value is personal data}"',documentation:"A free-text concept note, not a lawful basis."},{label:"secret reason",insertText:'secret reason "${1:why this value is an operational secret}"',documentation:"Records why the secret marker applies."},{label:"secret scope",insertText:"secret scope ${1|subject,namespace,global|}",documentation:"Explicit encryption scope; omitted scope keeps Chronicle\u2019s Subject default."},{label:"pii special",insertText:"pii special ${1|racialOrEthnicOrigin,politicalOpinions,religiousOrPhilosophicalBeliefs,tradeUnionMembership,genetic,biometric,health,sexLifeOrSexualOrientation|}",documentation:"GDPR Art. 9(1) special category of personal data."},{label:"pii criminal",insertText:"pii criminal",documentation:"Personal data relating to criminal convictions and offenses (GDPR Art. 10)."},{label:"validate",insertText:'validate\n ${1:not empty} message "${2:message}"',documentation:"Validation rules that travel with the value everywhere it appears."}],Nm=[{label:"file",insertText:"file ${1:Path}",documentation:"Names the repository relative file this declaration is realized by, so the document can be navigated back to the code."},{label:"description",insertText:'description "${1:what this shape represents}"',documentation:"A human-readable description of the type."},{label:"property",insertText:"${1:property} ${2:Type}",documentation:"A property of the type \u2014 a name and a type reference."}],no=[rt,...gt,{label:"operation",insertText:"operation ${1:Name}\n uses ${2:System}\n ${3:input} ${4:Type}",documentation:"Reusable slice-owned operation intent; not admitted by any supported executable model (ESM) version yet."},{label:"file",insertText:"file ${1:Path}",documentation:"Names the repository relative file this declaration is realized by, so the document can be navigated back to the code."},{label:"event",insertText:"event ${1:Name}\n ${2:property} ${3:Type}",documentation:"Declares an event type \u2014 an immutable, past-tense fact."},{label:"event generation",insertText:"event ${1:Name} generation ${2:2}\n ${3:property} ${4:Type}",documentation:"Declares a complete numbered event generation; start at 1 and do not skip a number."},{label:"command",insertText:"command ${1:Name}\n ${2:property} ${3:Type}",documentation:"Declares a command \u2014 an imperative intent that produces events."},{label:"query",insertText:"query ${1:Name} => ${2:ReadModel}",documentation:"Declares a read-side entry point mapping to a return type."},{label:"query observable",insertText:"query ${1:Name} => observable ${2:ReadModel}",documentation:"Declares a live read \u2014 the query keeps pushing as the read model changes, instead of answering once."},{label:"readmodel",insertText:"readmodel ${1:Name}\n ${2:property} ${3:Type}",documentation:"Declares the shape of a read model \u2014 its properties \u2014 that a projection, reducer or query fills and returns."},{label:"reducer",insertText:"reducer ${1:Name} => ${2:ReadModel}\n on ${3:EventType}\n ```csharp\n ${4}\n ```",documentation:"Declares a reducer building a read model from events with imperative code, for what a projection cannot express."},{label:"specification",insertText:"specification ${1:Name}\n given ${2:EventType}\n when ${3:Command}\n then ${4:EventType}",documentation:"Given/when/then acceptance criteria for the slice."},{label:"projection",insertText:"projection ${1:Name} => ${2:ReadModel}\n from ${3:EventType}",documentation:"Declares how events project into a read model (PDL)."},{label:"capture",insertText:"capture ${1:Name}\n source ${2:api}",documentation:"Declares a change data capture converting external data into events (CDL)."},{label:"reaction",insertText:"reaction ${1:Name}\n when ${2:Trigger}",documentation:"Declares behavior that runs when something happens."},{label:"screen",insertText:"screen ${1:Name}\n data ${2:ReadModel} via query ${3:QueryName}",documentation:"Declares a UI screen."},{label:"constraint",insertText:"constraint ${1:Name}\n unique ${2:property} on ${3:EventType}",documentation:"Declares a server-side rule enforced before events are committed."}],jm=[rt,{label:"property",insertText:"${1:property} ${2:Type}",documentation:"An input of the command \u2014 a name and a type reference."},{label:"produces operation",insertText:"produces operation ${1:Name}\n uses ${2:System}\n ${3:input} ${4:Type} = ${5:source}",documentation:"Declares ordered operation intent; not admitted by any supported executable model (ESM) version yet (PLAY0268)."},{label:"returns property",insertText:"returns @${1:property}",documentation:"Scalar response from a direct command property, only on acceptance. Executable as ESM v7."},{label:"returns block",insertText:"returns\n ${1:field} = ${2:property}",documentation:"Unnamed record response with inferred or explicit field types, only on acceptance. Executable as ESM v7."},{label:"produces event",insertText:"produces event ${1:Name}\n ${2:property} ${3:Type} = ${4:source}",documentation:"Declares a slice-owned generation-1 event and maps its properties. An omitted for uses the command identifier."},{label:"identifier property",insertText:"${1:property} ${2:Type} identifier",documentation:"Marks the property a runtime resolves the event source id from. At most one per command."},{label:"authorize",insertText:"authorize ${1:PolicyName}",documentation:"References the policies that must pass for the command to execute."},{label:"reads",insertText:"reads ${1:View} by ${2:property}",documentation:"Declares a view the command consults. Executable binding is not yet supported."},{label:"reads as",insertText:"reads ${1:View} as ${2:alias} by ${3:property}",documentation:"Names one instance of a view; every instance needs a unique alias when reading the same view more than once."},{label:"validate",insertText:'validate\n ${1:property} not empty message "${2:message}"',documentation:"Declarative validation rules with messages."},{label:"validate csharp",insertText:`validate
8
8
  ${be("csharp")}`,documentation:"Imperative validation in C#, yielding the message of every rule the artifact breaks."},{label:"produces",insertText:"produces ${1:EventType}\n ${2:property} = ${3:source}",documentation:"Declares the event the command emits, with property mappings."},{label:"produces when",insertText:"produces when ${1:condition}\n ${2:EventType}\n ${3:property} = ${4:source}",documentation:"Conditionally emits an event when the condition holds."},{label:"description",insertText:'description "${1:what the command asks for}"',documentation:"A human-readable description."},{label:"concurrency",insertText:"concurrency\n ${1|eventSource,sourceType,streamType,streamId,events|}",documentation:"The scope of the concurrency check made when the command appends events."},{label:"handler",insertText:`handler
9
9
  `,documentation:"Fully imperative command implementation \u2014 file reference or inline C#, instead of produces."}],Ds=[{label:"property",insertText:"${1:property} ${2:Type}",documentation:"A property of the event \u2014 a name and a type reference."},{label:"description",insertText:'description "${1:what happened}"',documentation:"Authoring metadata, as one line or a text/markdown fence."},{label:"documentation",insertText:"documentation\n ```markdown\n ${1:Details}\n ```",documentation:"Authoring-only Markdown documentation."},{label:"id",insertText:'id "${1:OldName}"',documentation:"Preserves a previous persisted event name after a rename. Leave absent for new events."},{label:"tag",insertText:"tag ${1:audit}",documentation:"An event-type tag stamped on every occurrence."}],Lm=[...Ds,{label:"for",insertText:"for ${1:identifier}",documentation:"Explicitly names the command identifier used as the event source."},{label:"property mapping",insertText:"${1:property} ${2:Type} = ${3:source}",documentation:"Declares and maps an event property on one line."}],qm=[{label:"when",insertText:"when ${1:condition}",documentation:"Guards the produced event with a condition."}],Bm=[{label:"hint",insertText:'hint "${1:implementation guidance}"',documentation:"Ordered nonblank guidance for a handler implementation. Not an execution guarantee."},{label:"file",insertText:"file ${1:Path}",documentation:"Selects one existing model-relative attachment."},...["csharp","typescript","react","html","sql"].map(t=>({label:t,insertText:be(t),documentation:"Selects one inline payload. Handler execution remains unsupported."}))],Fm=[{label:"implementation",insertText:'implementation\n hint "${1:implementation guidance}"',documentation:"Handler-only implementation intent with optional file or tagged fence. With no payload it is pending."},{label:"file",insertText:"file ${1:Path}",documentation:"Delegates the command implementation to an external C# file."},{label:"csharp",insertText:be("csharp"),documentation:"Inline C# returning the events to append."}],Ym=[{label:"description",insertText:'description "${1:what this query is trying to accomplish}"',documentation:"What the query is for, in prose \u2014 what a generator or reviewer works from."},{label:"by",insertText:"by ${1:param} ${2:Type}",documentation:"Declares the identifying parameter of the query."},{label:"filter",insertText:"filter ${1:param} ${2:Type} optional",documentation:"Declares an optional filter parameter supplied by the caller."},{label:"filter from context",insertText:"filter ${1:param} ${2:Type} from $context.${3|tenant,causedBy.subject,occurred|}",documentation:"Declares a parameter filled from the query context instead of the caller."},{label:"authorize",insertText:"authorize ${1:PolicyName}",documentation:"References the policies that must pass for the query to execute."},{label:"performer",insertText:`performer
10
10
  `,documentation:"The code that performs the query \u2014 a file reference or an inline csharp/sql block."}],Um=[{label:"file",insertText:"file ${1:Path}",documentation:"Delegates the query implementation to an external file."},{label:"csharp",insertText:be("csharp"),documentation:"Inline C# returning the query result, with the QueryContext in scope as context."},{label:"sql",insertText:be("sql"),documentation:"Inline SQL returning the query result."}],Wm=[{label:"unique",insertText:"unique ${1:property} on ${2:EventType}",documentation:"Enforces a unique property value across an event type."},{label:"unique event",insertText:"unique event ${1:EventType}",documentation:"Enforces that the event type occurs at most once per event source."},{label:"file",insertText:"file ${1:Path}",documentation:"Delegates the constraint to a custom C# implementation."}],zm=[rt,{label:"description",insertText:'description "${1:what this reaction does}"',documentation:"What the reaction does \u2014 a complete statement of intent before any code exists."},{label:"when",insertText:"when ${1:Trigger}",documentation:"An event, a declared trigger or a host signal that sets the reaction off. A trigger needs no body."},{label:"every",insertText:"every ${1:15} ${2|seconds,minutes,hours,days|}",documentation:"Runs the reaction on an interval."},{label:"at",insertText:"at ${1:08:00}",documentation:"Runs the reaction at a time of day \u2014 every day unless narrowed with `on <Weekday>` or `on day <n>`."},{label:"where",insertText:"where ${1:condition}",documentation:"Narrows which occurrences actually run the reaction."}],Vm=[{label:"reads",insertText:"reads ${1:View}",documentation:"The view this trigger consults. Optionally use `as <alias> by <trigger value>`; clock triggers take no values and cannot use `by`."},{label:"description",insertText:'description "${1:what this reaction does}"',documentation:"What this particular reaction does \u2014 enough on its own, with no file to point at."},{label:"produces",insertText:"produces ${1:EventType}",documentation:"An event the reaction appends."},{label:"invokes",insertText:"invokes ${1:Command}",documentation:"A command the reaction hands on. A command is asked for, not produced \u2014 it may still be rejected."},{label:"file",insertText:"file ${1:Path}",documentation:"Delegates the reaction to an external C# file."},{label:"csharp",insertText:be("csharp"),documentation:"Inline C# returning event side effects."}],ot="Syntax-only; reaction refusal handling and redelivery are not yet executable (PLAY0268).",Qm=[{label:"on refused",insertText:`on refused
@@ -30,4 +30,4 @@ Authored fixture values, not execution results. Matching is unchanged.`:"**Ambig
30
30
  `)[T.location.line-1];return M?.locations.some(F=>F.line===0)&&q!==void 0&&X(q)===0}),S=v.diagnostics.filter(T=>T.location.path===i).flatMap(T=>(P(T.location),T.location.line>0?[T]:[])),b=new se(v.value),k=new Set(b.slices.flatMap(({slice:T})=>[...T.commands.flatMap(M=>M.produces),...T.reactions.flatMap(M=>M.triggers).flatMap(M=>M.produces)].filter(M=>M.location.path===i&&!b.isEventProduction(M,T)).map(M=>M.location.line-1)));for(let T of S)T.code==="PLAY0499"&&k.add(T.location.line-1);let E=b.declarations.filter(T=>T.kind===ie.Operation).map(T=>({...T.node,scope:T.scope.filter(M=>!u.has(M))})),O=new Map,I=ke(t),R=l(T=>{let M=[],q=X(t[T]);for(let F=T;F<t.length&&!(F>T&&!I[F]&&Me(t[F]).trim()&&X(t[F])<=q);F++)M.push(F);return M},"range");for(let{slice:T,scope:M}of b.slices){if(T.location.path===i&&T.location.line>0)for(let q of R(T.location.line-1))O.set(q,{scope:M});for(let q of T.specifications.filter(F=>F.location.path===i&&F.location.line>0))for(let F of R(q.location.line-1))O.set(F,{scope:M});for(let q of T.commands.filter(F=>F.location.path===i&&F.location.line>0))for(let F of R(q.location.line-1))O.set(F,{scope:M,commandLine:q.location.line-1})}let N=new Map(b.declarations.map(T=>[T.node.location,T.scope]));for(let T of E.filter(M=>M.location.path===i)){let M=N.get(T.location);for(let q of R(T.location.line-1))O.set(q,{...O.get(q),scope:M,operation:T})}let j=new Map(E.map(T=>[T.location,T])),B=l((T,M)=>{let q=Me(t[T.line-1]??""),F=q.slice(T.column-1).match(/^(?:given\s+operation|then\s+(?:operation|compensated))\s+/)?.[0];return F&&q.slice(T.column-1+F.length,T.column-1+F.length+M.length)===M?{...T,column:T.column+F.length}:T},"referenceLocation"),L=[];for(let{slice:T}of b.slices){for(let M of T.commands)for(let q of M.produces){if(q.location.path!==i)continue;let F=b.resolve(q.event,T),it=F.declaration?j.get(F.declaration.node.location)??null:null,bt={name:q.event,location:q.location,targetLocation:q.targetLocation??q.location,kind:F.kind,declaration:it,mappings:q.mappings};if(L.push(bt),F.kind===ie.Operation)for(let Sn of R(q.location.line-1)){let Jr=O.get(Sn);Jr&&O.set(Sn,{...Jr,production:bt})}}for(let M of T.specifications)for(let q of[...M.givenOperationFailures??[],...M.thenOperations??[],...M.thenCompensated??[]]){if(q.location.path!==i)continue;let F=b.resolve(q.operation,T);L.push({name:q.operation,location:q.location,targetLocation:B(q.location,q.operation),kind:F.kind,declaration:F.declaration?j.get(F.declaration.node.location)??null:null,mappings:[]})}}let W={declarations:E,systems:v.value.systems??[],references:L,contexts:O,types:v.value.types,concepts:v.value.concepts,targets:l(T=>{let M=b.slices.find(q=>q.scope.length===T.length&&q.scope.every((F,it)=>F===T[it]))?.slice;return M?E.flatMap(q=>{let F=b.resolve(q.name,M).declaration?.node.location===q.location?q.name:[...q.scope,q.name].join(".");return b.resolve(F,M).kind===ie.Operation&&b.resolve(F,M).declaration?.node.location===q.location?[{name:F,declaration:q}]:[]}):[]},"targets")},z=v.physicalEventSources.map(T=>T.source),G=new Bt(v.physicalEventSources,v.sourceInventoryComplete&&!A),V=new Map,Z=l((T,M)=>{let q=JSON.stringify([T,M]),F=V.get(q);return F||(F=G.resolve(T,M),V.set(q,F)),{...F,source:F.state==="unique"?F.sources[0]:void 0,stream:F.state==="unique"?F.streams[0]:void 0}},"resolve"),ue=new Set(v.value.imports.map(T=>T.qualifiedName)),Pe=z.flatMap(T=>T.streams.filter(M=>Z(T.name,M.name).state==="unique"&&!ue.has(`${T.name}.${M.name}`)).map(M=>({name:`${T.name}.${M.name}`,source:T,stream:M}))),Y=new Map,oe=[];for(let T of $.values()){for(let M of R(T.location.line-1))Y.set(M,{command:T});for(let M of[...T.produces,...T.validations,...T.handler?[T.handler]:[]])for(let q of R(M.location.line-1))Y.delete(q);if(T.stream){oe.push(T.stream);for(let M of R(T.stream.location.line-1))Y.set(M,{command:T,route:T.stream})}}let de=gs(v.value,i,t,R,u,v.diagnostics),$e=[...[...C.values()].flatMap(T=>[...T.given.map(M=>({event:M,expectation:!1})),...T.whenAppended?[{event:T.whenAppended,expectation:!1}]:[],...T.thenEvents.map(M=>({event:M,expectation:!0})),...T.whenRedelivered?[{event:T.whenRedelivered,expectation:!0}]:[]]),...(de.eventExamples??[]).map(T=>({event:T,expectation:!0}))];for(let T of $e){let M=T.event;for(let q of R(M.location.line-1))Y.set(q,T);if(M.stream){oe.push(M.stream);for(let q of R(M.stream.location.line-1))Y.set(q,{...T,route:M.stream})}}for(let T of z.filter(M=>M.location.path===i)){for(let M of R(T.location.line-1))Y.set(M,{source:T});for(let M of T.streams)for(let q of R(M.location.line-1))Y.set(q,{source:T,stream:M})}let ht=[...$.values()].flatMap(T=>T.streamCandidates??[]).filter(T=>T.propertyCandidate!==null),St={declarations:z,routes:oe,ambiguousCandidates:ht,contexts:Y,targets:Pe,resolve:Z},pe;return{commands:$,specifications:C,diagnostics:S,operationProductionLines:k,operations:W,eventSources:St,examples:de,dependencies:{completions(T,M,q){if(pe===void 0){let F=Xe(h.source,i,h.placement,!1).value,it=l(bt=>{P(bt.location),bt.features.forEach(it)},"remapDependencyHeaders");F.modules.forEach(it),pe=xs(v.value,F,i,R,u)}return pe.completions(T,M,q)}}}}l(xu,"analyze");function Yt(t,e=[],n,i="current.play",r=!0){let o=JSON.stringify([t,e,n,i,r]),s=un.get(o);return s===void 0&&(s=xu(t,e,n,i,r),un.size>=16&&un.delete(un.keys().next().value),un.set(o,s)),s}l(Yt,"responseAnalysis");var Vr="file",vu=/^[A-Za-z_]\w*(?:\[\])?(?:\?|\s+optional)?$/,$u=/^(?:[/\\]|[A-Za-z]:[/\\]|~[/\\])/;function ZO(t){return $u.test(t)}l(ZO,"isAbsoluteFileReferencePath");function ku(t){let e=!1,n=!1;for(let i=0;i<t.length;i++){let r=t[i];if(r==="\\"&&e&&i+1<t.length)i++;else if(r==='"'&&!n)e=!e;else if(r==="`"&&!e)n=!n;else if(!e&&!n&&r==="/"&&t[i+1]==="/")return t.slice(0,i)}return t}l(ku,"withoutComment");function Qr(t,e){let n=X(t),i=ku(t.slice(n)).trimEnd();if(Mi(i)!==Vr)return;let r=i.slice(Vr.length),o=r.trim();if(o.length===0||vu.test(o))return;let s=r.length-r.trimStart().length,a=n+Vr.length+s+1;return{path:o,line:e,startColumn:a,endColumn:a+o.length}}l(Qr,"fileReferenceOn");function KO(t){let e=ke(t),n=[];for(let i=0;i<t.length;i++){if(e[i])continue;let r=Qr(t[i],i);r&&n.push(r)}return n}l(KO,"fileReferences");function mt(t){let e=!1;return t.map(n=>{if(e)return n.trim()==="```"&&(e=!1),n;let i=Me(n);return/^\s*```(?:[a-z]+)?\s*$/.test(i)&&(e=!0),i.trimEnd()})}l(mt,"eventAnalysisSource");var bu=/^concept\s+(\w+)\s*:\s*(\w+)((?:\s+@\w+)*)\s*$/,Eu=/^\s*(@?[a-z_]\w*)\s+([\w.]+(?:\[\])?(?:\?|\s+optional)?)(\s+generated)?(\s+identifier)?\s*$/,vs=/^([a-z_]\w*)\s+reason\s+"((?:[^"\\]|\\.)*)"\s*$/,Cu=/^\s*reads\s+([A-Z]\w*)(?:\s+as\s+([a-z_]\w*))?(?:\s+by\s+([a-z_]\w*))?\s*$/,Pu=["authorize","produces","reads"],Au=/^(?:(?:or|and)\s+)?[A-Za-z_(][\p{L}\p{Mn}\p{Nd}\p{Pc}\s()]*$/u,wu=tn,Ou=["tag","for","generation","origin","namespace","sequence","correlation","causation","causedBy","occurred"],Iu=/^\s*(?:by|filter)\s+([a-z_]\w*)\s+([\w.]+(?:\[\])?(?:\?|\s+optional)?)(?:\s+from\s+.+)?\s*$/;function yt(t){return t.typeReference??Wt(t.type)}l(yt,"propertyTypeReference");function Gr(t,e){let n=t.slice(e-1).match(/^[\p{L}\p{Mn}\p{Nd}\p{Pc}.]+(?:\[\])?(?:\?|\s+optional\b)?/u)?.[0]??"";return{text:n,startColumn:e,endColumn:e+n.length}}l(Gr,"sourceTypeAt");function Zr(t,e,n){return e.map(i=>({index:i,match:t[i].match(Eu)})).filter(i=>i.match!==null).filter(({match:i})=>i[1].startsWith("@")||i[1]==="as"||!n.includes(i[1])).map(({index:i,match:r})=>({name:r[1].replace(/^@/,""),type:r[2],typeReference:Wt(r[2]),sourceType:Gr(t[i],t[i].match(/^\s*\S+\s+/)[0].length+1),isIdentifier:r[4]!==void 0,...r[3]!==void 0?{isGenerated:!0}:{},line:i}))}l(Zr,"propertiesIn");function yn(t,e,n,i){let r=[];for(let o=n+1;o<t.length;o++){if(e[o])continue;let s=t[o];if(s.trim().length!==0){if(X(s)<=i)break;r.push(o)}}return r}l(yn,"collectBody");function Ut(t,e,n,i){let r=yn(t,e,n,i).filter(a=>!e[a]&&!/^\s*(?:\/\/|#)/.test(t[a]));if(!/^\s*command\b/.test(t[n]))return r;let o,s=!1;return r.filter(a=>{let c=X(t[a]),p=t[a].trim();return o!==void 0&&c>o&&(!s||Au.test(p))?!1:(o=p!=="validate csharp"&&Zr(t,[a],Pu).length>0||/^description(?:\s|$)/.test(p)?void 0:c,s=/^authorize(?:\s|$)/.test(p),!0)})}l(Ut,"directBody");var mn=new Map;function hn(t){let e=t.join(`
31
31
  `),n=mn.get(e);if(n)return n;let i=Yt(t),r={authoringSources:[e],eventSources:i.eventSources.declarations,imports:[],concepts:[],types:[],policies:[],events:[],commands:[],queries:[],screens:[],triggers:[]};t=mt(t);let o=ke(t),s=t,a=o,c=t.map(p=>p.replace(/\s*=(?!=|>).*/,""));for(let p=0;p<t.length;p++){if(o[p])continue;let y=t[p],u=y.trim(),m=X(y),h=s[p].trim().match(/^import\s+([\w.]+)\s*$/);if(h&&m===0){let b=h[1],k=b.split(".").pop()??b;r.imports.push({qualifiedName:b,shortName:k,line:p});continue}let g=u.match(bu);if(g){let b=yn(t,o,p,m).map(O=>t[O].trim()),k={};for(let O of b){let I=O.match(vs);I&&k[I[1]]===void 0&&(k[I[1]]=I[2])}let E=g[2]==="Enum"?b.filter(O=>!vs.test(O)):[];r.concepts.push({name:g[1],primitive:g[2],attributes:g[3].trim().split(/\s+/).filter(Boolean),attributeReasons:k,enumValues:E,line:p});continue}let v=u.match(/^type\s+(\w+)\s*$/);if(v){r.types.push({name:v[1],properties:Zr(t,yn(t,o,p,m),Xr),line:p});continue}let $=u.match(/^policy\s+(\w+)\s*$/);if($){let b=yn(t,o,p,m).filter(k=>!o[k]).map(k=>t[k].trim());r.policies.push({name:$[1],requires:b,line:p});continue}let C=s[p].trim().match(/^(?:produces\s+)?event\s+(\w+)(?:\s+generation\s+(\d+))?\s*$/);if(C){let b=u.startsWith("produces "),k=Ut(s,a,p,m),E=b?k:k.filter(O=>Qr(s[O],O)===void 0);r.events.push({name:C[1],...C[2]?{generation:Number(C[2])}:{},inline:b,properties:Zr(b?c:s,E,b?Ou:wu),line:p});continue}let x=i.commands.get(p);if(x){let b=Ut(t,o,p,m),k=b.filter(E=>/^\s*produces\b/.test(t[E])&&!i.operationProductionLines?.has(E));r.commands.push({name:x.name,properties:x.properties.map(E=>({name:E.name,type:`${E.type.name}${E.type.isCollection?"[]":""}${E.type.isOptional?" optional":""}`,typeReference:{name:E.type.name,isCollection:E.type.isCollection,isOptional:E.type.isOptional},sourceType:Gr(t[E.type.location.line-1],E.type.location.column),isIdentifier:E.isIdentifier||/\sidentifier\s*$/.test(t[E.location.line-1]),...E.isGenerated?{isGenerated:!0}:{},line:E.location.line-1})),response:x.response,productionHeaders:k,produces:k.flatMap(E=>{let O=s[E].trim(),I=/^produces\s+event\b/.test(O),R=/^produces\s+when\b/.test(O),N=R?Ut(s,a,E,X(s[E]))[0]:E;if(N===void 0)return[];let j=R?s[N].trim():O.match(I?/^produces\s+event\s+([A-Za-z_]\w*)(?:\s+generation\s+\d+)?\s*$/:/^produces\s+([A-Z]\w*)\s*$/)?.[1];if(j===void 0||!/^[A-Za-z_]\w*$/.test(j))return[];let B=Ut(s,a,N,X(s[N])),L=B.map(G=>s[G].trim().match(/^for(?:\s+(.*))?$/)).filter(G=>G!==null),W=L.length===0?void 0:L.length===1?L[0][1]??"":"",z=B.flatMap(G=>{let V=s[G].trim().match(I?/^(@?[a-z_]\w*)\s+[\w.]+(?:\[\])?(?:\?|\s+optional)?\s*=(?!=|>)\s*(.+)$/:/^(@?[\w.]+)\s*=(?!=|>)\s*(.+)$/);return V===null?[]:[{name:V[1].replace(/^@/,""),source:V[2],line:G}]});return[{name:j,inline:I,conditional:R,line:E,target:W,mappings:z}]}),reads:b.filter(E=>!o[E]).map(E=>({line:E,match:t[E].match(Cu)})).filter(E=>E.match!==null).map(({line:E,match:O})=>({view:O[1],...O[2]?{alias:O[2]}:{},...O[3]?{by:O[3]}:{},line:E})),line:p});continue}let P=u.match(/^query\s+(\w+)\s*=>\s*(?:observable\s+)?([\w.]+(?:\[\])?(?:\?|\s+optional)?)\s*$/);if(P){let b=yn(t,o,p,m).map(k=>({index:k,match:t[k].match(Iu)})).filter(k=>k.match!==null).map(({index:k,match:E})=>({name:E[1],type:E[2],typeReference:Wt(E[2]),sourceType:Gr(t[k],t[k].match(/^\s*(?:by|filter)\s+\S+\s+/)[0].length+1),isIdentifier:!1,line:k}));r.queries.push({name:P[1],returnType:P[2],returnTypeReference:Wt(P[2]),parameters:b,line:p});continue}let A=u.match(/^screen\s+(\w+)\s*$/);if(A){r.screens.push({name:A[1],line:p});continue}let S=u.match(/^trigger\s+(\w+)\s*$/);S&&m===0&&r.triggers.push({name:S[1],line:p})}return mn.size>=16&&mn.delete(mn.keys().next().value),mn.set(e,r),r}l(hn,"scanDocument");function wi(...t){return{authoringSources:t.flatMap(e=>e.authoringSources??[]),...t.some(e=>e.authoringDocuments)?{authoringDocuments:t.flatMap(e=>e.authoringDocuments??[])}:{},eventSources:t.flatMap(e=>e.eventSources??[]),imports:t.flatMap(e=>e.imports),concepts:t.flatMap(e=>e.concepts),types:t.flatMap(e=>e.types),policies:t.flatMap(e=>e.policies),events:t.flatMap(e=>e.events),commands:t.flatMap(e=>e.commands),queries:t.flatMap(e=>e.queries),screens:t.flatMap(e=>e.screens),triggers:t.flatMap(e=>e.triggers)}}l(wi,"mergeSymbols");function $s(t,e){let n=e?.authoringPath??"current.play",i=e?.authoringDocuments?.find(r=>r.path===n);return{...wi(hn(t),e??wi()),authoringDocuments:e?.authoringDocuments,authoringPath:n,authoringPlacement:e?.authoringPlacement??i?.placement,authoringPlacementResolved:e?.authoringPlacementResolved??i?.isPlacementResolved}}l($s,"symbolsForBuffer");function Oi(t){return[...t.events.map(e=>e.name),...t.imports.map(e=>e.shortName)]}l(Oi,"knownEventNames");var Tu=["Startup","Shutdown"];function dI(t){return[...Oi(t),...t.triggers.map(e=>e.name),...Tu]}l(dI,"knownTriggerNames");function Kr(t,e){return[...e,...t.concepts.map(n=>n.name),...t.types.map(n=>n.name),...t.imports.map(n=>n.shortName)]}l(Kr,"knownTypeNames");function _r(t){let e=t.properties.filter(o=>o.isIdentifier&&!yt(o).isOptional&&!yt(o).isCollection),n=e.length===1?e[0].name:void 0,i=t.produces??[],r=i.some(o=>o.target!==void 0&&o.target!==n)||i.some(o=>o.inline&&o.target===void 0)&&i.some(o=>!o.inline&&o.target===void 0);return{identifier:n,mixed:r}}l(_r,"productionDestinations");function gI(t,e){let n=Yt(t,e?.authoringDocuments??e?.authoringSources,e?.authoringPlacement,e?.authoringPath),i=mt(t);return hn(i).commands.map(r=>({...r,produces:r.produces?.filter(o=>!n.operationProductionLines?.has(o.line)&&n.operations.references.some(s=>s.location.line-1===o.line&&s.kind==="event")),productionHeaders:r.productionHeaders?.filter(o=>!n.operationProductionLines?.has(o))})).flatMap(r=>{let{identifier:o,mixed:s}=_r(r);if(s||r.productionHeaders?.length!==r.produces?.length)return[];let a=r.produces?.some(c=>c.target!==void 0||c.inline);return(r.produces??[]).flatMap(c=>c.target!==void 0||c.inline&&(o===void 0||/\bgeneration\b/.test(i[c.line]))?[]:!c.inline&&a?[]:[{line:c.line,column:i[c.line].length+1,label:c.inline?`for ${o}`:"for <new event source>"}])})}l(gI,"destinationHints");var H={unknownConceptDirective:"PLAY0010",attributeReasonWithoutAttribute:"PLAY0012",duplicateAttributeReason:"PLAY0013",legacyComplianceMarker:"PLAY0565",unknownComplianceMarker:"PLAY0566",invalidSecretScope:"PLAY0567",duplicateSecretScope:"PLAY0568",secretScopeIgnoredForPii:"PLAY0569",invalidPersonalDataQualifier:"PLAY0570",duplicateSpecialCategory:"PLAY0571",conflictingScreenDataBinding:"PLAY0530",screenDataQueryMismatch:"PLAY0531",actionWithoutInputSurface:"PLAY0532",commandWithoutInputSurface:"PLAY0533",readModelFieldWithoutOrigin:"PLAY0534",queryParameterNotHeldByView:"PLAY0535",unconsumedEvent:"PLAY0536",unreachableScreen:"PLAY0537",invalidActionAlternative:"PLAY0341",guardedActionWithoutAlternatives:"PLAY0342",misplacedActionOtherwise:"PLAY0343",unsupportedActionConditionOperand:"PLAY0344",unknownActionSubjectField:"PLAY0345",unresolvedActionSubject:"PLAY0346",unreachableActionAlternative:"PLAY0347",unknownActionArgumentProperty:"PLAY0348",invalidRefusalBranch:"PLAY0538",invalidRefusalBranchBody:"PLAY0539",unreachableRefusalBranch:"PLAY0540",invalidRefusalValue:"PLAY0541",unknownRefusalConstraint:"PLAY0542",unmatchedRedeliveredOccurrence:"PLAY0543",unknownRedeliveryReaction:"PLAY0544",invalidNoEventsExpectation:"PLAY0545",indeterminateNegatedClaimTarget:"PLAY0546",invalidAbsentReadModelStep:"PLAY0453",unknownConstraintProperty:"PLAY0391",invalidSpecificationExample:"PLAY0518",duplicateSpecificationAssignment:"PLAY0519",unknownReadModelProperty:"PLAY0514",piiNotSupportedOnIdentifier:"PLAY0515",invalidEventSourceDeclaration:"PLAY0503",invalidCommandStream:"PLAY0504",invalidSpecificationStream:"PLAY0547",specificationStreamOnCommand:"PLAY0548",invalidSpecificationStreamRoute:"PLAY0549",invalidSpecificationStreamEventSource:"PLAY0550",specificationStreamContradictsCommand:"PLAY0551",ambiguousCommandStream:"PLAY0505",unsupportedStreamIdType:"PLAY0506",redundantSourceStreamId:"PLAY0507",eventFromLaterSlice:"PLAY0516",timelineCycleGroup:"PLAY0517",invalidSpecificationExampleBody:"PLAY0526",undeclaredDependency:"PLAY0552",unusedDependencyDeclaration:"PLAY0553",invalidDependencyTarget:"PLAY0554",repeatedDependencyDeclaration:"PLAY0555",mutualDependencyDeclarations:"PLAY0556",authorizationRefusalWithoutIdentity:"PLAY0557",invalidDocumentation:"PLAY0558",conflictingDocumentationAcrossFiles:"PLAY0559",unsupportedInteractionAlternatives:"PLAY0560",mixedInteractionAlternatives:"PLAY0561",interactionAlternativeWithoutActions:"PLAY0562",inlineInteractionAlternative:"PLAY0563",legacyInteractionWhere:"PLAY0564",ambiguousReference:"PLAY0198",invalidImplementationBlock:"PLAY0492",invalidImplementationHint:"PLAY0493",conflictingImplementationSources:"PLAY0494",eventSourceIdInPayload:"PLAY0469",explicitProducesTargetsRequired:"PLAY0470",redundantEventId:"PLAY0471",invalidEventId:"PLAY0472",inlineEventCollision:"PLAY0473",inlineEventOutsideCommand:"PLAY0474",inlineEventGeneration:"PLAY0475",reservedProductionMetadata:"PLAY0476",invalidEventDocumentation:"PLAY0477",tabIndentation:"PLAY0006",unknownPrimitiveType:"PLAY0008",unknownSliceType:"PLAY0028",duplicateCommandIdentifier:"PLAY0036",unknownContextPath:"PLAY0153",unknownContextCausedByProperty:"PLAY0154",unknownContextIdentityProperty:"PLAY0155",unclosedCodeBlock:"PLAY0164",unknownType:"PLAY0165",unknownEvent:"PLAY0166",unknownPolicy:"PLAY0167",duplicateDeclaration:"PLAY0168",unknownEventContextMember:"PLAY0295",unknownEventContextPath:"PLAY0296",eventContextPathBelowCollection:"PLAY0297",missingEventContextPath:"PLAY0298",unresolvedDynamicKeySource:"PLAY0299",invalidFileImport:"PLAY0454",omittedProductionDestination:"PLAY0478",legacyOptionalSuffix:"PLAY0479",invalidOptionalModifierOrder:"PLAY0480",optionalReadsNotSupported:"PLAY0481",unavailableResponseExecution:"PLAY0268",generatedPropertyOutsideCommand:"PLAY0482",invalidGeneratedType:"PLAY0483",invalidGeneratedModifierOrder:"PLAY0484",generatedPropertyInput:"PLAY0485",invalidCommandResponse:"PLAY0486",invalidResponseSource:"PLAY0487",duplicateResponseField:"PLAY0488",invalidResponseShape:"PLAY0489",invalidGeneratedFixture:"PLAY0490",invalidReturnExpectation:"PLAY0491"};var Ru=/^import(\s+)"([^"\\]+)"\s*(?:\/\/.*)?$/,Du=/^import\s+"/;function bs(t){return Du.test(t.trim())}l(bs,"isFileImportLine");function Hr(t,e){let n=X(t),i=t.slice(n).match(Ru);if(!i)return;let r=n+6+i[1].length+2;return{pattern:i[2],line:e,startColumn:r,endColumn:r+i[2].length}}l(Hr,"fileImportOn");function bI(t){let e=ke(t),n=[];for(let i=0;i<t.length;i++){if(e[i])continue;let r=Hr(t[i],i);r&&n.push(r)}return n}l(bI,"fileImports");var ks=l(t=>t.split("/").slice(0,-1),"folderOf");function Mu(t,e){let n=e.split("/"),i=0;for(;i<t.length&&i<n.length-1&&t[i]===n[i];)i++;return[...t.slice(i).map(()=>".."),...n.slice(i)].join("/")}l(Mu,"relativeTo");function EI(t,e){let n=ks(t),i=new Set;for(let r of e.filter(o=>o!==t&&o.toLowerCase().endsWith(".play"))){let o=Mu(n,r),s=ks(o);i.add(o),i.add([...s,"*.play"].join("/"));for(let a=0;a<=s.length;a++)i.add([...s.slice(0,a),"**","*.play"].join("/"))}return[...i].sort()}l(EI,"importablePaths");var Nu=new Set(["namespace","sequence","correlation","causation","causedBy","occurred"]),ju=/^id\s+"((?:[^"\\]|\\.)*)"$/;function Es(t,e,n,i=new Set){t=mt(t);let r=[],o=ke(t),s=Lu(t,o),a=new Set(e.commands.flatMap(m=>m.productionHeaders??[])),c=new Map,p=new Set;for(let m of[e,n]){for(let h of m.events)c.set(h.name,(c.get(h.name)??0)+1);for(let h of m.imports)p.add(h.shortName)}let y=l((m,h,g,v="error")=>{r.push({line:m,startColumn:X(t[m])+1,endColumn:t[m].length+1,code:h,message:g,severity:v})},"report");for(let m of e.events){let h=Ut(t,o,m.line,X(t[m.line]));if(m.inline){let $=new Set;for(let C of m.properties)$.has(C.name)&&y(C.line,H.duplicateDeclaration,`Event '${m.name}' already declares property '${C.name}'.`),$.add(C.name);a.has(m.line)||y(m.line,H.inlineEventOutsideCommand,"Inline events can only be declared inside commands."),m.generation!==void 0&&y(m.line,H.inlineEventGeneration,"Inline events are generation 1; extract the event before declaring generations."),((c.get(m.name)??0)>1||p.has(m.name))&&y(m.line,H.inlineEventCollision,`Inline event '${m.name}' collides with another declaration or import.`)}let g=!1,v=!1;for(let $ of h){let C=t[$].trim(),x=C.split(/\s+/)[0];if(m.inline&&x==="generation"&&y($,H.inlineEventGeneration,"Inline events are generation 1; extract the event before declaring generations."),m.inline&&x==="origin"&&y($,H.reservedProductionMetadata,"An inline event is local to its command and cannot declare origin."),!/^(?:id|description|documentation)\s+[\w.]+(?:\[\])?(?:\?|\s+optional)?(?:\s*=.*)?$/.test(C)){if(x==="id"){let P=C.match(ju);g||P===null||P[1].trim().length===0?y($,H.invalidEventId,'Expected one nonempty id "<old-name>".'):P[1]===m.name&&y($,H.redundantEventId,"This id repeats the event name; remove it.","information"),g=!0}if(x==="documentation"){let P=$+1;for(;P<t.length&&t[P].trim().length===0;)P++;(v||C!=="documentation"||t[P]?.trim()!=="```markdown"||X(t[P])<=X(t[$])||!s.has(P))&&y($,H.invalidEventDocumentation,"Expected one nonempty fenced markdown documentation block."),v=!0}}}}let u=[];for(let m=0;m<t.length;m++){if(o[m]||t[m].trim().length===0)continue;let h=X(t[m]);for(;u.length>0&&u[u.length-1].indent>=h;)u.pop();let g=t[m].trim().split(/\s+/)[0];Nu.has(g)&&u.at(-1)?.event&&y(m,H.reservedProductionMetadata,`'${g}' is system-assigned production metadata.`),g==="produces"&&u.push({indent:h,event:!i.has(m)&&!/^\s*produces\s+operation\b/.test(t[m])})}for(let m of e.commands){let{identifier:h,mixed:g}=_r(m);for(let v of m.produces??[]){g&&v.target===void 0&&y(v.line,H.explicitProducesTargetsRequired,`Production '${v.name}' must state for explicitly when destinations differ.`);let $=v.target??(v.inline?h:void 0);if(!(h===void 0||$!==h))for(let C of v.mappings.filter(x=>x.source===h))y(C.line,H.eventSourceIdInPayload,`The payload copies '${h}', which already identifies the event source.`,v.inline?"warning":"information")}}return r}l(Es,"validateInlineEvents");function Lu(t,e){let n=new Set,i,r=!1;for(let o=0;o<t.length;o++){if(!e[o])continue;let s=t[o].trim();i===void 0?(i=o,r=!1):s==="```"?(r&&t[i].trim()==="```markdown"&&n.add(i),i=void 0):s.length>0&&(r=!0)}return n}l(Lu,"nonemptyMarkdownBlocks");function De(t,e,n,i,r,o){return{severity:t,message:r,line:e,startColumn:n,endColumn:n+i,code:o}}l(De,"issue");function Fe(t,e,n,i,r,o){let s=n.indexOf(i)+1;return De(t,e,s,i.length,r,o)}l(Fe,"tokenIssue");function qu(t,e,n){let i=[],r=new Set([...Kr(e,gn),...Kr(n,[])]),o=l((a,c)=>{for(let p of a.filter(y=>!r.has(yt(y).name))){let y=yt(p).name;i.push(De("warning",p.line,p.sourceType.startColumn,p.sourceType.text.length,y==="optional"?`Unknown type 'optional' on '${p.name}' of ${c} \u2014 did you forget the type before 'optional'?`:`Unknown type '${y}' on '${p.name}' of ${c} \u2014 declare it with 'concept ${y} : <Primitive>' or 'type ${y}'.`,H.unknownType))}},"checkProperties");for(let a of e.types)o(a.properties,`type '${a.name}'`);for(let a of e.events)o(a.properties,`event '${a.name}'`);for(let a of e.queries)o(a.parameters,`query '${a.name}'`);for(let a of e.commands){o(a.properties,`command '${a.name}'`);let c=a.properties.filter(p=>p.isIdentifier);for(let p of c.slice(1))i.push(Fe("error",p.line,t[p.line],"identifier",`Command '${a.name}' already marks '${c[0].name}' as identifier \u2014 only one property can be the identifier.`,H.duplicateCommandIdentifier))}let s=new Map;for(let a of[...e.concepts,...e.types]){if(s.get(a.name)===void 0){s.set(a.name,a.line);continue}i.push(Fe("error",a.line,t[a.line],a.name,`Duplicate declaration of '${a.name}' \u2014 concept and type names must be unique.`,H.duplicateDeclaration))}return i}l(qu,"validateDeclarations");function _I(t,e={}){let n=ke(t),i=hn(t),r=e.application??wi(),o=$s(t,{...r,authoringPath:e.path??r.authoringPath,authoringPlacement:e.placement??r.authoringPlacement}),s=Yt(t,o.authoringDocuments??o.authoringSources?.filter(k=>k!==t.join(`
32
32
  `)),o.authoringPlacement,o.authoringPath,o.authoringPlacementResolved),a=new Set(s.eventSources.routes.map(k=>k.location.line-1)),c={...i,commands:i.commands.map(k=>({...k,properties:k.properties.filter(E=>!a.has(E.line)),produces:k.produces?.filter(E=>!s.operationProductionLines?.has(E.line)),productionHeaders:k.productionHeaders?.filter(E=>!s.operationProductionLines?.has(E))}))},p=new Set([...Oi(c),...Oi(r)]),y=new Set([...c.policies,...r.policies].map(k=>k.name)),u=qu(t,c,r);u.push(...Bu(t,c));let m=new Set([d.LegacyOptionalSuffix,d.InvalidOptionalModifierOrder,d.OptionalReadsNotSupported]),h=new Set([d.UnexpectedTokenInPolicyCondition,d.ExpectedPolicyCondition,d.UnclosedPolicyConditionGroup,d.ExpectedRoleName,d.ExpectedClaimName,d.ExpectedClaimMatches,d.ExpectedClaimMatchTarget]),g=new Set([d.UnknownEvent,d.UnknownReadModelProperty,d.PiiNotSupportedOnIdentifier]),v=new Set([d.EventFromLaterSlice,d.TimelineCycleGroup]),$=new Set([d.UndeclaredDependency,d.UnusedDependencyDeclaration,d.InvalidDependencyTarget,d.RepeatedDependencyDeclaration,d.MutualDependencyDeclarations,d.AmbiguousReference]),C=new Set([d.UnsupportedInteractionAlternatives,d.MixedInteractionAlternatives,d.InteractionAlternativeWithoutActions,d.InlineInteractionAlternative,d.LegacyInteractionWhere,d.InvalidDocumentation,d.ConflictingDocumentationAcrossFiles,d.InvalidAbsentReadModelStep,d.UnknownConstraintProperty,d.OmittedProductionDestination,d.InvalidSpecificationExample,d.DuplicateSpecificationAssignment]),x=new Set([d.UnknownConceptDirective,d.AttributeReasonWithoutAttribute,d.DuplicateAttributeReason,d.LegacyComplianceMarker,d.UnknownComplianceMarker,d.InvalidSecretScope,d.DuplicateSecretScope,d.SecretScopeIgnoredForPii,d.InvalidPersonalDataQualifier,d.DuplicateSpecialCategory]),P=new Set;for(let k of e.compilerDiagnostics??s.diagnostics){if(!x.has(k.code)&&!m.has(k.code)&&!h.has(k.code)&&!g.has(k.code)&&!v.has(k.code)&&!$.has(k.code)&&!C.has(k.code)&&k.code!==d.InvalidSpecificationExampleBody&&k.code!==d.UnknownRuleImplementationDirective&&k.code!==d.InvalidValidationRule&&k.code!==d.RepeatedDeclarationAcrossFiles&&!/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$/.test(k.code))continue;let E=k.location.line-1;if(k.code===d.OmittedProductionDestination&&u.some(I=>I.code===k.code&&I.line===E))continue;k.code===d.UnknownEvent&&P.add(E);let O=Lr(t[E],k)||t[E].length-k.location.column+1;u.push(De(k.severity,E,k.location.column,O,k.message,k.code))}let A=l((k,E,O)=>{!p.has(O)&&!P.has(k)&&u.push(Fe("warning",k,E,O,`Unknown event type '${O}' \u2014 declare it in a slice or import it.`,H.unknownEvent))},"checkEvent"),S=-1;for(let k=0;k<t.length;k++){let E=t[k],O=E.trim();if(n[k]||O.length===0)continue;let I=E.match(/^[ ]*(\t+)/);if(I&&u.push(De("warning",k,I[0].length-I[1].length+1,I[1].length,"Screenplay is indentation-based \u2014 use spaces, not tabs.",H.tabIndentation)),S>=0){if(X(E)>S&&/^(?:or\s+)?[A-Z]\w*(?:\s+or\s+[A-Z]\w*)*$/.test(O)){for(let V of O.split(/\s+/).filter(Z=>Z!=="or"))y.has(V)||u.push(Fe("warning",k,E,V,`Unknown policy '${V}' \u2014 declare it with 'policy ${V}'.`,H.unknownPolicy));continue}S=-1}let R=Fu(t,n,k);R&&u.push(R);let N=O.match(/^slice\s+(\w+)/);N&&!Di.includes(N[1])&&u.push(Fe("error",k,E,N[1],`Unknown slice type '${N[1]}' \u2014 expected ${Di.join(", ")}.`,H.unknownSliceType));let j=O.match(/^concept\s+\w+\s*:\s*(\w+)/);j&&j[1]!=="Enum"&&!gn.includes(j[1])&&u.push(Fe("error",k,E,j[1],`Unknown primitive type '${j[1]}' \u2014 expected ${gn.join(", ")} or Enum.`,H.unknownPrimitiveType));let B=O.match(/^authorize\s+(.*)$/);if(B){S=X(E);for(let V of B[1].split(/\s+/).filter(Z=>Z!=="or"&&Z.length>0))y.has(V)||u.push(Fe("warning",k,E,V,`Unknown policy '${V}' \u2014 declare it with 'policy ${V}'.`,H.unknownPolicy))}let L=O.match(/^on\s+([A-Z]\w*)\s*$/);L&&A(k,E,L[1]);let W=O.match(/^produces\s+([A-Z]\w*)\s*$/);if(W&&!s.operationProductionLines?.has(k)&&A(k,E,W[1]),/^produces\s+when\b/.test(O)&&!s.operationProductionLines?.has(k))for(let V=k+1;V<t.length;V++){let Z=t[V];if(!(n[V]||Z.trim().length===0)){if(X(Z)>X(E)){let ue=Z.trim().match(/^([A-Z]\w*)\s*$/);ue&&A(V,Z,ue[1])}break}}let z=O.match(/^unique\s+event\s+([A-Z]\w*)/);z&&A(k,E,z[1]);let G=O.match(/^unique\s+[a-z_]\w*\s+on\s+([A-Z]\w*)/);G&&A(k,E,G[1]);for(let V of E.match(/\$context\.[\w.]+/g)??[]){let Z=V.substring(9).split(".");Ii.includes(Z[0])?Z[0]==="causedBy"&&Z.length>1&&!Ti.includes(Z[1])?u.push(Fe("warning",k,E,V,`Unknown $context.causedBy property '${Z[1]}' \u2014 expected ${Ti.join(", ")}.`,H.unknownContextCausedByProperty)):Z[0]==="identity"&&Z.length>1&&!Ri.includes(Z[1])&&u.push(Fe("warning",k,E,V,`Unknown $context.identity property '${Z[1]}' \u2014 expected ${Ri.join(", ")}.`,H.unknownContextIdentityProperty)):u.push(Fe("warning",k,E,V,`Unknown $context path '${Z.join(".")}' \u2014 expected one of ${Ii.join(", ")}.`,H.unknownContextPath))}}u.push(...Uu(t,n)),u.push(...Es(t,c,r,s.operationProductionLines));let b=t.map((k,E)=>({line:k,index:E})).filter(({line:k})=>/^\s*```(?:[a-z]+)?\s*$/.test(k));if(b.length%2===1){let k=b[b.length-1];u.push(De("error",k.index,1,k.line.length+1,"Unclosed inline code block \u2014 expected a closing ``` line.",H.unclosedCodeBlock))}return u}l(_I,"validateLines");function Bu(t,e){let n=[];t=mt(t);for(let i of e.commands){let r=i.properties.filter(o=>o.isIdentifier&&!yt(o).isOptional&&!yt(o).isCollection);if(r.length===1)for(let o of i.produces??[]){if(o.inline||o.conditional||o.target!==void 0)continue;let s=o.line;n.push(De("information",s,X(t[s])+1,t[s].trim().length,`Plain 'produces ${o.name}' omits its destination \u2014 use 'for ${r[0].name}' to explicitly select the command's identifier.`,H.omittedProductionDestination))}}return n}l(Bu,"validateProductionDestinations");function Fu(t,e,n){let i=t[n],r=i.trim().replace(/\s*\/\/.*$/,"");if(!/^import\b/.test(r)||Hr(i,n))return;let o=X(i);if(!(!(o>0&&["module","feature"].includes(eo(t,e,n,o)[0]))&&!bs(i)))return De("error",n,o+1,r.length,`Invalid import '${r}' \u2014 inside a module or feature, import names files: 'import "<path or glob>"'.`,H.invalidFileImport)}l(Fu,"validateImport");var Yu=/^(?:(?:increment|decrement|count|clear|add|subtract|set)\s+)?@?([$\w.]+)(?=\s|=|$)/;function Uu(t,e){let n=[],i=l(r=>r.map(o=>o.name).join(", "),"names");for(let r=0;r<t.length;r++){let o=t[r];if(e[r])continue;for(let c of o.matchAll(/(\.)?\$eventContext((?:\.(?:\w+(?:\(\))?)?)*)/g)){let p=c[0].substring(c[1]?.length??0),y=c[2];if(y.length===0){c[1]&&n.push(De("error",r,(c.index??0)+2,p.length,`'$eventContext' names no member - expected one of ${i(qi("").expected)}.`,H.missingEventContextPath));continue}let u=y.substring(1),m=qi(u),h=(c.index??0)+(c[1]?.length??0)+1;switch(m.status){case"missing":n.push(De("error",r,h,p.length,`'$eventContext.${u}' names no member - expected one of ${i(m.expected)}.`,H.missingEventContextPath));break;case"unknownMember":n.push(De("warning",r,h,p.length,`Unknown event context member '${m.segment}' in '$eventContext.${u}' - expected one of ${i(m.expected)}.`,H.unknownEventContextMember));break;case"unknownSubPath":{let g=m.expected.length===0?"no members to address":`members ${i(m.expected)}`;n.push(De("warning",r,h,p.length,`Unknown event context path '$eventContext.${u}' - '${m.member?.name}' (${m.member?.type}) has ${g}.`,H.unknownEventContextPath));break}case"belowCollection":n.push(De("error",r,h,p.length,`'$eventContext.${u}' cannot resolve - '${m.member?.name}' is a collection (${m.member?.type}) and cannot be addressed below.`,H.eventContextPathBelowCollection));break}}let s=o.trim().match(Yu)?.[1],a=s?.match(/\.\$(\w+)/)?.[1];s&&a&&a!=="eventContext"&&n.push(Fe("warning",r,o,s,`Dynamic dictionary key '$${a}' in '${s}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${a}' becomes the key.`,H.unresolvedDynamicKeySource))}return n}l(Uu,"validateEventContextPaths");export{Cs as a,Wu as b,zu as c,Xr as d,Vu as e,Ii as f,Ti as g,Di as h,gn as i,Qu as j,Ps as k,Gu as l,Ai as m,Wt as n,Ku as o,d as p,ye as q,Qi as r,wn as s,KC as t,_C as u,Me as v,X as w,Mi as x,ke as y,eo as z,Ju as A,Xu as B,mt as C,Ni as D,ji as E,Li as F,As as G,rm as H,om as I,am as J,ws as K,Os as L,um as M,mm as N,ym as O,hm as P,Sm as Q,gm as R,xm as S,vm as T,$m as U,km as V,bm as W,Ts as X,Em as Y,Im as Z,Tm as _,Rm as $,Rs as aa,Dm as ba,Mm as ca,Nm as da,jm as ea,Ds as fa,Lm as ga,qm as ha,Bm as ia,Fm as ja,Ym as ka,Um as la,Wm as ma,zm as na,Vm as oa,Qm as pa,Gm as qa,Zm as ra,Km as sa,io as ta,Ms as ua,_m as va,Hm as wa,Jm as xa,Xm as ya,ey as za,Ns as Aa,ty as Ba,js as Ca,ny as Da,iy as Ea,ry as Fa,oy as Ga,ay as Ha,zO as Ia,Yt as Ja,Vr as Ka,ZO as La,Qr as Ma,KO as Na,yt as Oa,Ut as Pa,hn as Qa,wi as Ra,$s as Sa,Oi as Ta,Tu as Ua,dI as Va,Kr as Wa,_r as Xa,gI as Ya,H as Za,bs as _a,Hr as $a,bI as ab,EI as bb,_I as cb,Uu as db};
33
- //# sourceMappingURL=chunk-6AH7HSFP.js.map
33
+ //# sourceMappingURL=chunk-3GABJIEP.js.map