@cratis/screenplay-language 4.138.0 → 4.140.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.
@@ -1,2 +1,2 @@
1
- import"../../_virtual/_virtual/_rolldown/runtime.js";import{isExactNumberToken as e,parseExactNumber as t}from"./ExactNumber.js";import{InvalidSyntaxJson as n}from"./InvalidSyntaxJson.js";import{legacySourceOptions as r,validatedSourceOptions as i}from"./SourceOptions.js";import{validateSyntaxInvariants as a}from"./SyntaxInvariants.js";import{syntaxMemberNames as o,validateClosedSyntaxMembers as s,validateSyntaxMembers as c}from"./SyntaxMemberContracts.js";import{isLegacyOmittedMember as l}from"./LegacyWireProjection.js";const isNode=e=>typeof e==`object`&&!!e&&typeof e.kind==`string`,u=/* @__PURE__ */ new Set([`kind`,`location`,`targetLocation`,`referenceLocation`,`referenceLength`,`nameWasEscaped`,`declaredTriggers`,`directiveLocations`]),d=/* @__PURE__ */ new Set([`ApplicationSyntax`,`ProjectionSyntax`,`CaptureSyntax`,`SpecificationSyntax`]);function toSyntaxJson(e){let t=snapshot(e);return validateNumbers(t,`legacy`,0),write(t)}function snapshot(e){let t=/* @__PURE__ */ new WeakMap,n=[];function detach(e){return typeof e!=`object`||!e?e:t.has(e)?t.get(e):Array.isArray(e)?detachArray(e):detachObject(e)}function detachArray(e){let r=dataArray();t.set(e,r);let i=e.length;for(let t=i-1;t>=0;t--)n.push(()=>{r[t]=detach(Object.hasOwn(e,t)?e[t]:void 0)});return r}function detachObject(e){let r=Object.create(null);t.set(e,r);let i=Object.keys(e);!i.includes(`kind`)&&`kind`in e&&i.unshift(`kind`);for(let t=i.length-1;t>=0;t--)n.push(()=>{let a=i[t],o=e[a];a===`sourceOptions`&&n.push(()=>preserveRejectedSourceOptions(r,a,o)),r[a]=detach(o)});return r}let r=detach(e);for(;n.length>0;)n.pop()();return r}function preserveRejectedSourceOptions(e,t,n){typeof n==`object`&&n&&hasExoticShape(n)&&(e[t]=Object.assign(Object.create(null),{numericMode:`invalid`}))}function hasExoticShape(e){return Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null||Reflect.ownKeys(e).length!==Object.keys(e).length}function dataArray(){let e=[];return Object.defineProperty(e,"toJSON",{value:void 0}),e}const f={ApplicationSyntax:[`identity`],EventSyntax:[`origin`],ImportSyntax:[`origin`],SliceSyntax:[`direction`],ReactionSyntax:[`from`],ReducerSyntax:[`from`],ProducesSyntax:[`stream`],ConceptAttributeSyntax:[`scope`,`specialCategory`],ConceptSyntax:[`description`,`valueNumbers`],PolicySyntax:[`description`],FileConstraintSyntax:[`description`],UniqueEventConstraintSyntax:[`description`],UniquePropertyConstraintSyntax:[`description`],ProjectionSyntax:[`description`],ScreenSyntax:[`description`],FormSyntax:[`description`],SpecificationSyntax:[`description`,`whenRedelivered`],SpecificationErrorSyntax:[`caseValue`],SpecificationExampleSyntax:[`stream`,`noStream`],SpecificationRedeliverySyntax:[`stream`,`noStream`]},p={ModuleSyntax:[`dependsOn`],FeatureSyntax:[`dependsOn`],SpecificationSyntax:[`parameters`,`cases`],InvokesSyntax:[`onRefused`]},m={EventSyntax:{visibility:`Private`},ImportSyntax:{visibility:`Private`},ConceptAttributeSyntax:{criminal:!1},PropertySyntax:{isSubject:!1},SpecificationSyntax:{thenNoEvents:!1}},ownEntry=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0,isEmptyArray=e=>Array.isArray(e)&&e.length===0;function isNullOmitted(e,t,n){return n==null?ownEntry(f,e)?.includes(t)===!0||t===`inlineProperty`||t===`documentation`&&e!==`EventSyntax`:!1}function isEmptyOmitted(e,t,n){return isEmptyArray(n)?ownEntry(p,e)?.includes(t)===!0||t===`examples`||t===`purposes`:!1}function isDefaultOmitted(e,t,n){if(t===`sourceOptions`)return n?.numericMode===`legacy`;let r=ownEntry(m,e);return r!==void 0&&Object.hasOwn(r,t)&&n===r[t]}function isOmittedByDefault(e,t,n){return isNullOmitted(e,t,n)||isEmptyOmitted(e,t,n)||isDefaultOmitted(e,t,n)}function write(e,t=`legacy`,n=!1){return Array.isArray(e)?writeArray(e,t,n):isNode(e)?writeNode(e,t,n):e===void 0?null:typeof e!=`object`||!e?e:writeRecord(e,t,n)}function writeArray(e,t,n){let r=dataArray();for(let i=0;i<e.length;i++)r.push(write(e[i],t,n));return r}function validateClosedImplementationShapes(e){if((e.kind===`ImplementationSyntax`||e.kind===`ImplementationHintSyntax`)&&s(e,u),e.kind!==`ValidationRuleSyntax`)return;let t=e;t.implementation!=null&&(t.file!=null&&s(t.file,u),t.code!=null&&s(t.code,u))}function structuralMembers(e){let t={...e};return e.kind===`ApplicationSyntax`&&t.eventSources===void 0&&(t.eventSources=[]),e.kind===`CommandSyntax`&&t.stream===void 0&&(t.stream=null),e.kind===`CommandSyntax`&&t.streamCandidates===void 0&&(t.streamCandidates=[]),t}function projectedMemberNames(e,t,n,r){let i=n===`exact`?o(e.kind):void 0,hiddenByLegacy=t=>n===`legacy`&&!r&&l(e,t),isProjected=t=>(i===void 0||i.has(t))&&!hiddenByLegacy(t)&&!u.has(t)&&(e.kind!==`OperationSyntax`||t!==`usesLocation`);return Object.keys(t).filter(isProjected).sort(ordinal)}function writeNode(e,t,n){d.has(e.kind)&&(t=i(e.sourceOptions??r).numericMode),a(e),validateClosedImplementationShapes(e);let o=Object.create(null);o.kind=e.kind;let s=structuralMembers(e);for(let r of projectedMemberNames(e,s,t,n)){let i=s[r];isOmittedByDefault(e.kind,r,i)||(o[r]=write(i,t,n))}return o}function writeRecord(e,t,n){let r=Object.create(null);if(e.literalType===`ExactNumber`)return r.literalType=`ExactNumber`,r.value=e.value,r;for(let i of Object.keys(e))i!==`toJSON`&&e[i]!==void 0&&(r[i]=write(e[i],t,n));return r}function validateNumbers(e,t,n){if(assertSupportedDepth(t,n),Array.isArray(e)){for(let r=0;r<e.length;r++)validateNumbers(e[r],t,n+1);return}if(typeof e!=`object`||!e)return;let r=e;t=resolveNumericMode(r,t,n),assertCompleteSourceRoot(r,t,n),t===`exact`&&isNode(r)&&c(r),validateRawNumericText(r,t),r.kind===`LiteralExpressionSyntax`&&Object.hasOwn(r,`value`)&&validateLiteralValue(r.value,t),validateNumberMembers(r,t,n)}function assertSupportedDepth(e,t){if(t>96&&e===`exact`)throw new n(`Syntax nesting exceeds the supported depth of 96.`)}function assertCompleteSourceRoot(e,t,r){if(r===0&&t===`exact`&&!d.has(e.kind))throw new n(`Exact syntax requires a complete source root.`)}function resolveNumericMode(e,t,a){if(!d.has(e.kind)&&!Object.hasOwn(e,`sourceOptions`))return t;let o=Object.hasOwn(e,`sourceOptions`)?i(e.sourceOptions):r;if(a>0&&t!==o.numericMode)throw new n(`Conflicting source numeric options.`);return o.numericMode}function validateRawNumericText(t,r){if(t.kind===`RawExpressionSyntax`&&r===`exact`&&typeof t.text==`string`&&e(t.text))throw new n(`An exact numeric operand must be an explicit ExactNumber, not opaque numeric text.`)}function isUnsupportedExactPrimitive(e){return typeof e==`number`||e!==null&&![`string`,`boolean`,`object`].includes(typeof e)}function validateLiteralValue(e,t){if(t===`exact`&&isUnsupportedExactPrimitive(e))throw new n(`Exact source requires supported primitive values or an explicit ExactNumber literal.`);if(typeof e!=`object`||!e)return;let r=e;if(r.literalType===`ExactNumber`)validateExactNumberLiteral(r,t);else if(t===`exact`)throw new n(`Exact source refuses old or plain object literal insertion.`)}function isWellFormedExactNumber(e){return typeof e.value==`string`&&t(e.value)?.value===e.value&&Object.keys(e).length===2}function validateExactNumberLiteral(e,t){if(t!==`exact`||!isWellFormedExactNumber(e))throw new n(`Malformed or incompatible ExactNumber literal.`)}function validateNumberMembers(e,t,n){let r=t===`exact`&&isNode(e)?o(e.kind):void 0,i=/* @__PURE__ */ new Set([`location`,`targetLocation`,`usesLocation`]),isTraversed=(e,t)=>(r===void 0||r.has(e)||isNode(t)&&d.has(t.kind))&&!i.has(e);for(let[r,i]of Object.entries(e))isTraversed(r,i)&&validateNumbers(i,t,n+1)}function ordinal(e,t){return e<t?-1:+(e>t)}export{toSyntaxJson};
1
+ import"../../_virtual/_virtual/_rolldown/runtime.js";import{isExactNumberToken as e,parseExactNumber as t}from"./ExactNumber.js";import{InvalidSyntaxJson as n}from"./InvalidSyntaxJson.js";import{legacySourceOptions as r,validatedSourceOptions as i}from"./SourceOptions.js";import{validateSyntaxInvariants as a}from"./SyntaxInvariants.js";import{syntaxMemberNames as o,validateClosedSyntaxMembers as s,validateSyntaxMembers as c}from"./SyntaxMemberContracts.js";import{isLegacyOmittedMember as l}from"./LegacyWireProjection.js";const isNode=e=>typeof e==`object`&&!!e&&typeof e.kind==`string`,isObject=e=>typeof e==`object`&&!!e,u=/* @__PURE__ */ new Set([`kind`,`location`,`targetLocation`,`referenceLocation`,`referenceLength`,`nameWasEscaped`,`declaredTriggers`,`directiveLocations`]),d=/* @__PURE__ */ new Set([`location`,`targetLocation`,`usesLocation`]),f=/* @__PURE__ */ new Set([`ApplicationSyntax`,`ProjectionSyntax`,`CaptureSyntax`,`SpecificationSyntax`]);function toSyntaxJson(e){let t=snapshot(e);return validateNumbers(t,`legacy`,0),write(t)}function snapshot(e){let t=/* @__PURE__ */ new WeakMap,n=[];function detach(e){return isObject(e)?t.has(e)?t.get(e):Array.isArray(e)?detachArray(e):detachObject(e):e}function detachArray(e){let r=dataArray();t.set(e,r);let i=e.length;for(let t=i-1;t>=0;t--)n.push(()=>{r[t]=detach(Object.hasOwn(e,t)?e[t]:void 0)});return r}function detachObject(e){let r=Object.create(null);t.set(e,r);let i=Object.keys(e);!i.includes(`kind`)&&`kind`in e&&i.unshift(`kind`);for(let t=i.length-1;t>=0;t--)n.push(()=>{let a=i[t],o=e[a];a===`sourceOptions`&&n.push(()=>preserveRejectedSourceOptions(r,a,o)),r[a]=detach(o)});return r}let r=detach(e);for(;n.length>0;)n.pop()();return r}function preserveRejectedSourceOptions(e,t,n){isObject(n)&&hasExoticShape(n)&&(e[t]=Object.assign(Object.create(null),{numericMode:`invalid`}))}function hasExoticShape(e){return Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null||Reflect.ownKeys(e).length!==Object.keys(e).length}function dataArray(){let e=[];return Object.defineProperty(e,"toJSON",{value:void 0}),e}const p={ApplicationSyntax:[`identity`],EventSyntax:[`origin`],ImportSyntax:[`origin`],SliceSyntax:[`direction`],ReactionSyntax:[`from`],ReducerSyntax:[`from`],ProducesSyntax:[`stream`],ConceptAttributeSyntax:[`scope`,`specialCategory`],ConceptSyntax:[`description`,`valueNumbers`],PolicySyntax:[`description`],FileConstraintSyntax:[`description`],UniqueEventConstraintSyntax:[`description`],UniquePropertyConstraintSyntax:[`description`],ProjectionSyntax:[`description`],ScreenSyntax:[`description`],FormSyntax:[`description`],SpecificationSyntax:[`description`,`whenRedelivered`],SpecificationErrorSyntax:[`caseValue`],SpecificationExampleSyntax:[`stream`,`noStream`],SpecificationRedeliverySyntax:[`stream`,`noStream`]},m={ModuleSyntax:[`dependsOn`],FeatureSyntax:[`dependsOn`],SpecificationSyntax:[`parameters`,`cases`],InvokesSyntax:[`onRefused`]},h={EventSyntax:{visibility:`Private`},ImportSyntax:{visibility:`Private`},ConceptAttributeSyntax:{criminal:!1},PropertySyntax:{isSubject:!1},SpecificationSyntax:{thenNoEvents:!1}},ownEntry=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0,isEmptyArray=e=>Array.isArray(e)&&e.length===0;function isNullOmitted(e,t,n){return n==null?ownEntry(p,e)?.includes(t)===!0||t===`inlineProperty`||t===`documentation`&&e!==`EventSyntax`:!1}function isEmptyOmitted(e,t,n){return isEmptyArray(n)?ownEntry(m,e)?.includes(t)===!0||t===`examples`||t===`purposes`:!1}function isDefaultOmitted(e,t,n){if(t===`sourceOptions`)return n?.numericMode===`legacy`;let r=ownEntry(h,e);return r!==void 0&&Object.hasOwn(r,t)&&n===r[t]}function isOmittedByDefault(e,t,n){return isNullOmitted(e,t,n)||isEmptyOmitted(e,t,n)||isDefaultOmitted(e,t,n)}function write(e,t=`legacy`,n=!1){return Array.isArray(e)?writeArray(e,t,n):isNode(e)?writeNode(e,t,n):e===void 0?null:isObject(e)?writeRecord(e,t,n):e}function writeArray(e,t,n){let r=dataArray();for(let i=0;i<e.length;i++)r.push(write(e[i],t,n));return r}function validateClosedImplementationShapes(e){if((e.kind===`ImplementationSyntax`||e.kind===`ImplementationHintSyntax`)&&s(e,u),e.kind!==`ValidationRuleSyntax`)return;let t=e;t.implementation!=null&&(t.file!=null&&s(t.file,u),t.code!=null&&s(t.code,u))}function structuralMembers(e){let t={...e};return e.kind===`ApplicationSyntax`&&t.eventSources===void 0&&(t.eventSources=[]),e.kind===`CommandSyntax`&&t.stream===void 0&&(t.stream=null),e.kind===`CommandSyntax`&&t.streamCandidates===void 0&&(t.streamCandidates=[]),t}function projectedMemberNames(e,t,n,r){let i=n===`exact`?o(e.kind):void 0,isProjected=t=>(i===void 0||i.has(t))&&!isHiddenByLegacy(e,t,n,r)&&!isAlwaysOmitted(e,t);return Object.keys(t).filter(isProjected).sort(ordinal)}function isHiddenByLegacy(e,t,n,r){return n===`legacy`&&!r&&l(e,t)}function isAlwaysOmitted(e,t){return u.has(t)||e.kind===`OperationSyntax`&&t===`usesLocation`}function writeNode(e,t,n){f.has(e.kind)&&(t=i(e.sourceOptions??r).numericMode),a(e),validateClosedImplementationShapes(e);let o=Object.create(null);o.kind=e.kind;let s=structuralMembers(e);for(let r of projectedMemberNames(e,s,t,n)){let i=s[r];isOmittedByDefault(e.kind,r,i)||(o[r]=write(i,t,n))}return o}function writeRecord(e,t,n){let r=Object.create(null);if(e.literalType===`ExactNumber`)return r.literalType=`ExactNumber`,r.value=e.value,r;for(let i of Object.keys(e))i!==`toJSON`&&e[i]!==void 0&&(r[i]=write(e[i],t,n));return r}function validateNumbers(e,t,n){if(assertSupportedDepth(t,n),Array.isArray(e))for(let r=0;r<e.length;r++)validateNumbers(e[r],t,n+1);else isObject(e)&&validateNodeNumbers(e,t,n)}function validateNodeNumbers(e,t,n){t=resolveNumericMode(e,t,n),assertCompleteSourceRoot(e,t,n),t===`exact`&&isNode(e)&&c(e),validateRawNumericText(e,t),e.kind===`LiteralExpressionSyntax`&&Object.hasOwn(e,`value`)&&validateLiteralValue(e.value,t),validateNumberMembers(e,t,n)}function assertSupportedDepth(e,t){if(t>96&&e===`exact`)throw new n(`Syntax nesting exceeds the supported depth of 96.`)}function assertCompleteSourceRoot(e,t,r){if(isIncompleteExactRoot(e,t,r))throw new n(`Exact syntax requires a complete source root.`)}function isIncompleteExactRoot(e,t,n){return n===0&&t===`exact`&&!f.has(e.kind)}function resolveNumericMode(e,t,a){if(!f.has(e.kind)&&!Object.hasOwn(e,`sourceOptions`))return t;let o=Object.hasOwn(e,`sourceOptions`)?i(e.sourceOptions):r;if(a>0&&t!==o.numericMode)throw new n(`Conflicting source numeric options.`);return o.numericMode}function validateRawNumericText(t,r){if(t.kind===`RawExpressionSyntax`&&r===`exact`&&typeof t.text==`string`&&e(t.text))throw new n(`An exact numeric operand must be an explicit ExactNumber, not opaque numeric text.`)}function isUnsupportedExactPrimitive(e){return typeof e==`number`||e!==null&&![`string`,`boolean`,`object`].includes(typeof e)}function validateLiteralValue(e,t){if(t===`exact`&&isUnsupportedExactPrimitive(e))throw new n(`Exact source requires supported primitive values or an explicit ExactNumber literal.`);isObject(e)&&validateObjectLiteral(e,t)}function validateObjectLiteral(e,t){if(e.literalType===`ExactNumber`)validateExactNumberLiteral(e,t);else if(t===`exact`)throw new n(`Exact source refuses old or plain object literal insertion.`)}function isWellFormedExactNumber(e){return typeof e.value==`string`&&t(e.value)?.value===e.value&&Object.keys(e).length===2}function validateExactNumberLiteral(e,t){if(t!==`exact`||!isWellFormedExactNumber(e))throw new n(`Malformed or incompatible ExactNumber literal.`)}function validateNumberMembers(e,t,n){let r=t===`exact`&&isNode(e)?o(e.kind):void 0;for(let[i,a]of Object.entries(e))isTraversedMember(r,i,a)&&validateNumbers(a,t,n+1)}function isTraversedMember(e,t,n){return(e===void 0||e.has(t)||isNode(n)&&f.has(n.kind))&&!d.has(t)}function ordinal(e,t){return e<t?-1:+(e>t)}export{toSyntaxJson};
2
2
  //# sourceMappingURL=SyntaxJson.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SyntaxJson.js","names":["value","omitted","sourceRoots","detached","node","copies","pending","items","length","index","copy","names","name","member","omittedWhenNull","omittedWhenEmpty","omittedWhenDefault","table","kind","defaults","owningMode","complete","validateClosedSyntaxMembers","rule","structural","known","syntaxMemberNames","isLegacyOmittedMember","validatedSourceOptions","legacySourceOptions","validateSyntaxInvariants","result","memberValue","record","depth","validateSyntaxMembers","InvalidSyntaxJson","options","isExactNumberToken","literal","parseExactNumber","skipped","left","right"],"sources":["../../../../../../Compiler/Syntax/SyntaxJson.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { SyntaxNode } from './SyntaxNode';\nimport { InvalidSyntaxJson } from './InvalidSyntaxJson';\nimport { isExactNumberToken, parseExactNumber } from './ExactNumber';\nimport { validateSyntaxInvariants } from './SyntaxInvariants';\nimport { syntaxMemberNames, validateClosedSyntaxMembers, validateSyntaxMembers } from './SyntaxMemberContracts';\nimport { ValidationRuleSyntax } from './Commands';\nimport { isLegacyOmittedMember } from './LegacyWireProjection';\nimport { legacySourceOptions, validatedSourceOptions } from './SourceOptions';\n\n// Returned record objects have null prototypes.\nexport type SyntaxJsonValue = string | number | boolean | null | SyntaxJsonValue[] | { [member: string]: SyntaxJsonValue };\n\nconst isNode = (value: unknown): value is SyntaxNode =>\n typeof value === 'object' && value !== null && typeof (value as { kind?: unknown }).kind === 'string';\nconst omitted = new Set(['kind', 'location', 'targetLocation', 'referenceLocation', 'referenceLength', 'nameWasEscaped', 'declaredTriggers', 'directiveLocations']);\nconst sourceRoots = new Set(['ApplicationSyntax', 'ProjectionSyntax', 'CaptureSyntax', 'SpecificationSyntax']);\n\n// The canonical JSON form of a syntax tree, the same form the C# SyntaxJson writes: 'kind' first, then the\n// members in ordinal order, with source locations left out. Because a node only carries the members this\n// compiler models, the result is the C# form narrowed to those members.\nexport function toSyntaxJson(node: SyntaxNode): SyntaxJsonValue {\n const detached = snapshot(node);\n validateNumbers(detached, 'legacy', 0);\n return write(detached);\n}\n\n// The enriched internal tree written completely, Legacy members included. Not a wire form: it exists so the\n// walker and other tree consumers can be held to every node the parser builds.\nexport function toCompleteSyntaxJson(node: SyntaxNode): SyntaxJsonValue {\n const detached = snapshot(node);\n validateNumbers(detached, 'legacy', 0);\n return write(detached, 'legacy', true);\n}\n\n// Read caller-owned properties only once, before validation. Both validation and projection see the same\n// detached data; accessors, proxies and shared references cannot change it between passes.\nfunction snapshot(value: unknown): unknown {\n const copies = new WeakMap<object, unknown>();\n const pending: (() => void)[] = [];\n // Schedule depth-first reads without consuming the call stack, including for ignored metadata.\n function detach(value: unknown): unknown {\n if (typeof value !== 'object' || value === null) return value;\n if (copies.has(value)) return copies.get(value);\n return Array.isArray(value) ? detachArray(value) : detachObject(value);\n }\n function detachArray(value: unknown[]): unknown {\n const items = dataArray<unknown>();\n copies.set(value, items);\n const length = value.length;\n for (let index = length - 1; index >= 0; index--) pending.push(() => {\n items[index] = detach(Object.hasOwn(value, index) ? value[index] : undefined);\n });\n return items;\n }\n function detachObject(value: object): unknown {\n const copy = Object.create(null) as Record<string, unknown>;\n copies.set(value, copy);\n const names = Object.keys(value);\n // Node identity also accepts inherited, hidden and class-getter kinds; read it just once.\n if (!names.includes('kind') && 'kind' in value) names.unshift('kind');\n for (let index = names.length - 1; index >= 0; index--) pending.push(() => {\n const name = names[index];\n const member = (value as Record<string, unknown>)[name];\n if (name === 'sourceOptions') pending.push(() => preserveRejectedSourceOptions(copy, name, member));\n copy[name] = detach(member);\n });\n return copy;\n }\n const detached = detach(value);\n while (pending.length > 0) pending.pop()!();\n return detached;\n}\n\n// Source option contracts also reject exotic prototypes and hidden/symbol members. Preserve\n// that rejected shape as data rather than sanitizing it into an apparently valid option record.\nfunction preserveRejectedSourceOptions(copy: Record<string, unknown>, name: string, member: unknown): void {\n if (typeof member === 'object' && member !== null && hasExoticShape(member)) {\n copy[name] = Object.assign(Object.create(null), { numericMode: 'invalid' });\n }\n}\n\nfunction hasExoticShape(member: object): boolean {\n return (Object.getPrototypeOf(member) !== Object.prototype && Object.getPrototypeOf(member) !== null) || Reflect.ownKeys(member).length !== Object.keys(member).length;\n}\n\nfunction dataArray<T>(): T[] {\n const items: T[] = [];\n // JSON.stringify consults inherited toJSON even on plain arrays. Shadow that hook without changing\n // their indexed JSON bytes or normal Array prototype (including for existing tree consumers).\n Object.defineProperty(items, 'toJSON', { value: undefined });\n return items;\n}\n\n// Members omitted from the wire form when null (or undefined), by node kind.\nconst omittedWhenNull: Record<string, readonly string[]> = {\n ApplicationSyntax: ['identity'],\n EventSyntax: ['origin'],\n ImportSyntax: ['origin'],\n SliceSyntax: ['direction'],\n ReactionSyntax: ['from'],\n ReducerSyntax: ['from'],\n ProducesSyntax: ['stream'],\n ConceptAttributeSyntax: ['scope', 'specialCategory'],\n ConceptSyntax: ['description', 'valueNumbers'],\n PolicySyntax: ['description'],\n FileConstraintSyntax: ['description'],\n UniqueEventConstraintSyntax: ['description'],\n UniquePropertyConstraintSyntax: ['description'],\n ProjectionSyntax: ['description'],\n ScreenSyntax: ['description'],\n FormSyntax: ['description'],\n SpecificationSyntax: ['description', 'whenRedelivered'],\n SpecificationErrorSyntax: ['caseValue'],\n SpecificationExampleSyntax: ['stream', 'noStream'],\n SpecificationRedeliverySyntax: ['stream', 'noStream']\n};\n\n// Members omitted from the wire form when empty arrays, by node kind.\nconst omittedWhenEmpty: Record<string, readonly string[]> = {\n ModuleSyntax: ['dependsOn'],\n FeatureSyntax: ['dependsOn'],\n SpecificationSyntax: ['parameters', 'cases'],\n InvokesSyntax: ['onRefused']\n};\n\n// Members omitted when they hold their default value, by node kind.\nconst omittedWhenDefault: Record<string, Record<string, unknown>> = {\n EventSyntax: { visibility: 'Private' },\n ImportSyntax: { visibility: 'Private' },\n ConceptAttributeSyntax: { criminal: false },\n PropertySyntax: { isSubject: false },\n SpecificationSyntax: { thenNoEvents: false }\n};\n\nconst ownEntry = <T>(table: Record<string, T>, kind: string): T | undefined => Object.hasOwn(table, kind) ? table[kind] : undefined;\nconst isEmptyArray = (value: unknown): boolean => Array.isArray(value) && value.length === 0;\n\nfunction isNullOmitted(kind: string, member: string, value: unknown): boolean {\n if (value != null) return false;\n return ownEntry(omittedWhenNull, kind)?.includes(member) === true\n || member === 'inlineProperty'\n || (member === 'documentation' && kind !== 'EventSyntax');\n}\n\nfunction isEmptyOmitted(kind: string, member: string, value: unknown): boolean {\n if (!isEmptyArray(value)) return false;\n return ownEntry(omittedWhenEmpty, kind)?.includes(member) === true || member === 'examples' || member === 'purposes';\n}\n\nfunction isDefaultOmitted(kind: string, member: string, value: unknown): boolean {\n if (member === 'sourceOptions') return (value as { numericMode?: string } | undefined)?.numericMode === 'legacy';\n const defaults = ownEntry(omittedWhenDefault, kind);\n return defaults !== undefined && Object.hasOwn(defaults, member) && value === defaults[member];\n}\n\nfunction isOmittedByDefault(kind: string, member: string, value: unknown): boolean {\n return isNullOmitted(kind, member, value) || isEmptyOmitted(kind, member, value) || isDefaultOmitted(kind, member, value);\n}\n\nfunction write(value: unknown, owningMode = 'legacy', complete = false): SyntaxJsonValue {\n if (Array.isArray(value)) return writeArray(value, owningMode, complete);\n if (isNode(value)) return writeNode(value, owningMode, complete);\n if (value === undefined) return null;\n if (typeof value !== 'object' || value === null) return value as SyntaxJsonValue;\n return writeRecord(value as Record<string, unknown>, owningMode, complete);\n}\n\nfunction writeArray(value: unknown[], owningMode: string, complete: boolean): SyntaxJsonValue {\n // A fresh plain array: never map (Symbol.species) or serialize through a caller-supplied hook.\n const items = dataArray<SyntaxJsonValue>();\n for (let index = 0; index < value.length; index++) items.push(write(value[index], owningMode, complete));\n return items;\n}\n\nfunction validateClosedImplementationShapes(value: SyntaxNode): void {\n // #307 shapes are closed in both modes, before any projection can hide unknown members.\n if (value.kind === 'ImplementationSyntax' || value.kind === 'ImplementationHintSyntax') validateClosedSyntaxMembers(value, omitted);\n if (value.kind !== 'ValidationRuleSyntax') return;\n const rule = value as ValidationRuleSyntax;\n if (rule.implementation == null) return;\n if (rule.file != null) validateClosedSyntaxMembers(rule.file, omitted);\n if (rule.code != null) validateClosedSyntaxMembers(rule.code, omitted);\n}\n\nfunction structuralMembers(value: SyntaxNode): Record<string, unknown> {\n const structural = { ...value } as unknown as Record<string, unknown>;\n if (value.kind === 'ApplicationSyntax' && structural.eventSources === undefined) structural.eventSources = [];\n if (value.kind === 'CommandSyntax' && structural.stream === undefined) structural.stream = null;\n if (value.kind === 'CommandSyntax' && structural.streamCandidates === undefined) structural.streamCandidates = [];\n return structural;\n}\n\nfunction projectedMemberNames(value: SyntaxNode, structural: Record<string, unknown>, owningMode: string, complete: boolean): string[] {\n const known = owningMode === 'exact' ? syntaxMemberNames(value.kind) : undefined;\n const hiddenByLegacy = (member: string) => owningMode === 'legacy' && !complete && isLegacyOmittedMember(value, member);\n const isProjected = (member: string) =>\n (known === undefined || known.has(member)) && !hiddenByLegacy(member) && !omitted.has(member) &&\n !(value.kind === 'OperationSyntax' && member === 'usesLocation');\n return Object.keys(structural).filter(isProjected).sort(ordinal);\n}\n\nfunction writeNode(value: SyntaxNode, owningMode: string, complete: boolean): SyntaxJsonValue {\n if (sourceRoots.has(value.kind)) owningMode = validatedSourceOptions((value as unknown as { sourceOptions?: unknown }).sourceOptions ?? legacySourceOptions).numericMode;\n validateSyntaxInvariants(value);\n validateClosedImplementationShapes(value);\n const result = Object.create(null) as Record<string, SyntaxJsonValue>;\n result.kind = value.kind;\n const structural = structuralMembers(value);\n for (const member of projectedMemberNames(value, structural, owningMode, complete)) {\n const memberValue = structural[member];\n if (isOmittedByDefault(value.kind, member, memberValue)) continue;\n result[member] = write(memberValue, owningMode, complete);\n }\n return result;\n}\n\nfunction writeRecord(record: Record<string, unknown>, owningMode: string, complete: boolean): SyntaxJsonValue {\n // The ordered ExactNumber form, whatever the input key order; other objects are copied without any toJSON hook.\n const copy = Object.create(null) as Record<string, SyntaxJsonValue>;\n if (record.literalType === 'ExactNumber') {\n copy.literalType = 'ExactNumber';\n copy.value = record.value as string;\n return copy;\n }\n for (const name of Object.keys(record)) if (name !== 'toJSON' && record[name] !== undefined) copy[name] = write(record[name], owningMode, complete);\n return copy;\n}\n\nfunction validateNumbers(value: unknown, owningMode: string, depth: number): void {\n assertSupportedDepth(owningMode, depth);\n if (Array.isArray(value)) {\n for (let index = 0; index < value.length; index++) validateNumbers(value[index], owningMode, depth + 1);\n return;\n }\n if (typeof value !== 'object' || value === null) return;\n const node = value as Record<string, unknown>;\n owningMode = resolveNumericMode(node, owningMode, depth);\n assertCompleteSourceRoot(node, owningMode, depth);\n if (owningMode === 'exact' && isNode(node)) validateSyntaxMembers(node);\n validateRawNumericText(node, owningMode);\n if (node.kind === 'LiteralExpressionSyntax' && Object.hasOwn(node, 'value')) validateLiteralValue(node.value, owningMode);\n validateNumberMembers(node, owningMode, depth);\n}\n\nfunction assertSupportedDepth(owningMode: string, depth: number): void {\n if (depth > 96 && owningMode === 'exact') throw new InvalidSyntaxJson('Syntax nesting exceeds the supported depth of 96.');\n}\n\nfunction assertCompleteSourceRoot(node: Record<string, unknown>, owningMode: string, depth: number): void {\n if (depth === 0 && owningMode === 'exact' && !sourceRoots.has(node.kind as string)) throw new InvalidSyntaxJson('Exact syntax requires a complete source root.');\n}\n\nfunction resolveNumericMode(node: Record<string, unknown>, owningMode: string, depth: number): string {\n if (!sourceRoots.has(node.kind as string) && !Object.hasOwn(node, 'sourceOptions')) return owningMode;\n // Omission is Legacy on every complete source root, never inheritance from its container.\n const options = Object.hasOwn(node, 'sourceOptions') ? validatedSourceOptions(node.sourceOptions) : legacySourceOptions;\n if (depth > 0 && owningMode !== options.numericMode) throw new InvalidSyntaxJson('Conflicting source numeric options.');\n return options.numericMode;\n}\n\nfunction validateRawNumericText(node: Record<string, unknown>, owningMode: string): void {\n if (node.kind !== 'RawExpressionSyntax' || owningMode !== 'exact') return;\n if (typeof node.text === 'string' && isExactNumberToken(node.text)) throw new InvalidSyntaxJson('An exact numeric operand must be an explicit ExactNumber, not opaque numeric text.');\n}\n\nfunction isUnsupportedExactPrimitive(value: unknown): boolean {\n return typeof value === 'number' || (value !== null && !['string', 'boolean', 'object'].includes(typeof value));\n}\n\nfunction validateLiteralValue(value: unknown, owningMode: string): void {\n if (owningMode === 'exact' && isUnsupportedExactPrimitive(value)) throw new InvalidSyntaxJson('Exact source requires supported primitive values or an explicit ExactNumber literal.');\n if (typeof value !== 'object' || value === null) return;\n const literal = value as { literalType?: unknown; value?: unknown };\n if (literal.literalType === 'ExactNumber') validateExactNumberLiteral(literal, owningMode);\n else if (owningMode === 'exact') throw new InvalidSyntaxJson('Exact source refuses old or plain object literal insertion.');\n}\n\nfunction isWellFormedExactNumber(literal: { value?: unknown }): boolean {\n return typeof literal.value === 'string' && parseExactNumber(literal.value)?.value === literal.value && Object.keys(literal).length === 2;\n}\n\nfunction validateExactNumberLiteral(literal: { value?: unknown }, owningMode: string): void {\n if (owningMode !== 'exact' || !isWellFormedExactNumber(literal)) throw new InvalidSyntaxJson('Malformed or incompatible ExactNumber literal.');\n}\n\nfunction validateNumberMembers(node: Record<string, unknown>, owningMode: string, depth: number): void {\n const known = owningMode === 'exact' && isNode(node) ? syntaxMemberNames(node.kind) : undefined;\n const skipped = new Set(['location', 'targetLocation', 'usesLocation']);\n const isTraversed = (name: string, member: unknown) =>\n (known === undefined || known.has(name) || (isNode(member) && sourceRoots.has(member.kind))) && !skipped.has(name);\n for (const [name, member] of Object.entries(node)) if (isTraversed(name, member)) validateNumbers(member, owningMode, depth + 1);\n}\n\nfunction ordinal(left: string, right: string): number {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n"],"mappings":"+gBAeA,MAAM,OAAU,GACZ,OAAOA,GAAU,YAAYA,GAAkB,OAAQA,EAA6B,MAAS,SAC3FC,kBAAU,IAAI,IAAI,CAAC,OAAQ,WAAY,iBAAkB,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"}
1
+ {"version":3,"file":"SyntaxJson.js","names":["value","omitted","skippedNumberMembers","sourceRoots","detached","node","copies","pending","items","length","index","copy","names","name","member","omittedWhenNull","omittedWhenEmpty","omittedWhenDefault","table","kind","defaults","owningMode","complete","validateClosedSyntaxMembers","rule","structural","known","syntaxMemberNames","isLegacyOmittedMember","validatedSourceOptions","legacySourceOptions","validateSyntaxInvariants","result","memberValue","record","depth","validateSyntaxMembers","InvalidSyntaxJson","options","isExactNumberToken","literal","parseExactNumber","left","right"],"sources":["../../../../../../Compiler/Syntax/SyntaxJson.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { SyntaxNode } from './SyntaxNode';\nimport { InvalidSyntaxJson } from './InvalidSyntaxJson';\nimport { isExactNumberToken, parseExactNumber } from './ExactNumber';\nimport { validateSyntaxInvariants } from './SyntaxInvariants';\nimport { syntaxMemberNames, validateClosedSyntaxMembers, validateSyntaxMembers } from './SyntaxMemberContracts';\nimport { ValidationRuleSyntax } from './Commands';\nimport { isLegacyOmittedMember } from './LegacyWireProjection';\nimport { legacySourceOptions, validatedSourceOptions } from './SourceOptions';\n\n// Returned record objects have null prototypes.\nexport type SyntaxJsonValue = string | number | boolean | null | SyntaxJsonValue[] | { [member: string]: SyntaxJsonValue };\n\nconst isNode = (value: unknown): value is SyntaxNode =>\n typeof value === 'object' && value !== null && typeof (value as { kind?: unknown }).kind === 'string';\nconst isObject = (value: unknown): value is object => typeof value === 'object' && value !== null;\nconst omitted = new Set(['kind', 'location', 'targetLocation', 'referenceLocation', 'referenceLength', 'nameWasEscaped', 'declaredTriggers', 'directiveLocations']);\nconst skippedNumberMembers = new Set(['location', 'targetLocation', 'usesLocation']);\nconst sourceRoots = new Set(['ApplicationSyntax', 'ProjectionSyntax', 'CaptureSyntax', 'SpecificationSyntax']);\n\n// The canonical JSON form of a syntax tree, the same form the C# SyntaxJson writes: 'kind' first, then the\n// members in ordinal order, with source locations left out. Because a node only carries the members this\n// compiler models, the result is the C# form narrowed to those members.\nexport function toSyntaxJson(node: SyntaxNode): SyntaxJsonValue {\n const detached = snapshot(node);\n validateNumbers(detached, 'legacy', 0);\n return write(detached);\n}\n\n// The enriched internal tree written completely, Legacy members included. Not a wire form: it exists so the\n// walker and other tree consumers can be held to every node the parser builds.\nexport function toCompleteSyntaxJson(node: SyntaxNode): SyntaxJsonValue {\n const detached = snapshot(node);\n validateNumbers(detached, 'legacy', 0);\n return write(detached, 'legacy', true);\n}\n\n// Read caller-owned properties only once, before validation. Both validation and projection see the same\n// detached data; accessors, proxies and shared references cannot change it between passes.\nfunction snapshot(value: unknown): unknown {\n const copies = new WeakMap<object, unknown>();\n const pending: (() => void)[] = [];\n // Schedule depth-first reads without consuming the call stack, including for ignored metadata.\n function detach(value: unknown): unknown {\n if (!isObject(value)) return value;\n if (copies.has(value)) return copies.get(value);\n return Array.isArray(value) ? detachArray(value) : detachObject(value);\n }\n function detachArray(value: unknown[]): unknown {\n const items = dataArray<unknown>();\n copies.set(value, items);\n const length = value.length;\n for (let index = length - 1; index >= 0; index--) pending.push(() => {\n items[index] = detach(Object.hasOwn(value, index) ? value[index] : undefined);\n });\n return items;\n }\n function detachObject(value: object): unknown {\n const copy = Object.create(null) as Record<string, unknown>;\n copies.set(value, copy);\n const names = Object.keys(value);\n // Node identity also accepts inherited, hidden and class-getter kinds; read it just once.\n if (!names.includes('kind') && 'kind' in value) names.unshift('kind');\n for (let index = names.length - 1; index >= 0; index--) pending.push(() => {\n const name = names[index];\n const member = (value as Record<string, unknown>)[name];\n if (name === 'sourceOptions') pending.push(() => preserveRejectedSourceOptions(copy, name, member));\n copy[name] = detach(member);\n });\n return copy;\n }\n const detached = detach(value);\n while (pending.length > 0) pending.pop()!();\n return detached;\n}\n\n// Source option contracts also reject exotic prototypes and hidden/symbol members. Preserve\n// that rejected shape as data rather than sanitizing it into an apparently valid option record.\nfunction preserveRejectedSourceOptions(copy: Record<string, unknown>, name: string, member: unknown): void {\n if (isObject(member) && hasExoticShape(member)) {\n copy[name] = Object.assign(Object.create(null), { numericMode: 'invalid' });\n }\n}\n\nfunction hasExoticShape(member: object): boolean {\n return (Object.getPrototypeOf(member) !== Object.prototype && Object.getPrototypeOf(member) !== null) || Reflect.ownKeys(member).length !== Object.keys(member).length;\n}\n\nfunction dataArray<T>(): T[] {\n const items: T[] = [];\n // JSON.stringify consults inherited toJSON even on plain arrays. Shadow that hook without changing\n // their indexed JSON bytes or normal Array prototype (including for existing tree consumers).\n Object.defineProperty(items, 'toJSON', { value: undefined });\n return items;\n}\n\n// Members omitted from the wire form when null (or undefined), by node kind.\nconst omittedWhenNull: Record<string, readonly string[]> = {\n ApplicationSyntax: ['identity'],\n EventSyntax: ['origin'],\n ImportSyntax: ['origin'],\n SliceSyntax: ['direction'],\n ReactionSyntax: ['from'],\n ReducerSyntax: ['from'],\n ProducesSyntax: ['stream'],\n ConceptAttributeSyntax: ['scope', 'specialCategory'],\n ConceptSyntax: ['description', 'valueNumbers'],\n PolicySyntax: ['description'],\n FileConstraintSyntax: ['description'],\n UniqueEventConstraintSyntax: ['description'],\n UniquePropertyConstraintSyntax: ['description'],\n ProjectionSyntax: ['description'],\n ScreenSyntax: ['description'],\n FormSyntax: ['description'],\n SpecificationSyntax: ['description', 'whenRedelivered'],\n SpecificationErrorSyntax: ['caseValue'],\n SpecificationExampleSyntax: ['stream', 'noStream'],\n SpecificationRedeliverySyntax: ['stream', 'noStream']\n};\n\n// Members omitted from the wire form when empty arrays, by node kind.\nconst omittedWhenEmpty: Record<string, readonly string[]> = {\n ModuleSyntax: ['dependsOn'],\n FeatureSyntax: ['dependsOn'],\n SpecificationSyntax: ['parameters', 'cases'],\n InvokesSyntax: ['onRefused']\n};\n\n// Members omitted when they hold their default value, by node kind.\nconst omittedWhenDefault: Record<string, Record<string, unknown>> = {\n EventSyntax: { visibility: 'Private' },\n ImportSyntax: { visibility: 'Private' },\n ConceptAttributeSyntax: { criminal: false },\n PropertySyntax: { isSubject: false },\n SpecificationSyntax: { thenNoEvents: false }\n};\n\nconst ownEntry = <T>(table: Record<string, T>, kind: string): T | undefined => Object.hasOwn(table, kind) ? table[kind] : undefined;\nconst isEmptyArray = (value: unknown): boolean => Array.isArray(value) && value.length === 0;\n\nfunction isNullOmitted(kind: string, member: string, value: unknown): boolean {\n if (value != null) return false;\n return ownEntry(omittedWhenNull, kind)?.includes(member) === true\n || member === 'inlineProperty'\n || (member === 'documentation' && kind !== 'EventSyntax');\n}\n\nfunction isEmptyOmitted(kind: string, member: string, value: unknown): boolean {\n if (!isEmptyArray(value)) return false;\n return ownEntry(omittedWhenEmpty, kind)?.includes(member) === true || member === 'examples' || member === 'purposes';\n}\n\nfunction isDefaultOmitted(kind: string, member: string, value: unknown): boolean {\n if (member === 'sourceOptions') return (value as { numericMode?: string } | undefined)?.numericMode === 'legacy';\n const defaults = ownEntry(omittedWhenDefault, kind);\n return defaults !== undefined && Object.hasOwn(defaults, member) && value === defaults[member];\n}\n\nfunction isOmittedByDefault(kind: string, member: string, value: unknown): boolean {\n return isNullOmitted(kind, member, value) || isEmptyOmitted(kind, member, value) || isDefaultOmitted(kind, member, value);\n}\n\nfunction write(value: unknown, owningMode = 'legacy', complete = false): SyntaxJsonValue {\n if (Array.isArray(value)) return writeArray(value, owningMode, complete);\n if (isNode(value)) return writeNode(value, owningMode, complete);\n if (value === undefined) return null;\n if (!isObject(value)) return value as SyntaxJsonValue;\n return writeRecord(value as Record<string, unknown>, owningMode, complete);\n}\n\nfunction writeArray(value: unknown[], owningMode: string, complete: boolean): SyntaxJsonValue {\n // A fresh plain array: never map (Symbol.species) or serialize through a caller-supplied hook.\n const items = dataArray<SyntaxJsonValue>();\n for (let index = 0; index < value.length; index++) items.push(write(value[index], owningMode, complete));\n return items;\n}\n\nfunction validateClosedImplementationShapes(value: SyntaxNode): void {\n // #307 shapes are closed in both modes, before any projection can hide unknown members.\n if (value.kind === 'ImplementationSyntax' || value.kind === 'ImplementationHintSyntax') validateClosedSyntaxMembers(value, omitted);\n if (value.kind !== 'ValidationRuleSyntax') return;\n const rule = value as ValidationRuleSyntax;\n if (rule.implementation == null) return;\n if (rule.file != null) validateClosedSyntaxMembers(rule.file, omitted);\n if (rule.code != null) validateClosedSyntaxMembers(rule.code, omitted);\n}\n\nfunction structuralMembers(value: SyntaxNode): Record<string, unknown> {\n const structural = { ...value } as unknown as Record<string, unknown>;\n if (value.kind === 'ApplicationSyntax' && structural.eventSources === undefined) structural.eventSources = [];\n if (value.kind === 'CommandSyntax' && structural.stream === undefined) structural.stream = null;\n if (value.kind === 'CommandSyntax' && structural.streamCandidates === undefined) structural.streamCandidates = [];\n return structural;\n}\n\nfunction projectedMemberNames(value: SyntaxNode, structural: Record<string, unknown>, owningMode: string, complete: boolean): string[] {\n const known = owningMode === 'exact' ? syntaxMemberNames(value.kind) : undefined;\n const isProjected = (member: string) =>\n (known === undefined || known.has(member)) && !isHiddenByLegacy(value, member, owningMode, complete) && !isAlwaysOmitted(value, member);\n return Object.keys(structural).filter(isProjected).sort(ordinal);\n}\n\nfunction isHiddenByLegacy(value: SyntaxNode, member: string, owningMode: string, complete: boolean): boolean {\n return owningMode === 'legacy' && !complete && isLegacyOmittedMember(value, member);\n}\n\nfunction isAlwaysOmitted(value: SyntaxNode, member: string): boolean {\n return omitted.has(member) || (value.kind === 'OperationSyntax' && member === 'usesLocation');\n}\n\nfunction writeNode(value: SyntaxNode, owningMode: string, complete: boolean): SyntaxJsonValue {\n if (sourceRoots.has(value.kind)) owningMode = validatedSourceOptions((value as unknown as { sourceOptions?: unknown }).sourceOptions ?? legacySourceOptions).numericMode;\n validateSyntaxInvariants(value);\n validateClosedImplementationShapes(value);\n const result = Object.create(null) as Record<string, SyntaxJsonValue>;\n result.kind = value.kind;\n const structural = structuralMembers(value);\n for (const member of projectedMemberNames(value, structural, owningMode, complete)) {\n const memberValue = structural[member];\n if (isOmittedByDefault(value.kind, member, memberValue)) continue;\n result[member] = write(memberValue, owningMode, complete);\n }\n return result;\n}\n\nfunction writeRecord(record: Record<string, unknown>, owningMode: string, complete: boolean): SyntaxJsonValue {\n // The ordered ExactNumber form, whatever the input key order; other objects are copied without any toJSON hook.\n const copy = Object.create(null) as Record<string, SyntaxJsonValue>;\n if (record.literalType === 'ExactNumber') {\n copy.literalType = 'ExactNumber';\n copy.value = record.value as string;\n return copy;\n }\n for (const name of Object.keys(record)) if (name !== 'toJSON' && record[name] !== undefined) copy[name] = write(record[name], owningMode, complete);\n return copy;\n}\n\nfunction validateNumbers(value: unknown, owningMode: string, depth: number): void {\n assertSupportedDepth(owningMode, depth);\n if (Array.isArray(value)) {\n for (let index = 0; index < value.length; index++) validateNumbers(value[index], owningMode, depth + 1);\n return;\n }\n if (!isObject(value)) return;\n validateNodeNumbers(value as Record<string, unknown>, owningMode, depth);\n}\n\nfunction validateNodeNumbers(node: Record<string, unknown>, owningMode: string, depth: number): void {\n owningMode = resolveNumericMode(node, owningMode, depth);\n assertCompleteSourceRoot(node, owningMode, depth);\n if (owningMode === 'exact' && isNode(node)) validateSyntaxMembers(node);\n validateRawNumericText(node, owningMode);\n if (node.kind === 'LiteralExpressionSyntax' && Object.hasOwn(node, 'value')) validateLiteralValue(node.value, owningMode);\n validateNumberMembers(node, owningMode, depth);\n}\n\nfunction assertSupportedDepth(owningMode: string, depth: number): void {\n if (depth > 96 && owningMode === 'exact') throw new InvalidSyntaxJson('Syntax nesting exceeds the supported depth of 96.');\n}\n\nfunction assertCompleteSourceRoot(node: Record<string, unknown>, owningMode: string, depth: number): void {\n if (isIncompleteExactRoot(node, owningMode, depth)) throw new InvalidSyntaxJson('Exact syntax requires a complete source root.');\n}\n\nfunction isIncompleteExactRoot(node: Record<string, unknown>, owningMode: string, depth: number): boolean {\n return depth === 0 && owningMode === 'exact' && !sourceRoots.has(node.kind as string);\n}\n\nfunction resolveNumericMode(node: Record<string, unknown>, owningMode: string, depth: number): string {\n if (!sourceRoots.has(node.kind as string) && !Object.hasOwn(node, 'sourceOptions')) return owningMode;\n // Omission is Legacy on every complete source root, never inheritance from its container.\n const options = Object.hasOwn(node, 'sourceOptions') ? validatedSourceOptions(node.sourceOptions) : legacySourceOptions;\n if (depth > 0 && owningMode !== options.numericMode) throw new InvalidSyntaxJson('Conflicting source numeric options.');\n return options.numericMode;\n}\n\nfunction validateRawNumericText(node: Record<string, unknown>, owningMode: string): void {\n if (node.kind !== 'RawExpressionSyntax' || owningMode !== 'exact') return;\n if (typeof node.text === 'string' && isExactNumberToken(node.text)) throw new InvalidSyntaxJson('An exact numeric operand must be an explicit ExactNumber, not opaque numeric text.');\n}\n\nfunction isUnsupportedExactPrimitive(value: unknown): boolean {\n return typeof value === 'number' || (value !== null && !['string', 'boolean', 'object'].includes(typeof value));\n}\n\nfunction validateLiteralValue(value: unknown, owningMode: string): void {\n if (owningMode === 'exact' && isUnsupportedExactPrimitive(value)) throw new InvalidSyntaxJson('Exact source requires supported primitive values or an explicit ExactNumber literal.');\n if (!isObject(value)) return;\n validateObjectLiteral(value as { literalType?: unknown; value?: unknown }, owningMode);\n}\n\nfunction validateObjectLiteral(literal: { literalType?: unknown; value?: unknown }, owningMode: string): void {\n if (literal.literalType === 'ExactNumber') validateExactNumberLiteral(literal, owningMode);\n else if (owningMode === 'exact') throw new InvalidSyntaxJson('Exact source refuses old or plain object literal insertion.');\n}\n\nfunction isWellFormedExactNumber(literal: { value?: unknown }): boolean {\n return typeof literal.value === 'string' && parseExactNumber(literal.value)?.value === literal.value && Object.keys(literal).length === 2;\n}\n\nfunction validateExactNumberLiteral(literal: { value?: unknown }, owningMode: string): void {\n if (owningMode !== 'exact' || !isWellFormedExactNumber(literal)) throw new InvalidSyntaxJson('Malformed or incompatible ExactNumber literal.');\n}\n\nfunction validateNumberMembers(node: Record<string, unknown>, owningMode: string, depth: number): void {\n const known = owningMode === 'exact' && isNode(node) ? syntaxMemberNames(node.kind) : undefined;\n for (const [name, member] of Object.entries(node)) if (isTraversedMember(known, name, member)) validateNumbers(member, owningMode, depth + 1);\n}\n\nfunction isTraversedMember(known: ReadonlySet<string> | undefined, name: string, member: unknown): boolean {\n return (known === undefined || known.has(name) || (isNode(member) && sourceRoots.has(member.kind))) && !skippedNumberMembers.has(name);\n}\n\nfunction ordinal(left: string, right: string): number {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n"],"mappings":"+gBAeA,MAAM,OAAU,GACZ,OAAOA,GAAU,YAAYA,GAAkB,OAAQA,EAA6B,MAAS,SAC3F,SAAY,GAAoC,OAAOA,GAAU,YAAYA,EAC7EC,kBAAU,IAAI,IAAI,CAAC,OAAQ,WAAY,iBAAkB,oBAAqB,kBAAmB,iBAAkB,mBAAoB,oBAAoB,CAAC,EAC5JC,kBAAuB,IAAI,IAAI,CAAC,WAAY,iBAAkB,cAAc,CAAC,EAC7EC,kBAAc,IAAI,IAAI,CAAC,oBAAqB,mBAAoB,gBAAiB,qBAAqB,CAAC,EAK7G,SAAgB,aAAa,EAAmC,CAC5D,IAAMC,EAAW,SAASC,CAAI,EAE9B,OADA,gBAAgBD,EAAU,SAAU,CAAC,EAC9B,MAAMA,CAAQ,CACzB,CAYA,SAAS,SAAS,EAAyB,CACvC,IAAME,kBAAS,IAAI,QACbC,EAA0B,CAAC,EAEjC,SAAS,OAAO,EAAyB,CAGrC,OAFK,SAASP,CAAK,EACfM,EAAO,IAAIN,CAAK,EAAUM,EAAO,IAAIN,CAAK,EACvC,MAAM,QAAQA,CAAK,EAAI,YAAYA,CAAK,EAAI,aAAaA,CAAK,EAFxCA,CAGjC,CACA,SAAS,YAAY,EAA2B,CAC5C,IAAMQ,EAAQ,UAAmB,EACjCF,EAAO,IAAIN,EAAOQ,CAAK,EACvB,IAAMC,EAAST,EAAM,OACrB,IAAK,IAAIU,EAAQD,EAAS,EAAGC,GAAS,EAAG,IAASH,EAAQ,SAAW,CACjE,EAAMG,GAAS,OAAO,OAAO,OAAOV,EAAOU,CAAK,EAAIV,EAAMU,GAAS,IAAA,EAAS,CAChF,CAAC,EACD,OAAOF,CAC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AAO,CAAC,CAAC,SAAW,CAC5I,CAEA,SAAS,2BAA2B,EAA8B,EAA0B,CACxF,GAAInB,IAAe,SAAW,CAAC,wBAAwBmB,CAAO,EAAG,MAAM,IAAIH,EAAkB,gDAAgD,CACjJ,CAEA,SAAS,sBAAsB,EAA+B,EAAoB,EAAqB,CACnG,IAAMX,EAAQL,IAAe,SAAW,OAAOhB,CAAI,EAAIsB,EAAkBtB,EAAK,IAAI,EAAI,IAAA,GACtF,IAAK,GAAM,CAACQ,EAAMC,KAAW,OAAO,QAAQT,CAAI,EAAO,kBAAkBqB,EAAOb,EAAMC,CAAM,GAAG,gBAAgBA,EAAQO,EAAYc,EAAQ,CAAC,CAChJ,CAEA,SAAS,kBAAkB,EAAwC,EAAc,EAA0B,CACvG,OAAQT,IAAU,IAAA,IAAaA,EAAM,IAAIb,CAAI,GAAM,OAAOC,CAAM,GAAKX,EAAY,IAAIW,EAAO,IAAI,IAAO,CAACZ,EAAqB,IAAIW,CAAI,CACzI,CAEA,SAAS,QAAQ,EAAc,EAAuB,CAClD,OAAO6B,EAAOC,EAAQ,GAAK,IAAOA,EACtC"}
@@ -1,2 +1,2 @@
1
- import"./_virtual/_virtual/_rolldown/runtime.js";import{eventContextPaths as e}from"./event-context-catalog.js";import"./event-context.js";const t={implementation:`Handler-only intent with ordered hints and at most one file or tagged fence. No payload means pending. Handler execution is unsupported; this is not confirmation.`,hint:`One nonblank quoted implementation hint. Order and decoded text are retained; hints do not execute or confirm code.`},n={parameter:`A typed value declared by a specification table, or an argument of a named behavior. Table types are required; every case supplies each parameter exactly once.`,case:`One named concrete row of a specification table, expanded as <Specification>_<Case>. Use case.<parameter> for a whole step value.`,example:"One typed, possibly partial fixture: `example <Name> : <EventOrCommandOrReadModel>`. Use its name in a matching specification step; assignments override example values without changing matching or supplying defaults. Event examples may carry stream or no stream; a step replaces that route as a whole.",domain:`The domain the file belongs to — optional, at most one per file, before everything else.`,import:'Imports a type from another module by its qualified name — `import Module.Type` — making it available by its short name; or, quoted, other `.play` files by path or glob — `import "Orders/**/*.play"`, relative to this file\'s folder. Written inside a module or feature, a file import places the imported files there: their top level is that module\'s or feature\'s body. `import Module.Event from "origin"` is instead public contract metadata with an opaque origin; executable binding refuses it with PLAY0268.',concept:`A formalized value type wrapping a primitive. Bare pii and secret markers travel with every usage, with optional concept notes and qualifiers.`,type:`A composite value type — a named shape built from several properties, referenced by events, commands and other types the same way a concept is.`,reason:`A free-text concept note, not a lawful basis. Written as pii reason "..." or secret reason "..."; migration preserves it verbatim.`,optional:"Allows a value to be absent. Write it after the type: `note String optional` or `lines InvoiceLine[] optional`. The collection itself may be absent; its items keep their declared type.",identifier:`Marks the command property a runtime resolves the event source id from. At most one per command; without it a new Uuid is generated.`,policy:`A named authorization rule referenced by commands and queries. Multiple policies AND together.`,purpose:`A report-only processing declaration (GDPR Art. 30), referenced on modules, features and slices. Coverage is their union, not an authorization gate. Generated declarations are not legal advice.`,basis:`One declared Art. 6(1) basis: consent, contract, legalObligation, vitalInterests, publicTask or legitimateInterests; an optional quoted reference may follow.`,interest:`The legitimate-interest statement for basis legitimateInterests (Art. 13(1)(d)).`,condition:`One Art. 9(2) processing condition, optionally followed by a quoted reference.`,subjects:`Comma-separated categories of data subjects, as open identifiers.`,retention:`Declared retention period or criteria, not enforced by the model or Chronicle.`,recipient:`A quoted recipient category; repeatable on a purpose.`,transfer:`A declared destination followed by safeguard and quoted safeguards; repeatable.`,safeguard:`The declared safeguard accompanying a third-country transfer.`,erasure:`An erasure exception under Art. 17(3); Chronicle crypto-shredding remains per subject, not per purpose.`,exception:`One declared Art. 17(3) exception: expression, legalObligation, publicTask, publicHealth, archiving or legalClaims.`,persona:`A named role interacting with the application, with an optional description and its associated policies.`,identity:"Declares typed additional caller details from a claim, a keyed single-result query, inline code or a file. Authoring metadata only; executable use of `$identity.<detail>` reports PLAY0268 until admitted (#600).",authentication:`Declares the identity providers of the application — at most one block per file.`,provider:"A named identity provider within `authentication`, with free-form `name value` settings.",description:"A human-readable description, including the rule or case a specification witnesses, as a quoted single line or a fenced ```text block for multiple lines.",depends:"Declares `depends on <Name>` on a module or feature. This opts only that container into checking counted explicit references against its own declarations; it does not change executable bytes.",module:`The top-level namespace — maps to a bounded context.`,layout:`A reusable screen template with named slots.`,template:`Declares the named slots of a layout.`,feature:`A vertical slice grouping. Features nest arbitrarily deep.`,slice:`The atomic unit of behavior, aligned with Event Modeling. Has a type and a name.`,public:`Marks an event as a public contract. An event with from "origin" is also public. Origin is opaque, not a path or declaration reference. Public events and origins are admitted by executable semantic model (ESM) v9.`,direction:`Declare direction inbound or direction outbound once inside a Translate slice. Admitted by executable semantic model (ESM) v9; a Translate slice that uses public events must declare it (PLAY0614).`,inbound:`Inbound Translate direction metadata. No transport or delivery guarantee is implied.`,outbound:`Outbound Translate direction metadata. No transport or delivery guarantee is implied.`,event:"An immutable, past-tense fact. Declare it in a slice or inline with `produces event <Name>` in a command. Inline properties are typed mappings; inline tags belong to the event type.",documentation:"Authoring-only reasoning on a module, feature, slice, command, event, read model or reaction in one nonempty fenced ```markdown block. It does not change executable model bytes.",id:`Preserves the previous persisted event name after a rename. Leave absent on new events; repeating the current name is redundant.`,command:`An imperative intent. Declares authorization, validation, and what events it produces — declaratively, or via a full handler.`,query:`A read-side entry point mapping to a return type, with an optional description, parameters and performer.`,observable:"Qualifies a query return type as a live read — `query <Name> => observable <ReadModel>` keeps pushing as the read model changes, instead of answering once.",performer:"The code that performs a query — a `file <Path>` reference or an inline `csharp`/`sql` block. The query's counterpart to a command handler.",from:"On a reaction or reducer, `from Source[.Stream]` observes only matching routed facts. It does not filter stream ids. Admitted by ESM v10. On a query parameter, fills it from the query context instead of the caller, as in `filter tenantId TenantId from $context.tenant`.",projection:`Declares how events project into a read model, using the embedded Projection Declaration Language (PDL).`,capture:`Converts external data into events, using the embedded Change Data Capture Language (CDL).`,reaction:"Behavior that runs when something happens. Lives inside Automation slices. A trigger with no body states intent on its own — `file`/code is optional realization metadata.",runs:'`runs as system [role "Role" and role "Role"]` declares the identity for every returned or invoked command of a reaction, not imperative pipeline calls. Admitted by released ESM v10; claims are unknown for this identity. Clock and application triggers have no Stage realization yet.',trigger:`Declares a kind of occurrence a reaction can respond to, and the values it hands the reaction. What makes one occur belongs to whoever provides it, never to the compiler.`,where:`Narrows which occurrences actually run the reaction.`,contains:`Text comparison — true when the left string holds the right one anywhere.`,every:"Runs a reaction on an interval — `every 15 minutes`, `every 1 day`.",refused:"Ordered invocation refusal branch: first match wins. Bare `on refused` covers validation and constraints, not authorization. Syntax-only, not yet executable (PLAY0268).",acknowledge:`A refusal branch acknowledges alone, or produces events instead. Syntax-only, not yet executable (PLAY0268).`,validation:"In `on refused by validation`, selects property, concept and require refusals. Syntax-only, not yet executable (PLAY0268).",authorization:"In `on refused by authorization`, explicitly selects unauthorized results, never Unsupported. Syntax-only, not yet executable (PLAY0268).",redelivered:"`when redelivered <Event> to <Reaction>` selects exactly one effective given occurrence by optional for, stated values and stream or no stream, without appending it again. Syntax-only, not yet executable (PLAY0268).",invokes:`A command a reaction hands on. A command is asked for, not produced — it may still be rejected.`,screen:`A UI declaration. Supports intent, structure, and layout-with-code levels, or a full file reference.`,constraint:`A server-side rule enforced in the Chronicle kernel before events are committed.`,authorize:`References the policies that must all pass for the construct to execute.`,validate:"Declarative validation rules, or `validate` followed by ```csharp for imperative rules — on commands and concepts.",produces:"References a declared event with `produces <Name>`, or declares one inline with `produces event <Name>`. An inline omitted `for` uses the command identifier only when all destinations are the same source; legacy plain omission allocates an identity.",reads:"Declares a view consulted by a command or reaction trigger: `reads <View> [as <alias>] [by <value>]`. A reaction `by` names a value taken by its trigger; clock triggers cannot use `by`. A child by block supplies composite key parts by name, using part = source. Repeated views require unique aliases. Runtime binding is not yet supported for command or reaction reads.",as:"Names an instance of a view in a command or reaction trigger reads declaration, for example `reads Account as source by sourceId`.",handler:"A fully imperative command implementation — a `file <Path>` reference or an inline `csharp` block, instead of `produces`.",when:"Guards a produced event or a capture append with a condition. In a labeled screen action, `when item.<field> == <literal> execute <Command>` selects the first matching command. Inside on click, double click or select, block-form `when <condition>` selects one whole action list at gesture time.",rule:"Names a predicate. Bare, it states that a constraint exists without expressing what it computes — nothing resolves the name. Optionally followed by an indented `file <Path>` reference or inline `csharp` block giving it a body.",require:'A policy condition: `authenticated`, `role "..."`, or `claim "..." matches ...`. Unary `not` negates a condition or group; precedence is not, and, or.',authenticated:`Requires an authenticated caller.`,role:`Requires the caller to have the given role.`,claim:`Requires a claim on the caller to match a subject or value.`,subject:"In policy `matches subject`, the identifier of the thing acted on, not the caller. The caller is `$context.causedBy.subject`.",data:`Binds a read model to a screen through a query.`,action:'Makes a command available on a screen. `action "Label"` declares one button with ordered `when … execute` alternatives over the nearest data item or selected row. No subject hides it; commands still enforce authorization and validation.',otherwise:"The final fallback of a guarded action: `otherwise hidden` or `otherwise execute <Command>`. In an item interaction, bare `otherwise` opens a fallback action list. No subject runs nothing, including fallback; authorization never falls through.",hidden:`Hides a guarded action when no condition matches. Without a subject the action is always hidden, even with an execute fallback.`,execute:"Executes a command. A guarded screen action selects it by the first matching condition; explicit `with … from` bindings precede same-name item fields, its declared form and renderer input.",navigate:"Navigates to a screen, optionally passing a parameter with `by`.",section:`A named structural section of a screen.`,table:`A table widget over a read model or child collection.`,summary:`A summary widget showing labeled fields.`,column:`A table column bound to a property.`,field:`A summary field bound to a property.`,title:`The display title of a screen or section.`,label:`The display label of an action, column, or field.`,unique:"A uniqueness constraint — `unique <property> on <EventType>` or `unique event <EventType>`.",concurrency:"The concurrency scope enforced when the command appends events — dimensions: `eventSource`, `sourceType`, `streamType`, `streamId`, `events`.",eventSource:`Concurrency dimension — scope the check to the event source id of the command.`,sourceType:`Concurrency dimension — scope the check to an event source type.`,streamType:`Concurrency dimension — scope the check to an event stream type.`,streamId:`Concurrency dimension — scope the check to an event stream id.`,tag:"Attaches a tag to appended events — a static identifier or string, or a `$context.` expression resolved at append time.",seed:`Declares events to seed into the event store per event source id — multiple blocks accumulate.`,for:"Names the event source of a production or seed group. Inside `produces event`, omission uses the command identifier unless another production targets a different source.",readmodel:"Declares a read model — its name and properties — in a slice, or, in a specification, read model state: `given readmodel` establishes it, `then readmodel` asserts it, `then no readmodel <View> for <key>` asserts keyed absence.",reducer:"Builds a read model from events with imperative code — `reducer <Name> => <ReadModel>` with an `on <EventType>` rule per event. Use it when a projection cannot express the transition.",specification:`Given/when/then acceptance criteria for a slice: prior events and state, the command, query or appended event under test, and the events, state, results, errors or denials that follow.`,dialog:"A dialog opened over the shell, or with `dialog template` a reusable dialog shape.",form:"A form bound to a command — `form <Name> for <Command>` with a `field` per input.",contribute:"Contributes entries to a slot of the shell — `contribute to Navigation` with `navigate to`, `label` and `order`.",theme:`A named theme and the component packages it is compatible with.`,ui:"A UI profile — `ui profile <Name>` binds a target platform and size to a layout, theme and packages.",behavior:"A named interaction wiring of `on <interaction>` handlers, attached to a screen, form or dialog with `uses`.",system:`An application-scoped external system that operations use.`,eventsource:`An application-owned event source with nested streams.`,operation:`A reusable operation intent that uses one external system.`,no:"A keyed absence assertion: `then no readmodel <View> for <key>`.",arguments:"The values supplied to a query asserted by `then query`.",result:"One expected result - `then result [exactly]` after `when query`, or a `result` block inside `then query`. Repeat it to assert several results in authored order.",clock:'The instant a specification happens at - `given clock "2026-10-05T08:00:00Z"` fixes when everything occurs; `when clock "<instant>"` is the clock reaching it, as the action.',exactly:"Requires every property to match, rather than only the ones asserted - on `then readmodel`, `then query` and `then result`.",file:`Delegates the implementation to an external file; the Screenplay contract stays visible.`,key:`Trailing modifier on a required top-level read-model property. Explicit keys replace inference. Composite keys remain authoring-only (PLAY0268, #599).`,stream:`On a command event production, replaces the whole command route for that event. Other productions keep the command route. Admitted by ESM v10.`,by:`Introduces one identifying parameter or a block of at least two named key parts. Reads use part = source; queries use part Type.`,via:`Connects screen data to the query that supplies it.`,filter:`An optional query filter parameter.`,on:"The event a constraint applies to, the day a schedule narrows to, or a widget interaction such as `on row-click`.",message:`The validation message reported when the rule fails.`,matches:"Matches a value against a regular expression or a named pattern such as `email`.",all:`Applies a comparison to every element of a collection.`,max:`Maximum length or value.`,min:`Minimum length or value.`,length:`Constrains the exact length of a value.`,today:`The current date.`,empty:"Used with `not empty` — the value must be present.",not:"Negates a validation condition, as in `not empty`.",and:`Both conditions must hold.`,or:`Either condition may hold.`,csharp:"An inline C# block whose opening fence is ```csharp.",sql:`An inline SQL block between triple backticks — a query performer written against a relational store.`,typescript:`An inline TypeScript block between triple backticks.`,react:"An inline React/TSX block; receives the surrounding data contract as `Props`.",html:`An inline static HTML block.`,StateChange:`Slice type — a command → events flow; something that changes the system.`,StateView:`Slice type — a query + projection + screen; something that reads the system.`,Automation:`Slice type — a reaction or reducer; something that runs when something happens.`,Translate:`Slice type — a capture; converts external data into events.`,Uuid:`Primitive type — a universally unique identifier.`,String:`Primitive type — a string of characters.`,Int:`Primitive type — an integer number.`,Decimal:`Primitive type — a decimal number.`,Bool:`Primitive type — true or false.`,Date:`Primitive type — a date without time.`,DateTime:`Primitive type — a date and time.`,Enum:`An enumeration concept with named members. Members may all declare unique int32 numbers (draft = 1) or all omit them (zero-based positions). Never renumber or reuse a published number. Non-positional numbers are not admitted by any supported executable model (ESM) version yet (#643); specifications still name members.`},r={parameter:"Declares a required typed case value: `parameter <name> <Type>`. Every case assigns it once. `optional` permits literal null but supplies no default.",case:"One named complete row of a specification table. `case.<parameter>` substitutes a whole value after example overrides; each row runs as `<Specification>_<Case>`.",caller:"`given caller` states an explicit identity; `given caller as <Persona>` synthesizes an authenticated deterministic witness of the persona, with no body. Leftmost buildable policy alternatives are significant.",clock:n.clock,redelivered:n.redelivered,trigger:"`when trigger <Trigger>` - an application trigger fires, as the action, with the values on the lines beneath it.",capture:"`given capture <Capture>` - a record the capture's source held before; `when capture <Capture>` - the record it sees now, as the action. The fields go on the lines beneath.",query:"`when query <Query>` - the query is performed, as the action, with its arguments on the lines beneath; assert what it returns with `then result` or `then no result`. `then query` instead asserts a query after another action.",events:"`then no events` - asserts no new events after a non-append action. Syntax-only, not yet executable (PLAY0268). Cannot accompany event, event-order, error or denial expectations.",result:"`then result [exactly]` - one result the query performed by `when query` returns, in order; `then no result` - it returns nothing."},i={pii:`personal data (GDPR Art. 4(1)); renders Chronicle [PII]. Bare suffix marker; @pii is deprecated (PLAY0565). Not admitted by the executable model (PLAY0268).`,personal:`Alias of pii: personal data (GDPR Art. 4(1)); renders Chronicle [PII]. No diagnostic; canonical printing writes pii.`,secret:`Operational secret, not personal data: encrypted at rest without erasure and withheld from causation. Provider mapping: [Encrypted] + [NotAudited], or [PII] only with pii. Cannot be identity (PLAY0515). Not admitted by the executable model (PLAY0268).`,sensitive:`Deprecated spelling of secret (PLAY0565); repair to bare secret. Operational secret, not GDPR Art. 9 special-category data.`},a={"$context.occurred":`When the command or query was received.`,"$context.tenant":`The tenant the command or query is executing for.`,"$context.command":"The command being handled, shaped by its `command` declaration.","$context.arguments":`The arguments of the query being performed.`,"$context.causedBy":"The identity that caused the command or query — `subject`, `name`, `userName`.","$context.causedBy.subject":`The subject of the identity that caused the command or query.`,"$context.causedBy.name":`The display name of the identity that caused the command or query.`,"$context.causedBy.userName":`The user name of the identity that caused the command or query.`,"$context.causation":"What caused the command or query — `type`, `occurred`, `properties`.","$context.causation.type":`What caused the command or query — a command, a reactor, a schedule.`,$identity:"The caller — token built-ins `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`, plus declared identity details. Built-ins are equivalent to `$context.identity`; details are authoring-only until admitted (#600).","$identity.id":"The identifier of the caller from the auth token; equivalent to `$context.identity.id`.","$identity.name":"The display name of the caller; equivalent to `$context.identity.name`.","$identity.userName":"The user name of the caller; equivalent to `$context.identity.userName`.","$identity.isAuthenticated":`Whether the caller is authenticated.`,"$identity.roles":`The roles the caller holds.`,"$identity.claims":"The claims the caller carries — `$identity.claims.<name>` reads one.","$context.identity":"The caller a decision is made about — `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`.","$context.identity.id":`The identifier of the caller from the auth token.`,"$context.identity.name":`The display name of the caller.`,"$context.identity.userName":`The user name of the caller.`,"$context.identity.isAuthenticated":`Whether the caller is authenticated.`,"$context.identity.roles":`The roles the caller holds.`,"$context.identity.claims":"The claims the caller carries — `$context.identity.claims.<name>` reads one.",$env:"An environment variable, e.g. `$env.SERVICE_NAME`.",$secrets:"An encrypted secret resolved at runtime, e.g. `$secrets.azureAdClientId` — stays symbolic in the compiled tree.",$strings:"A localized string resolved from the `.strings` file of the active locale, e.g. `$strings.invoices.title`.",...Object.fromEntries(e.map(e=>[`$eventContext.${e.path}`,e.description]))},o={racialOrEthnicOrigin:`Data revealing a person's racial or ethnic origin (GDPR Art. 9(1)).`,politicalOpinions:`Data revealing a person's political opinions (GDPR Art. 9(1)).`,religiousOrPhilosophicalBeliefs:`Data revealing a person's religious or philosophical beliefs (GDPR Art. 9(1)).`,tradeUnionMembership:`Data revealing whether a person belongs to a trade union (GDPR Art. 9(1)).`,genetic:`Data about inherited or acquired genetic characteristics that gives unique information about a person's physiology or health (GDPR Art. 9(1), Art. 4(13)).`,biometric:`Data from technical processing of physical, physiological or behavioral characteristics, special only when processed to uniquely identify a person (GDPR Art. 9(1), Art. 4(14)).`,health:`Data about a person's physical or mental health, including health care services, that reveals their health status (GDPR Art. 9(1), Art. 4(15)).`,sexLifeOrSexualOrientation:`Data concerning a person's sex life or sexual orientation (GDPR Art. 9(1)).`};export{i as attributeDocs,a as contextVariableDocs,t as handlerIntentDocs,n as keywordDocs,o as specialCategoryDocs,r as specificationKeywordDocs};
1
+ import"./_virtual/_virtual/_rolldown/runtime.js";import{eventContextPaths as e}from"./event-context-catalog.js";import"./event-context.js";const t={implementation:`Handler-only intent with ordered hints and at most one file or tagged fence. No payload means pending. Handler execution is unsupported; this is not confirmation.`,hint:`One nonblank quoted implementation hint. Order and decoded text are retained; hints do not execute or confirm code.`},n={parameter:`A typed value declared by a specification table, or an argument of a named behavior. Table types are required; every case supplies each parameter exactly once.`,case:`One named concrete row of a specification table, expanded as <Specification>_<Case>. Use case.<parameter> for a whole step value.`,example:"One typed, possibly partial fixture: `example <Name> : <EventOrCommandOrReadModel>`. Use its name in a matching specification step; assignments override example values without changing matching or supplying defaults. Event examples may carry stream or no stream; a step replaces that route as a whole.",domain:`The domain the file belongs to — optional, at most one per file, before everything else.`,import:'Imports a type from another module by its qualified name — `import Module.Type` — making it available by its short name; or, quoted, other `.play` files by path or glob — `import "Orders/**/*.play"`, relative to this file\'s folder. Written inside a module or feature, a file import places the imported files there: their top level is that module\'s or feature\'s body. `import Module.Event from "origin"` is instead public contract metadata with an opaque origin; executable binding refuses it with PLAY0268.',concept:`A formalized value type wrapping a primitive. Bare pii and secret markers travel with every usage, with optional concept notes and qualifiers.`,type:`A composite value type — a named shape built from several properties, referenced by events, commands and other types the same way a concept is.`,reason:`A free-text concept note, not a lawful basis. Written as pii reason "..." or secret reason "..."; migration preserves it verbatim.`,optional:"Allows a value to be absent. Write it after the type: `note String optional` or `lines InvoiceLine[] optional`. The collection itself may be absent; its items keep their declared type.",identifier:`Marks the command property a runtime resolves the event source id from. At most one per command; without it a new Uuid is generated.`,policy:`A named authorization rule referenced by commands and queries. Multiple policies AND together.`,purpose:`A report-only processing declaration (GDPR Art. 30), referenced on modules, features and slices. Coverage is their union, not an authorization gate. Generated declarations are not legal advice.`,basis:`One declared Art. 6(1) basis: consent, contract, legalObligation, vitalInterests, publicTask or legitimateInterests; an optional quoted reference may follow.`,interest:`The legitimate-interest statement for basis legitimateInterests (Art. 13(1)(d)).`,condition:`One Art. 9(2) processing condition, optionally followed by a quoted reference.`,subjects:`Comma-separated categories of data subjects, as open identifiers.`,retention:`Declared retention period or criteria, not enforced by the model or Chronicle.`,recipient:`A quoted recipient category; repeatable on a purpose.`,transfer:`A declared destination followed by safeguard and quoted safeguards; repeatable.`,safeguard:`The declared safeguard accompanying a third-country transfer.`,erasure:`An erasure exception under Art. 17(3); Chronicle crypto-shredding remains per subject, not per purpose.`,exception:`One declared Art. 17(3) exception: expression, legalObligation, publicTask, publicHealth, archiving or legalClaims.`,persona:`A named role interacting with the application, with an optional description and its associated policies.`,identity:"Declares typed additional caller details from a claim, a keyed single-result query, inline code or a file. Authoring metadata only; executable use of `$identity.<detail>` reports PLAY0268 until admitted (#600).",authentication:`Declares the identity providers of the application — at most one block per file.`,provider:"A named identity provider within `authentication`, with free-form `name value` settings.",description:"A human-readable description, including the rule or case a specification witnesses, as a quoted single line or a fenced ```text block for multiple lines.",depends:"Declares `depends on <Name>` on a module or feature. This opts only that container into checking counted explicit references against its own declarations; it does not change executable bytes.",module:`The top-level namespace — maps to a bounded context.`,layout:`A reusable screen template with named slots.`,template:`Declares the named slots of a layout.`,feature:`A vertical slice grouping. Features nest arbitrarily deep.`,slice:`The atomic unit of behavior, aligned with Event Modeling. Has a type and a name.`,public:`Marks an event as a public contract. An event with from "origin" is also public. Origin is opaque, not a path or declaration reference. Public events and origins are admitted by executable semantic model (ESM) v9.`,direction:`Declare direction inbound or direction outbound once inside a Translate slice. Admitted by executable semantic model (ESM) v9; a Translate slice that uses public events must declare it (PLAY0614).`,inbound:`Inbound Translate direction metadata. No transport or delivery guarantee is implied.`,outbound:`Outbound Translate direction metadata. No transport or delivery guarantee is implied.`,event:"An immutable, past-tense fact. Declare it in a slice or inline with `produces event <Name>` in a command. Inline properties are typed mappings; inline tags belong to the event type.",documentation:"Authoring-only reasoning on a module, feature, slice, command, event, read model or reaction in one nonempty fenced ```markdown block. It does not change executable model bytes.",id:`Preserves the previous persisted event name after a rename. Leave absent on new events; repeating the current name is redundant.`,command:`An imperative intent. Declares authorization, validation, and what events it produces — declaratively, or via a full handler.`,query:`A read-side entry point mapping to a return type, with an optional description, parameters and performer.`,observable:"Qualifies a query return type as a live read — `query <Name> => observable <ReadModel>` keeps pushing as the read model changes, instead of answering once.",performer:"The code that performs a query — a `file <Path>` reference or an inline `csharp`/`sql` block. The query's counterpart to a command handler.",from:"On a reaction or reducer, `from Source[.Stream]` observes only matching routed facts. It does not filter stream ids. Admitted by ESM v10. On a query parameter, fills it from the query context instead of the caller, as in `filter tenantId TenantId from $context.tenant`.",projection:`Declares how events project into a read model, using the embedded Projection Declaration Language (PDL).`,capture:`Converts external data into events, using the embedded Change Data Capture Language (CDL).`,reaction:"Behavior that runs when something happens. Lives inside Automation slices. A trigger with no body states intent on its own — `file`/code is optional realization metadata.",runs:'`runs as system [role "Role" and role "Role"]` declares the identity for every returned or invoked command of a reaction, not imperative pipeline calls. Admitted by released ESM v10; claims are unknown for this identity. Clock and application triggers have no Stage realization yet.',trigger:`Declares a kind of occurrence a reaction can respond to, and the values it hands the reaction. What makes one occur belongs to whoever provides it, never to the compiler.`,where:`Narrows which occurrences actually run the reaction.`,contains:`Text comparison — true when the left string holds the right one anywhere.`,every:"Runs a reaction on an interval — `every 15 minutes`, `every 1 day`.",refused:"Ordered invocation refusal branch: first match wins. Bare `on refused` covers validation and constraints, not authorization. Syntax-only, not yet executable (PLAY0268).",acknowledge:`A refusal branch acknowledges alone, or produces events instead. Syntax-only, not yet executable (PLAY0268).`,validation:"In `on refused by validation`, selects property, concept and require refusals. Syntax-only, not yet executable (PLAY0268).",authorization:"In `on refused by authorization`, explicitly selects unauthorized results, never Unsupported. Syntax-only, not yet executable (PLAY0268).",redelivered:"`when redelivered <Event> to <Reaction>` selects exactly one effective given occurrence by optional for, stated values and stream or no stream, without appending it again. Syntax-only, not yet executable (PLAY0268).",invokes:`A command a reaction hands on. A command is asked for, not produced — it may still be rejected.`,screen:`A UI declaration. Supports intent, structure, and layout-with-code levels, or a full file reference.`,constraint:`A server-side rule enforced in the Chronicle kernel before events are committed.`,authorize:`References the policies that must all pass for the construct to execute.`,validate:"Declarative validation rules, or `validate` followed by ```csharp for imperative rules — on commands and concepts.",produces:"References a declared event with `produces <Name>`, or declares one inline with `produces event <Name>`. An inline omitted `for` uses the command identifier only when all destinations are the same source; legacy plain omission allocates an identity.",reads:"Declares a view consulted by a command or reaction trigger: `reads <View> [as <alias>] [by <value>]`. A reaction `by` names a value taken by its trigger; clock triggers cannot use `by`. A child by block supplies composite key parts by name, using part = source. Repeated views require unique aliases. Runtime binding is not yet supported for command or reaction reads.",as:"Names an instance of a view in a command or reaction trigger reads declaration, for example `reads Account as source by sourceId`.",handler:"A fully imperative command implementation — a `file <Path>` reference or an inline `csharp` block, instead of `produces`.",when:"Guards a produced event or a capture append with a condition. In a labeled screen action, `when item.<field> == <literal> execute <Command>` selects the first matching command. Inside on click, double click or select, block-form `when <condition>` selects one whole action list at gesture time.",rule:"Names a predicate. Bare, it states that a constraint exists without expressing what it computes — nothing resolves the name. Optionally followed by an indented `file <Path>` reference or inline `csharp` block giving it a body.",require:'A policy condition: `authenticated`, `role "..."`, or `claim "..." matches ...`. Unary `not` negates a condition or group; precedence is not, and, or.',authenticated:`Requires an authenticated caller.`,role:`Requires the caller to have the given role.`,claim:`Requires a claim on the caller to match a subject or value.`,subject:"In policy `matches subject`, the identifier of the thing acted on, not the caller. The caller is `$context.causedBy.subject`.",data:`Binds a read model to a screen through a query.`,action:'Makes a command available on a screen. `action "Label"` declares one button with ordered `when … execute` alternatives over the nearest data item or selected row. No subject hides it; commands still enforce authorization and validation.',otherwise:"The final fallback of a guarded action: `otherwise hidden` or `otherwise execute <Command>`. In an item interaction, bare `otherwise` opens a fallback action list. No subject runs nothing, including fallback; authorization never falls through.",hidden:`Hides a guarded action when no condition matches. Without a subject the action is always hidden, even with an execute fallback.`,execute:"Executes a command. A guarded screen action selects it by the first matching condition; explicit `with … from` bindings precede same-name item fields, its declared form and renderer input.",navigate:"Navigates to a screen, optionally passing a parameter with `by`.",section:`A named structural section of a screen.`,table:`A table widget over a read model or child collection.`,summary:`A summary widget showing labeled fields.`,column:`A table column bound to a property.`,field:`A summary field bound to a property.`,title:`The display title of a screen or section.`,label:`The display label of an action, column, or field.`,unique:"A uniqueness constraint — `unique <property> on <EventType>` or `unique event <EventType>`.",concurrency:"The concurrency scope enforced when the command appends events — dimensions: `eventSource`, `sourceType`, `streamType`, `streamId`, `events`.",eventSource:`Concurrency dimension — scope the check to the event source id of the command.`,sourceType:`Concurrency dimension — scope the check to an event source type.`,streamType:`Concurrency dimension — scope the check to an event stream type.`,streamId:`Concurrency dimension — scope the check to an event stream id.`,tag:"Attaches a tag to appended events — a static identifier or string, or a `$context.` expression resolved at append time.",seed:`Declares events to seed into the event store per event source id — multiple blocks accumulate.`,for:"Names the event source of a production or seed group. Inside `produces event`, omission uses the command identifier unless another production targets a different source.",readmodel:"Declares a read model — its name and properties — in a slice, or, in a specification, read model state: `given readmodel` establishes it, `then readmodel` asserts it, `then no readmodel <View> for <key>` asserts keyed absence.",reducer:"Builds a read model from events with imperative code — `reducer <Name> => <ReadModel>` with an `on <EventType>` rule per event. Use it when a projection cannot express the transition.",specification:`Given/when/then acceptance criteria for a slice: prior events and state, the command, query or appended event under test, and the events, state, results, errors or denials that follow.`,dialog:"A dialog opened over the shell, or with `dialog template` a reusable dialog shape.",form:"A form bound to a command — `form <Name> for <Command>` with a `field` per input.",contribute:"Contributes entries to a slot of the shell — `contribute to Navigation` with `navigate to`, `label` and `order`.",theme:`A named theme and the component packages it is compatible with.`,ui:"A UI profile — `ui profile <Name>` binds a target platform and size to a layout, theme and packages.",behavior:"A named interaction wiring of `on <interaction>` handlers, attached to a screen, form or dialog with `uses`.",system:`An application-scoped external system that operations use.`,eventsource:`An application-owned event source with nested streams.`,operation:`A reusable operation intent that uses one external system.`,no:"A keyed absence assertion: `then no readmodel <View> for <key>`.",arguments:"The values supplied to a query asserted by `then query`.",result:"One expected result - `then result [exactly]` after `when query`, or a `result` block inside `then query`. Repeat it to assert several results in authored order.",clock:'The instant a specification happens at - `given clock "2026-10-05T08:00:00Z"` fixes when everything occurs; `when clock "<instant>"` is the clock reaching it, as the action.',exactly:"Requires every property to match, rather than only the ones asserted - on `then readmodel`, `then query` and `then result`.",file:`Delegates the implementation to an external file; the Screenplay contract stays visible.`,key:`Trailing modifier on a required top-level read-model property. Explicit keys replace inference. Composite keys remain authoring-only (PLAY0268, #599).`,stream:`On a command event production, replaces the whole command route for that event. Other productions keep the command route. Admitted by ESM v10.`,by:`Introduces one identifying parameter or a block of at least two named key parts. Reads use part = source; queries use part Type.`,via:`Connects screen data to the query that supplies it.`,filter:`An optional query filter parameter.`,on:"The event a constraint applies to, the day a schedule narrows to, or a widget interaction such as `on row-click`.",message:`The validation message reported when the rule fails.`,matches:"Matches a value against a regular expression or a named pattern such as `email`.",all:`Applies a comparison to every element of a collection.`,max:`Maximum length or value.`,min:`Minimum length or value.`,length:`Constrains the exact length of a value.`,today:`The current date.`,empty:"Used with `not empty` — the value must be present.",not:"Negates a validation condition, as in `not empty`.",and:`Both conditions must hold.`,or:`Either condition may hold.`,csharp:"An inline C# block whose opening fence is ```csharp.",sql:`An inline SQL block between triple backticks — a query performer written against a relational store.`,typescript:`An inline TypeScript block between triple backticks.`,react:"An inline React/TSX block; receives the surrounding data contract as `Props`.",html:`An inline static HTML block.`,StateChange:`Slice type — a command → events flow; something that changes the system.`,StateView:`Slice type — a query + projection + screen; something that reads the system.`,Automation:`Slice type — a reaction or reducer; something that runs when something happens.`,Translate:`Slice type — a capture; converts external data into events.`,Uuid:`Primitive type — a universally unique identifier.`,String:`Primitive type — a string of characters.`,Int:`Primitive type — an integer number.`,Decimal:`Primitive type — a decimal number.`,Bool:`Primitive type — true or false.`,Date:`Primitive type — a date without time.`,DateTime:`Primitive type — a date and time.`,Enum:`An enumeration concept with named members. Members may all declare unique int32 numbers (draft = 1) or all omit them (zero-based positions). Never renumber or reuse a published number. Non-positional numbers select executable model (ESM) v12; consumers must explicitly admit v12. Specifications still name members.`},r={parameter:"Declares a required typed case value: `parameter <name> <Type>`. Every case assigns it once. `optional` permits literal null but supplies no default.",case:"One named complete row of a specification table. `case.<parameter>` substitutes a whole value after example overrides; each row runs as `<Specification>_<Case>`.",caller:"`given caller` states an explicit identity; `given caller as <Persona>` synthesizes an authenticated deterministic witness of the persona, with no body. Leftmost buildable policy alternatives are significant.",clock:n.clock,redelivered:n.redelivered,trigger:"`when trigger <Trigger>` - an application trigger fires, as the action, with the values on the lines beneath it.",capture:"`given capture <Capture>` - a record the capture's source held before; `when capture <Capture>` - the record it sees now, as the action. The fields go on the lines beneath.",query:"`when query <Query>` - the query is performed, as the action, with its arguments on the lines beneath; assert what it returns with `then result` or `then no result`. `then query` instead asserts a query after another action.",events:"`then no events` - asserts no new events after a non-append action. Syntax-only, not yet executable (PLAY0268). Cannot accompany event, event-order, error or denial expectations.",result:"`then result [exactly]` - one result the query performed by `when query` returns, in order; `then no result` - it returns nothing."},i={pii:`personal data (GDPR Art. 4(1)); renders Chronicle [PII]. Bare suffix marker; @pii is deprecated (PLAY0565). Not admitted by the executable model (PLAY0268).`,personal:`Alias of pii: personal data (GDPR Art. 4(1)); renders Chronicle [PII]. No diagnostic; canonical printing writes pii.`,secret:`Operational secret, not personal data: encrypted at rest without erasure and withheld from causation. Provider mapping: [Encrypted] + [NotAudited], or [PII] only with pii. Cannot be identity (PLAY0515). Not admitted by the executable model (PLAY0268).`,sensitive:`Deprecated spelling of secret (PLAY0565); repair to bare secret. Operational secret, not GDPR Art. 9 special-category data.`},a={"$context.occurred":`When the command or query was received.`,"$context.tenant":`The tenant the command or query is executing for.`,"$context.command":"The command being handled, shaped by its `command` declaration.","$context.arguments":`The arguments of the query being performed.`,"$context.causedBy":"The identity that caused the command or query — `subject`, `name`, `userName`.","$context.causedBy.subject":`The subject of the identity that caused the command or query.`,"$context.causedBy.name":`The display name of the identity that caused the command or query.`,"$context.causedBy.userName":`The user name of the identity that caused the command or query.`,"$context.causation":"What caused the command or query — `type`, `occurred`, `properties`.","$context.causation.type":`What caused the command or query — a command, a reactor, a schedule.`,$identity:"The caller — token built-ins `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`, plus declared identity details. Built-ins are equivalent to `$context.identity`; details are authoring-only until admitted (#600).","$identity.id":"The identifier of the caller from the auth token; equivalent to `$context.identity.id`.","$identity.name":"The display name of the caller; equivalent to `$context.identity.name`.","$identity.userName":"The user name of the caller; equivalent to `$context.identity.userName`.","$identity.isAuthenticated":`Whether the caller is authenticated.`,"$identity.roles":`The roles the caller holds.`,"$identity.claims":"The claims the caller carries — `$identity.claims.<name>` reads one.","$context.identity":"The caller a decision is made about — `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`.","$context.identity.id":`The identifier of the caller from the auth token.`,"$context.identity.name":`The display name of the caller.`,"$context.identity.userName":`The user name of the caller.`,"$context.identity.isAuthenticated":`Whether the caller is authenticated.`,"$context.identity.roles":`The roles the caller holds.`,"$context.identity.claims":"The claims the caller carries — `$context.identity.claims.<name>` reads one.",$env:"An environment variable, e.g. `$env.SERVICE_NAME`.",$secrets:"An encrypted secret resolved at runtime, e.g. `$secrets.azureAdClientId` — stays symbolic in the compiled tree.",$strings:"A localized string resolved from the `.strings` file of the active locale, e.g. `$strings.invoices.title`.",...Object.fromEntries(e.map(e=>[`$eventContext.${e.path}`,e.description]))},o={racialOrEthnicOrigin:`Data revealing a person's racial or ethnic origin (GDPR Art. 9(1)).`,politicalOpinions:`Data revealing a person's political opinions (GDPR Art. 9(1)).`,religiousOrPhilosophicalBeliefs:`Data revealing a person's religious or philosophical beliefs (GDPR Art. 9(1)).`,tradeUnionMembership:`Data revealing whether a person belongs to a trade union (GDPR Art. 9(1)).`,genetic:`Data about inherited or acquired genetic characteristics that gives unique information about a person's physiology or health (GDPR Art. 9(1), Art. 4(13)).`,biometric:`Data from technical processing of physical, physiological or behavioral characteristics, special only when processed to uniquely identify a person (GDPR Art. 9(1), Art. 4(14)).`,health:`Data about a person's physical or mental health, including health care services, that reveals their health status (GDPR Art. 9(1), Art. 4(15)).`,sexLifeOrSexualOrientation:`Data concerning a person's sex life or sexual orientation (GDPR Art. 9(1)).`};export{i as attributeDocs,a as contextVariableDocs,t as handlerIntentDocs,n as keywordDocs,o as specialCategoryDocs,r as specificationKeywordDocs};
2
2
  //# sourceMappingURL=keyword-docs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"keyword-docs.js","names":["handlerIntentDocs","keywordDocs","specificationKeywordDocs","attributeDocs","contextVariableDocs","\"$identity\"","\"$env\"","\"$secrets\"","\"$strings\"","eventContextPaths","path","specialCategoryDocs"],"sources":["../../keyword-docs.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { eventContextPaths } from './event-context';\n\n// These words are contextual beneath a handler, never global property keywords.\nexport const handlerIntentDocs = {\n implementation: 'Handler-only intent with ordered hints and at most one file or tagged fence. No payload means pending. Handler execution is unsupported; this is not confirmation.',\n hint: 'One nonblank quoted implementation hint. Order and decoded text are retained; hints do not execute or confirm code.',\n};\n\nexport const keywordDocs: Record<string, string> = {\n parameter: 'A typed value declared by a specification table, or an argument of a named behavior. Table types are required; every case supplies each parameter exactly once.',\n case: 'One named concrete row of a specification table, expanded as <Specification>_<Case>. Use case.<parameter> for a whole step value.',\n example: 'One typed, possibly partial fixture: `example <Name> : <EventOrCommandOrReadModel>`. Use its name in a matching specification step; assignments override example values without changing matching or supplying defaults. Event examples may carry stream or no stream; a step replaces that route as a whole.',\n domain: 'The domain the file belongs to — optional, at most one per file, before everything else.',\n import: 'Imports a type from another module by its qualified name — `import Module.Type` — making it available by its short name; or, quoted, other `.play` files by path or glob — `import \"Orders/**/*.play\"`, relative to this file\\'s folder. Written inside a module or feature, a file import places the imported files there: their top level is that module\\'s or feature\\'s body. `import Module.Event from \"origin\"` is instead public contract metadata with an opaque origin; executable binding refuses it with PLAY0268.',\n concept: 'A formalized value type wrapping a primitive. Bare pii and secret markers travel with every usage, with optional concept notes and qualifiers.',\n type: 'A composite value type — a named shape built from several properties, referenced by events, commands and other types the same way a concept is.',\n reason: 'A free-text concept note, not a lawful basis. Written as pii reason \"...\" or secret reason \"...\"; migration preserves it verbatim.',\n optional: 'Allows a value to be absent. Write it after the type: `note String optional` or `lines InvoiceLine[] optional`. The collection itself may be absent; its items keep their declared type.',\n identifier: 'Marks the command property a runtime resolves the event source id from. At most one per command; without it a new Uuid is generated.',\n policy: 'A named authorization rule referenced by commands and queries. Multiple policies AND together.',\n purpose: 'A report-only processing declaration (GDPR Art. 30), referenced on modules, features and slices. Coverage is their union, not an authorization gate. Generated declarations are not legal advice.',\n basis: 'One declared Art. 6(1) basis: consent, contract, legalObligation, vitalInterests, publicTask or legitimateInterests; an optional quoted reference may follow.',\n interest: 'The legitimate-interest statement for basis legitimateInterests (Art. 13(1)(d)).',\n condition: 'One Art. 9(2) processing condition, optionally followed by a quoted reference.',\n subjects: 'Comma-separated categories of data subjects, as open identifiers.',\n retention: 'Declared retention period or criteria, not enforced by the model or Chronicle.',\n recipient: 'A quoted recipient category; repeatable on a purpose.',\n transfer: 'A declared destination followed by safeguard and quoted safeguards; repeatable.',\n safeguard: 'The declared safeguard accompanying a third-country transfer.',\n erasure: 'An erasure exception under Art. 17(3); Chronicle crypto-shredding remains per subject, not per purpose.',\n exception: 'One declared Art. 17(3) exception: expression, legalObligation, publicTask, publicHealth, archiving or legalClaims.',\n persona: 'A named role interacting with the application, with an optional description and its associated policies.',\n identity: 'Declares typed additional caller details from a claim, a keyed single-result query, inline code or a file. Authoring metadata only; executable use of `$identity.<detail>` reports PLAY0268 until admitted (#600).',\n authentication: 'Declares the identity providers of the application — at most one block per file.',\n provider: 'A named identity provider within `authentication`, with free-form `name value` settings.',\n description: 'A human-readable description, including the rule or case a specification witnesses, as a quoted single line or a fenced ```text block for multiple lines.',\n depends: 'Declares `depends on <Name>` on a module or feature. This opts only that container into checking counted explicit references against its own declarations; it does not change executable bytes.',\n module: 'The top-level namespace — maps to a bounded context.',\n layout: 'A reusable screen template with named slots.',\n template: 'Declares the named slots of a layout.',\n feature: 'A vertical slice grouping. Features nest arbitrarily deep.',\n slice: 'The atomic unit of behavior, aligned with Event Modeling. Has a type and a name.',\n public: 'Marks an event as a public contract. An event with from \"origin\" is also public. Origin is opaque, not a path or declaration reference. Public events and origins are admitted by executable semantic model (ESM) v9.',\n direction: 'Declare direction inbound or direction outbound once inside a Translate slice. Admitted by executable semantic model (ESM) v9; a Translate slice that uses public events must declare it (PLAY0614).',\n inbound: 'Inbound Translate direction metadata. No transport or delivery guarantee is implied.',\n outbound: 'Outbound Translate direction metadata. No transport or delivery guarantee is implied.',\n event: 'An immutable, past-tense fact. Declare it in a slice or inline with `produces event <Name>` in a command. Inline properties are typed mappings; inline tags belong to the event type.',\n documentation: 'Authoring-only reasoning on a module, feature, slice, command, event, read model or reaction in one nonempty fenced ```markdown block. It does not change executable model bytes.',\n id: 'Preserves the previous persisted event name after a rename. Leave absent on new events; repeating the current name is redundant.',\n command: 'An imperative intent. Declares authorization, validation, and what events it produces — declaratively, or via a full handler.',\n query: 'A read-side entry point mapping to a return type, with an optional description, parameters and performer.',\n observable: 'Qualifies a query return type as a live read — `query <Name> => observable <ReadModel>` keeps pushing as the read model changes, instead of answering once.',\n performer: 'The code that performs a query — a `file <Path>` reference or an inline `csharp`/`sql` block. The query\\'s counterpart to a command handler.',\n from: 'On a reaction or reducer, `from Source[.Stream]` observes only matching routed facts. It does not filter stream ids. Admitted by ESM v10. On a query parameter, fills it from the query context instead of the caller, as in `filter tenantId TenantId from $context.tenant`.',\n projection: 'Declares how events project into a read model, using the embedded Projection Declaration Language (PDL).',\n capture: 'Converts external data into events, using the embedded Change Data Capture Language (CDL).',\n reaction: 'Behavior that runs when something happens. Lives inside Automation slices. A trigger with no body states intent on its own — `file`/code is optional realization metadata.',\n runs: '`runs as system [role \"Role\" and role \"Role\"]` declares the identity for every returned or invoked command of a reaction, not imperative pipeline calls. Admitted by released ESM v10; claims are unknown for this identity. Clock and application triggers have no Stage realization yet.',\n trigger: 'Declares a kind of occurrence a reaction can respond to, and the values it hands the reaction. What makes one occur belongs to whoever provides it, never to the compiler.',\n where: 'Narrows which occurrences actually run the reaction.',\n contains: 'Text comparison — true when the left string holds the right one anywhere.',\n every: 'Runs a reaction on an interval — `every 15 minutes`, `every 1 day`.',\n refused: 'Ordered invocation refusal branch: first match wins. Bare `on refused` covers validation and constraints, not authorization. Syntax-only, not yet executable (PLAY0268).',\n acknowledge: 'A refusal branch acknowledges alone, or produces events instead. Syntax-only, not yet executable (PLAY0268).',\n validation: 'In `on refused by validation`, selects property, concept and require refusals. Syntax-only, not yet executable (PLAY0268).',\n authorization: 'In `on refused by authorization`, explicitly selects unauthorized results, never Unsupported. Syntax-only, not yet executable (PLAY0268).',\n redelivered: '`when redelivered <Event> to <Reaction>` selects exactly one effective given occurrence by optional for, stated values and stream or no stream, without appending it again. Syntax-only, not yet executable (PLAY0268).',\n invokes: 'A command a reaction hands on. A command is asked for, not produced — it may still be rejected.',\n screen: 'A UI declaration. Supports intent, structure, and layout-with-code levels, or a full file reference.',\n constraint: 'A server-side rule enforced in the Chronicle kernel before events are committed.',\n authorize: 'References the policies that must all pass for the construct to execute.',\n validate: 'Declarative validation rules, or `validate` followed by ```csharp for imperative rules — on commands and concepts.',\n produces: 'References a declared event with `produces <Name>`, or declares one inline with `produces event <Name>`. An inline omitted `for` uses the command identifier only when all destinations are the same source; legacy plain omission allocates an identity.',\n reads: 'Declares a view consulted by a command or reaction trigger: `reads <View> [as <alias>] [by <value>]`. A reaction `by` names a value taken by its trigger; clock triggers cannot use `by`. A child by block supplies composite key parts by name, using part = source. Repeated views require unique aliases. Runtime binding is not yet supported for command or reaction reads.',\n as: 'Names an instance of a view in a command or reaction trigger reads declaration, for example `reads Account as source by sourceId`.',\n handler: 'A fully imperative command implementation — a `file <Path>` reference or an inline `csharp` block, instead of `produces`.',\n when: 'Guards a produced event or a capture append with a condition. In a labeled screen action, `when item.<field> == <literal> execute <Command>` selects the first matching command. Inside on click, double click or select, block-form `when <condition>` selects one whole action list at gesture time.',\n rule: 'Names a predicate. Bare, it states that a constraint exists without expressing what it computes — nothing resolves the name. Optionally followed by an indented `file <Path>` reference or inline `csharp` block giving it a body.',\n require: 'A policy condition: `authenticated`, `role \"...\"`, or `claim \"...\" matches ...`. Unary `not` negates a condition or group; precedence is not, and, or.',\n authenticated: 'Requires an authenticated caller.',\n role: 'Requires the caller to have the given role.',\n claim: 'Requires a claim on the caller to match a subject or value.',\n subject: 'In policy `matches subject`, the identifier of the thing acted on, not the caller. The caller is `$context.causedBy.subject`.',\n data: 'Binds a read model to a screen through a query.',\n action: 'Makes a command available on a screen. `action \"Label\"` declares one button with ordered `when … execute` alternatives over the nearest data item or selected row. No subject hides it; commands still enforce authorization and validation.',\n otherwise: 'The final fallback of a guarded action: `otherwise hidden` or `otherwise execute <Command>`. In an item interaction, bare `otherwise` opens a fallback action list. No subject runs nothing, including fallback; authorization never falls through.',\n hidden: 'Hides a guarded action when no condition matches. Without a subject the action is always hidden, even with an execute fallback.',\n execute: 'Executes a command. A guarded screen action selects it by the first matching condition; explicit `with … from` bindings precede same-name item fields, its declared form and renderer input.',\n navigate: 'Navigates to a screen, optionally passing a parameter with `by`.',\n section: 'A named structural section of a screen.',\n table: 'A table widget over a read model or child collection.',\n summary: 'A summary widget showing labeled fields.',\n column: 'A table column bound to a property.',\n field: 'A summary field bound to a property.',\n title: 'The display title of a screen or section.',\n label: 'The display label of an action, column, or field.',\n unique: 'A uniqueness constraint — `unique <property> on <EventType>` or `unique event <EventType>`.',\n concurrency: 'The concurrency scope enforced when the command appends events — dimensions: `eventSource`, `sourceType`, `streamType`, `streamId`, `events`.',\n eventSource: 'Concurrency dimension — scope the check to the event source id of the command.',\n sourceType: 'Concurrency dimension — scope the check to an event source type.',\n streamType: 'Concurrency dimension — scope the check to an event stream type.',\n streamId: 'Concurrency dimension — scope the check to an event stream id.',\n tag: 'Attaches a tag to appended events — a static identifier or string, or a `$context.` expression resolved at append time.',\n seed: 'Declares events to seed into the event store per event source id — multiple blocks accumulate.',\n for: 'Names the event source of a production or seed group. Inside `produces event`, omission uses the command identifier unless another production targets a different source.',\n readmodel: 'Declares a read model — its name and properties — in a slice, or, in a specification, read model state: `given readmodel` establishes it, `then readmodel` asserts it, `then no readmodel <View> for <key>` asserts keyed absence.',\n reducer: 'Builds a read model from events with imperative code — `reducer <Name> => <ReadModel>` with an `on <EventType>` rule per event. Use it when a projection cannot express the transition.',\n specification: 'Given/when/then acceptance criteria for a slice: prior events and state, the command, query or appended event under test, and the events, state, results, errors or denials that follow.',\n dialog: 'A dialog opened over the shell, or with `dialog template` a reusable dialog shape.',\n form: 'A form bound to a command — `form <Name> for <Command>` with a `field` per input.',\n contribute: 'Contributes entries to a slot of the shell — `contribute to Navigation` with `navigate to`, `label` and `order`.',\n theme: 'A named theme and the component packages it is compatible with.',\n ui: 'A UI profile — `ui profile <Name>` binds a target platform and size to a layout, theme and packages.',\n behavior: 'A named interaction wiring of `on <interaction>` handlers, attached to a screen, form or dialog with `uses`.',\n system: 'An application-scoped external system that operations use.',\n eventsource: 'An application-owned event source with nested streams.',\n operation: 'A reusable operation intent that uses one external system.',\n no: 'A keyed absence assertion: `then no readmodel <View> for <key>`.',\n arguments: 'The values supplied to a query asserted by `then query`.',\n result: 'One expected result - `then result [exactly]` after `when query`, or a `result` block inside `then query`. Repeat it to assert several results in authored order.',\n clock: 'The instant a specification happens at - `given clock \"2026-10-05T08:00:00Z\"` fixes when everything occurs; `when clock \"<instant>\"` is the clock reaching it, as the action.',\n exactly: 'Requires every property to match, rather than only the ones asserted - on `then readmodel`, `then query` and `then result`.',\n file: 'Delegates the implementation to an external file; the Screenplay contract stays visible.',\n key: 'Trailing modifier on a required top-level read-model property. Explicit keys replace inference. Composite keys remain authoring-only (PLAY0268, #599).',\n stream: 'On a command event production, replaces the whole command route for that event. Other productions keep the command route. Admitted by ESM v10.',\n by: 'Introduces one identifying parameter or a block of at least two named key parts. Reads use part = source; queries use part Type.',\n via: 'Connects screen data to the query that supplies it.',\n filter: 'An optional query filter parameter.',\n on: 'The event a constraint applies to, the day a schedule narrows to, or a widget interaction such as `on row-click`.',\n message: 'The validation message reported when the rule fails.',\n matches: 'Matches a value against a regular expression or a named pattern such as `email`.',\n all: 'Applies a comparison to every element of a collection.',\n max: 'Maximum length or value.',\n min: 'Minimum length or value.',\n length: 'Constrains the exact length of a value.',\n today: 'The current date.',\n empty: 'Used with `not empty` — the value must be present.',\n not: 'Negates a validation condition, as in `not empty`.',\n and: 'Both conditions must hold.',\n or: 'Either condition may hold.',\n csharp: 'An inline C# block whose opening fence is ```csharp.',\n sql: 'An inline SQL block between triple backticks — a query performer written against a relational store.',\n typescript: 'An inline TypeScript block between triple backticks.',\n react: 'An inline React/TSX block; receives the surrounding data contract as `Props`.',\n html: 'An inline static HTML block.',\n StateChange: 'Slice type — a command → events flow; something that changes the system.',\n StateView: 'Slice type — a query + projection + screen; something that reads the system.',\n Automation: 'Slice type — a reaction or reducer; something that runs when something happens.',\n Translate: 'Slice type — a capture; converts external data into events.',\n Uuid: 'Primitive type — a universally unique identifier.',\n String: 'Primitive type — a string of characters.',\n Int: 'Primitive type — an integer number.',\n Decimal: 'Primitive type — a decimal number.',\n Bool: 'Primitive type — true or false.',\n Date: 'Primitive type — a date without time.',\n DateTime: 'Primitive type — a date and time.',\n Enum: 'An enumeration concept with named members. Members may all declare unique int32 numbers (draft = 1) or all omit them (zero-based positions). Never renumber or reuse a published number. Non-positional numbers are not admitted by any supported executable model (ESM) version yet (#643); specifications still name members.',\n};\n\n// What the words of a specification's steps mean there - where 'trigger', 'capture' and 'query' name what the\n// scenario exercises rather than declare one.\nexport const specificationKeywordDocs: Record<string, string> = {\n parameter: 'Declares a required typed case value: `parameter <name> <Type>`. Every case assigns it once. `optional` permits literal null but supplies no default.',\n case: 'One named complete row of a specification table. `case.<parameter>` substitutes a whole value after example overrides; each row runs as `<Specification>_<Case>`.',\n caller: '`given caller` states an explicit identity; `given caller as <Persona>` synthesizes an authenticated deterministic witness of the persona, with no body. Leftmost buildable policy alternatives are significant.',\n clock: keywordDocs.clock,\n redelivered: keywordDocs.redelivered,\n trigger: '`when trigger <Trigger>` - an application trigger fires, as the action, with the values on the lines beneath it.',\n capture: '`given capture <Capture>` - a record the capture\\'s source held before; `when capture <Capture>` - the record it sees now, as the action. The fields go on the lines beneath.',\n query: '`when query <Query>` - the query is performed, as the action, with its arguments on the lines beneath; assert what it returns with `then result` or `then no result`. `then query` instead asserts a query after another action.',\n events: '`then no events` - asserts no new events after a non-append action. Syntax-only, not yet executable (PLAY0268). Cannot accompany event, event-order, error or denial expectations.',\n result: '`then result [exactly]` - one result the query performed by `when query` returns, in order; `then no result` - it returns nothing.',\n};\n\nexport const attributeDocs: Record<string, string> = {\n pii: 'personal data (GDPR Art. 4(1)); renders Chronicle [PII]. Bare suffix marker; @pii is deprecated (PLAY0565). Not admitted by the executable model (PLAY0268).',\n personal: 'Alias of pii: personal data (GDPR Art. 4(1)); renders Chronicle [PII]. No diagnostic; canonical printing writes pii.',\n secret: 'Operational secret, not personal data: encrypted at rest without erasure and withheld from causation. Provider mapping: [Encrypted] + [NotAudited], or [PII] only with pii. Cannot be identity (PLAY0515). Not admitted by the executable model (PLAY0268).',\n sensitive: 'Deprecated spelling of secret (PLAY0565); repair to bare secret. Operational secret, not GDPR Art. 9 special-category data.',\n};\n\nexport const contextVariableDocs: Record<string, string> = {\n '$context.occurred': 'When the command or query was received.',\n '$context.tenant': 'The tenant the command or query is executing for.',\n '$context.command': 'The command being handled, shaped by its `command` declaration.',\n '$context.arguments': 'The arguments of the query being performed.',\n '$context.causedBy': 'The identity that caused the command or query — `subject`, `name`, `userName`.',\n '$context.causedBy.subject': 'The subject of the identity that caused the command or query.',\n '$context.causedBy.name': 'The display name of the identity that caused the command or query.',\n '$context.causedBy.userName': 'The user name of the identity that caused the command or query.',\n '$context.causation': 'What caused the command or query — `type`, `occurred`, `properties`.',\n '$context.causation.type': 'What caused the command or query — a command, a reactor, a schedule.',\n '$identity': 'The caller — token built-ins `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`, plus declared identity details. Built-ins are equivalent to `$context.identity`; details are authoring-only until admitted (#600).',\n '$identity.id': 'The identifier of the caller from the auth token; equivalent to `$context.identity.id`.',\n '$identity.name': 'The display name of the caller; equivalent to `$context.identity.name`.',\n '$identity.userName': 'The user name of the caller; equivalent to `$context.identity.userName`.',\n '$identity.isAuthenticated': 'Whether the caller is authenticated.',\n '$identity.roles': 'The roles the caller holds.',\n '$identity.claims': 'The claims the caller carries — `$identity.claims.<name>` reads one.',\n '$context.identity': 'The caller a decision is made about — `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`.',\n '$context.identity.id': 'The identifier of the caller from the auth token.',\n '$context.identity.name': 'The display name of the caller.',\n '$context.identity.userName': 'The user name of the caller.',\n '$context.identity.isAuthenticated': 'Whether the caller is authenticated.',\n '$context.identity.roles': 'The roles the caller holds.',\n '$context.identity.claims': 'The claims the caller carries — `$context.identity.claims.<name>` reads one.',\n '$env': 'An environment variable, e.g. `$env.SERVICE_NAME`.',\n '$secrets': 'An encrypted secret resolved at runtime, e.g. `$secrets.azureAdClientId` — stays symbolic in the compiled tree.',\n '$strings': 'A localized string resolved from the `.strings` file of the active locale, e.g. `$strings.invoices.title`.',\n // Every $eventContext path the event-context catalog lists, for projections.\n ...Object.fromEntries(eventContextPaths.map((path) => [`$eventContext.${path.path}`, path.description])),\n};\n\n// One-sentence descriptions of the `pii special` categories (GDPR Art. 9(1)) and `pii criminal` (Art. 10).\n// The same sentences appear in Documentation/screenplay/concepts.md.\nexport const specialCategoryDocs: Record<string, string> = {\n racialOrEthnicOrigin: 'Data revealing a person\\'s racial or ethnic origin (GDPR Art. 9(1)).',\n politicalOpinions: 'Data revealing a person\\'s political opinions (GDPR Art. 9(1)).',\n religiousOrPhilosophicalBeliefs: 'Data revealing a person\\'s religious or philosophical beliefs (GDPR Art. 9(1)).',\n tradeUnionMembership: 'Data revealing whether a person belongs to a trade union (GDPR Art. 9(1)).',\n genetic: 'Data about inherited or acquired genetic characteristics that gives unique information about a person\\'s physiology or health (GDPR Art. 9(1), Art. 4(13)).',\n biometric: 'Data from technical processing of physical, physiological or behavioral characteristics, special only when processed to uniquely identify a person (GDPR Art. 9(1), Art. 4(14)).',\n health: 'Data about a person\\'s physical or mental health, including health care services, that reveals their health status (GDPR Art. 9(1), Art. 4(15)).',\n sexLifeOrSexualOrientation: 'Data concerning a person\\'s sex life or sexual orientation (GDPR Art. 9(1)).'\n};\n"],"mappings":"2IAMA,MAAaA,EAAoB,CAC7B,eAAgB,qKAChB,KAAM,qHACV,EAEaC,EAAsC,CAC/C,UAAW,kKACX,KAAM,oIACN,QAAS,gTACT,OAAQ,2FACR,OAAQ,ggBACR,QAAS,iJACT,KAAM,kJACN,OAAQ,qIACR,SAAU,2LACV,WAAY,uIACZ,OAAQ,iGACR,QAAS,oMACT,MAAO,gKACP,SAAU,mFACV,UAAW,iFACX,SAAU,oEACV,UAAW,iFACX,UAAW,wDACX,SAAU,kFACV,UAAW,gEACX,QAAS,0GACT,UAAW,sHACX,QAAS,2GACT,SAAU,qNACV,eAAgB,mFAChB,SAAU,2FACV,YAAa,4JACb,QAAS,kMACT,OAAQ,uDACR,OAAQ,+CACR,SAAU,wCACV,QAAS,6DACT,MAAO,mFACP,OAAQ,wNACR,UAAW,uMACX,QAAS,uFACT,SAAU,wFACV,MAAO,wLACP,cAAe,oLACf,GAAI,mIACJ,QAAS,gIACT,MAAO,4GACP,WAAY,8JACZ,UAAW,8IACX,KAAM,gRACN,WAAY,2GACZ,QAAS,6FACT,SAAU,6KACV,KAAM,6RACN,QAAS,6KACT,MAAO,uDACP,SAAU,4EACV,MAAO,sEACP,QAAS,2KACT,YAAa,+GACb,WAAY,6HACZ,cAAe,4IACf,YAAa,0NACb,QAAS,kGACT,OAAQ,uGACR,WAAY,mFACZ,UAAW,2EACX,SAAU,qHACV,SAAU,4PACV,MAAO,mXACP,GAAI,qIACJ,QAAS,4HACT,KAAM,ySACN,KAAM,qOACN,QAAS,yJACT,cAAe,oCACf,KAAM,8CACN,MAAO,8DACP,QAAS,gIACT,KAAM,kDACN,OAAQ,+OACR,UAAW,sPACX,OAAQ,kIACR,QAAS,+LACT,SAAU,mEACV,QAAS,0CACT,MAAO,wDACP,QAAS,2CACT,OAAQ,sCACR,MAAO,uCACP,MAAO,4CAC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sB,2EACtB,4BAA6B,uCAC7B,kBAAmB,8BACnB,mBAAoB,uEACpB,oBAAqB,wGACrB,uBAAwB,oDACxB,yBAA0B,kCAC1B,6BAA8B,+BAC9B,oCAAqC,uCACrC,0BAA2B,8BAC3B,2BAA4B,+EAC5BC,KAAQ,qDACRC,SAAY,kHACZC,SAAY,6GAEZ,GAAG,OAAO,YAAYC,EAAkB,IAAK,GAAS,CAAC,iBAAiBC,EAAK,OAAQA,EAAK,WAAW,CAAC,CAAC,CAC3G,EAIaC,EAA8C,CACvD,qBAAsB,sEACtB,kBAAmB,iEACnB,gCAAiC,iFACjC,qBAAsB,6EACtB,QAAS,6JACT,UAAW,mLACX,OAAQ,kJACR,2BAA4B,6EAChC"}
1
+ {"version":3,"file":"keyword-docs.js","names":["handlerIntentDocs","keywordDocs","specificationKeywordDocs","attributeDocs","contextVariableDocs","\"$identity\"","\"$env\"","\"$secrets\"","\"$strings\"","eventContextPaths","path","specialCategoryDocs"],"sources":["../../keyword-docs.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { eventContextPaths } from './event-context';\n\n// These words are contextual beneath a handler, never global property keywords.\nexport const handlerIntentDocs = {\n implementation: 'Handler-only intent with ordered hints and at most one file or tagged fence. No payload means pending. Handler execution is unsupported; this is not confirmation.',\n hint: 'One nonblank quoted implementation hint. Order and decoded text are retained; hints do not execute or confirm code.',\n};\n\nexport const keywordDocs: Record<string, string> = {\n parameter: 'A typed value declared by a specification table, or an argument of a named behavior. Table types are required; every case supplies each parameter exactly once.',\n case: 'One named concrete row of a specification table, expanded as <Specification>_<Case>. Use case.<parameter> for a whole step value.',\n example: 'One typed, possibly partial fixture: `example <Name> : <EventOrCommandOrReadModel>`. Use its name in a matching specification step; assignments override example values without changing matching or supplying defaults. Event examples may carry stream or no stream; a step replaces that route as a whole.',\n domain: 'The domain the file belongs to — optional, at most one per file, before everything else.',\n import: 'Imports a type from another module by its qualified name — `import Module.Type` — making it available by its short name; or, quoted, other `.play` files by path or glob — `import \"Orders/**/*.play\"`, relative to this file\\'s folder. Written inside a module or feature, a file import places the imported files there: their top level is that module\\'s or feature\\'s body. `import Module.Event from \"origin\"` is instead public contract metadata with an opaque origin; executable binding refuses it with PLAY0268.',\n concept: 'A formalized value type wrapping a primitive. Bare pii and secret markers travel with every usage, with optional concept notes and qualifiers.',\n type: 'A composite value type — a named shape built from several properties, referenced by events, commands and other types the same way a concept is.',\n reason: 'A free-text concept note, not a lawful basis. Written as pii reason \"...\" or secret reason \"...\"; migration preserves it verbatim.',\n optional: 'Allows a value to be absent. Write it after the type: `note String optional` or `lines InvoiceLine[] optional`. The collection itself may be absent; its items keep their declared type.',\n identifier: 'Marks the command property a runtime resolves the event source id from. At most one per command; without it a new Uuid is generated.',\n policy: 'A named authorization rule referenced by commands and queries. Multiple policies AND together.',\n purpose: 'A report-only processing declaration (GDPR Art. 30), referenced on modules, features and slices. Coverage is their union, not an authorization gate. Generated declarations are not legal advice.',\n basis: 'One declared Art. 6(1) basis: consent, contract, legalObligation, vitalInterests, publicTask or legitimateInterests; an optional quoted reference may follow.',\n interest: 'The legitimate-interest statement for basis legitimateInterests (Art. 13(1)(d)).',\n condition: 'One Art. 9(2) processing condition, optionally followed by a quoted reference.',\n subjects: 'Comma-separated categories of data subjects, as open identifiers.',\n retention: 'Declared retention period or criteria, not enforced by the model or Chronicle.',\n recipient: 'A quoted recipient category; repeatable on a purpose.',\n transfer: 'A declared destination followed by safeguard and quoted safeguards; repeatable.',\n safeguard: 'The declared safeguard accompanying a third-country transfer.',\n erasure: 'An erasure exception under Art. 17(3); Chronicle crypto-shredding remains per subject, not per purpose.',\n exception: 'One declared Art. 17(3) exception: expression, legalObligation, publicTask, publicHealth, archiving or legalClaims.',\n persona: 'A named role interacting with the application, with an optional description and its associated policies.',\n identity: 'Declares typed additional caller details from a claim, a keyed single-result query, inline code or a file. Authoring metadata only; executable use of `$identity.<detail>` reports PLAY0268 until admitted (#600).',\n authentication: 'Declares the identity providers of the application — at most one block per file.',\n provider: 'A named identity provider within `authentication`, with free-form `name value` settings.',\n description: 'A human-readable description, including the rule or case a specification witnesses, as a quoted single line or a fenced ```text block for multiple lines.',\n depends: 'Declares `depends on <Name>` on a module or feature. This opts only that container into checking counted explicit references against its own declarations; it does not change executable bytes.',\n module: 'The top-level namespace — maps to a bounded context.',\n layout: 'A reusable screen template with named slots.',\n template: 'Declares the named slots of a layout.',\n feature: 'A vertical slice grouping. Features nest arbitrarily deep.',\n slice: 'The atomic unit of behavior, aligned with Event Modeling. Has a type and a name.',\n public: 'Marks an event as a public contract. An event with from \"origin\" is also public. Origin is opaque, not a path or declaration reference. Public events and origins are admitted by executable semantic model (ESM) v9.',\n direction: 'Declare direction inbound or direction outbound once inside a Translate slice. Admitted by executable semantic model (ESM) v9; a Translate slice that uses public events must declare it (PLAY0614).',\n inbound: 'Inbound Translate direction metadata. No transport or delivery guarantee is implied.',\n outbound: 'Outbound Translate direction metadata. No transport or delivery guarantee is implied.',\n event: 'An immutable, past-tense fact. Declare it in a slice or inline with `produces event <Name>` in a command. Inline properties are typed mappings; inline tags belong to the event type.',\n documentation: 'Authoring-only reasoning on a module, feature, slice, command, event, read model or reaction in one nonempty fenced ```markdown block. It does not change executable model bytes.',\n id: 'Preserves the previous persisted event name after a rename. Leave absent on new events; repeating the current name is redundant.',\n command: 'An imperative intent. Declares authorization, validation, and what events it produces — declaratively, or via a full handler.',\n query: 'A read-side entry point mapping to a return type, with an optional description, parameters and performer.',\n observable: 'Qualifies a query return type as a live read — `query <Name> => observable <ReadModel>` keeps pushing as the read model changes, instead of answering once.',\n performer: 'The code that performs a query — a `file <Path>` reference or an inline `csharp`/`sql` block. The query\\'s counterpart to a command handler.',\n from: 'On a reaction or reducer, `from Source[.Stream]` observes only matching routed facts. It does not filter stream ids. Admitted by ESM v10. On a query parameter, fills it from the query context instead of the caller, as in `filter tenantId TenantId from $context.tenant`.',\n projection: 'Declares how events project into a read model, using the embedded Projection Declaration Language (PDL).',\n capture: 'Converts external data into events, using the embedded Change Data Capture Language (CDL).',\n reaction: 'Behavior that runs when something happens. Lives inside Automation slices. A trigger with no body states intent on its own — `file`/code is optional realization metadata.',\n runs: '`runs as system [role \"Role\" and role \"Role\"]` declares the identity for every returned or invoked command of a reaction, not imperative pipeline calls. Admitted by released ESM v10; claims are unknown for this identity. Clock and application triggers have no Stage realization yet.',\n trigger: 'Declares a kind of occurrence a reaction can respond to, and the values it hands the reaction. What makes one occur belongs to whoever provides it, never to the compiler.',\n where: 'Narrows which occurrences actually run the reaction.',\n contains: 'Text comparison — true when the left string holds the right one anywhere.',\n every: 'Runs a reaction on an interval — `every 15 minutes`, `every 1 day`.',\n refused: 'Ordered invocation refusal branch: first match wins. Bare `on refused` covers validation and constraints, not authorization. Syntax-only, not yet executable (PLAY0268).',\n acknowledge: 'A refusal branch acknowledges alone, or produces events instead. Syntax-only, not yet executable (PLAY0268).',\n validation: 'In `on refused by validation`, selects property, concept and require refusals. Syntax-only, not yet executable (PLAY0268).',\n authorization: 'In `on refused by authorization`, explicitly selects unauthorized results, never Unsupported. Syntax-only, not yet executable (PLAY0268).',\n redelivered: '`when redelivered <Event> to <Reaction>` selects exactly one effective given occurrence by optional for, stated values and stream or no stream, without appending it again. Syntax-only, not yet executable (PLAY0268).',\n invokes: 'A command a reaction hands on. A command is asked for, not produced — it may still be rejected.',\n screen: 'A UI declaration. Supports intent, structure, and layout-with-code levels, or a full file reference.',\n constraint: 'A server-side rule enforced in the Chronicle kernel before events are committed.',\n authorize: 'References the policies that must all pass for the construct to execute.',\n validate: 'Declarative validation rules, or `validate` followed by ```csharp for imperative rules — on commands and concepts.',\n produces: 'References a declared event with `produces <Name>`, or declares one inline with `produces event <Name>`. An inline omitted `for` uses the command identifier only when all destinations are the same source; legacy plain omission allocates an identity.',\n reads: 'Declares a view consulted by a command or reaction trigger: `reads <View> [as <alias>] [by <value>]`. A reaction `by` names a value taken by its trigger; clock triggers cannot use `by`. A child by block supplies composite key parts by name, using part = source. Repeated views require unique aliases. Runtime binding is not yet supported for command or reaction reads.',\n as: 'Names an instance of a view in a command or reaction trigger reads declaration, for example `reads Account as source by sourceId`.',\n handler: 'A fully imperative command implementation — a `file <Path>` reference or an inline `csharp` block, instead of `produces`.',\n when: 'Guards a produced event or a capture append with a condition. In a labeled screen action, `when item.<field> == <literal> execute <Command>` selects the first matching command. Inside on click, double click or select, block-form `when <condition>` selects one whole action list at gesture time.',\n rule: 'Names a predicate. Bare, it states that a constraint exists without expressing what it computes — nothing resolves the name. Optionally followed by an indented `file <Path>` reference or inline `csharp` block giving it a body.',\n require: 'A policy condition: `authenticated`, `role \"...\"`, or `claim \"...\" matches ...`. Unary `not` negates a condition or group; precedence is not, and, or.',\n authenticated: 'Requires an authenticated caller.',\n role: 'Requires the caller to have the given role.',\n claim: 'Requires a claim on the caller to match a subject or value.',\n subject: 'In policy `matches subject`, the identifier of the thing acted on, not the caller. The caller is `$context.causedBy.subject`.',\n data: 'Binds a read model to a screen through a query.',\n action: 'Makes a command available on a screen. `action \"Label\"` declares one button with ordered `when … execute` alternatives over the nearest data item or selected row. No subject hides it; commands still enforce authorization and validation.',\n otherwise: 'The final fallback of a guarded action: `otherwise hidden` or `otherwise execute <Command>`. In an item interaction, bare `otherwise` opens a fallback action list. No subject runs nothing, including fallback; authorization never falls through.',\n hidden: 'Hides a guarded action when no condition matches. Without a subject the action is always hidden, even with an execute fallback.',\n execute: 'Executes a command. A guarded screen action selects it by the first matching condition; explicit `with … from` bindings precede same-name item fields, its declared form and renderer input.',\n navigate: 'Navigates to a screen, optionally passing a parameter with `by`.',\n section: 'A named structural section of a screen.',\n table: 'A table widget over a read model or child collection.',\n summary: 'A summary widget showing labeled fields.',\n column: 'A table column bound to a property.',\n field: 'A summary field bound to a property.',\n title: 'The display title of a screen or section.',\n label: 'The display label of an action, column, or field.',\n unique: 'A uniqueness constraint — `unique <property> on <EventType>` or `unique event <EventType>`.',\n concurrency: 'The concurrency scope enforced when the command appends events — dimensions: `eventSource`, `sourceType`, `streamType`, `streamId`, `events`.',\n eventSource: 'Concurrency dimension — scope the check to the event source id of the command.',\n sourceType: 'Concurrency dimension — scope the check to an event source type.',\n streamType: 'Concurrency dimension — scope the check to an event stream type.',\n streamId: 'Concurrency dimension — scope the check to an event stream id.',\n tag: 'Attaches a tag to appended events — a static identifier or string, or a `$context.` expression resolved at append time.',\n seed: 'Declares events to seed into the event store per event source id — multiple blocks accumulate.',\n for: 'Names the event source of a production or seed group. Inside `produces event`, omission uses the command identifier unless another production targets a different source.',\n readmodel: 'Declares a read model — its name and properties — in a slice, or, in a specification, read model state: `given readmodel` establishes it, `then readmodel` asserts it, `then no readmodel <View> for <key>` asserts keyed absence.',\n reducer: 'Builds a read model from events with imperative code — `reducer <Name> => <ReadModel>` with an `on <EventType>` rule per event. Use it when a projection cannot express the transition.',\n specification: 'Given/when/then acceptance criteria for a slice: prior events and state, the command, query or appended event under test, and the events, state, results, errors or denials that follow.',\n dialog: 'A dialog opened over the shell, or with `dialog template` a reusable dialog shape.',\n form: 'A form bound to a command — `form <Name> for <Command>` with a `field` per input.',\n contribute: 'Contributes entries to a slot of the shell — `contribute to Navigation` with `navigate to`, `label` and `order`.',\n theme: 'A named theme and the component packages it is compatible with.',\n ui: 'A UI profile — `ui profile <Name>` binds a target platform and size to a layout, theme and packages.',\n behavior: 'A named interaction wiring of `on <interaction>` handlers, attached to a screen, form or dialog with `uses`.',\n system: 'An application-scoped external system that operations use.',\n eventsource: 'An application-owned event source with nested streams.',\n operation: 'A reusable operation intent that uses one external system.',\n no: 'A keyed absence assertion: `then no readmodel <View> for <key>`.',\n arguments: 'The values supplied to a query asserted by `then query`.',\n result: 'One expected result - `then result [exactly]` after `when query`, or a `result` block inside `then query`. Repeat it to assert several results in authored order.',\n clock: 'The instant a specification happens at - `given clock \"2026-10-05T08:00:00Z\"` fixes when everything occurs; `when clock \"<instant>\"` is the clock reaching it, as the action.',\n exactly: 'Requires every property to match, rather than only the ones asserted - on `then readmodel`, `then query` and `then result`.',\n file: 'Delegates the implementation to an external file; the Screenplay contract stays visible.',\n key: 'Trailing modifier on a required top-level read-model property. Explicit keys replace inference. Composite keys remain authoring-only (PLAY0268, #599).',\n stream: 'On a command event production, replaces the whole command route for that event. Other productions keep the command route. Admitted by ESM v10.',\n by: 'Introduces one identifying parameter or a block of at least two named key parts. Reads use part = source; queries use part Type.',\n via: 'Connects screen data to the query that supplies it.',\n filter: 'An optional query filter parameter.',\n on: 'The event a constraint applies to, the day a schedule narrows to, or a widget interaction such as `on row-click`.',\n message: 'The validation message reported when the rule fails.',\n matches: 'Matches a value against a regular expression or a named pattern such as `email`.',\n all: 'Applies a comparison to every element of a collection.',\n max: 'Maximum length or value.',\n min: 'Minimum length or value.',\n length: 'Constrains the exact length of a value.',\n today: 'The current date.',\n empty: 'Used with `not empty` — the value must be present.',\n not: 'Negates a validation condition, as in `not empty`.',\n and: 'Both conditions must hold.',\n or: 'Either condition may hold.',\n csharp: 'An inline C# block whose opening fence is ```csharp.',\n sql: 'An inline SQL block between triple backticks — a query performer written against a relational store.',\n typescript: 'An inline TypeScript block between triple backticks.',\n react: 'An inline React/TSX block; receives the surrounding data contract as `Props`.',\n html: 'An inline static HTML block.',\n StateChange: 'Slice type — a command → events flow; something that changes the system.',\n StateView: 'Slice type — a query + projection + screen; something that reads the system.',\n Automation: 'Slice type — a reaction or reducer; something that runs when something happens.',\n Translate: 'Slice type — a capture; converts external data into events.',\n Uuid: 'Primitive type — a universally unique identifier.',\n String: 'Primitive type — a string of characters.',\n Int: 'Primitive type — an integer number.',\n Decimal: 'Primitive type — a decimal number.',\n Bool: 'Primitive type — true or false.',\n Date: 'Primitive type — a date without time.',\n DateTime: 'Primitive type — a date and time.',\n Enum: 'An enumeration concept with named members. Members may all declare unique int32 numbers (draft = 1) or all omit them (zero-based positions). Never renumber or reuse a published number. Non-positional numbers select executable model (ESM) v12; consumers must explicitly admit v12. Specifications still name members.',\n};\n\n// What the words of a specification's steps mean there - where 'trigger', 'capture' and 'query' name what the\n// scenario exercises rather than declare one.\nexport const specificationKeywordDocs: Record<string, string> = {\n parameter: 'Declares a required typed case value: `parameter <name> <Type>`. Every case assigns it once. `optional` permits literal null but supplies no default.',\n case: 'One named complete row of a specification table. `case.<parameter>` substitutes a whole value after example overrides; each row runs as `<Specification>_<Case>`.',\n caller: '`given caller` states an explicit identity; `given caller as <Persona>` synthesizes an authenticated deterministic witness of the persona, with no body. Leftmost buildable policy alternatives are significant.',\n clock: keywordDocs.clock,\n redelivered: keywordDocs.redelivered,\n trigger: '`when trigger <Trigger>` - an application trigger fires, as the action, with the values on the lines beneath it.',\n capture: '`given capture <Capture>` - a record the capture\\'s source held before; `when capture <Capture>` - the record it sees now, as the action. The fields go on the lines beneath.',\n query: '`when query <Query>` - the query is performed, as the action, with its arguments on the lines beneath; assert what it returns with `then result` or `then no result`. `then query` instead asserts a query after another action.',\n events: '`then no events` - asserts no new events after a non-append action. Syntax-only, not yet executable (PLAY0268). Cannot accompany event, event-order, error or denial expectations.',\n result: '`then result [exactly]` - one result the query performed by `when query` returns, in order; `then no result` - it returns nothing.',\n};\n\nexport const attributeDocs: Record<string, string> = {\n pii: 'personal data (GDPR Art. 4(1)); renders Chronicle [PII]. Bare suffix marker; @pii is deprecated (PLAY0565). Not admitted by the executable model (PLAY0268).',\n personal: 'Alias of pii: personal data (GDPR Art. 4(1)); renders Chronicle [PII]. No diagnostic; canonical printing writes pii.',\n secret: 'Operational secret, not personal data: encrypted at rest without erasure and withheld from causation. Provider mapping: [Encrypted] + [NotAudited], or [PII] only with pii. Cannot be identity (PLAY0515). Not admitted by the executable model (PLAY0268).',\n sensitive: 'Deprecated spelling of secret (PLAY0565); repair to bare secret. Operational secret, not GDPR Art. 9 special-category data.',\n};\n\nexport const contextVariableDocs: Record<string, string> = {\n '$context.occurred': 'When the command or query was received.',\n '$context.tenant': 'The tenant the command or query is executing for.',\n '$context.command': 'The command being handled, shaped by its `command` declaration.',\n '$context.arguments': 'The arguments of the query being performed.',\n '$context.causedBy': 'The identity that caused the command or query — `subject`, `name`, `userName`.',\n '$context.causedBy.subject': 'The subject of the identity that caused the command or query.',\n '$context.causedBy.name': 'The display name of the identity that caused the command or query.',\n '$context.causedBy.userName': 'The user name of the identity that caused the command or query.',\n '$context.causation': 'What caused the command or query — `type`, `occurred`, `properties`.',\n '$context.causation.type': 'What caused the command or query — a command, a reactor, a schedule.',\n '$identity': 'The caller — token built-ins `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`, plus declared identity details. Built-ins are equivalent to `$context.identity`; details are authoring-only until admitted (#600).',\n '$identity.id': 'The identifier of the caller from the auth token; equivalent to `$context.identity.id`.',\n '$identity.name': 'The display name of the caller; equivalent to `$context.identity.name`.',\n '$identity.userName': 'The user name of the caller; equivalent to `$context.identity.userName`.',\n '$identity.isAuthenticated': 'Whether the caller is authenticated.',\n '$identity.roles': 'The roles the caller holds.',\n '$identity.claims': 'The claims the caller carries — `$identity.claims.<name>` reads one.',\n '$context.identity': 'The caller a decision is made about — `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`.',\n '$context.identity.id': 'The identifier of the caller from the auth token.',\n '$context.identity.name': 'The display name of the caller.',\n '$context.identity.userName': 'The user name of the caller.',\n '$context.identity.isAuthenticated': 'Whether the caller is authenticated.',\n '$context.identity.roles': 'The roles the caller holds.',\n '$context.identity.claims': 'The claims the caller carries — `$context.identity.claims.<name>` reads one.',\n '$env': 'An environment variable, e.g. `$env.SERVICE_NAME`.',\n '$secrets': 'An encrypted secret resolved at runtime, e.g. `$secrets.azureAdClientId` — stays symbolic in the compiled tree.',\n '$strings': 'A localized string resolved from the `.strings` file of the active locale, e.g. `$strings.invoices.title`.',\n // Every $eventContext path the event-context catalog lists, for projections.\n ...Object.fromEntries(eventContextPaths.map((path) => [`$eventContext.${path.path}`, path.description])),\n};\n\n// One-sentence descriptions of the `pii special` categories (GDPR Art. 9(1)) and `pii criminal` (Art. 10).\n// The same sentences appear in Documentation/screenplay/concepts.md.\nexport const specialCategoryDocs: Record<string, string> = {\n racialOrEthnicOrigin: 'Data revealing a person\\'s racial or ethnic origin (GDPR Art. 9(1)).',\n politicalOpinions: 'Data revealing a person\\'s political opinions (GDPR Art. 9(1)).',\n religiousOrPhilosophicalBeliefs: 'Data revealing a person\\'s religious or philosophical beliefs (GDPR Art. 9(1)).',\n tradeUnionMembership: 'Data revealing whether a person belongs to a trade union (GDPR Art. 9(1)).',\n genetic: 'Data about inherited or acquired genetic characteristics that gives unique information about a person\\'s physiology or health (GDPR Art. 9(1), Art. 4(13)).',\n biometric: 'Data from technical processing of physical, physiological or behavioral characteristics, special only when processed to uniquely identify a person (GDPR Art. 9(1), Art. 4(14)).',\n health: 'Data about a person\\'s physical or mental health, including health care services, that reveals their health status (GDPR Art. 9(1), Art. 4(15)).',\n sexLifeOrSexualOrientation: 'Data concerning a person\\'s sex life or sexual orientation (GDPR Art. 9(1)).'\n};\n"],"mappings":"2IAMA,MAAaA,EAAoB,CAC7B,eAAgB,qKAChB,KAAM,qHACV,EAEaC,EAAsC,CAC/C,UAAW,kKACX,KAAM,oIACN,QAAS,gTACT,OAAQ,2FACR,OAAQ,ggBACR,QAAS,iJACT,KAAM,kJACN,OAAQ,qIACR,SAAU,2LACV,WAAY,uIACZ,OAAQ,iGACR,QAAS,oMACT,MAAO,gKACP,SAAU,mFACV,UAAW,iFACX,SAAU,oEACV,UAAW,iFACX,UAAW,wDACX,SAAU,kFACV,UAAW,gEACX,QAAS,0GACT,UAAW,sHACX,QAAS,2GACT,SAAU,qNACV,eAAgB,mFAChB,SAAU,2FACV,YAAa,4JACb,QAAS,kMACT,OAAQ,uDACR,OAAQ,+CACR,SAAU,wCACV,QAAS,6DACT,MAAO,mFACP,OAAQ,wNACR,UAAW,uMACX,QAAS,uFACT,SAAU,wFACV,MAAO,wLACP,cAAe,oLACf,GAAI,mIACJ,QAAS,gIACT,MAAO,4GACP,WAAY,8JACZ,UAAW,8IACX,KAAM,gR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,kCACN,KAAM,wCACN,SAAU,oCACV,KAAM,4TACV,EAIaC,EAAmD,CAC5D,UAAW,wJACX,KAAM,oKACN,OAAQ,mNACR,MAAOD,EAAY,MACnB,YAAaA,EAAY,YACzB,QAAS,mHACT,QAAS,+KACT,MAAO,mOACP,OAAQ,qLACR,OAAQ,oIACZ,EAEaE,EAAwC,CACjD,IAAK,+JACL,SAAU,uHACV,OAAQ,8PACR,UAAW,6HACf,EAEaC,EAA8C,CACvD,oBAAqB,0CACrB,kBAAmB,oDACnB,mBAAoB,kEACpB,qBAAsB,8CACtB,oBAAqB,iFACrB,4BAA6B,gEAC7B,yBAA0B,qEAC1B,6BAA8B,kEAC9B,qBAAsB,uEACtB,0BAA2B,uEAC3BC,UAAa,kOACb,eAAgB,0FAChB,iBAAkB,0EAClB,qBAAsB,2EACtB,4BAA6B,uCAC7B,kBAAmB,8BACnB,mBAAoB,uEACpB,oBAAqB,wGACrB,uBAAwB,oDACxB,yBAA0B,kCAC1B,6BAA8B,+BAC9B,oCAAqC,uCACrC,0BAA2B,8BAC3B,2BAA4B,+EAC5BC,KAAQ,qDACRC,SAAY,kHACZC,SAAY,6GAEZ,GAAG,OAAO,YAAYC,EAAkB,IAAK,GAAS,CAAC,iBAAiBC,EAAK,OAAQA,EAAK,WAAW,CAAC,CAAC,CAC3G,EAIaC,EAA8C,CACvD,qBAAsB,sEACtB,kBAAmB,iEACnB,gCAAiC,iFACjC,qBAAsB,6EACtB,QAAS,6JACT,UAAW,mLACX,OAAQ,kJACR,2BAA4B,6EAChC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/screenplay-language",
3
- "version": "4.138.0",
3
+ "version": "4.140.0",
4
4
  "description": "Monaco language service for the Cratis Screenplay DSL — syntax highlighting, IntelliSense, hover and diagnostics for .play files",
5
5
  "keywords": [
6
6
  "cratis",