@cratis/screenplay-language 4.176.0 → 4.178.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ModuleBody.js +1 -1
- package/dist/bundles/compiler/Parsing/ModuleBody.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ScreenParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ScreenParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/TemplateReferenceText.js +2 -0
- package/dist/bundles/compiler/Parsing/TemplateReferenceText.js.map +1 -0
- package/dist/bundles/compiler/Syntax/SyntaxCollections.js +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxCollections.js.map +1 -1
- package/dist/bundles/completion-planner.js +2 -2
- package/dist/bundles/completion-planner.js.map +1 -1
- package/dist/bundles/diagnostic-codes.js +1 -1
- package/dist/bundles/diagnostic-codes.js.map +1 -1
- package/dist/bundles/keyword-docs.js +1 -1
- package/dist/bundles/keyword-docs.js.map +1 -1
- package/dist/bundles/language.js +1 -1
- package/dist/bundles/language.js.map +1 -1
- package/dist/bundles/scope-items.js +3 -3
- package/dist/bundles/scope-items.js.map +1 -1
- package/dist/bundles/validation.js +1 -1
- package/dist/bundles/validation.js.map +1 -1
- package/dist/completion-planner.d.ts.map +1 -1
- package/dist/diagnostic-codes.d.ts +3 -0
- package/dist/diagnostic-codes.d.ts.map +1 -1
- package/dist/keyword-docs.d.ts.map +1 -1
- package/dist/language.d.ts.map +1 -1
- package/dist/scope-items.d.ts +1 -0
- package/dist/scope-items.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -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. The by key and every supplied filter value satisfy their concept rules after authorization; violations reject with Validation, not an empty result.',\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, executable from ESM v19: first match wins and stops remaining invocations of this trigger. Bare `on refused` covers validation and constraints, not authorization. Other reactions and cascades continue; contract errors, concurrency and Unsupported never match.',\n acknowledge: 'A refusal branch acknowledges alone without facts, or produces events instead. Executable from ESM v19; handling stops remaining invocations of this trigger.',\n validation: 'In `on refused by validation`, selects error-severity property, concept and require refusals. Executable from ESM v19.',\n authorization: 'In `on refused by authorization`, explicitly selects unauthorized results, never Unsupported. Executable from ESM v19; bare refusal excludes authorization.',\n redelivered: '`when redelivered <Event> to <Reaction>` selects exactly one effective given occurrence by optional for, stated values and stream or no stream, delivering that event again to one named reaction without appending it again. Executable from ESM v17.',\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 checksum: 'String-concept validation: exact trailing luhn/mod11 digit or two mod97 digits over preceding ASCII digits. Also applies to supplied and stored values; generation does not silently add validation.',\n luhn: 'Luhn check digit, with standard parity from the right. Generation appends it; validate checksum luhn checks the arithmetic.',\n mod11: 'Check digit (11 - weighted sum modulo 11) modulo 11, weights 2..7 cycling from the right. Output 10 is excluded from generation support.',\n mod97: 'ISO 7064 MOD 97-10, two zero-padded trailing digits. Validation checks the exact computed suffix, not only congruence.',\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, including every generated pattern date segment at that same UTC instant. Without given clock, generation fixtures check date digit widths only, never the wall clock. `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` — text needs a non-whitespace character; null, empty and whitespace-only text fail. Unicode White_Space is U+0009–U+000D, U+0020, U+0085, U+00A0, U+1680, U+2000–U+200A, U+2028, U+2029, U+202F, U+205F and U+3000 (not U+FEFF). Collections need at least one element. Applies to concept and command rules in every ESM version; no trimming. Identity text is unchanged: whitespace is a value.',\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>` performs the query with arguments beneath it; assert returned rows with `then result` or genuine absence with `then no result`. From ESM v18, one actionless query with `then error` asserts exactly Validation and no other outcome. This also works with `then query` and an arguments block, without a result block.',\n events: '`then no events` - asserts the action appended no events, also after `when append`, where it means no reaction appended anything. Executable from ESM v17. 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). Selects executable model (ESM) v13; consumers must explicitly admit it. Cannot classify identity or enum concepts. An event with personal values and an explicit subject mark refuses binding (PLAY0268) until lineage is admitted.',\n personal: 'Alias of pii: personal data (GDPR Art. 4(1)); renders Chronicle [PII]. No diagnostic; canonical printing writes pii. Selects executable model (ESM) v13, like 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. Selects executable model (ESM) v13; reference outcomes are unchanged. Cannot classify identity (PLAY0515) or enum concepts. Explicit scope is omitted next to pii. An event combining secret scope subject with an explicit subject mark refuses binding (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,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,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: 'Names a template to fill or assign: `template <Name>` for an own template, `template blueprint <Blueprint> <Name> [version \"<range>\"]` for a template a blueprint package ships.',\n blueprint: 'In `template blueprint <Blueprint> <Name>`, the blueprint package the template comes from. A `ui profile` should list it under `packages`.',\n version: 'In `template blueprint ... version \"<range>\"`, the semver range of the blueprint the reference accepts, such as `^1.4`.',\n scopes: 'Where a template may be used: `application`, `module`, `feature`, `subfeature` or `slice`. `slice` can be followed by the kinds `statechange` and `stateview`, such as `scopes slice statechange|stateview`.',\n category: 'The group a template picker lists a layout or template under. Every layout and template needs one.',\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. The by key and every supplied filter value satisfy their concept rules after authorization; violations reject with Validation, not an empty result.',\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, executable from ESM v19: first match wins and stops remaining invocations of this trigger. Bare `on refused` covers validation and constraints, not authorization. Other reactions and cascades continue; contract errors, concurrency and Unsupported never match.',\n acknowledge: 'A refusal branch acknowledges alone without facts, or produces events instead. Executable from ESM v19; handling stops remaining invocations of this trigger.',\n validation: 'In `on refused by validation`, selects error-severity property, concept and require refusals. Executable from ESM v19.',\n authorization: 'In `on refused by authorization`, explicitly selects unauthorized results, never Unsupported. Executable from ESM v19; bare refusal excludes authorization.',\n redelivered: '`when redelivered <Event> to <Reaction>` selects exactly one effective given occurrence by optional for, stated values and stream or no stream, delivering that event again to one named reaction without appending it again. Executable from ESM v17.',\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 checksum: 'String-concept validation: exact trailing luhn/mod11 digit or two mod97 digits over preceding ASCII digits. Also applies to supplied and stored values; generation does not silently add validation.',\n luhn: 'Luhn check digit, with standard parity from the right. Generation appends it; validate checksum luhn checks the arithmetic.',\n mod11: 'Check digit (11 - weighted sum modulo 11) modulo 11, weights 2..7 cycling from the right. Output 10 is excluded from generation support.',\n mod97: 'ISO 7064 MOD 97-10, two zero-padded trailing digits. Validation checks the exact computed suffix, not only congruence.',\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 navigation: 'A navigation region of the shell — `navigation topbar` or `navigation sidebar`. A layout declares the application\\'s regions with a `logo` and `item` lines; a module adds `inherits`, `extends` or `overrides` to change what it shows.',\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, including every generated pattern date segment at that same UTC instant. Without given clock, generation fixtures check date digit widths only, never the wall clock. `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` — text needs a non-whitespace character; null, empty and whitespace-only text fail. Unicode White_Space is U+0009–U+000D, U+0020, U+0085, U+00A0, U+1680, U+2000–U+200A, U+2028, U+2029, U+202F, U+205F and U+3000 (not U+FEFF). Collections need at least one element. Applies to concept and command rules in every ESM version; no trimming. Identity text is unchanged: whitespace is a value.',\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>` performs the query with arguments beneath it; assert returned rows with `then result` or genuine absence with `then no result`. From ESM v18, one actionless query with `then error` asserts exactly Validation and no other outcome. This also works with `then query` and an arguments block, without a result block.',\n events: '`then no events` - asserts the action appended no events, also after `when append`, where it means no reaction appended anything. Executable from ESM v17. 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). Selects executable model (ESM) v13; consumers must explicitly admit it. Cannot classify identity or enum concepts. An event with personal values and an explicit subject mark refuses binding (PLAY0268) until lineage is admitted.',\n personal: 'Alias of pii: personal data (GDPR Art. 4(1)); renders Chronicle [PII]. No diagnostic; canonical printing writes pii. Selects executable model (ESM) v13, like 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. Selects executable model (ESM) v13; reference outcomes are unchanged. Cannot classify identity (PLAY0515) or enum concepts. Explicit scope is omitted next to pii. An event combining secret scope subject with an explicit subject mark refuses binding (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,mLACV,UAAW,6IACX,QAAS,0HACT,OAAQ,+MACR,SAAU,qGACV,QAAS,6DACT,MAAO,mFACP,OAAQ,wNACR,UAAW,uMACX,QAAS,uFACT,SAAU,wFACV,MAAO,wLACP,cAAe,oLACf,GAAI,mIACJ,QAAS,gIACT,MAAO,gQACP,WAAY,8JACZ,UAAW,8IACX,KAAM,gRACN,WAAY,2GACZ,QAAS,6FACT,SAAU,6KACV,KAAM,6RACN,QAAS,6KACT,MAAO,uDACP,SAAU,4EACV,MAAO,sEACP,QAAS,ySACT,YAAa,gKACb,WAAY,yHACZ,cAAe,8JACf,YAAa,yPACb,QAAS,kGACT,OAAQ,uGACR,WAAY,mFACZ,UAAW,2EACX,SAAU,qHACV,SAAU,uMACV,KAAM,8HACN,MAAO,2IACP,MAAO,yHACP,SAAU,4PACV,M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,IAAK,kVACL,SAAU,qKACV,OAAQ,mbACR,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/dist/bundles/language.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=`screenplay`,t={id:e,extensions:[`.play`],aliases:[`Screenplay`,`screenplay`,`play`],mimetypes:[`text/x-screenplay`]},n=/* @__PURE__ */ `domain.import.concept.type.policy.purpose.persona.authentication.identity.module.layout.theme.ui.feature.slice.event.public.system.eventsource.operation.command.query.projection.capture.reaction.runs.reducer.readmodel.trigger.screen.dialog.form.contribute.constraint.specification.case.parameter.example.seed.behavior.exposure.instance`.split(`.`),r=/* @__PURE__ */ `depends.direction.inbound.outbound.description.documentation.template.profile.require.authenticated.role.claim.subject.authorize.validate.produces.reads.as.handler.performer.observable.identifier.reason.from.when.given.then.arguments.result.clock.exactly.error.message.not.empty.rule.matches.all.max.min.length.today.true.false.and.or.by.filter.data.via.component.context.property.literal.icons.packages.outlet.display.scopes.reexposes.operations.items.toolbar.item.presentation.exposes.mode.oneWay.twoWay.null.propagate.clear.preserve.expected.action.navigate.to.label.section.table.summary.title.column.field.on.unique.file.concurrency.eventSource.sourceType.streamType.streamId.tag.for.readmodel.no.when.every.at.where.invokes.contains.starts.with.provider.uses.parameter.order.open.close.refresh.set.notify.confirm.raise.interval.success.failure.click.double.select.submit.change.load.unload.enter.leave.info.warning`.split(`.`),i=[`csharp`,`typescript`,`react`,`html`,`sql`],a=[`command`,`arguments`,`tenant`,`causedBy`,`causation`,`occurred`,`identity`],o=[`subject`,`name`,`userName`],s=[`id`,`name`,`userName`,`isAuthenticated`,`roles`,`claims`],c=[`StateChange`,`StateView`,`Automation`,`Translate`],l=[`Uuid`,`String`,`Int`,`Decimal`,`Bool`,`Date`,`DateTime`],u=[`pii`,`personal`,`secret`],d=/^\s*(?:module|feature|slice\s+\w+|type|command|event|readmodel|reducer|projection|capture|reaction|screen|dialog|form|contribute|specification|case|constraint|persona|policy|behavior|layout|theme|ui\s+profile|trigger|authentication|identity|seed|system|eventsource|operation|screen\s+template|dialog\s+template|produces\s+event|generate\s+rule|validate|handler|on)\b[^=]*$/,f={comments:{lineComment:`//`},brackets:[[`(`,`)`],[`[`,`]`]],autoClosingPairs:[{open:`(`,close:`)`},{open:`[`,close:`]`},{open:`"`,close:`"`}],surroundingPairs:[{open:`(`,close:`)`},{open:`[`,close:`]`},{open:`"`,close:`"`}],folding:{offSide:!0},onEnterRules:[{beforeText:d,action:{indentAction:1}}],indentationRules:{increaseIndentPattern:/^\s*(module|feature|slice|policy|persona|authentication|identity|provider|event|command|query|type|screen|projection|capture|reaction|trigger|constraint|specification|layout|template|generate\s+rule|validate|produces|handler|implementation(?=\s*$)|performer|rule|section|action|otherwise(?=\s*$|\s+execute\b)|concurrency|seed|for|when|then|arguments|result|every|at|invokes|on)\b.*$/,decreaseIndentPattern:/(?!)/}};export{d as blockHeaderPattern,o as causedByProperties,r as clauseKeywords,i as codeBlockTags,u as conceptAttributes,n as constructKeywords,a as contextRoots,s as identityProperties,f as languageConfiguration,t as languageExtensionPoint,e as languageId,l as primitiveTypes,c as sliceTypes};
|
|
1
|
+
const e=`screenplay`,t={id:e,extensions:[`.play`],aliases:[`Screenplay`,`screenplay`,`play`],mimetypes:[`text/x-screenplay`]},n=/* @__PURE__ */ `domain.import.concept.type.policy.purpose.persona.authentication.identity.module.layout.theme.ui.feature.slice.event.public.system.eventsource.operation.command.query.projection.capture.reaction.runs.reducer.readmodel.trigger.screen.dialog.form.contribute.navigation.constraint.specification.case.parameter.example.seed.behavior.exposure.instance`.split(`.`),r=/* @__PURE__ */ `depends.direction.inbound.outbound.description.documentation.template.profile.require.authenticated.role.claim.subject.authorize.validate.produces.reads.as.handler.performer.observable.identifier.reason.from.when.given.then.arguments.result.clock.exactly.error.message.not.empty.rule.matches.all.max.min.length.today.true.false.and.or.by.filter.data.via.component.context.property.literal.icons.packages.outlet.display.scopes.blueprint.version.statechange.stateview.reexposes.operations.items.toolbar.item.topbar.sidebar.inherits.extends.overrides.logo.image.icon.target.slot.presentation.exposes.mode.oneWay.twoWay.null.propagate.clear.preserve.expected.action.navigate.to.label.section.table.summary.title.column.field.on.unique.file.concurrency.eventSource.sourceType.streamType.streamId.tag.for.readmodel.no.when.every.at.where.invokes.contains.starts.with.provider.uses.parameter.order.open.close.refresh.set.notify.confirm.raise.interval.success.failure.click.double.select.submit.change.load.unload.enter.leave.info.warning`.split(`.`),i=[`csharp`,`typescript`,`react`,`html`,`sql`],a=[`command`,`arguments`,`tenant`,`causedBy`,`causation`,`occurred`,`identity`],o=[`subject`,`name`,`userName`],s=[`id`,`name`,`userName`,`isAuthenticated`,`roles`,`claims`],c=[`StateChange`,`StateView`,`Automation`,`Translate`],l=[`Uuid`,`String`,`Int`,`Decimal`,`Bool`,`Date`,`DateTime`],u=[`pii`,`personal`,`secret`],d=/^\s*(?:module|feature|slice\s+\w+|type|command|event|readmodel|reducer|projection|capture|reaction|screen|dialog|form|contribute|specification|case|constraint|persona|policy|behavior|layout|theme|ui\s+profile|trigger|authentication|identity|seed|system|eventsource|operation|screen\s+template|dialog\s+template|produces\s+event|generate\s+rule|validate|handler|on)\b[^=]*$/,f={comments:{lineComment:`//`},brackets:[[`(`,`)`],[`[`,`]`]],autoClosingPairs:[{open:`(`,close:`)`},{open:`[`,close:`]`},{open:`"`,close:`"`}],surroundingPairs:[{open:`(`,close:`)`},{open:`[`,close:`]`},{open:`"`,close:`"`}],folding:{offSide:!0},onEnterRules:[{beforeText:d,action:{indentAction:1}}],indentationRules:{increaseIndentPattern:/^\s*(module|feature|slice|policy|persona|authentication|identity|provider|event|command|query|type|screen|projection|capture|reaction|trigger|constraint|specification|layout|template|generate\s+rule|validate|produces|handler|implementation(?=\s*$)|performer|rule|section|action|otherwise(?=\s*$|\s+execute\b)|concurrency|seed|for|when|then|arguments|result|every|at|invokes|on)\b.*$/,decreaseIndentPattern:/(?!)/}};export{d as blockHeaderPattern,o as causedByProperties,r as clauseKeywords,i as codeBlockTags,u as conceptAttributes,n as constructKeywords,a as contextRoots,s as identityProperties,f as languageConfiguration,t as languageExtensionPoint,e as languageId,l as primitiveTypes,c as sliceTypes};
|
|
2
2
|
//# sourceMappingURL=language.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"language.js","names":["languageId","languageExtensionPoint","constructKeywords","clauseKeywords","codeBlockTags","contextRoots","causedByProperties","identityProperties","sliceTypes","primitiveTypes","conceptAttributes","blockHeaderPattern","languageConfiguration"],"sources":["../../language.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 type { languages } from 'monaco-editor';\n\nexport type Monaco = typeof import('monaco-editor');\n\nexport const languageId = 'screenplay';\n\nexport const languageExtensionPoint: languages.ILanguageExtensionPoint = {\n id: languageId,\n extensions: ['.play'],\n aliases: ['Screenplay', 'screenplay', 'play'],\n mimetypes: ['text/x-screenplay'],\n};\n\n// Every word the parser dispatches on at the top level, inside a module, or inside a slice.\n// `for_LanguageService.when_comparing_keywords_against_the_parsers` derives that set from\n// ScreenplayParser and SliceParser and fails when this list has drifted from it, so a construct\n// added to the compiler cannot silently lose its highlighting and completion.\nexport const constructKeywords = [\n 'domain',\n 'import',\n 'concept',\n 'type',\n 'policy',\n 'purpose',\n 'persona',\n 'authentication',\n 'identity',\n 'module',\n 'layout',\n 'theme',\n 'ui',\n 'feature',\n 'slice',\n 'event',\n 'public',\n 'system',\n 'eventsource',\n 'operation',\n 'command',\n 'query',\n 'projection',\n 'capture',\n 'reaction',\n 'runs',\n 'reducer',\n 'readmodel',\n 'trigger',\n 'screen',\n 'dialog',\n 'form',\n 'contribute',\n 'constraint',\n 'specification',\n 'case',\n 'parameter',\n 'example',\n 'seed',\n 'behavior',\n 'exposure',\n 'instance',\n];\n\n// Type modifiers are contextual, never excluded from property or declaration names.\nexport const typeModifierKeywords = ['optional'];\n\nexport const clauseKeywords = [\n 'depends',\n 'direction',\n 'inbound',\n 'outbound',\n 'description',\n 'documentation',\n 'template',\n 'profile',\n 'require',\n 'authenticated',\n 'role',\n 'claim',\n 'subject',\n 'authorize',\n 'validate',\n 'produces',\n 'reads', // A clause in command bodies and reaction trigger bodies; @reads remains a value.\n 'as',\n 'handler',\n 'performer',\n 'observable',\n 'identifier',\n 'reason',\n 'from',\n 'when',\n 'given',\n 'then',\n 'arguments',\n 'result',\n 'clock', // A specification step - 'given clock' and 'when clock' state an instant.\n 'exactly',\n 'error',\n 'message',\n 'not', // Unary policy negation, as well as 'not empty' validation.\n 'empty',\n 'rule',\n 'matches',\n 'all',\n 'max',\n 'min',\n 'length',\n 'today',\n 'true',\n 'false',\n 'and',\n 'or',\n 'by',\n 'filter',\n 'data',\n 'via',\n 'component',\n 'context',\n 'property',\n 'literal',\n 'icons',\n 'packages',\n 'outlet',\n 'display',\n 'scopes',\n 'reexposes',\n 'operations',\n 'items',\n 'toolbar',\n 'item',\n 'presentation',\n 'exposes',\n 'mode',\n 'oneWay',\n 'twoWay',\n 'null',\n 'propagate',\n 'clear',\n 'preserve',\n 'expected',\n 'action',\n 'navigate',\n 'to',\n 'label',\n 'section',\n 'table',\n 'summary',\n 'title',\n 'column',\n 'field',\n 'on',\n 'unique',\n 'file',\n 'concurrency',\n 'eventSource',\n 'sourceType',\n 'streamType',\n 'streamId',\n 'tag',\n 'for',\n 'readmodel',\n 'no',\n 'when',\n 'every',\n 'at',\n 'where',\n 'invokes',\n 'contains',\n 'starts',\n 'with',\n 'provider',\n // Interaction: the words a behavior body uses. The built-in interaction kinds ('click', 'submit', and\n // friends) are only reserved inside an `on` clause, so they are clause words rather than constructs -\n // an identifier of the same name elsewhere in a document remains an identifier.\n 'uses',\n 'parameter',\n 'order',\n 'open',\n 'close',\n 'refresh',\n 'set',\n 'notify',\n 'confirm',\n 'raise',\n 'interval',\n 'success',\n 'failure',\n 'click',\n 'double',\n 'select',\n 'submit',\n 'change',\n 'load',\n 'unload',\n 'enter',\n 'leave',\n 'info',\n 'warning',\n];\n\nexport const codeBlockTags = ['csharp', 'typescript', 'react', 'html', 'sql'];\n\n// The roots a `$context.` path can start with — the members of CommandContext and QueryContext.\nexport const contextRoots = [\n 'command',\n 'arguments',\n 'tenant',\n 'causedBy',\n 'causation',\n 'occurred',\n 'identity',\n];\n\nexport const causedByProperties = ['subject', 'name', 'userName'];\n\n// The properties a `$identity.` or `$context.identity.` path can name — the members of Identity. Everything after\n// `claims.` is the name of a claim rather than a member, so it is never checked.\nexport const identityProperties = ['id', 'name', 'userName', 'isAuthenticated', 'roles', 'claims'];\n\nexport const sliceTypes = ['StateChange', 'StateView', 'Automation', 'Translate'];\n\nexport const primitiveTypes = ['Uuid', 'String', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime'];\n\nexport const conceptAttributes = ['pii', 'personal', 'secret'];\n\n// The lines that open a block with a body of their own. A line that is complete as written - a `domain`, a\n// `concept` or `query` with nothing under it, a `produces` of an existing event - is not one.\nexport const blockHeaderPattern = /^\\s*(?:module|feature|slice\\s+\\w+|type|command|event|readmodel|reducer|projection|capture|reaction|screen|dialog|form|contribute|specification|case|constraint|persona|policy|behavior|layout|theme|ui\\s+profile|trigger|authentication|identity|seed|system|eventsource|operation|screen\\s+template|dialog\\s+template|produces\\s+event|generate\\s+rule|validate|handler|on)\\b[^=]*$/;\n\nexport const languageConfiguration: languages.LanguageConfiguration = {\n comments: {\n lineComment: '//',\n },\n brackets: [\n ['(', ')'],\n ['[', ']'],\n ],\n autoClosingPairs: [\n { open: '(', close: ')' },\n { open: '[', close: ']' },\n { open: '\"', close: '\"' },\n ],\n surroundingPairs: [\n { open: '(', close: ')' },\n { open: '[', close: ']' },\n { open: '\"', close: '\"' },\n ],\n folding: {\n offSide: true,\n },\n // A header that opens a block puts the cursor one level in on Enter, so what is typed - or suggested - starts at\n // the block's own indentation. IndentAction.Indent is 1.\n onEnterRules: [\n { beforeText: blockHeaderPattern, action: { indentAction: 1 as languages.IndentAction } },\n ],\n indentationRules: {\n increaseIndentPattern:\n /^\\s*(module|feature|slice|policy|persona|authentication|identity|provider|event|command|query|type|screen|projection|capture|reaction|trigger|constraint|specification|layout|template|generate\\s+rule|validate|produces|handler|implementation(?=\\s*$)|performer|rule|section|action|otherwise(?=\\s*$|\\s+execute\\b)|concurrency|seed|for|when|then|arguments|result|every|at|invokes|on)\\b.*$/,\n // Dedents are always explicit in an offside language — never auto-dedent.\n decreaseIndentPattern: /(?!)/,\n },\n};\n"],"mappings":"AAOA,MAAaA,EAAa,aAEbC,EAA4D,CACrE,GAAID,EACJ,WAAY,CAAC,OAAO,EACpB,QAAS,CAAC,aAAc,aAAc,MAAM,EAC5C,UAAW,CAAC,mBAAmB,CACnC,EAMaE,EAAoB,
|
|
1
|
+
{"version":3,"file":"language.js","names":["languageId","languageExtensionPoint","constructKeywords","clauseKeywords","codeBlockTags","contextRoots","causedByProperties","identityProperties","sliceTypes","primitiveTypes","conceptAttributes","blockHeaderPattern","languageConfiguration"],"sources":["../../language.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 type { languages } from 'monaco-editor';\n\nexport type Monaco = typeof import('monaco-editor');\n\nexport const languageId = 'screenplay';\n\nexport const languageExtensionPoint: languages.ILanguageExtensionPoint = {\n id: languageId,\n extensions: ['.play'],\n aliases: ['Screenplay', 'screenplay', 'play'],\n mimetypes: ['text/x-screenplay'],\n};\n\n// Every word the parser dispatches on at the top level, inside a module, or inside a slice.\n// `for_LanguageService.when_comparing_keywords_against_the_parsers` derives that set from\n// ScreenplayParser and SliceParser and fails when this list has drifted from it, so a construct\n// added to the compiler cannot silently lose its highlighting and completion.\nexport const constructKeywords = [\n 'domain',\n 'import',\n 'concept',\n 'type',\n 'policy',\n 'purpose',\n 'persona',\n 'authentication',\n 'identity',\n 'module',\n 'layout',\n 'theme',\n 'ui',\n 'feature',\n 'slice',\n 'event',\n 'public',\n 'system',\n 'eventsource',\n 'operation',\n 'command',\n 'query',\n 'projection',\n 'capture',\n 'reaction',\n 'runs',\n 'reducer',\n 'readmodel',\n 'trigger',\n 'screen',\n 'dialog',\n 'form',\n 'contribute',\n 'navigation',\n 'constraint',\n 'specification',\n 'case',\n 'parameter',\n 'example',\n 'seed',\n 'behavior',\n 'exposure',\n 'instance',\n];\n\n// Type modifiers are contextual, never excluded from property or declaration names.\nexport const typeModifierKeywords = ['optional'];\n\nexport const clauseKeywords = [\n 'depends',\n 'direction',\n 'inbound',\n 'outbound',\n 'description',\n 'documentation',\n 'template',\n 'profile',\n 'require',\n 'authenticated',\n 'role',\n 'claim',\n 'subject',\n 'authorize',\n 'validate',\n 'produces',\n 'reads', // A clause in command bodies and reaction trigger bodies; @reads remains a value.\n 'as',\n 'handler',\n 'performer',\n 'observable',\n 'identifier',\n 'reason',\n 'from',\n 'when',\n 'given',\n 'then',\n 'arguments',\n 'result',\n 'clock', // A specification step - 'given clock' and 'when clock' state an instant.\n 'exactly',\n 'error',\n 'message',\n 'not', // Unary policy negation, as well as 'not empty' validation.\n 'empty',\n 'rule',\n 'matches',\n 'all',\n 'max',\n 'min',\n 'length',\n 'today',\n 'true',\n 'false',\n 'and',\n 'or',\n 'by',\n 'filter',\n 'data',\n 'via',\n 'component',\n 'context',\n 'property',\n 'literal',\n 'icons',\n 'packages',\n 'outlet',\n 'display',\n 'scopes',\n 'blueprint', // 'template blueprint <Blueprint> <Name> [version \"<range>\"]' names a template a blueprint package ships.\n 'version',\n 'statechange', // Slice kinds a template's 'scopes slice ...' narrows to.\n 'stateview',\n 'reexposes',\n 'operations',\n 'items',\n 'toolbar',\n 'item',\n 'topbar',\n 'sidebar',\n 'inherits',\n 'extends',\n 'overrides',\n 'logo',\n 'image',\n 'icon',\n 'target',\n 'slot',\n 'presentation',\n 'exposes',\n 'mode',\n 'oneWay',\n 'twoWay',\n 'null',\n 'propagate',\n 'clear',\n 'preserve',\n 'expected',\n 'action',\n 'navigate',\n 'to',\n 'label',\n 'section',\n 'table',\n 'summary',\n 'title',\n 'column',\n 'field',\n 'on',\n 'unique',\n 'file',\n 'concurrency',\n 'eventSource',\n 'sourceType',\n 'streamType',\n 'streamId',\n 'tag',\n 'for',\n 'readmodel',\n 'no',\n 'when',\n 'every',\n 'at',\n 'where',\n 'invokes',\n 'contains',\n 'starts',\n 'with',\n 'provider',\n // Interaction: the words a behavior body uses. The built-in interaction kinds ('click', 'submit', and\n // friends) are only reserved inside an `on` clause, so they are clause words rather than constructs -\n // an identifier of the same name elsewhere in a document remains an identifier.\n 'uses',\n 'parameter',\n 'order',\n 'open',\n 'close',\n 'refresh',\n 'set',\n 'notify',\n 'confirm',\n 'raise',\n 'interval',\n 'success',\n 'failure',\n 'click',\n 'double',\n 'select',\n 'submit',\n 'change',\n 'load',\n 'unload',\n 'enter',\n 'leave',\n 'info',\n 'warning',\n];\n\nexport const codeBlockTags = ['csharp', 'typescript', 'react', 'html', 'sql'];\n\n// The roots a `$context.` path can start with — the members of CommandContext and QueryContext.\nexport const contextRoots = [\n 'command',\n 'arguments',\n 'tenant',\n 'causedBy',\n 'causation',\n 'occurred',\n 'identity',\n];\n\nexport const causedByProperties = ['subject', 'name', 'userName'];\n\n// The properties a `$identity.` or `$context.identity.` path can name — the members of Identity. Everything after\n// `claims.` is the name of a claim rather than a member, so it is never checked.\nexport const identityProperties = ['id', 'name', 'userName', 'isAuthenticated', 'roles', 'claims'];\n\nexport const sliceTypes = ['StateChange', 'StateView', 'Automation', 'Translate'];\n\nexport const primitiveTypes = ['Uuid', 'String', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime'];\n\nexport const conceptAttributes = ['pii', 'personal', 'secret'];\n\n// The lines that open a block with a body of their own. A line that is complete as written - a `domain`, a\n// `concept` or `query` with nothing under it, a `produces` of an existing event - is not one.\nexport const blockHeaderPattern = /^\\s*(?:module|feature|slice\\s+\\w+|type|command|event|readmodel|reducer|projection|capture|reaction|screen|dialog|form|contribute|specification|case|constraint|persona|policy|behavior|layout|theme|ui\\s+profile|trigger|authentication|identity|seed|system|eventsource|operation|screen\\s+template|dialog\\s+template|produces\\s+event|generate\\s+rule|validate|handler|on)\\b[^=]*$/;\n\nexport const languageConfiguration: languages.LanguageConfiguration = {\n comments: {\n lineComment: '//',\n },\n brackets: [\n ['(', ')'],\n ['[', ']'],\n ],\n autoClosingPairs: [\n { open: '(', close: ')' },\n { open: '[', close: ']' },\n { open: '\"', close: '\"' },\n ],\n surroundingPairs: [\n { open: '(', close: ')' },\n { open: '[', close: ']' },\n { open: '\"', close: '\"' },\n ],\n folding: {\n offSide: true,\n },\n // A header that opens a block puts the cursor one level in on Enter, so what is typed - or suggested - starts at\n // the block's own indentation. IndentAction.Indent is 1.\n onEnterRules: [\n { beforeText: blockHeaderPattern, action: { indentAction: 1 as languages.IndentAction } },\n ],\n indentationRules: {\n increaseIndentPattern:\n /^\\s*(module|feature|slice|policy|persona|authentication|identity|provider|event|command|query|type|screen|projection|capture|reaction|trigger|constraint|specification|layout|template|generate\\s+rule|validate|produces|handler|implementation(?=\\s*$)|performer|rule|section|action|otherwise(?=\\s*$|\\s+execute\\b)|concurrency|seed|for|when|then|arguments|result|every|at|invokes|on)\\b.*$/,\n // Dedents are always explicit in an offside language — never auto-dedent.\n decreaseIndentPattern: /(?!)/,\n },\n};\n"],"mappings":"AAOA,MAAaA,EAAa,aAEbC,EAA4D,CACrE,GAAID,EACJ,WAAY,CAAC,OAAO,EACpB,QAAS,CAAC,aAAc,aAAc,MAAM,EAC5C,UAAW,CAAC,mBAAmB,CACnC,EAMaE,EAAoB,sXA4CjC,EAKaC,EAAiB,kiCAmJ9B,EAEaC,EAAgB,CAAC,SAAU,aAAc,QAAS,OAAQ,KAAK,EAG/DC,EAAe,CACxB,UACA,YACA,SACA,WACA,YACA,WACA,UACJ,EAEaC,EAAqB,CAAC,UAAW,OAAQ,UAAU,EAInDC,EAAqB,CAAC,KAAM,OAAQ,WAAY,kBAAmB,QAAS,QAAQ,EAEpFC,EAAa,CAAC,cAAe,YAAa,aAAc,WAAW,EAEnEC,EAAiB,CAAC,OAAQ,SAAU,MAAO,UAAW,OAAQ,OAAQ,UAAU,EAEhFC,EAAoB,CAAC,MAAO,WAAY,QAAQ,EAIhDC,EAAqB,uXAErBC,EAAyD,CAClE,SAAU,CACN,YAAa,IACjB,EACA,SAAU,CACN,CAAC,IAAK,GAAG,EACT,CAAC,IAAK,GAAG,CACb,EACA,iBAAkB,CACd,CAAE,KAAM,IAAK,MAAO,GAAI,EACxB,CAAE,KAAM,IAAK,MAAO,GAAI,EACxB,CAAE,KAAM,IAAK,MAAO,GAAI,CAC5B,EACA,iBAAkB,CACd,CAAE,KAAM,IAAK,MAAO,GAAI,EACxB,CAAE,KAAM,IAAK,MAAO,GAAI,EACxB,CAAE,KAAM,IAAK,MAAO,GAAI,CAC5B,EACA,QAAS,CACL,QAAS,EACb,EAGA,aAAc,CACV,CAAE,WAAYD,EAAoB,OAAQ,CAAE,aAAc,CAA4B,CAAE,CAC5F,EACA,iBAAkB,CACd,sBACI,iYAEJ,sBAAuB,MAC3B,CACJ"}
|
|
@@ -2,7 +2,7 @@ import"./_virtual/_virtual/_rolldown/runtime.js";import{documentationItem as e}f
|
|
|
2
2
|
`,documentation:`Groups related slices into a vertical feature.`},{label:`screen`,insertText:"screen ${1:Name}\n data ${2:ReadModel} via query ${3:QueryName}",documentation:`Declares a module-level UI screen.`},{label:`screen template`,insertText:`screen template \${1:Name}
|
|
3
3
|
fits slot \${2:content}
|
|
4
4
|
|
|
5
|
-
\${3:slot}`,documentation:`Declares a reusable screen shape that fits a slot of the shell.`},{label:`dialog template`,insertText:"dialog template ${1:Name}\n ${2:body}\n ${3:actions}",documentation:`Declares a reusable dialog shape that opens over the shell.`},{label:`form`,insertText:'form ${1:Name} for ${2:Command}\n field ${3:property} label "${4:Label}"',documentation:`Declares a form bound to a command.`},{label:`contribute`,insertText:'contribute to ${1:Navigation}\n navigate to ${2:Screen}\n label "${3:Label}"',documentation:`Contributes an entry to a slot of the shell, such as navigation.`},...r],a=[t,e,...n,{label:`description`,insertText:'description "${1:what this feature is for}"',documentation:`A human-readable description.`},{label:`authorize`,insertText:"authorize ${1:PolicyName}",documentation:`Policies that must pass for everything in the feature.`},{label:`depends on`,insertText:"depends on ${1:Name}",documentation:`Declares an allowed module or feature dependency. Sibling feature names resolve before module names.`},{label:`import "…"`,insertText:'import "${1:*.play}"',documentation:"Imports `.play` files into this feature — their top level is the feature's body."},{label:`feature`,insertText:`feature \${1:Name}
|
|
5
|
+
\${3:slot}`,documentation:`Declares a reusable screen shape that fits a slot of the shell.`},{label:`dialog template`,insertText:"dialog template ${1:Name}\n ${2:body}\n ${3:actions}",documentation:`Declares a reusable dialog shape that opens over the shell.`},{label:`form`,insertText:'form ${1:Name} for ${2:Command}\n field ${3:property} label "${4:Label}"',documentation:`Declares a form bound to a command.`},{label:`contribute`,insertText:'contribute to ${1:Navigation}\n navigate to ${2:Screen}\n label "${3:Label}"',documentation:`Contributes an entry to a slot of the shell, such as navigation.`},{label:`navigation sidebar extends`,insertText:'navigation ${1|sidebar,topbar|} ${2|extends,overrides,inherits|}\n item ${3:id} title "${4:Title}" target ${5:Module.Feature}',documentation:"Changes a navigation region for this module: `extends` adds items after the application's, `overrides` replaces them, `inherits` shows the application's."},...r],a=[t,e,...n,{label:`description`,insertText:'description "${1:what this feature is for}"',documentation:`A human-readable description.`},{label:`authorize`,insertText:"authorize ${1:PolicyName}",documentation:`Policies that must pass for everything in the feature.`},{label:`depends on`,insertText:"depends on ${1:Name}",documentation:`Declares an allowed module or feature dependency. Sibling feature names resolve before module names.`},{label:`import "…"`,insertText:'import "${1:*.play}"',documentation:"Imports `.play` files into this feature — their top level is the feature's body."},{label:`feature`,insertText:`feature \${1:Name}
|
|
6
6
|
`,documentation:`Declares a nested sub-feature.`},{label:`slice StateChange`,insertText:`slice StateChange \${1:Name}
|
|
7
7
|
`,documentation:`A command → events flow; something that changes the system.`},{label:`slice StateView`,insertText:`slice StateView \${1:Name}
|
|
8
8
|
`,documentation:`A query + projection + screen; something that reads the system.`},{label:`slice Automation`,insertText:`slice Automation \${1:Name}
|
|
@@ -12,7 +12,7 @@ import"./_virtual/_virtual/_rolldown/runtime.js";import{documentationItem as e}f
|
|
|
12
12
|
\${2:execute command}`,`Asks before continuing.`),step(`raise`,"raise ${1:Trigger}",`Raises a trigger.`)],f=[step(`on success`,`on success
|
|
13
13
|
\${1:notify info "Done"}`,`What happens when it succeeds.`),step(`on failure`,`on failure
|
|
14
14
|
\${1:notify error "Failed"}`,`What happens when it fails.`),...d],p=[{label:`description`,insertText:'description "${1:who they are}"',documentation:`A human-readable description.`},{label:`policy`,insertText:"policy ${1:PolicyName}",documentation:`A policy this persona holds.`}],m=[{label:`provider`,insertText:"provider ${1:Name}",documentation:`An identity provider.`},{label:`provider (named)`,insertText:"provider ${1:Kind} name ${2:Name}",documentation:`An identity provider of a kind, under its own name.`}],h=[{label:`for`,insertText:'for ${1:"event-source-id"}\n ${2:EventType}\n ${3:property} = ${4:value}',documentation:`Events to seed for one event source id.`}],g=[{label:`compatible with`,insertText:"compatible with ${1:Package}",documentation:`A component package the theme is compatible with.`}],_=[{label:`target platform`,insertText:"target platform ${1:web}",documentation:`The platforms the profile is for.`},{label:`target size`,insertText:"target size ${1|compact,regular|}",documentation:`The screen sizes the profile is for.`},{label:`packages`,insertText:`packages
|
|
15
|
-
\${1:Package}`,documentation:`The component packages the profile uses.`},{label:`layout`,insertText:"layout ${1:Layout}",documentation:`The layout of the profile.`},{label:`theme`,insertText:"theme ${1:Theme}",documentation:`The theme of the profile.`}],v=[{label:`slot`,insertText:"${1:slot}",documentation:`A named slot of the shell.`},{label:`slot contributes`,insertText:"${1:slot} contributes ${2:Name}",documentation:"A slot other declarations contribute to, such as `navigation contributes Navigation`."},{label:`arrangement`,insertText:`arrangement flow
|
|
15
|
+
\${1:Package}`,documentation:`The component packages the profile uses.`},{label:`layout`,insertText:"layout ${1:Layout}",documentation:`The layout of the profile.`},{label:`theme`,insertText:"theme ${1:Theme}",documentation:`The theme of the profile.`}],v=[{label:`slot`,insertText:"${1:slot}",documentation:`A named slot of the shell.`},{label:`slot contributes`,insertText:"${1:slot} contributes ${2:Name}",documentation:"A slot other declarations contribute to, such as `navigation contributes Navigation`."},{label:`navigation topbar`,insertText:'navigation ${1|topbar,sidebar|}\n logo image "${2:/logo.svg}" title "${3:Application}"\n item ${4:id} title "${5:Title}" target ${6:Module}',documentation:`The application's navigation region: a logo and items that target a module or feature.`},{label:`arrangement`,insertText:`arrangement flow
|
|
16
16
|
column
|
|
17
|
-
\${1:slot}`,documentation:`How the slots are placed.`}],y=[{label:`fits slot`,insertText:"fits slot ${1:content}",documentation:`The slot of the shell the template fits.`},...v,{label:`on`,insertText:"on ${1|enter,leave,load,unload|}\n ${2:refresh query}",documentation:`Wires what happens on an interaction.`}];export{d as actionStepItems,m as authenticationItems,u as behaviorItems,l as contributeItems,a as featureScopeItems,c as formItems,v as layoutItems,i as moduleScopeItems,f as outcomeItems,p as personaItems,o as readModelItems,s as reducerItems,h as seedItems,
|
|
17
|
+
\${1:slot}`,documentation:`How the slots are placed.`}],y=[{label:`logo`,insertText:'logo image "${1:/logo.svg}" title "${2:Application}"',documentation:`The application logo. Declared once, in a layout.`},{label:`item`,insertText:'item ${1:id} title "${2:Title}" target ${3:Module.Feature}',documentation:"A navigation item with a title, an optional `icon`, a `target` module or feature and an optional rendering `slot`. Sidebar items may nest `item` lines."},{label:`item (with slot)`,insertText:'item ${1:id} title "${2:Title}" icon ${3:icon} target ${4:Module.Feature} slot ${5:content}',documentation:`A navigation item that renders its target into a named layout slot.`}],b=[{label:`fits slot`,insertText:"fits slot ${1:content}",documentation:`The slot of the shell the template fits.`},...v,{label:`on`,insertText:"on ${1|enter,leave,load,unload|}\n ${2:refresh query}",documentation:`Wires what happens on an interaction.`}];export{d as actionStepItems,m as authenticationItems,u as behaviorItems,l as contributeItems,a as featureScopeItems,c as formItems,v as layoutItems,i as moduleScopeItems,y as navigationItems,f as outcomeItems,p as personaItems,o as readModelItems,s as reducerItems,h as seedItems,b as templateItems,g as themeItems,_ as uiProfileItems};
|
|
18
18
|
//# sourceMappingURL=scope-items.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-items.js","names":["interactionItems","moduleScopeItems","purposeReferenceItem","documentationItem","exampleDeclarationItems","featureScopeItems","readModelItems","reducerItems","formItems","contributeItems","behaviorItems","actionStepItems","outcomeItems","personaItems","authenticationItems","seedItems","themeItems","uiProfileItems","layoutItems","templateItems"],"sources":["../../scope-items.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 type { CompletionEntry } from './completion-items';\nimport { exampleDeclarationItems } from './example-declaration-items';\nimport { documentationItem } from './documentation-item';\nimport { purposeReferenceItem } from './purpose-items';\n\nconst interactions = ['click', 'double click', 'select', 'submit', 'change', 'load', 'unload', 'enter', 'leave'];\n\nconst interactionItems: CompletionEntry[] = [\n { label: 'on', insertText: 'on ${1|click,select,submit,change,load,unload,enter,leave|}\\n ${2:execute command}', documentation: 'Wires what happens on an interaction - a click, a submit, entering or leaving the screen.' },\n { label: 'uses', insertText: 'uses ${1:Behavior}', documentation: 'Attaches a named behavior declared at the top level.' },\n];\n\nexport const moduleScopeItems: CompletionEntry[] = [\n purposeReferenceItem,\n documentationItem,\n ...exampleDeclarationItems,\n { label: 'description', insertText: 'description \"${1:what this module is for}\"', documentation: 'A human-readable description.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'Policies that must pass for everything in the module.' },\n { label: 'depends on', insertText: 'depends on ${1:Name}', documentation: 'Declares an allowed module or feature dependency. Opts this container into independent explicit-reference checks.' },\n { label: 'import \"…\"', insertText: 'import \"${1:*/*.play}\"', documentation: 'Imports `.play` files into this module — their top level is the module\\'s body.' },\n { label: 'feature', insertText: 'feature ${1:Name}\\n ', documentation: 'Groups related slices into a vertical feature.' },\n { label: 'screen', insertText: 'screen ${1:Name}\\n data ${2:ReadModel} via query ${3:QueryName}', documentation: 'Declares a module-level UI screen.' },\n { label: 'screen template', insertText: 'screen template ${1:Name}\\n fits slot ${2:content}\\n\\n ${3:slot}', documentation: 'Declares a reusable screen shape that fits a slot of the shell.' },\n { label: 'dialog template', insertText: 'dialog template ${1:Name}\\n ${2:body}\\n ${3:actions}', documentation: 'Declares a reusable dialog shape that opens over the shell.' },\n { label: 'form', insertText: 'form ${1:Name} for ${2:Command}\\n field ${3:property} label \"${4:Label}\"', documentation: 'Declares a form bound to a command.' },\n { label: 'contribute', insertText: 'contribute to ${1:Navigation}\\n navigate to ${2:Screen}\\n label \"${3:Label}\"', documentation: 'Contributes an entry to a slot of the shell, such as navigation.' },\n ...interactionItems,\n];\n\nexport const featureScopeItems: CompletionEntry[] = [\n purposeReferenceItem,\n documentationItem,\n ...exampleDeclarationItems,\n { label: 'description', insertText: 'description \"${1:what this feature is for}\"', documentation: 'A human-readable description.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'Policies that must pass for everything in the feature.' },\n { label: 'depends on', insertText: 'depends on ${1:Name}', documentation: 'Declares an allowed module or feature dependency. Sibling feature names resolve before module names.' },\n { label: 'import \"…\"', insertText: 'import \"${1:*.play}\"', documentation: 'Imports `.play` files into this feature — their top level is the feature\\'s body.' },\n { label: 'feature', insertText: 'feature ${1:Name}\\n ', documentation: 'Declares a nested sub-feature.' },\n { label: 'slice StateChange', insertText: 'slice StateChange ${1:Name}\\n ', documentation: 'A command → events flow; something that changes the system.' },\n { label: 'slice StateView', insertText: 'slice StateView ${1:Name}\\n ', documentation: 'A query + projection + screen; something that reads the system.' },\n { label: 'slice Automation', insertText: 'slice Automation ${1:Name}\\n ', documentation: 'A reaction or reducer; something that runs when something happens.' },\n { label: 'slice Translate', insertText: 'slice Translate ${1:Name}\\n ', documentation: 'A capture; converts external data into events.' },\n { label: 'contribute', insertText: 'contribute to ${1:Navigation}\\n navigate to ${2:Screen}\\n label \"${3:Label}\"', documentation: 'Contributes an entry to a slot of the shell, such as navigation.' },\n ...interactionItems,\n];\n\nexport const readModelItems: CompletionEntry[] = [\n documentationItem,\n { label: 'description', insertText: 'description \"${1:what one instance holds}\"', documentation: 'A human-readable description.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the file this read model is realized by.' },\n { label: 'property', insertText: '${1:property} ${2:Type}', documentation: 'A property of the read model — a name and a type reference.' },\n];\n\nexport const reducerItems: CompletionEntry[] = [\n { label: 'from', insertText: 'from ${1:Source.Stream}', documentation: 'Observe matching routed facts only, without filtering stream ids. ESM v10.' },\n { label: 'description', insertText: 'description \"${1:what the reducer does}\"', documentation: 'A human-readable description.' },\n { label: 'on', insertText: 'on ${1:EventType}\\n ```csharp\\n ${2}\\n ```', documentation: 'A rule applied when the event occurs, in code or from a file.' },\n];\n\nexport const formItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:input surface intent}\"', documentation: 'Report-only description of the form.' },\n { label: 'populate via query', insertText: 'populate via query ${1:Query} by ${2:parameter}', documentation: 'Fills the form from a query before it is shown.' },\n { label: 'populate from item', insertText: 'populate from item', documentation: 'Fills the form from the item the screen was opened for.' },\n { label: 'field', insertText: 'field ${1:property} label \"${2:Label}\"', documentation: 'A form field bound to a command property.' },\n ...interactionItems,\n];\n\nexport const contributeItems: CompletionEntry[] = [\n { label: 'navigate to', insertText: 'navigate to ${1:Screen}', documentation: 'The screen the entry opens.' },\n { label: 'label', insertText: 'label \"${1:Label}\"', documentation: 'The text of the entry.' },\n { label: 'order', insertText: 'order ${1:10}', documentation: 'Where the entry sits among the others; lower comes first.' },\n];\n\nexport const behaviorItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:what the behavior does}\"', documentation: 'A human-readable description.' },\n { label: 'parameter', insertText: 'parameter ${1:name} ${2:Type}', documentation: 'A value the behavior is given where it is attached.' },\n { label: 'order', insertText: 'order ${1:10}', documentation: 'The order behaviors attached to the same element run in.' },\n { label: 'on', insertText: 'on ${1|click,select,submit,change,load,unload,enter,leave|}\\n ${2:execute command}', documentation: 'Wires what happens on an interaction.' },\n];\n\nconst step = (label: string, insertText: string, documentation: string): CompletionEntry => ({ label, insertText, documentation });\n\n// What an interaction does, and what can follow an action's outcome.\nexport const actionStepItems: CompletionEntry[] = [\n step('execute', 'execute ${1:command}', 'Runs a command.'),\n step('navigate to', 'navigate to ${1:Screen}', 'Opens a screen.'),\n step('open', 'open ${1:Dialog}', 'Opens a dialog.'),\n step('close', 'close', 'Closes the dialog.'),\n step('refresh', 'refresh ${1:query}', 'Reloads a query.'),\n step('set', 'set ${1:name} ${2:value}', 'Sets a value.'),\n step('notify', 'notify ${1|info,warning,error|} \"${2:message}\"', 'Shows a notification.'),\n step('confirm', 'confirm ${1:message}\\n on success\\n ${2:execute command}', 'Asks before continuing.'),\n step('raise', 'raise ${1:Trigger}', 'Raises a trigger.'),\n];\n\nexport const outcomeItems: CompletionEntry[] = [\n step('on success', 'on success\\n ${1:notify info \"Done\"}', 'What happens when it succeeds.'),\n step('on failure', 'on failure\\n ${1:notify error \"Failed\"}', 'What happens when it fails.'),\n ...actionStepItems,\n];\n\nexport const personaItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:who they are}\"', documentation: 'A human-readable description.' },\n { label: 'policy', insertText: 'policy ${1:PolicyName}', documentation: 'A policy this persona holds.' },\n];\n\nexport const authenticationItems: CompletionEntry[] = [\n { label: 'provider', insertText: 'provider ${1:Name}', documentation: 'An identity provider.' },\n { label: 'provider (named)', insertText: 'provider ${1:Kind} name ${2:Name}', documentation: 'An identity provider of a kind, under its own name.' },\n];\n\nexport const seedItems: CompletionEntry[] = [\n { label: 'for', insertText: 'for ${1:\"event-source-id\"}\\n ${2:EventType}\\n ${3:property} = ${4:value}', documentation: 'Events to seed for one event source id.' },\n];\n\nexport const themeItems: CompletionEntry[] = [\n { label: 'compatible with', insertText: 'compatible with ${1:Package}', documentation: 'A component package the theme is compatible with.' },\n];\n\nexport const uiProfileItems: CompletionEntry[] = [\n { label: 'target platform', insertText: 'target platform ${1:web}', documentation: 'The platforms the profile is for.' },\n { label: 'target size', insertText: 'target size ${1|compact,regular|}', documentation: 'The screen sizes the profile is for.' },\n { label: 'packages', insertText: 'packages\\n ${1:Package}', documentation: 'The component packages the profile uses.' },\n { label: 'layout', insertText: 'layout ${1:Layout}', documentation: 'The layout of the profile.' },\n { label: 'theme', insertText: 'theme ${1:Theme}', documentation: 'The theme of the profile.' },\n];\n\nexport const layoutItems: CompletionEntry[] = [\n { label: 'slot', insertText: '${1:slot}', documentation: 'A named slot of the shell.' },\n { label: 'slot contributes', insertText: '${1:slot} contributes ${2:Name}', documentation: 'A slot other declarations contribute to, such as `navigation contributes Navigation`.' },\n { label: 'arrangement', insertText: 'arrangement flow\\n column\\n ${1:slot}', documentation: 'How the slots are placed.' },\n];\n\nexport const templateItems: CompletionEntry[] = [\n { label: 'fits slot', insertText: 'fits slot ${1:content}', documentation: 'The slot of the shell the template fits.' },\n ...layoutItems,\n { label: 'on', insertText: 'on ${1|enter,leave,load,unload|}\\n ${2:refresh query}', documentation: 'Wires what happens on an interaction.' },\n];\n\nexport const interactionNames = interactions;\n"],"mappings":"gPAUA,MAAMA,EAAsC,CACxC,CAAE,MAAO,KAAM,WAAY,wFAAyF,cAAe,2FAA4F,EAC/N,CAAE,MAAO,OAAQ,WAAY,qBAAsB,cAAe,sDAAuD,CAC7H,EAEaC,EAAsC,CAC/CC,EACAC,EACA,GAAGC,EACH,CAAE,MAAO,cAAe,WAAY,6CAA8C,cAAe,+BAAgC,EACjI,CAAE,MAAO,YAAa,WAAY,4BAA6B,cAAe,uDAAwD,EACtI,CAAE,MAAO,aAAc,WAAY,uBAAwB,cAAe,mHAAoH,EAC9L,CAAE,MAAO,aAAc,WAAY,yBAA0B,cAAe,gFAAkF,EAC9J,CAAE,MAAO,UAAW,WAAY;MAA2B,cAAe,gDAAiD,EAC3H,CAAE,MAAO,SAAU,WAAY,qEAAsE,cAAe,oCAAqC,EACzJ,CAAE,MAAO,kBAAmB,WAAY;;;gBAA0E,cAAe,iEAAkE,EACnM,CAAE,MAAO,kBAAmB,WAAY,6DAA8D,cAAe,6DAA8D,EACnL,CAAE,MAAO,OAAQ,WAAY,8EAA+E,cAAe,qCAAsC,EACjK,CAAE,MAAO,aAAc,WAAY,qFAAsF,cAAe,kEAAmE,EAC3M,GAAGJ,CACP,EAEaK,EAAuC,CAChDH,EACAC,EACA,GAAGC,EACH,CAAE,MAAO,cAAe,WAAY,8CAA+C,cAAe,+BAAgC,EAClI,CAAE,MAAO,YAAa,WAAY,4BAA6B,cAAe,wDAAyD,EACvI,CAAE,MAAO,aAAc,WAAY,uBAAwB,cAAe,sGAAuG,EACjL,CAAE,MAAO,aAAc,WAAY,uBAAwB,cAAe,kFAAoF,EAC9J,CAAE,MAAO,UAAW,WAAY;MAA2B,cAAe,gCAAiC,EAC3G,CAAE,MAAO,oBAAqB,WAAY;MAAqC,cAAe,6DAA8D,EAC5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Ae,2BAA4B,CACjG,EAEaC,EAAiC,CAC1C,CAAE,MAAO,OAAQ,WAAY,YAAa,cAAe,4BAA6B,EACtF,CAAE,MAAO,mBAAoB,WAAY,kCAAmC,cAAe,uFAAwF,EACnL,CAAE,MAAO,cAAe,WAAY;;oBAAmD,cAAe,2BAA4B,CACtI,EAEaC,EAAmC,CAC5C,CAAE,MAAO,YAAa,WAAY,yBAA0B,cAAe,0CAA2C,EACtH,GAAGD,EACH,CAAE,MAAO,KAAM,WAAY,2DAA4D,cAAe,uCAAwC,CAClJ"}
|
|
1
|
+
{"version":3,"file":"scope-items.js","names":["interactionItems","moduleScopeItems","purposeReferenceItem","documentationItem","exampleDeclarationItems","featureScopeItems","readModelItems","reducerItems","formItems","contributeItems","behaviorItems","actionStepItems","outcomeItems","personaItems","authenticationItems","seedItems","themeItems","uiProfileItems","layoutItems","navigationItems","templateItems"],"sources":["../../scope-items.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 type { CompletionEntry } from './completion-items';\nimport { exampleDeclarationItems } from './example-declaration-items';\nimport { documentationItem } from './documentation-item';\nimport { purposeReferenceItem } from './purpose-items';\n\nconst interactions = ['click', 'double click', 'select', 'submit', 'change', 'load', 'unload', 'enter', 'leave'];\n\nconst interactionItems: CompletionEntry[] = [\n { label: 'on', insertText: 'on ${1|click,select,submit,change,load,unload,enter,leave|}\\n ${2:execute command}', documentation: 'Wires what happens on an interaction - a click, a submit, entering or leaving the screen.' },\n { label: 'uses', insertText: 'uses ${1:Behavior}', documentation: 'Attaches a named behavior declared at the top level.' },\n];\n\nexport const moduleScopeItems: CompletionEntry[] = [\n purposeReferenceItem,\n documentationItem,\n ...exampleDeclarationItems,\n { label: 'description', insertText: 'description \"${1:what this module is for}\"', documentation: 'A human-readable description.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'Policies that must pass for everything in the module.' },\n { label: 'depends on', insertText: 'depends on ${1:Name}', documentation: 'Declares an allowed module or feature dependency. Opts this container into independent explicit-reference checks.' },\n { label: 'import \"…\"', insertText: 'import \"${1:*/*.play}\"', documentation: 'Imports `.play` files into this module — their top level is the module\\'s body.' },\n { label: 'feature', insertText: 'feature ${1:Name}\\n ', documentation: 'Groups related slices into a vertical feature.' },\n { label: 'screen', insertText: 'screen ${1:Name}\\n data ${2:ReadModel} via query ${3:QueryName}', documentation: 'Declares a module-level UI screen.' },\n { label: 'screen template', insertText: 'screen template ${1:Name}\\n fits slot ${2:content}\\n\\n ${3:slot}', documentation: 'Declares a reusable screen shape that fits a slot of the shell.' },\n { label: 'dialog template', insertText: 'dialog template ${1:Name}\\n ${2:body}\\n ${3:actions}', documentation: 'Declares a reusable dialog shape that opens over the shell.' },\n { label: 'form', insertText: 'form ${1:Name} for ${2:Command}\\n field ${3:property} label \"${4:Label}\"', documentation: 'Declares a form bound to a command.' },\n { label: 'contribute', insertText: 'contribute to ${1:Navigation}\\n navigate to ${2:Screen}\\n label \"${3:Label}\"', documentation: 'Contributes an entry to a slot of the shell, such as navigation.' },\n { label: 'navigation sidebar extends', insertText: 'navigation ${1|sidebar,topbar|} ${2|extends,overrides,inherits|}\\n item ${3:id} title \"${4:Title}\" target ${5:Module.Feature}', documentation: 'Changes a navigation region for this module: `extends` adds items after the application\\'s, `overrides` replaces them, `inherits` shows the application\\'s.' },\n ...interactionItems,\n];\n\nexport const featureScopeItems: CompletionEntry[] = [\n purposeReferenceItem,\n documentationItem,\n ...exampleDeclarationItems,\n { label: 'description', insertText: 'description \"${1:what this feature is for}\"', documentation: 'A human-readable description.' },\n { label: 'authorize', insertText: 'authorize ${1:PolicyName}', documentation: 'Policies that must pass for everything in the feature.' },\n { label: 'depends on', insertText: 'depends on ${1:Name}', documentation: 'Declares an allowed module or feature dependency. Sibling feature names resolve before module names.' },\n { label: 'import \"…\"', insertText: 'import \"${1:*.play}\"', documentation: 'Imports `.play` files into this feature — their top level is the feature\\'s body.' },\n { label: 'feature', insertText: 'feature ${1:Name}\\n ', documentation: 'Declares a nested sub-feature.' },\n { label: 'slice StateChange', insertText: 'slice StateChange ${1:Name}\\n ', documentation: 'A command → events flow; something that changes the system.' },\n { label: 'slice StateView', insertText: 'slice StateView ${1:Name}\\n ', documentation: 'A query + projection + screen; something that reads the system.' },\n { label: 'slice Automation', insertText: 'slice Automation ${1:Name}\\n ', documentation: 'A reaction or reducer; something that runs when something happens.' },\n { label: 'slice Translate', insertText: 'slice Translate ${1:Name}\\n ', documentation: 'A capture; converts external data into events.' },\n { label: 'contribute', insertText: 'contribute to ${1:Navigation}\\n navigate to ${2:Screen}\\n label \"${3:Label}\"', documentation: 'Contributes an entry to a slot of the shell, such as navigation.' },\n ...interactionItems,\n];\n\nexport const readModelItems: CompletionEntry[] = [\n documentationItem,\n { label: 'description', insertText: 'description \"${1:what one instance holds}\"', documentation: 'A human-readable description.' },\n { label: 'file', insertText: 'file ${1:Path}', documentation: 'Names the file this read model is realized by.' },\n { label: 'property', insertText: '${1:property} ${2:Type}', documentation: 'A property of the read model — a name and a type reference.' },\n];\n\nexport const reducerItems: CompletionEntry[] = [\n { label: 'from', insertText: 'from ${1:Source.Stream}', documentation: 'Observe matching routed facts only, without filtering stream ids. ESM v10.' },\n { label: 'description', insertText: 'description \"${1:what the reducer does}\"', documentation: 'A human-readable description.' },\n { label: 'on', insertText: 'on ${1:EventType}\\n ```csharp\\n ${2}\\n ```', documentation: 'A rule applied when the event occurs, in code or from a file.' },\n];\n\nexport const formItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:input surface intent}\"', documentation: 'Report-only description of the form.' },\n { label: 'populate via query', insertText: 'populate via query ${1:Query} by ${2:parameter}', documentation: 'Fills the form from a query before it is shown.' },\n { label: 'populate from item', insertText: 'populate from item', documentation: 'Fills the form from the item the screen was opened for.' },\n { label: 'field', insertText: 'field ${1:property} label \"${2:Label}\"', documentation: 'A form field bound to a command property.' },\n ...interactionItems,\n];\n\nexport const contributeItems: CompletionEntry[] = [\n { label: 'navigate to', insertText: 'navigate to ${1:Screen}', documentation: 'The screen the entry opens.' },\n { label: 'label', insertText: 'label \"${1:Label}\"', documentation: 'The text of the entry.' },\n { label: 'order', insertText: 'order ${1:10}', documentation: 'Where the entry sits among the others; lower comes first.' },\n];\n\nexport const behaviorItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:what the behavior does}\"', documentation: 'A human-readable description.' },\n { label: 'parameter', insertText: 'parameter ${1:name} ${2:Type}', documentation: 'A value the behavior is given where it is attached.' },\n { label: 'order', insertText: 'order ${1:10}', documentation: 'The order behaviors attached to the same element run in.' },\n { label: 'on', insertText: 'on ${1|click,select,submit,change,load,unload,enter,leave|}\\n ${2:execute command}', documentation: 'Wires what happens on an interaction.' },\n];\n\nconst step = (label: string, insertText: string, documentation: string): CompletionEntry => ({ label, insertText, documentation });\n\n// What an interaction does, and what can follow an action's outcome.\nexport const actionStepItems: CompletionEntry[] = [\n step('execute', 'execute ${1:command}', 'Runs a command.'),\n step('navigate to', 'navigate to ${1:Screen}', 'Opens a screen.'),\n step('open', 'open ${1:Dialog}', 'Opens a dialog.'),\n step('close', 'close', 'Closes the dialog.'),\n step('refresh', 'refresh ${1:query}', 'Reloads a query.'),\n step('set', 'set ${1:name} ${2:value}', 'Sets a value.'),\n step('notify', 'notify ${1|info,warning,error|} \"${2:message}\"', 'Shows a notification.'),\n step('confirm', 'confirm ${1:message}\\n on success\\n ${2:execute command}', 'Asks before continuing.'),\n step('raise', 'raise ${1:Trigger}', 'Raises a trigger.'),\n];\n\nexport const outcomeItems: CompletionEntry[] = [\n step('on success', 'on success\\n ${1:notify info \"Done\"}', 'What happens when it succeeds.'),\n step('on failure', 'on failure\\n ${1:notify error \"Failed\"}', 'What happens when it fails.'),\n ...actionStepItems,\n];\n\nexport const personaItems: CompletionEntry[] = [\n { label: 'description', insertText: 'description \"${1:who they are}\"', documentation: 'A human-readable description.' },\n { label: 'policy', insertText: 'policy ${1:PolicyName}', documentation: 'A policy this persona holds.' },\n];\n\nexport const authenticationItems: CompletionEntry[] = [\n { label: 'provider', insertText: 'provider ${1:Name}', documentation: 'An identity provider.' },\n { label: 'provider (named)', insertText: 'provider ${1:Kind} name ${2:Name}', documentation: 'An identity provider of a kind, under its own name.' },\n];\n\nexport const seedItems: CompletionEntry[] = [\n { label: 'for', insertText: 'for ${1:\"event-source-id\"}\\n ${2:EventType}\\n ${3:property} = ${4:value}', documentation: 'Events to seed for one event source id.' },\n];\n\nexport const themeItems: CompletionEntry[] = [\n { label: 'compatible with', insertText: 'compatible with ${1:Package}', documentation: 'A component package the theme is compatible with.' },\n];\n\nexport const uiProfileItems: CompletionEntry[] = [\n { label: 'target platform', insertText: 'target platform ${1:web}', documentation: 'The platforms the profile is for.' },\n { label: 'target size', insertText: 'target size ${1|compact,regular|}', documentation: 'The screen sizes the profile is for.' },\n { label: 'packages', insertText: 'packages\\n ${1:Package}', documentation: 'The component packages the profile uses.' },\n { label: 'layout', insertText: 'layout ${1:Layout}', documentation: 'The layout of the profile.' },\n { label: 'theme', insertText: 'theme ${1:Theme}', documentation: 'The theme of the profile.' },\n];\n\nexport const layoutItems: CompletionEntry[] = [\n { label: 'slot', insertText: '${1:slot}', documentation: 'A named slot of the shell.' },\n { label: 'slot contributes', insertText: '${1:slot} contributes ${2:Name}', documentation: 'A slot other declarations contribute to, such as `navigation contributes Navigation`.' },\n { label: 'navigation topbar', insertText: 'navigation ${1|topbar,sidebar|}\\n logo image \"${2:/logo.svg}\" title \"${3:Application}\"\\n item ${4:id} title \"${5:Title}\" target ${6:Module}', documentation: 'The application\\'s navigation region: a logo and items that target a module or feature.' },\n { label: 'arrangement', insertText: 'arrangement flow\\n column\\n ${1:slot}', documentation: 'How the slots are placed.' },\n];\n\nexport const navigationItems: CompletionEntry[] = [\n { label: 'logo', insertText: 'logo image \"${1:/logo.svg}\" title \"${2:Application}\"', documentation: 'The application logo. Declared once, in a layout.' },\n { label: 'item', insertText: 'item ${1:id} title \"${2:Title}\" target ${3:Module.Feature}', documentation: 'A navigation item with a title, an optional `icon`, a `target` module or feature and an optional rendering `slot`. Sidebar items may nest `item` lines.' },\n { label: 'item (with slot)', insertText: 'item ${1:id} title \"${2:Title}\" icon ${3:icon} target ${4:Module.Feature} slot ${5:content}', documentation: 'A navigation item that renders its target into a named layout slot.' },\n];\n\nexport const templateItems: CompletionEntry[] = [\n { label: 'fits slot', insertText: 'fits slot ${1:content}', documentation: 'The slot of the shell the template fits.' },\n ...layoutItems,\n { label: 'on', insertText: 'on ${1|enter,leave,load,unload|}\\n ${2:refresh query}', documentation: 'Wires what happens on an interaction.' },\n];\n\nexport const interactionNames = interactions;\n"],"mappings":"gPAUA,MAAMA,EAAsC,CACxC,CAAE,MAAO,KAAM,WAAY,wFAAyF,cAAe,2FAA4F,EAC/N,CAAE,MAAO,OAAQ,WAAY,qBAAsB,cAAe,sDAAuD,CAC7H,EAEaC,EAAsC,CAC/CC,EACAC,EACA,GAAGC,EACH,CAAE,MAAO,cAAe,WAAY,6CAA8C,cAAe,+BAAgC,EACjI,CAAE,MAAO,YAAa,WAAY,4BAA6B,cAAe,uDAAwD,EACtI,CAAE,MAAO,aAAc,WAAY,uBAAwB,cAAe,mHAAoH,EAC9L,CAAE,MAAO,aAAc,WAAY,yBAA0B,cAAe,gFAAkF,EAC9J,CAAE,MAAO,UAAW,WAAY;MAA2B,cAAe,gDAAiD,EAC3H,CAAE,MAAO,SAAU,WAAY,qEAAsE,cAAe,oCAAqC,EACzJ,CAAE,MAAO,kBAAmB,WAAY;;;gBAA0E,cAAe,iEAAkE,EACnM,CAAE,MAAO,kBAAmB,WAAY,6DAA8D,cAAe,6DAA8D,EACnL,CAAE,MAAO,OAAQ,WAAY,8EAA+E,cAAe,qCAAsC,EACjK,CAAE,MAAO,aAAc,WAAY,qFAAsF,cAAe,kEAAmE,EAC3M,CAAE,MAAO,6BAA8B,WAAY,mIAAoI,cAAe,2JAA8J,EACpW,GAAGJ,CACP,EAEaK,EAAuC,CAChDH,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EAAgC,CACzC,CAAE,MAAO,kBAAmB,WAAY,+BAAgC,cAAe,mDAAoD,CAC/I,EAEaC,EAAoC,CAC7C,CAAE,MAAO,kBAAmB,WAAY,2BAA4B,cAAe,mCAAoC,EACvH,CAAE,MAAO,cAAe,WAAY,oCAAqC,cAAe,sCAAuC,EAC/H,CAAE,MAAO,WAAY,WAAY;mBAA8B,cAAe,0CAA2C,EACzH,CAAE,MAAO,SAAU,WAAY,qBAAsB,cAAe,4BAA6B,EACjG,CAAE,MAAO,QAAS,WAAY,mBAAoB,cAAe,2BAA4B,CACjG,EAEaC,EAAiC,CAC1C,CAAE,MAAO,OAAQ,WAAY,YAAa,cAAe,4BAA6B,EACtF,CAAE,MAAO,mBAAoB,WAAY,kCAAmC,cAAe,uFAAwF,EACnL,CAAE,MAAO,oBAAqB,WAAY,oJAAqJ,cAAe,wFAA0F,EACxS,CAAE,MAAO,cAAe,WAAY;;oBAAmD,cAAe,2BAA4B,CACtI,EAEaC,EAAqC,CAC9C,CAAE,MAAO,OAAQ,WAAY,uDAAwD,cAAe,mDAAoD,EACxJ,CAAE,MAAO,OAAQ,WAAY,6DAA8D,cAAe,yJAA0J,EACpQ,CAAE,MAAO,mBAAoB,WAAY,8FAA+F,cAAe,qEAAsE,CACjO,EAEaC,EAAmC,CAC5C,CAAE,MAAO,YAAa,WAAY,yBAA0B,cAAe,0CAA2C,EACtH,GAAGF,EACH,CAAE,MAAO,KAAM,WAAY,2DAA4D,cAAe,uCAAwC,CAClJ"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import"./_virtual/_virtual/_rolldown/runtime.js";import{causedByProperties as e,contextRoots as t,identityProperties as n,primitiveTypes as r,sliceTypes as i}from"./language.js";import{DiagnosticCodes as a}from"./compiler/Diagnostics/DiagnosticCodes.js";import{legacyOptionalTypeLength as o}from"./compiler/Authoring/QuickFixes.js";import"./compiler/index.js";import{enclosingChain as s,fenceMap as c,indentOf as l}from"./document-context.js";import{eventAnalysisSource as u}from"./event-analysis-source.js";import{resolveEventContextPath as d}from"./event-context.js";import{responseAnalysis as f}from"./response-analysis.js";import{knownEventNames as p,knownTypeNames as m,mergeSymbols as h,propertyTypeReference as g,scanDocument as _,symbolsForBuffer as v}from"./symbols.js";import{diagnosticCodes as y}from"./diagnostic-codes.js";import{validateInlineEvents as b}from"./inline-event-validation.js";import{fileImportOn as x,isFileImportLine as S}from"./file-imports.js";function issue(e,t,n,r,i,a){return{severity:e,message:i,line:t,startColumn:n,endColumn:n+r,code:a}}function tokenIssue(e,t,n,r,i,a){return issue(e,t,n.indexOf(r)+1,r.length,i,a)}function validateDeclarations(e,t,n){let i=[],a=/* @__PURE__ */ new Set([...m(t,r),...m(n,[])]),checkProperties=(e,t)=>{for(let n of e.filter(e=>!a.has(g(e).name))){let e=g(n).name;i.push(issue(`warning`,n.line,n.sourceType.startColumn,n.sourceType.text.length,e===`optional`?`Unknown type 'optional' on '${n.name}' of ${t} — did you forget the type before 'optional'?`:`Unknown type '${e}' on '${n.name}' of ${t} — declare it with 'concept ${e} : <Primitive>' or 'type ${e}'.`,y.unknownType))}};for(let e of t.types)checkProperties(e.properties,`type '${e.name}'`);for(let e of t.events)checkProperties(e.properties,`event '${e.name}'`);for(let e of t.queries)checkProperties(e.parameters,`query '${e.name}'`);for(let n of t.commands){checkProperties(n.properties,`command '${n.name}'`);let t=n.properties.filter(e=>e.isIdentifier);for(let r of t.slice(1))i.push(tokenIssue(`error`,r.line,e[r.line],`identifier`,`Command '${n.name}' already marks '${t[0].name}' as identifier — only one property can be the identifier.`,y.duplicateCommandIdentifier))}let o=/* @__PURE__ */ new Map;for(let n of[...t.concepts,...t.types])o.get(n.name)===void 0?o.set(n.name,n.line):i.push(tokenIssue(`error`,n.line,e[n.line],n.name,`Duplicate declaration of '${n.name}' — concept and type names must be unique.`,y.duplicateDeclaration));return i}function validateLines(s,u={}){let d=c(s),m=_(s),g=u.application??h(),x=v(s,{...g,authoringPath:u.path??g.authoringPath,authoringPlacement:u.placement??g.authoringPlacement}),S=f(s,x.authoringDocuments??x.authoringSources?.filter(e=>e!==s.join(`
|
|
2
|
-
`)),x.authoringPlacement,x.authoringPath,x.authoringPlacementResolved),C=new Set(S.eventSources.routes.map(e=>e.location.line-1)),w={...m,commands:m.commands.map(e=>({...e,properties:e.properties.filter(e=>!C.has(e.line)),produces:e.produces?.filter(e=>!S.operationProductionLines?.has(e.line)),productionHeaders:e.productionHeaders?.filter(e=>!S.operationProductionLines?.has(e))}))},T=/* @__PURE__ */ new Set([...p(w),...p(g)]),E=new Set([...w.policies,...g.policies].map(e=>e.name)),D=validateDeclarations(s,w,g);D.push(...validateProductionDestinations(s,w));let O=/* @__PURE__ */ new Set([a.UnknownGenerationStrategy,a.InvalidGenerationArgument,a.InvalidGenerationModifier,a.DuplicateGenerationModifier,a.DuplicateGeneration,a.InvalidGenerationPrimitive,a.InvalidGenerationPrefix,a.InvalidGenerationAlphabet,a.InvalidTypeIdPrefix,a.GenerationSizeOutsideRange,a.ReservedSequenceGeneration,a.LowGenerationEntropy,a.LowGeneratedIdentifierEntropy,a.RefutedGeneratedConceptRule,a.UnprovenGeneratedConceptRule,a.GenerationSupportBudgetExceeded,a.EmptyGenerationSupport]),k=/* @__PURE__ */ new Set([a.MixedEnumerationNumbering,a.DuplicateEnumerationNumber,a.EnumerationNumberOutsideInt32,a.MalformedEnumerationNumber,a.UnpinnedStoredEnumeration]),A=/* @__PURE__ */ new Set([a.LegacyOptionalSuffix,a.InvalidOptionalModifierOrder,a.OptionalReadsNotSupported]),j=/* @__PURE__ */ new Set([a.UnexpectedTokenInPolicyCondition,a.ExpectedPolicyCondition,a.UnclosedPolicyConditionGroup,a.ExpectedRoleName,a.ExpectedClaimName,a.ExpectedClaimMatches,a.ExpectedClaimMatchTarget]),M=/* @__PURE__ */ new Set([a.UnknownEvent,a.UnknownReadModelProperty,a.PiiNotSupportedOnIdentifier]),N=/* @__PURE__ */ new Set([a.EventFromLaterSlice,a.TimelineCycleGroup]),P=/* @__PURE__ */ new Set([a.UndeclaredDependency,a.UnusedDependencyDeclaration,a.InvalidDependencyTarget,a.RepeatedDependencyDeclaration,a.MutualDependencyDeclarations,a.AmbiguousReference]),F=/* @__PURE__ */ new Set([a.MismatchedSpecificationQueryResult,a.DirectionlessTranslationReactsToOwnCapture,a.CaptureEventsFromSeveralOrigins,a.CaptureEventsKeyNotRequired,a.CaptureEventsRecordFixture,a.EventIdPinNotCarriedToRenderers,a.ResponseNameUsedOnFailure,a.InvalidEventDeclaration,a.InvalidImportDeclaration,a.InvalidSliceDeclaration,a.InvalidDescription,a.DuplicateDescription,a.EmptyDescription,a.DuplicateEventSubject,a.InvalidSubjectType,a.ProtectedSubjectType,a.InvalidSubjectOwner,a.ReadModelSubjectNotSupported,a.InvalidSubjectModifierOrder,a.UnsupportedInteractionAlternatives,a.MixedInteractionAlternatives,a.InteractionAlternativeWithoutActions,a.InlineInteractionAlternative,a.LegacyInteractionWhere,a.InvalidSpecificationParameter,a.InvalidSpecificationCase,a.DuplicateSpecificationParameter,a.DuplicateSpecificationCase,a.IncompleteSpecificationTable,a.InvalidSpecificationCaseAssignment,a.InvalidSpecificationCaseValue,a.InvalidSpecificationCaseReference,a.OptionalSpecificationParameterTarget,a.SpecificationCaseNameCollision,a.IncompatibleSpecificationParameterType,a.UnusedSpecificationParameter,a.SingularSpecificationTableExpansion,a.InvalidSpecificationCallerPersona,a.UnsynthesizablePersonaCaller,a.PersonaWithoutGate,a.GateWithoutPersona,a.AmbiguousPersonaCaller,a.InvalidDocumentation,a.ConflictingDocumentationAcrossFiles,a.InvalidAbsentReadModelStep,a.UnknownConstraintProperty,a.OmittedProductionDestination,a.InvalidSpecificationExample,a.DuplicateSpecificationAssignment]),I=/* @__PURE__ */ new Set([a.InvalidPurposeDeclaration,a.InvalidPurposeVocabulary,a.DuplicatePurposeField,a.DuplicatePurposeDeclaration,a.UnknownPurpose,a.PurposeInterestMismatch,a.PersonalDataWithoutPurpose,a.SpecialDataWithoutCondition,a.CriminalDataWithoutAuthorization,a.PurposeWithoutBasis,a.UnusedPurpose,a.UnknownConceptDirective,a.AttributeReasonWithoutAttribute,a.DuplicateAttributeReason,a.LegacyComplianceMarker,a.DuplicateComplianceMarker,a.UnknownComplianceMarker,a.InvalidSecretScope,a.DuplicateSecretScope,a.SecretScopeIgnoredForPii,a.InvalidPersonalDataQualifier,a.DuplicateSpecialCategory]),L=/* @__PURE__ */ new Set;for(let e of u.compilerDiagnostics??S.diagnostics){let t=e.code===a.UnknownType&&(S.identityDetails??[]).some(t=>t.line===e.location.line-1),n=e.code===a.RepeatedSingularDeclarationAcrossFiles&&e.message.includes(`identity block`);if(!t&&!n&&!O.has(e.code)&&!k.has(e.code)&&!I.has(e.code)&&!A.has(e.code)&&!j.has(e.code)&&!M.has(e.code)&&!N.has(e.code)&&!P.has(e.code)&&!F.has(e.code)&&e.code!==a.ReducerIdentityMismatch&&e.code!==a.InvalidSpecificationExampleBody&&e.code!==a.UnknownRuleImplementationDirective&&e.code!==a.InvalidValidationRule&&e.code!==a.RepeatedDeclarationAcrossFiles&&!/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$|^PLAY060[7-9]$|^PLAY061[0-9]$|^PLAY0620$|^PLAY062[1-9]$|^PLAY063[0-9]$|^PLAY064[0-9]$|^PLAY065[0-2]$|^PLAY065[4-6]$|^PLAY066[0-6]$/.test(e.code))continue;let r=e.location.line-1;if(e.code===a.OmittedProductionDestination&&D.some(t=>t.code===e.code&&t.line===r))continue;if(e.code===a.UnknownEvent){if(L.has(r))continue;L.add(r)}let i=o(s[r],e)||s[r].length-e.location.column+1;D.push(issue(e.severity,r,e.location.column,i,e.message,e.code))}let checkEvent=(e,t,n)=>{!T.has(n)&&!L.has(e)&&D.push(tokenIssue(`warning`,e,t,n,`Unknown event type '${n}' — declare it in a slice or import it.`,y.unknownEvent))},R=-1;for(let a=0;a<s.length;a++){let o=s[a],c=o.trim();if(d[a]||c.length===0)continue;let u=o.match(/^[ ]*(\t+)/);if(u&&D.push(issue(`warning`,a,u[0].length-u[1].length+1,u[1].length,`Screenplay is indentation-based — use spaces, not tabs.`,y.tabIndentation)),R>=0){if(l(o)>R&&/^(?:or\s+)?[A-Z]\w*(?:\s+or\s+[A-Z]\w*)*$/.test(c)){for(let e of c.split(/\s+/).filter(e=>e!==`or`))E.has(e)||D.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy));continue}R=-1}let f=validateImport(s,d,a);f&&D.push(f);let p=c.match(/^slice\s+(\w+)/);p&&!i.includes(p[1])&&D.push(tokenIssue(`error`,a,o,p[1],`Unknown slice type '${p[1]}' — expected ${i.join(`, `)}.`,y.unknownSliceType));let m=c.match(/^concept\s+\w+\s*:\s*(\w+)/);m&&m[1]!==`Enum`&&!r.includes(m[1])&&D.push(tokenIssue(`error`,a,o,m[1],`Unknown primitive type '${m[1]}' — expected ${r.join(`, `)} or Enum.`,y.unknownPrimitiveType));let h=c.match(/^authorize\s+(.*)$/);if(h){R=l(o);for(let e of h[1].split(/\s+/).filter(e=>e!==`or`&&e.length>0))E.has(e)||D.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy))}let g=c.match(/^on\s+([A-Z]\w*)\s*$/);g&&checkEvent(a,o,g[1]);let _=c.match(/^produces\s+([A-Z]\w*)\s*$/);if(_&&!S.operationProductionLines?.has(a)&&checkEvent(a,o,_[1]),/^produces\s+when\b/.test(c)&&!S.operationProductionLines?.has(a))for(let e=a+1;e<s.length;e++){let t=s[e];if(!(d[e]||t.trim().length===0)){if(l(t)>l(o)){let n=t.trim().match(/^([A-Z]\w*)\s*$/);n&&checkEvent(e,t,n[1])}break}}let v=c.match(/^unique\s+event\s+([A-Z]\w*)/);v&&checkEvent(a,o,v[1]);let b=c.match(/^unique\s+[a-z_]\w*\s+on\s+([A-Z]\w*)/);b&&checkEvent(a,o,b[1]);for(let e of o.match(/\$identity\.[\w.]+/g)??[]){let t=e.substring(10).split(`.`)[0],r=[...n,...(S.identityDetails??[]).map(e=>e.name)];r.includes(t)||D.push(tokenIssue(`warning`,a,o,e,`Unknown $identity property '${t}' — expected ${r.join(`, `)}.`,y.unknownContextIdentityProperty))}for(let r of o.match(/\$context\.[\w.]+/g)??[]){let i=r.substring(9).split(`.`);t.includes(i[0])?i[0]===`causedBy`&&i.length>1&&!e.includes(i[1])?D.push(tokenIssue(`warning`,a,o,r,`Unknown $context.causedBy property '${i[1]}' — expected ${e.join(`, `)}.`,y.unknownContextCausedByProperty)):i[0]===`identity`&&i.length>1&&!n.includes(i[1])&&D.push(tokenIssue(`warning`,a,o,r,`Unknown $context.identity property '${i[1]}' — expected ${n.join(`, `)}.`,y.unknownContextIdentityProperty)):D.push(tokenIssue(`warning`,a,o,r,`Unknown $context path '${i.join(`.`)}' — expected one of ${t.join(`, `)}.`,y.unknownContextPath))}}D.push(...validateEventContextPaths(s,d)),D.push(...b(s,w,g,S.operationProductionLines));let z=s.map((e,t)=>({line:e,index:t})).filter(({line:e})=>/^\s*```(?:[a-z]+)?\s*$/.test(e));if(z.length%2==1){let e=z[z.length-1];D.push(issue(`error`,e.index,1,e.line.length+1,"Unclosed inline code block — expected a closing ``` line.",y.unclosedCodeBlock))}return D}function validateProductionDestinations(e,t){let n=[];e=u(e);for(let r of t.commands){let t=r.properties.filter(e=>e.isIdentifier&&!g(e).isOptional&&!g(e).isCollection);if(t.length===1)for(let i of r.produces??[]){if(i.inline||i.conditional||i.target!==void 0)continue;let r=i.line;n.push(issue(`information`,r,l(e[r])+1,e[r].trim().length,`Plain 'produces ${i.name}' omits its destination — use 'for ${t[0].name}' to explicitly select the command's identifier.`,y.omittedProductionDestination))}}return n}function validateImport(e,t,n){let r=e[n],i=r.trim().replace(/\s*\/\/.*$/,``);if(!/^import\b/.test(i)||x(r,n))return;let a=l(r);if(a>0&&[`module`,`feature`].includes(s(e,t,n,a)[0])||S(r))return issue(`error`,n,a+1,i.length,`Invalid import '${i}' — inside a module or feature, import names files: 'import "<path or glob>"'.`,y.invalidFileImport)}const C=/^(?:(?:increment|decrement|count|clear|add|subtract|set)\s+)?@?([$\w.]+)(?=\s|=|$)/;function validateEventContextPaths(e,t){let n=[],names=e=>e.map(e=>e.name).join(`, `);for(let r=0;r<e.length;r++){let i=e[r];if(t[r])continue;for(let e of i.matchAll(/(\.)?\$eventContext((?:\.(?:\w+(?:\(\))?)?)*)/g)){let t=e[0].substring(e[1]?.length??0),i=e[2];if(i.length===0){e[1]&&n.push(issue(`error`,r,(e.index??0)+2,t.length,`'$eventContext' names no member - expected one of ${names(d(``).expected)}.`,y.missingEventContextPath));continue}let a=i.substring(1),o=d(a),s=(e.index??0)+(e[1]?.length??0)+1;switch(o.status){case`missing`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' names no member - expected one of ${names(o.expected)}.`,y.missingEventContextPath));break;case`unknownMember`:n.push(issue(`warning`,r,s,t.length,`Unknown event context member '${o.segment}' in '$eventContext.${a}' - expected one of ${names(o.expected)}.`,y.unknownEventContextMember));break;case`unknownSubPath`:{let e=o.expected.length===0?`no members to address`:`members ${names(o.expected)}`;n.push(issue(`warning`,r,s,t.length,`Unknown event context path '$eventContext.${a}' - '${o.member?.name}' (${o.member?.type}) has ${e}.`,y.unknownEventContextPath));break}case`belowCollection`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' cannot resolve - '${o.member?.name}' is a collection (${o.member?.type}) and cannot be addressed below.`,y.eventContextPathBelowCollection))}}let a=i.trim().match(C)?.[1],o=a?.match(/\.\$(\w+)/)?.[1];a&&o&&o!==`eventContext`&&n.push(tokenIssue(`warning`,r,i,a,`Dynamic dictionary key '$${o}' in '${a}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${o}' becomes the key.`,y.unresolvedDynamicKeySource))}return n}export{validateEventContextPaths,validateLines};
|
|
2
|
+
`)),x.authoringPlacement,x.authoringPath,x.authoringPlacementResolved),C=new Set(S.eventSources.routes.map(e=>e.location.line-1)),w={...m,commands:m.commands.map(e=>({...e,properties:e.properties.filter(e=>!C.has(e.line)),produces:e.produces?.filter(e=>!S.operationProductionLines?.has(e.line)),productionHeaders:e.productionHeaders?.filter(e=>!S.operationProductionLines?.has(e))}))},T=/* @__PURE__ */ new Set([...p(w),...p(g)]),E=new Set([...w.policies,...g.policies].map(e=>e.name)),D=validateDeclarations(s,w,g);D.push(...validateProductionDestinations(s,w));let O=/* @__PURE__ */ new Set([a.UnknownGenerationStrategy,a.InvalidGenerationArgument,a.InvalidGenerationModifier,a.DuplicateGenerationModifier,a.DuplicateGeneration,a.InvalidGenerationPrimitive,a.InvalidGenerationPrefix,a.InvalidGenerationAlphabet,a.InvalidTypeIdPrefix,a.GenerationSizeOutsideRange,a.ReservedSequenceGeneration,a.LowGenerationEntropy,a.LowGeneratedIdentifierEntropy,a.RefutedGeneratedConceptRule,a.UnprovenGeneratedConceptRule,a.GenerationSupportBudgetExceeded,a.EmptyGenerationSupport]),k=/* @__PURE__ */ new Set([a.MixedEnumerationNumbering,a.DuplicateEnumerationNumber,a.EnumerationNumberOutsideInt32,a.MalformedEnumerationNumber,a.UnpinnedStoredEnumeration]),A=/* @__PURE__ */ new Set([a.LegacyOptionalSuffix,a.InvalidOptionalModifierOrder,a.OptionalReadsNotSupported]),j=/* @__PURE__ */ new Set([a.UnexpectedTokenInPolicyCondition,a.ExpectedPolicyCondition,a.UnclosedPolicyConditionGroup,a.ExpectedRoleName,a.ExpectedClaimName,a.ExpectedClaimMatches,a.ExpectedClaimMatchTarget]),M=/* @__PURE__ */ new Set([a.UnknownEvent,a.UnknownReadModelProperty,a.PiiNotSupportedOnIdentifier]),N=/* @__PURE__ */ new Set([a.EventFromLaterSlice,a.TimelineCycleGroup]),P=/* @__PURE__ */ new Set([a.UndeclaredDependency,a.UnusedDependencyDeclaration,a.InvalidDependencyTarget,a.RepeatedDependencyDeclaration,a.MutualDependencyDeclarations,a.AmbiguousReference]),F=/* @__PURE__ */ new Set([a.MismatchedSpecificationQueryResult,a.DirectionlessTranslationReactsToOwnCapture,a.CaptureEventsFromSeveralOrigins,a.CaptureEventsKeyNotRequired,a.CaptureEventsRecordFixture,a.EventIdPinNotCarriedToRenderers,a.ResponseNameUsedOnFailure,a.InvalidEventDeclaration,a.InvalidImportDeclaration,a.InvalidSliceDeclaration,a.InvalidDescription,a.DuplicateDescription,a.EmptyDescription,a.DuplicateEventSubject,a.InvalidSubjectType,a.ProtectedSubjectType,a.InvalidSubjectOwner,a.ReadModelSubjectNotSupported,a.InvalidSubjectModifierOrder,a.UnsupportedInteractionAlternatives,a.MixedInteractionAlternatives,a.InteractionAlternativeWithoutActions,a.InlineInteractionAlternative,a.LegacyInteractionWhere,a.InvalidSpecificationParameter,a.InvalidSpecificationCase,a.DuplicateSpecificationParameter,a.DuplicateSpecificationCase,a.IncompleteSpecificationTable,a.InvalidSpecificationCaseAssignment,a.InvalidSpecificationCaseValue,a.InvalidSpecificationCaseReference,a.OptionalSpecificationParameterTarget,a.SpecificationCaseNameCollision,a.IncompatibleSpecificationParameterType,a.UnusedSpecificationParameter,a.SingularSpecificationTableExpansion,a.InvalidSpecificationCallerPersona,a.UnsynthesizablePersonaCaller,a.PersonaWithoutGate,a.GateWithoutPersona,a.AmbiguousPersonaCaller,a.InvalidDocumentation,a.ConflictingDocumentationAcrossFiles,a.InvalidAbsentReadModelStep,a.UnknownConstraintProperty,a.OmittedProductionDestination,a.InvalidSpecificationExample,a.DuplicateSpecificationAssignment]),I=/* @__PURE__ */ new Set([a.InvalidPurposeDeclaration,a.InvalidPurposeVocabulary,a.DuplicatePurposeField,a.DuplicatePurposeDeclaration,a.UnknownPurpose,a.PurposeInterestMismatch,a.PersonalDataWithoutPurpose,a.SpecialDataWithoutCondition,a.CriminalDataWithoutAuthorization,a.PurposeWithoutBasis,a.UnusedPurpose,a.UnknownConceptDirective,a.AttributeReasonWithoutAttribute,a.DuplicateAttributeReason,a.LegacyComplianceMarker,a.DuplicateComplianceMarker,a.UnknownComplianceMarker,a.InvalidSecretScope,a.DuplicateSecretScope,a.SecretScopeIgnoredForPii,a.InvalidPersonalDataQualifier,a.DuplicateSpecialCategory]),L=/* @__PURE__ */ new Set;for(let e of u.compilerDiagnostics??S.diagnostics){let t=e.code===a.UnknownType&&(S.identityDetails??[]).some(t=>t.line===e.location.line-1),n=e.code===a.RepeatedSingularDeclarationAcrossFiles&&e.message.includes(`identity block`);if(!t&&!n&&!O.has(e.code)&&!k.has(e.code)&&!I.has(e.code)&&!A.has(e.code)&&!j.has(e.code)&&!M.has(e.code)&&!N.has(e.code)&&!P.has(e.code)&&!F.has(e.code)&&e.code!==a.ReducerIdentityMismatch&&e.code!==a.InvalidSpecificationExampleBody&&e.code!==a.UnknownRuleImplementationDirective&&e.code!==a.InvalidValidationRule&&e.code!==a.RepeatedDeclarationAcrossFiles&&!/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$|^PLAY060[7-9]$|^PLAY061[0-9]$|^PLAY0620$|^PLAY062[1-9]$|^PLAY063[0-9]$|^PLAY064[0-9]$|^PLAY065[0-2]$|^PLAY065[4-6]$|^PLAY066[0-6]$|^PLAY072[0-2]$/.test(e.code))continue;let r=e.location.line-1;if(e.code===a.OmittedProductionDestination&&D.some(t=>t.code===e.code&&t.line===r))continue;if(e.code===a.UnknownEvent){if(L.has(r))continue;L.add(r)}let i=o(s[r],e)||s[r].length-e.location.column+1;D.push(issue(e.severity,r,e.location.column,i,e.message,e.code))}let checkEvent=(e,t,n)=>{!T.has(n)&&!L.has(e)&&D.push(tokenIssue(`warning`,e,t,n,`Unknown event type '${n}' — declare it in a slice or import it.`,y.unknownEvent))},R=-1;for(let a=0;a<s.length;a++){let o=s[a],c=o.trim();if(d[a]||c.length===0)continue;let u=o.match(/^[ ]*(\t+)/);if(u&&D.push(issue(`warning`,a,u[0].length-u[1].length+1,u[1].length,`Screenplay is indentation-based — use spaces, not tabs.`,y.tabIndentation)),R>=0){if(l(o)>R&&/^(?:or\s+)?[A-Z]\w*(?:\s+or\s+[A-Z]\w*)*$/.test(c)){for(let e of c.split(/\s+/).filter(e=>e!==`or`))E.has(e)||D.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy));continue}R=-1}let f=validateImport(s,d,a);f&&D.push(f);let p=c.match(/^slice\s+(\w+)/);p&&!i.includes(p[1])&&D.push(tokenIssue(`error`,a,o,p[1],`Unknown slice type '${p[1]}' — expected ${i.join(`, `)}.`,y.unknownSliceType));let m=c.match(/^concept\s+\w+\s*:\s*(\w+)/);m&&m[1]!==`Enum`&&!r.includes(m[1])&&D.push(tokenIssue(`error`,a,o,m[1],`Unknown primitive type '${m[1]}' — expected ${r.join(`, `)} or Enum.`,y.unknownPrimitiveType));let h=c.match(/^authorize\s+(.*)$/);if(h){R=l(o);for(let e of h[1].split(/\s+/).filter(e=>e!==`or`&&e.length>0))E.has(e)||D.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy))}let g=c.match(/^on\s+([A-Z]\w*)\s*$/);g&&checkEvent(a,o,g[1]);let _=c.match(/^produces\s+([A-Z]\w*)\s*$/);if(_&&!S.operationProductionLines?.has(a)&&checkEvent(a,o,_[1]),/^produces\s+when\b/.test(c)&&!S.operationProductionLines?.has(a))for(let e=a+1;e<s.length;e++){let t=s[e];if(!(d[e]||t.trim().length===0)){if(l(t)>l(o)){let n=t.trim().match(/^([A-Z]\w*)\s*$/);n&&checkEvent(e,t,n[1])}break}}let v=c.match(/^unique\s+event\s+([A-Z]\w*)/);v&&checkEvent(a,o,v[1]);let b=c.match(/^unique\s+[a-z_]\w*\s+on\s+([A-Z]\w*)/);b&&checkEvent(a,o,b[1]);for(let e of o.match(/\$identity\.[\w.]+/g)??[]){let t=e.substring(10).split(`.`)[0],r=[...n,...(S.identityDetails??[]).map(e=>e.name)];r.includes(t)||D.push(tokenIssue(`warning`,a,o,e,`Unknown $identity property '${t}' — expected ${r.join(`, `)}.`,y.unknownContextIdentityProperty))}for(let r of o.match(/\$context\.[\w.]+/g)??[]){let i=r.substring(9).split(`.`);t.includes(i[0])?i[0]===`causedBy`&&i.length>1&&!e.includes(i[1])?D.push(tokenIssue(`warning`,a,o,r,`Unknown $context.causedBy property '${i[1]}' — expected ${e.join(`, `)}.`,y.unknownContextCausedByProperty)):i[0]===`identity`&&i.length>1&&!n.includes(i[1])&&D.push(tokenIssue(`warning`,a,o,r,`Unknown $context.identity property '${i[1]}' — expected ${n.join(`, `)}.`,y.unknownContextIdentityProperty)):D.push(tokenIssue(`warning`,a,o,r,`Unknown $context path '${i.join(`.`)}' — expected one of ${t.join(`, `)}.`,y.unknownContextPath))}}D.push(...validateEventContextPaths(s,d)),D.push(...b(s,w,g,S.operationProductionLines));let z=s.map((e,t)=>({line:e,index:t})).filter(({line:e})=>/^\s*```(?:[a-z]+)?\s*$/.test(e));if(z.length%2==1){let e=z[z.length-1];D.push(issue(`error`,e.index,1,e.line.length+1,"Unclosed inline code block — expected a closing ``` line.",y.unclosedCodeBlock))}return D}function validateProductionDestinations(e,t){let n=[];e=u(e);for(let r of t.commands){let t=r.properties.filter(e=>e.isIdentifier&&!g(e).isOptional&&!g(e).isCollection);if(t.length===1)for(let i of r.produces??[]){if(i.inline||i.conditional||i.target!==void 0)continue;let r=i.line;n.push(issue(`information`,r,l(e[r])+1,e[r].trim().length,`Plain 'produces ${i.name}' omits its destination — use 'for ${t[0].name}' to explicitly select the command's identifier.`,y.omittedProductionDestination))}}return n}function validateImport(e,t,n){let r=e[n],i=r.trim().replace(/\s*\/\/.*$/,``);if(!/^import\b/.test(i)||x(r,n))return;let a=l(r);if(a>0&&[`module`,`feature`].includes(s(e,t,n,a)[0])||S(r))return issue(`error`,n,a+1,i.length,`Invalid import '${i}' — inside a module or feature, import names files: 'import "<path or glob>"'.`,y.invalidFileImport)}const C=/^(?:(?:increment|decrement|count|clear|add|subtract|set)\s+)?@?([$\w.]+)(?=\s|=|$)/;function validateEventContextPaths(e,t){let n=[],names=e=>e.map(e=>e.name).join(`, `);for(let r=0;r<e.length;r++){let i=e[r];if(t[r])continue;for(let e of i.matchAll(/(\.)?\$eventContext((?:\.(?:\w+(?:\(\))?)?)*)/g)){let t=e[0].substring(e[1]?.length??0),i=e[2];if(i.length===0){e[1]&&n.push(issue(`error`,r,(e.index??0)+2,t.length,`'$eventContext' names no member - expected one of ${names(d(``).expected)}.`,y.missingEventContextPath));continue}let a=i.substring(1),o=d(a),s=(e.index??0)+(e[1]?.length??0)+1;switch(o.status){case`missing`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' names no member - expected one of ${names(o.expected)}.`,y.missingEventContextPath));break;case`unknownMember`:n.push(issue(`warning`,r,s,t.length,`Unknown event context member '${o.segment}' in '$eventContext.${a}' - expected one of ${names(o.expected)}.`,y.unknownEventContextMember));break;case`unknownSubPath`:{let e=o.expected.length===0?`no members to address`:`members ${names(o.expected)}`;n.push(issue(`warning`,r,s,t.length,`Unknown event context path '$eventContext.${a}' - '${o.member?.name}' (${o.member?.type}) has ${e}.`,y.unknownEventContextPath));break}case`belowCollection`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' cannot resolve - '${o.member?.name}' is a collection (${o.member?.type}) and cannot be addressed below.`,y.eventContextPathBelowCollection))}}let a=i.trim().match(C)?.[1],o=a?.match(/\.\$(\w+)/)?.[1];a&&o&&o!==`eventContext`&&n.push(tokenIssue(`warning`,r,i,a,`Dynamic dictionary key '$${o}' in '${a}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${o}' becomes the key.`,y.unresolvedDynamicKeySource))}return n}export{validateEventContextPaths,validateLines};
|
|
3
3
|
//# sourceMappingURL=validation.js.map
|