@cratis/screenplay-language 4.116.0 → 4.118.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 Sl="screenplay",ry={id:Sl,extensions
4
4
  column
5
5
  \${1:slot}`,documentation:"How the slots are placed."}],Uy=[{label:"fits slot",insertText:"fits slot ${1:content}",documentation:"The slot of the shell the template fits."},...kl,{label:"on",insertText:"on ${1|enter,leave,load,unload|}\n ${2:refresh query}",documentation:"Wires what happens on an interaction."}];var Zy=[{label:"optional",insertText:"optional",documentation:"Allows the complete value, including a collection, to be absent."}],Oe=l(t=>`\`\`\`${t}
6
6
  \${1}
7
- \`\`\``,"fenced"),Ky=[{label:"purpose",insertText:'purpose ${1:Name}\n description "${2:processing intent}"\n basis ${3|consent,contract,legalObligation,vitalInterests,publicTask,legitimateInterests|}',documentation:"Report-only processing metadata. Not legal advice; referenced by module, feature and slice."},...kt,{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 from",insertText:'import ${1:Module}.${2:Event} from "${3:origin}"',documentation:"Imports a public event contract with a nonblank opaque origin, not a file path. Executable binding refuses it with PLAY0268."},{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."}],Jy=[{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."}],Cl=[{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:Oe(t),documentation:"Selects the phase\u2019s sole inline source; not admitted by any supported executable model (ESM) version yet."}))],Hy=[{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."},...Cl.filter(t=>t.label!=="hint")],Xy=[{label:"description",insertText:'description "${1:what this value represents}"',documentation:"Report-only authoring description; not a validation or compliance note."},{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."}],eh=[{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."}],qo=[on,ut,...kt,{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:"public event",insertText:"public event ${1:Name}\n ${2:property} ${3:Type}",documentation:"Public contract metadata; executable binding refuses it with PLAY0268."},{label:"event from",insertText:'event ${1:Name} from "${2:origin}"\n ${3:property} ${4:Type}',documentation:"An imported public event with an opaque origin, not a path or declaration reference. Executable binding refuses it with PLAY0268."},{label:"direction",insertText:"direction ${1|inbound,outbound|}",documentation:"Translate direction metadata; executable binding refuses it with PLAY0268."},{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."}],th=[ut,{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"),Ky=[{label:"purpose",insertText:'purpose ${1:Name}\n description "${2:processing intent}"\n basis ${3|consent,contract,legalObligation,vitalInterests,publicTask,legitimateInterests|}',documentation:"Report-only processing metadata. Not legal advice; referenced by module, feature and slice."},...kt,{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 from",insertText:'import ${1:Module}.${2:Event} from "${3:origin}"',documentation:"Imports a public event contract with a nonblank opaque origin, not a file path. An import has no local shape, so executable binding still refuses it with PLAY0268."},{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."}],Jy=[{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."}],Cl=[{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:Oe(t),documentation:"Selects the phase\u2019s sole inline source; not admitted by any supported executable model (ESM) version yet."}))],Hy=[{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."},...Cl.filter(t=>t.label!=="hint")],Xy=[{label:"description",insertText:'description "${1:what this value represents}"',documentation:"Report-only authoring description; not a validation or compliance note."},{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."}],eh=[{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."}],qo=[on,ut,...kt,{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:"public event",insertText:"public event ${1:Name}\n ${2:property} ${3:Type}",documentation:"Declares a public event: a contract this application publishes. Admitted by ESM v9; an outbound Translate slice produces it through a projection that targets it."},{label:"event from",insertText:'event ${1:Name} from "${2:origin}"\n ${3:property} ${4:Type}',documentation:"An event with an opaque origin naming the application that owns it, not a path or declaration reference. It is a public event admitted by ESM v9; consume it with a capture over source events."},{label:"direction",insertText:"direction ${1|inbound,outbound|}",documentation:"Translate direction, inbound or outbound, admitted by ESM v9. No transport or delivery guarantee is implied."},{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."}],th=[ut,{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
  ${Oe("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."}],El=[{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."}],nh=[...El,{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."}],ih=[{label:"when",insertText:"when ${1:condition}",documentation:"Guards the produced event with a condition."}],rh=[{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:Oe(t),documentation:"Selects one inline payload. Handler execution remains unsupported."}))],oh=[{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:Oe("csharp"),documentation:"Inline C# returning the events to append."}],ah=[{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."}],sh=[{label:"file",insertText:"file ${1:Path}",documentation:"Delegates the query implementation to an external file."},{label:"csharp",insertText:Oe("csharp"),documentation:"Inline C# returning the query result, with the QueryContext in scope as context."},{label:"sql",insertText:Oe("sql"),documentation:"Inline SQL returning the query result."}],lh=[{label:"description",insertText:'description "${1:invariant intent}"',documentation:"Report-only description, distinct from the violation message."},{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."}],ch=[ut,{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."}],dh=[{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:Oe("csharp"),documentation:"Inline C# returning event side effects."}],ft="Syntax-only; reaction refusal handling and redelivery are not yet executable (PLAY0268).",ph=[{label:"on refused",insertText:`on refused
@@ -39,4 +39,4 @@ Contributions: ${p.contributions.map(m=>`${m.policy}: ${m.kind}${m.type?` ${JSON
39
39
  `)[R.location.line-1];return M?.locations.some(Y=>Y.line===0)&&B!==void 0&&te(B)===0}),x=v.diagnostics.filter(R=>R.location.path===i).flatMap(R=>(P(R.location),R.location.line>0?[R]:[])),b=new re(v.value),C=new Set(b.slices.flatMap(({slice:R})=>[...R.commands.flatMap(M=>M.produces),...R.reactions.flatMap(M=>M.triggers).flatMap(M=>M.produces)].filter(M=>M.location.path===i&&!b.isEventProduction(M,R)).map(M=>M.location.line-1)));for(let R of x)R.code==="PLAY0499"&&C.add(R.location.line-1);let k=b.declarations.filter(R=>R.kind===H.Operation).map(R=>({...R.node,scope:R.scope.filter(M=>!u.has(M))})),w=new Map,I=we(t),T=l(R=>{let M=[],B=te(t[R]);for(let Y=R;Y<t.length&&!(Y>R&&!I[Y]&&Ee(t[Y]).trim()&&te(t[Y])<=B);Y++)M.push(Y);return M},"range");for(let{slice:R,scope:M}of b.slices){if(R.location.path===i&&R.location.line>0)for(let B of T(R.location.line-1))w.set(B,{scope:M});for(let B of R.specifications.filter(Y=>Y.location.path===i&&Y.location.line>0))for(let Y of T(B.location.line-1))w.set(Y,{scope:M});for(let B of R.commands.filter(Y=>Y.location.path===i&&Y.location.line>0))for(let Y of T(B.location.line-1))w.set(Y,{scope:M,commandLine:B.location.line-1})}let j=new Map(b.declarations.map(R=>[R.node.location,R.scope]));for(let R of k.filter(M=>M.location.path===i)){let M=j.get(R.location);for(let B of T(R.location.line-1))w.set(B,{...w.get(B),scope:M,operation:R})}let N=new Map(k.map(R=>[R.location,R])),L=l((R,M)=>{let B=Ee(t[R.line-1]??""),Y=B.slice(R.column-1).match(/^(?:given\s+operation|then\s+(?:operation|compensated))\s+/)?.[0];return Y&&B.slice(R.column-1+Y.length,R.column-1+Y.length+M.length)===M?{...R,column:R.column+Y.length}:R},"referenceLocation"),q=[];for(let{slice:R}of b.slices){for(let M of R.commands)for(let B of M.produces){if(B.location.path!==i)continue;let Y=b.resolve(B.event,R),pt=Y.declaration?N.get(Y.declaration.node.location)??null:null,Ot={name:B.event,location:B.location,targetLocation:B.targetLocation??B.location,kind:Y.kind,declaration:pt,mappings:B.mappings};if(q.push(Ot),Y.kind===H.Operation)for(let Nn of T(B.location.line-1)){let Mo=w.get(Nn);Mo&&w.set(Nn,{...Mo,production:Ot})}}for(let M of R.specifications)for(let B of[...M.givenOperationFailures??[],...M.thenOperations??[],...M.thenCompensated??[]]){if(B.location.path!==i)continue;let Y=b.resolve(B.operation,R);q.push({name:B.operation,location:B.location,targetLocation:L(B.location,B.operation),kind:Y.kind,declaration:Y.declaration?N.get(Y.declaration.node.location)??null:null,mappings:[]})}}let V={declarations:k,systems:v.value.systems??[],references:q,contexts:w,types:v.value.types,concepts:v.value.concepts,targets:l(R=>{let M=b.slices.find(B=>B.scope.length===R.length&&B.scope.every((Y,pt)=>Y===R[pt]))?.slice;return M?k.flatMap(B=>{let Y=b.resolve(B.name,M).declaration?.node.location===B.location?B.name:[...B.scope,B.name].join(".");return b.resolve(Y,M).kind===H.Operation&&b.resolve(Y,M).declaration?.node.location===B.location?[{name:Y,declaration:B}]:[]}):[]},"targets")},K=v.physicalEventSources.map(R=>R.source),J=new Ht(v.physicalEventSources,v.sourceInventoryComplete&&!A),U=new Map,G=l((R,M)=>{let B=JSON.stringify([R,M]),Y=U.get(B);return Y||(Y=J.resolve(R,M),U.set(B,Y)),{...Y,source:Y.state==="unique"?Y.sources[0]:void 0,stream:Y.state==="unique"?Y.streams[0]:void 0}},"resolve"),ie=new Set(v.value.imports.map(R=>R.qualifiedName)),Ce=K.flatMap(R=>R.streams.filter(M=>G(R.name,M.name).state==="unique"&&!ie.has(`${R.name}.${M.name}`)).map(M=>({name:`${R.name}.${M.name}`,source:R,stream:M}))),F=new Map,le=[];for(let R of S.values()){for(let M of T(R.location.line-1))F.set(M,{command:R});for(let M of[...R.produces,...R.validations,...R.handler?[R.handler]:[]])for(let B of T(M.location.line-1))F.delete(B);if(R.stream){le.push(R.stream);for(let M of T(R.stream.location.line-1))F.set(M,{command:R,route:R.stream})}}let fe=cl(v.value,i,t,T,u,v.diagnostics),Ae=[...[...E.values()].flatMap(R=>[...R.given.map(M=>({event:M,expectation:!1})),...R.whenAppended?[{event:R.whenAppended,expectation:!1}]:[],...R.thenEvents.map(M=>({event:M,expectation:!0})),...R.whenRedelivered?[{event:R.whenRedelivered,expectation:!0}]:[]]),...(fe.eventExamples??[]).map(R=>({event:R,expectation:!0}))];for(let R of Ae){let M=R.event;for(let B of T(M.location.line-1))F.set(B,R);if(M.stream){le.push(M.stream);for(let B of T(M.stream.location.line-1))F.set(B,{...R,route:M.stream})}}for(let R of K.filter(M=>M.location.path===i)){for(let M of T(R.location.line-1))F.set(M,{source:R});for(let M of R.streams)for(let B of T(M.location.line-1))F.set(B,{source:R,stream:M})}let $t=[...S.values()].flatMap(R=>R.streamCandidates??[]).filter(R=>R.propertyCandidate!==null),bt={declarations:K,routes:le,ambiguousCandidates:$t,contexts:F,targets:Ce,resolve:G},me,ve={completions(R,M,B){if(me===void 0){let Y=He(h.source,i,h.placement,!1).value,pt=l(Ot=>{P(Ot.location),Ot.features.forEach(pt)},"remapDependencyHeaders");Y.modules.forEach(pt),me=pl(v.value,Y,i,T,u)}return me.completions(R,M,B)}};return{commands:S,specifications:E,diagnostics:x,operationProductionLines:C,operations:V,eventSources:bt,examples:fe,personas:dl(v.value,t),dependencies:ve}}l(Mm,"analyze");function en(t,e=[],n,i="current.play",r=!0){let o=JSON.stringify([t,e,n,i,r]),s=Dn.get(o);return s===void 0&&(s=Mm(t,e,n,i,r),Dn.size>=16&&Dn.delete(Dn.keys().next().value),Dn.set(o,s)),s}l(en,"responseAnalysis");var Ao="file",jm=/^[A-Za-z_]\w*(?:\[\])?(?:\?|\s+optional)?$/,Lm=/^(?:[/\\]|[A-Za-z]:[/\\]|~[/\\])/;function RR(t){return Lm.test(t)}l(RR,"isAbsoluteFileReferencePath");function Nm(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(Nm,"withoutComment");function wo(t,e){let n=te(t),i=Nm(t.slice(n)).trimEnd();if(nr(i)!==Ao)return;let r=i.slice(Ao.length),o=r.trim();if(o.length===0||jm.test(o))return;let s=r.length-r.trimStart().length,a=n+Ao.length+s+1;return{path:o,line:e,startColumn:a,endColumn:a+o.length}}l(wo,"fileReferenceOn");function DR(t){let e=we(t),n=[];for(let i=0;i<t.length;i++){if(e[i])continue;let r=wo(t[i],i);r&&n.push(r)}return n}l(DR,"fileReferences");function vt(t){let e=!1;return t.map(n=>{if(e)return n.trim()==="```"&&(e=!1),n;let i=Ee(n);return/^\s*```(?:[a-z]+)?\s*$/.test(i)&&(e=!0),i.trimEnd()})}l(vt,"eventAnalysisSource");var qm=/^concept\s+(\w+)\s*:\s*(\w+)((?:\s+@\w+)*)\s*$/,Bm=/^\s*(@?[a-z_]\w*)\s+([\w.]+(?:\[\])?(?:\?|\s+optional)?)(\s+generated)?(\s+identifier)?(\s+subject)?\s*$/,ul=/^([a-z_]\w*)\s+reason\s+"((?:[^"\\]|\\.)*)"\s*$/,Ym=/^\s*reads\s+([A-Z]\w*)(?:\s+as\s+([a-z_]\w*))?(?:\s+by\s+([a-z_]\w*))?\s*$/,Fm=["authorize","produces","reads"],Um=/^(?:(?:or|and)\s+)?[A-Za-z_(][\p{L}\p{Mn}\p{Nd}\p{Pc}\s()]*$/u,Wm=xn,Vm=["tag","for","generation","origin","namespace","sequence","correlation","causation","causedBy","occurred"],zm=/^\s*(?:by|filter)\s+([a-z_]\w*)\s+([\w.]+(?:\[\])?(?:\?|\s+optional)?)(?:\s+from\s+.+)?\s*$/;function xt(t){return t.typeReference??nn(t.type)}l(xt,"propertyTypeReference");function Oo(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(Oo,"sourceTypeAt");function Io(t,e,n){return e.map(i=>({index:i,match:t[i].match(Bm)})).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:nn(r[2]),sourceType:Oo(t[i],t[i].match(/^\s*\S+\s+/)[0].length+1),isIdentifier:r[4]!==void 0,...r[3]!==void 0?{isGenerated:!0}:{},...r[5]!==void 0?{isSubject:!0}:{},line:i}))}l(Io,"propertiesIn");function jn(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(te(s)<=i)break;r.push(o)}}return r}l(jn,"collectBody");function tn(t,e,n,i){let r=jn(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 d=te(t[a]),p=t[a].trim();return o!==void 0&&d>o&&(!s||Um.test(p))?!1:(o=p!=="validate csharp"&&Io(t,[a],Fm).length>0||/^description(?:\s|$)/.test(p)?void 0:d,s=/^authorize(?:\s|$)/.test(p),!0)})}l(tn,"directBody");var Mn=new Map;function Ln(t){let e=t.join(`
40
40
  `),n=Mn.get(e);if(n)return n;let i=en(t),r={authoringSources:[e],eventSources:i.eventSources.declarations,imports:[],concepts:[],types:[],policies:[],events:[],commands:[],queries:[],screens:[],triggers:[]};t=vt(t);let o=we(t),s=t,a=o,d=t.map(p=>p.replace(/\s*=(?!=|>).*/,""));for(let p=0;p<t.length;p++){if(o[p])continue;let m=t[p],u=m.trim(),y=te(m),h=s[p].trim().match(/^import\s+([\w.]+)(?:\s+from\s+"(?:[^"\\]|\\.)*")?\s*$/);if(h&&y===0){let b=h[1],C=b.split(".").pop()??b;r.imports.push({qualifiedName:b,shortName:C,line:p});continue}let g=u.match(qm);if(g){let b=jn(t,o,p,y).map(w=>t[w].trim()),C={};for(let w of b){let I=w.match(ul);I&&C[I[1]]===void 0&&(C[I[1]]=I[2])}let k=g[2]==="Enum"?b.filter(w=>!ul.test(w)):[];r.concepts.push({name:g[1],primitive:g[2],attributes:g[3].trim().split(/\s+/).filter(Boolean),attributeReasons:C,enumValues:k,line:p});continue}let v=u.match(/^type\s+(\w+)\s*$/);if(v){r.types.push({name:v[1],properties:Io(t,jn(t,o,p,y),jo),line:p});continue}let S=u.match(/^policy\s+(\w+)\s*$/);if(S){let b=jn(t,o,p,y).filter(C=>!o[C]).map(C=>t[C].trim());r.policies.push({name:S[1],requires:b,line:p});continue}let E=s[p].trim().match(/^(?:(?:produces|(?<public>public))\s+)?event\s+(?<name>\w+)(?:\s+generation\s+(?<generation>\d+))?(?:\s+from\s+(?<origin>"(?:[^"\\]|\\.)*"))?\s*$/);if(E){let b=u.startsWith("produces "),C=tn(s,a,p,y),k=b?C:C.filter(w=>wo(s[w],w)===void 0);r.events.push({name:E.groups.name,...E.groups.generation?{generation:Number(E.groups.generation)}:{},...E.groups.public||E.groups.origin?{visibility:ae.Public}:{},...E.groups.origin?{origin:Q(E.groups.origin.slice(1,-1))}:{},inline:b,properties:Io(b?d:s,k,b?Vm:Wm),line:p});continue}let $=i.commands.get(p);if($){let b=tn(t,o,p,y),C=b.filter(k=>/^\s*produces\b/.test(t[k])&&!i.operationProductionLines?.has(k));r.commands.push({name:$.name,properties:$.properties.map(k=>({name:k.name,type:`${k.type.name}${k.type.isCollection?"[]":""}${k.type.isOptional?" optional":""}`,typeReference:{name:k.type.name,isCollection:k.type.isCollection,isOptional:k.type.isOptional},sourceType:Oo(t[k.type.location.line-1],k.type.location.column),isIdentifier:k.isIdentifier||/\sidentifier\s*$/.test(t[k.location.line-1]),...k.isGenerated?{isGenerated:!0}:{},line:k.location.line-1})),response:$.response,productionHeaders:C,produces:C.flatMap(k=>{let w=s[k].trim(),I=/^produces\s+event\b/.test(w),T=/^produces\s+when\b/.test(w),j=T?tn(s,a,k,te(s[k]))[0]:k;if(j===void 0)return[];let N=T?s[j].trim():w.match(I?/^produces\s+event\s+([A-Za-z_]\w*)(?:\s+generation\s+\d+)?\s*$/:/^produces\s+([A-Z]\w*)\s*$/)?.[1];if(N===void 0||!/^[A-Za-z_]\w*$/.test(N))return[];let L=tn(s,a,j,te(s[j])),q=L.map(J=>s[J].trim().match(/^for(?:\s+(.*))?$/)).filter(J=>J!==null),V=q.length===0?void 0:q.length===1?q[0][1]??"":"",K=L.flatMap(J=>{let U=s[J].trim().match(I?/^(@?[a-z_]\w*)\s+[\w.]+(?:\[\])?(?:\?|\s+optional)?\s*=(?!=|>)\s*(.+)$/:/^(@?[\w.]+)\s*=(?!=|>)\s*(.+)$/);return U===null?[]:[{name:U[1].replace(/^@/,""),source:U[2],line:J}]});return[{name:N,inline:I,conditional:T,line:k,target:V,mappings:K}]}),reads:b.filter(k=>!o[k]).map(k=>({line:k,match:t[k].match(Ym)})).filter(k=>k.match!==null).map(({line:k,match:w})=>({view:w[1],...w[2]?{alias:w[2]}:{},...w[3]?{by:w[3]}:{},line:k})),line:p});continue}let P=u.match(/^query\s+(\w+)\s*=>\s*(?:observable\s+)?([\w.]+(?:\[\])?(?:\?|\s+optional)?)\s*$/);if(P){let b=jn(t,o,p,y).map(C=>({index:C,match:t[C].match(zm)})).filter(C=>C.match!==null).map(({index:C,match:k})=>({name:k[1],type:k[2],typeReference:nn(k[2]),sourceType:Oo(t[C],t[C].match(/^\s*(?:by|filter)\s+\S+\s+/)[0].length+1),isIdentifier:!1,line:C}));r.queries.push({name:P[1],returnType:P[2],returnTypeReference:nn(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 x=u.match(/^trigger\s+(\w+)\s*$/);x&&y===0&&r.triggers.push({name:x[1],line:p})}return Mn.size>=16&&Mn.delete(Mn.keys().next().value),Mn.set(e,r),r}l(Ln,"scanDocument");function Ki(...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(Ki,"mergeSymbols");function fl(t,e){let n=e?.authoringPath??"current.play",i=e?.authoringDocuments?.find(r=>r.path===n);return{...Ki(Ln(t),e??Ki()),authoringDocuments:e?.authoringDocuments,authoringPath:n,authoringPlacement:e?.authoringPlacement??i?.placement,authoringPlacementResolved:e?.authoringPlacementResolved??i?.isPlacementResolved}}l(fl,"symbolsForBuffer");function Ji(t){return[...t.events.map(e=>e.name),...t.imports.map(e=>e.shortName)]}l(Ji,"knownEventNames");var Qm=["Startup","Shutdown"];function _R(t){return[...Ji(t),...t.triggers.map(e=>e.name),...Qm]}l(_R,"knownTriggerNames");function To(t,e){return[...e,...t.concepts.map(n=>n.name),...t.types.map(n=>n.name),...t.imports.map(n=>n.shortName)]}l(To,"knownTypeNames");function Ro(t){let e=t.properties.filter(o=>o.isIdentifier&&!xt(o).isOptional&&!xt(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(Ro,"productionDestinations");function nD(t,e){let n=en(t,e?.authoringDocuments??e?.authoringSources,e?.authoringPlacement,e?.authoringPath),i=vt(t);return Ln(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}=Ro(r);if(s||r.productionHeaders?.length!==r.produces?.length)return[];let a=r.produces?.some(d=>d.target!==void 0||d.inline);return(r.produces??[]).flatMap(d=>d.target!==void 0||d.inline&&(o===void 0||/\bgeneration\b/.test(i[d.line]))?[]:!d.inline&&a?[]:[{line:d.line,column:i[d.line].length+1,label:d.inline?`for ${o}`:"for <new event source>"}])})}l(nD,"destinationHints");var ee={commandProducesPublicEvent:"PLAY0607",publicEventRequiresOutboundTranslation:"PLAY0608",outboundPublicEventCount:"PLAY0609",foreignPublicEventConsumer:"PLAY0610",outboundTranslationInput:"PLAY0611",inboundTranslationOutput:"PLAY0612",foreignPublicEventProduced:"PLAY0613",publicTranslationRequiresDirection:"PLAY0614",translationConstructDirection:"PLAY0615",inboundTranslationInput:"PLAY0616",outboundTranslationOutput:"PLAY0617",eventTargetOutsideOutboundTranslation:"PLAY0618",eventsSourceOutsideInboundTranslation:"PLAY0619",invalidCaptureEventsSource:"PLAY0620",invalidDescription:"PLAY0145",emptyDescription:"PLAY0146",duplicateDescription:"PLAY0147",unknownConceptDirective:"PLAY0010",attributeReasonWithoutAttribute:"PLAY0012",duplicateAttributeReason:"PLAY0013",legacyComplianceMarker:"PLAY0565",unknownComplianceMarker:"PLAY0566",invalidSecretScope:"PLAY0567",duplicateSecretScope:"PLAY0568",secretScopeIgnoredForPii:"PLAY0569",invalidPersonalDataQualifier:"PLAY0570",duplicateSpecialCategory:"PLAY0571",invalidPurposeDeclaration:"PLAY0596",invalidPurposeVocabulary:"PLAY0597",duplicatePurposeField:"PLAY0598",duplicatePurposeDeclaration:"PLAY0599",unknownPurpose:"PLAY0600",purposeInterestMismatch:"PLAY0601",personalDataWithoutPurpose:"PLAY0602",specialDataWithoutCondition:"PLAY0603",criminalDataWithoutAuthorization:"PLAY0604",purposeWithoutBasis:"PLAY0605",unusedPurpose:"PLAY0606",duplicateEventSubject:"PLAY0590",invalidSubjectType:"PLAY0591",protectedSubjectType:"PLAY0592",invalidSubjectOwner:"PLAY0593",readModelSubjectNotSupported:"PLAY0594",invalidSubjectModifierOrder:"PLAY0595",conflictingScreenDataBinding:"PLAY0530",screenDataQueryMismatch:"PLAY0531",actionWithoutInputSurface:"PLAY0532",commandWithoutInputSurface:"PLAY0533",readModelFieldWithoutOrigin:"PLAY0534",queryParameterNotHeldByView:"PLAY0535",unconsumedEvent:"PLAY0536",unreachableScreen:"PLAY0537",invalidSpecificationCallerPersona:"PLAY0572",unsynthesizablePersonaCaller:"PLAY0573",personaWithoutGate:"PLAY0574",gateWithoutPersona:"PLAY0575",ambiguousPersonaCaller:"PLAY0576",invalidSpecificationParameter:"PLAY0577",invalidSpecificationCase:"PLAY0578",duplicateSpecificationParameter:"PLAY0579",duplicateSpecificationCase:"PLAY0580",incompleteSpecificationTable:"PLAY0581",invalidSpecificationCaseAssignment:"PLAY0582",invalidSpecificationCaseValue:"PLAY0583",invalidSpecificationCaseReference:"PLAY0584",optionalSpecificationParameterTarget:"PLAY0585",specificationCaseNameCollision:"PLAY0586",incompatibleSpecificationParameterType:"PLAY0587",unusedSpecificationParameter:"PLAY0588",singularSpecificationTableExpansion:"PLAY0589",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 Gm=/^import(\s+)"([^"\\]+)"\s*(?:\/\/.*)?$/,_m=/^import\s+"/;function yl(t){return _m.test(t.trim())}l(yl,"isFileImportLine");function Do(t,e){let n=te(t),i=t.slice(n).match(Gm);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(Do,"fileImportOn");function sD(t){let e=we(t),n=[];for(let i=0;i<t.length;i++){if(e[i])continue;let r=Do(t[i],i);r&&n.push(r)}return n}l(sD,"fileImports");var ml=l(t=>t.split("/").slice(0,-1),"folderOf");function Zm(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(Zm,"relativeTo");function lD(t,e){let n=ml(t),i=new Set;for(let r of e.filter(o=>o!==t&&o.toLowerCase().endsWith(".play"))){let o=Zm(n,r),s=ml(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(lD,"importablePaths");var Km=new Set(["namespace","sequence","correlation","causation","causedBy","occurred"]),Jm=/^id\s+"((?:[^"\\]|\\.)*)"$/;function hl(t,e,n,i=new Set){t=vt(t);let r=[],o=we(t),s=Hm(t,o),a=new Set(e.commands.flatMap(y=>y.productionHeaders??[])),d=new Map,p=new Set;for(let y of[e,n]){for(let h of y.events)d.set(h.name,(d.get(h.name)??0)+1);for(let h of y.imports)p.add(h.shortName)}let m=l((y,h,g,v="error")=>{r.push({line:y,startColumn:te(t[y])+1,endColumn:t[y].length+1,code:h,message:g,severity:v})},"report");for(let y of e.events){let h=tn(t,o,y.line,te(t[y.line]));if(y.inline){let S=new Set;for(let E of y.properties)S.has(E.name)&&m(E.line,ee.duplicateDeclaration,`Event '${y.name}' already declares property '${E.name}'.`),S.add(E.name);a.has(y.line)||m(y.line,ee.inlineEventOutsideCommand,"Inline events can only be declared inside commands."),y.generation!==void 0&&m(y.line,ee.inlineEventGeneration,"Inline events are generation 1; extract the event before declaring generations."),((d.get(y.name)??0)>1||p.has(y.name))&&m(y.line,ee.inlineEventCollision,`Inline event '${y.name}' collides with another declaration or import.`)}let g=!1,v=!1;for(let S of h){let E=t[S].trim(),$=E.split(/\s+/)[0];if(y.inline&&$==="generation"&&m(S,ee.inlineEventGeneration,"Inline events are generation 1; extract the event before declaring generations."),y.inline&&$==="origin"&&m(S,ee.reservedProductionMetadata,"An inline event is local to its command and cannot declare origin."),!/^(?:id|description|documentation)\s+[\w.]+(?:\[\])?(?:\?|\s+optional)?(?:\s*=.*)?$/.test(E)){if($==="id"){let P=E.match(Jm);g||P===null||P[1].trim().length===0?m(S,ee.invalidEventId,'Expected one nonempty id "<old-name>".'):P[1]===y.name&&m(S,ee.redundantEventId,"This id repeats the event name; remove it.","information"),g=!0}if($==="documentation"){let P=S+1;for(;P<t.length&&t[P].trim().length===0;)P++;(v||E!=="documentation"||t[P]?.trim()!=="```markdown"||te(t[P])<=te(t[S])||!s.has(P))&&m(S,ee.invalidEventDocumentation,"Expected one nonempty fenced markdown documentation block."),v=!0}}}}let u=[];for(let y=0;y<t.length;y++){if(o[y]||t[y].trim().length===0)continue;let h=te(t[y]);for(;u.length>0&&u[u.length-1].indent>=h;)u.pop();let g=t[y].trim().split(/\s+/)[0];Km.has(g)&&u.at(-1)?.event&&m(y,ee.reservedProductionMetadata,`'${g}' is system-assigned production metadata.`),g==="produces"&&u.push({indent:h,event:!i.has(y)&&!/^\s*produces\s+operation\b/.test(t[y])})}for(let y of e.commands){let{identifier:h,mixed:g}=Ro(y);for(let v of y.produces??[]){g&&v.target===void 0&&m(v.line,ee.explicitProducesTargetsRequired,`Production '${v.name}' must state for explicitly when destinations differ.`);let S=v.target??(v.inline?h:void 0);if(!(h===void 0||S!==h))for(let E of v.mappings.filter($=>$.source===h))m(E.line,ee.eventSourceIdInPayload,`The payload copies '${h}', which already identifies the event source.`,v.inline?"warning":"information")}}return r}l(hl,"validateInlineEvents");function Hm(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(Hm,"nonemptyMarkdownBlocks");function Fe(t,e,n,i,r,o){return{severity:t,message:r,line:e,startColumn:n,endColumn:n+i,code:o}}l(Fe,"issue");function _e(t,e,n,i,r,o){let s=n.indexOf(i)+1;return Fe(t,e,s,i.length,r,o)}l(_e,"tokenIssue");function Xm(t,e,n){let i=[],r=new Set([...To(e,qn),...To(n,[])]),o=l((a,d)=>{for(let p of a.filter(m=>!r.has(xt(m).name))){let m=xt(p).name;i.push(Fe("warning",p.line,p.sourceType.startColumn,p.sourceType.text.length,m==="optional"?`Unknown type 'optional' on '${p.name}' of ${d} \u2014 did you forget the type before 'optional'?`:`Unknown type '${m}' on '${p.name}' of ${d} \u2014 declare it with 'concept ${m} : <Primitive>' or 'type ${m}'.`,ee.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 d=a.properties.filter(p=>p.isIdentifier);for(let p of d.slice(1))i.push(_e("error",p.line,t[p.line],"identifier",`Command '${a.name}' already marks '${d[0].name}' as identifier \u2014 only one property can be the identifier.`,ee.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(_e("error",a.line,t[a.line],a.name,`Duplicate declaration of '${a.name}' \u2014 concept and type names must be unique.`,ee.duplicateDeclaration))}return i}l(Xm,"validateDeclarations");function MD(t,e={}){let n=we(t),i=Ln(t),r=e.application??Ki(),o=fl(t,{...r,authoringPath:e.path??r.authoringPath,authoringPlacement:e.placement??r.authoringPlacement}),s=en(t,o.authoringDocuments??o.authoringSources?.filter(C=>C!==t.join(`
41
41
  `)),o.authoringPlacement,o.authoringPath,o.authoringPlacementResolved),a=new Set(s.eventSources.routes.map(C=>C.location.line-1)),d={...i,commands:i.commands.map(C=>({...C,properties:C.properties.filter(k=>!a.has(k.line)),produces:C.produces?.filter(k=>!s.operationProductionLines?.has(k.line)),productionHeaders:C.productionHeaders?.filter(k=>!s.operationProductionLines?.has(k))}))},p=new Set([...Ji(d),...Ji(r)]),m=new Set([...d.policies,...r.policies].map(C=>C.name)),u=Xm(t,d,r);u.push(...ey(t,d));let y=new Set([c.LegacyOptionalSuffix,c.InvalidOptionalModifierOrder,c.OptionalReadsNotSupported]),h=new Set([c.UnexpectedTokenInPolicyCondition,c.ExpectedPolicyCondition,c.UnclosedPolicyConditionGroup,c.ExpectedRoleName,c.ExpectedClaimName,c.ExpectedClaimMatches,c.ExpectedClaimMatchTarget]),g=new Set([c.UnknownEvent,c.UnknownReadModelProperty,c.PiiNotSupportedOnIdentifier]),v=new Set([c.EventFromLaterSlice,c.TimelineCycleGroup]),S=new Set([c.UndeclaredDependency,c.UnusedDependencyDeclaration,c.InvalidDependencyTarget,c.RepeatedDependencyDeclaration,c.MutualDependencyDeclarations,c.AmbiguousReference]),E=new Set([c.InvalidEventDeclaration,c.InvalidImportDeclaration,c.InvalidSliceDeclaration,c.InvalidDescription,c.DuplicateDescription,c.EmptyDescription,c.DuplicateEventSubject,c.InvalidSubjectType,c.ProtectedSubjectType,c.InvalidSubjectOwner,c.ReadModelSubjectNotSupported,c.InvalidSubjectModifierOrder,c.UnsupportedInteractionAlternatives,c.MixedInteractionAlternatives,c.InteractionAlternativeWithoutActions,c.InlineInteractionAlternative,c.LegacyInteractionWhere,c.InvalidSpecificationParameter,c.InvalidSpecificationCase,c.DuplicateSpecificationParameter,c.DuplicateSpecificationCase,c.IncompleteSpecificationTable,c.InvalidSpecificationCaseAssignment,c.InvalidSpecificationCaseValue,c.InvalidSpecificationCaseReference,c.OptionalSpecificationParameterTarget,c.SpecificationCaseNameCollision,c.IncompatibleSpecificationParameterType,c.UnusedSpecificationParameter,c.SingularSpecificationTableExpansion,c.InvalidSpecificationCallerPersona,c.UnsynthesizablePersonaCaller,c.PersonaWithoutGate,c.GateWithoutPersona,c.AmbiguousPersonaCaller,c.InvalidDocumentation,c.ConflictingDocumentationAcrossFiles,c.InvalidAbsentReadModelStep,c.UnknownConstraintProperty,c.OmittedProductionDestination,c.InvalidSpecificationExample,c.DuplicateSpecificationAssignment]),$=new Set([c.InvalidPurposeDeclaration,c.InvalidPurposeVocabulary,c.DuplicatePurposeField,c.DuplicatePurposeDeclaration,c.UnknownPurpose,c.PurposeInterestMismatch,c.PersonalDataWithoutPurpose,c.SpecialDataWithoutCondition,c.CriminalDataWithoutAuthorization,c.PurposeWithoutBasis,c.UnusedPurpose,c.UnknownConceptDirective,c.AttributeReasonWithoutAttribute,c.DuplicateAttributeReason,c.LegacyComplianceMarker,c.UnknownComplianceMarker,c.InvalidSecretScope,c.DuplicateSecretScope,c.SecretScopeIgnoredForPii,c.InvalidPersonalDataQualifier,c.DuplicateSpecialCategory]),P=new Set;for(let C of e.compilerDiagnostics??s.diagnostics){if(!$.has(C.code)&&!y.has(C.code)&&!h.has(C.code)&&!g.has(C.code)&&!v.has(C.code)&&!S.has(C.code)&&!E.has(C.code)&&C.code!==c.InvalidSpecificationExampleBody&&C.code!==c.UnknownRuleImplementationDirective&&C.code!==c.InvalidValidationRule&&C.code!==c.RepeatedDeclarationAcrossFiles&&!/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$|^PLAY060[7-9]$|^PLAY061[0-9]$|^PLAY0620$/.test(C.code))continue;let k=C.location.line-1;if(C.code===c.OmittedProductionDestination&&u.some(I=>I.code===C.code&&I.line===k))continue;if(C.code===c.UnknownEvent){if(P.has(k))continue;P.add(k)}let w=go(t[k],C)||t[k].length-C.location.column+1;u.push(Fe(C.severity,k,C.location.column,w,C.message,C.code))}let A=l((C,k,w)=>{!p.has(w)&&!P.has(C)&&u.push(_e("warning",C,k,w,`Unknown event type '${w}' \u2014 declare it in a slice or import it.`,ee.unknownEvent))},"checkEvent"),x=-1;for(let C=0;C<t.length;C++){let k=t[C],w=k.trim();if(n[C]||w.length===0)continue;let I=k.match(/^[ ]*(\t+)/);if(I&&u.push(Fe("warning",C,I[0].length-I[1].length+1,I[1].length,"Screenplay is indentation-based \u2014 use spaces, not tabs.",ee.tabIndentation)),x>=0){if(te(k)>x&&/^(?:or\s+)?[A-Z]\w*(?:\s+or\s+[A-Z]\w*)*$/.test(w)){for(let U of w.split(/\s+/).filter(G=>G!=="or"))m.has(U)||u.push(_e("warning",C,k,U,`Unknown policy '${U}' \u2014 declare it with 'policy ${U}'.`,ee.unknownPolicy));continue}x=-1}let T=ty(t,n,C);T&&u.push(T);let j=w.match(/^slice\s+(\w+)/);j&&!tr.includes(j[1])&&u.push(_e("error",C,k,j[1],`Unknown slice type '${j[1]}' \u2014 expected ${tr.join(", ")}.`,ee.unknownSliceType));let N=w.match(/^concept\s+\w+\s*:\s*(\w+)/);N&&N[1]!=="Enum"&&!qn.includes(N[1])&&u.push(_e("error",C,k,N[1],`Unknown primitive type '${N[1]}' \u2014 expected ${qn.join(", ")} or Enum.`,ee.unknownPrimitiveType));let L=w.match(/^authorize\s+(.*)$/);if(L){x=te(k);for(let U of L[1].split(/\s+/).filter(G=>G!=="or"&&G.length>0))m.has(U)||u.push(_e("warning",C,k,U,`Unknown policy '${U}' \u2014 declare it with 'policy ${U}'.`,ee.unknownPolicy))}let q=w.match(/^on\s+([A-Z]\w*)\s*$/);q&&A(C,k,q[1]);let V=w.match(/^produces\s+([A-Z]\w*)\s*$/);if(V&&!s.operationProductionLines?.has(C)&&A(C,k,V[1]),/^produces\s+when\b/.test(w)&&!s.operationProductionLines?.has(C))for(let U=C+1;U<t.length;U++){let G=t[U];if(!(n[U]||G.trim().length===0)){if(te(G)>te(k)){let ie=G.trim().match(/^([A-Z]\w*)\s*$/);ie&&A(U,G,ie[1])}break}}let K=w.match(/^unique\s+event\s+([A-Z]\w*)/);K&&A(C,k,K[1]);let J=w.match(/^unique\s+[a-z_]\w*\s+on\s+([A-Z]\w*)/);J&&A(C,k,J[1]);for(let U of k.match(/\$context\.[\w.]+/g)??[]){let G=U.substring(9).split(".");Hi.includes(G[0])?G[0]==="causedBy"&&G.length>1&&!Xi.includes(G[1])?u.push(_e("warning",C,k,U,`Unknown $context.causedBy property '${G[1]}' \u2014 expected ${Xi.join(", ")}.`,ee.unknownContextCausedByProperty)):G[0]==="identity"&&G.length>1&&!er.includes(G[1])&&u.push(_e("warning",C,k,U,`Unknown $context.identity property '${G[1]}' \u2014 expected ${er.join(", ")}.`,ee.unknownContextIdentityProperty)):u.push(_e("warning",C,k,U,`Unknown $context path '${G.join(".")}' \u2014 expected one of ${Hi.join(", ")}.`,ee.unknownContextPath))}}u.push(...iy(t,n)),u.push(...hl(t,d,r,s.operationProductionLines));let b=t.map((C,k)=>({line:C,index:k})).filter(({line:C})=>/^\s*```(?:[a-z]+)?\s*$/.test(C));if(b.length%2===1){let C=b[b.length-1];u.push(Fe("error",C.index,1,C.line.length+1,"Unclosed inline code block \u2014 expected a closing ``` line.",ee.unclosedCodeBlock))}return u}l(MD,"validateLines");function ey(t,e){let n=[];t=vt(t);for(let i of e.commands){let r=i.properties.filter(o=>o.isIdentifier&&!xt(o).isOptional&&!xt(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(Fe("information",s,te(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.`,ee.omittedProductionDestination))}}return n}l(ey,"validateProductionDestinations");function ty(t,e,n){let i=t[n],r=i.trim().replace(/\s*\/\/.*$/,"");if(!/^import\b/.test(r)||Do(i,n))return;let o=te(i);if(!(!(o>0&&["module","feature"].includes(Lo(t,e,n,o)[0]))&&!yl(i)))return Fe("error",n,o+1,r.length,`Invalid import '${r}' \u2014 inside a module or feature, import names files: 'import "<path or glob>"'.`,ee.invalidFileImport)}l(ty,"validateImport");var ny=/^(?:(?:increment|decrement|count|clear|add|subtract|set)\s+)?@?([$\w.]+)(?=\s|=|$)/;function iy(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 d of o.matchAll(/(\.)?\$eventContext((?:\.(?:\w+(?:\(\))?)?)*)/g)){let p=d[0].substring(d[1]?.length??0),m=d[2];if(m.length===0){d[1]&&n.push(Fe("error",r,(d.index??0)+2,p.length,`'$eventContext' names no member - expected one of ${i(ar("").expected)}.`,ee.missingEventContextPath));continue}let u=m.substring(1),y=ar(u),h=(d.index??0)+(d[1]?.length??0)+1;switch(y.status){case"missing":n.push(Fe("error",r,h,p.length,`'$eventContext.${u}' names no member - expected one of ${i(y.expected)}.`,ee.missingEventContextPath));break;case"unknownMember":n.push(Fe("warning",r,h,p.length,`Unknown event context member '${y.segment}' in '$eventContext.${u}' - expected one of ${i(y.expected)}.`,ee.unknownEventContextMember));break;case"unknownSubPath":{let g=y.expected.length===0?"no members to address":`members ${i(y.expected)}`;n.push(Fe("warning",r,h,p.length,`Unknown event context path '$eventContext.${u}' - '${y.member?.name}' (${y.member?.type}) has ${g}.`,ee.unknownEventContextPath));break}case"belowCollection":n.push(Fe("error",r,h,p.length,`'$eventContext.${u}' cannot resolve - '${y.member?.name}' is a collection (${y.member?.type}) and cannot be addressed below.`,ee.eventContextPathBelowCollection));break}}let s=o.trim().match(ny)?.[1],a=s?.match(/\.\$(\w+)/)?.[1];s&&a&&a!=="eventContext"&&n.push(_e("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.`,ee.unresolvedDynamicKeySource))}return n}l(iy,"validateEventContextPaths");export{Sl as a,ry as b,oy as c,jo as d,ay as e,Hi as f,Xi as g,tr as h,qn as i,sy as j,gl as k,ly as l,wt as m,nn as n,dy as o,c as p,$e as q,kr as r,ii as s,cO as t,dO as u,Ee as v,te as w,nr as x,we as y,Lo as z,fy as A,my as B,vt as C,Ey as D,ir as E,rr as F,or as G,vl as H,vy as I,xy as J,$y as K,xl as L,$l as M,Ty as N,Ry as O,Dy as P,My as Q,jy as R,Ly as S,Ny as T,qy as U,By as V,Yy as W,Fy as X,kl as Y,Uy as Z,Zy as _,Ky as $,Jy as aa,Cl as ba,Hy as ca,Xy as da,eh as ea,th as fa,El as ga,nh as ha,ih as ia,rh as ja,oh as ka,ah as la,sh as ma,lh as na,ch as oa,dh as pa,ph as qa,uh as ra,fh as sa,mh as ta,Bo as ua,Pl as va,yh as wa,hh as xa,Sh as ya,gh as za,vh as Aa,Al as Ba,xh as Ca,wl as Da,$h as Ea,bh as Fa,kh as Ga,Ch as Ha,Eh as Ia,wR as Ja,en as Ka,Ao as La,RR as Ma,wo as Na,DR as Oa,xt as Pa,tn as Qa,Ln as Ra,Ki as Sa,fl as Ta,Ji as Ua,Qm as Va,_R as Wa,To as Xa,Ro as Ya,nD as Za,ee as _a,yl as $a,Do as ab,sD as bb,lD as cb,MD as db,iy as eb};
42
- //# sourceMappingURL=chunk-JHXTJC4U.js.map
42
+ //# sourceMappingURL=chunk-T4MD6O7Y.js.map