@cratis/screenplay-language 4.128.0 → 4.129.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.
Files changed (85) hide show
  1. package/dist/AuthoredReadModelKeys.d.ts +13 -0
  2. package/dist/AuthoredReadModelKeys.d.ts.map +1 -0
  3. package/dist/EventSourceAnalysis.d.ts +11 -0
  4. package/dist/EventSourceAnalysis.d.ts.map +1 -1
  5. package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +1 -1
  6. package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -1
  7. package/dist/bundles/compiler/Files/PlayApplicationAssembly.js +1 -1
  8. package/dist/bundles/compiler/Files/PlayApplicationAssembly.js.map +1 -1
  9. package/dist/bundles/compiler/Parsing/CommandParser.js +1 -1
  10. package/dist/bundles/compiler/Parsing/CommandParser.js.map +1 -1
  11. package/dist/bundles/compiler/Parsing/DeclarationParsers.js +1 -1
  12. package/dist/bundles/compiler/Parsing/DeclarationParsers.js.map +1 -1
  13. package/dist/bundles/compiler/Parsing/DependencySourceParser.js +1 -1
  14. package/dist/bundles/compiler/Parsing/DependencySourceParser.js.map +1 -1
  15. package/dist/bundles/compiler/Parsing/EventSourceValidator.js +1 -1
  16. package/dist/bundles/compiler/Parsing/EventSourceValidator.js.map +1 -1
  17. package/dist/bundles/compiler/Parsing/IdentifierComplianceValidator.js +1 -1
  18. package/dist/bundles/compiler/Parsing/IdentifierComplianceValidator.js.map +1 -1
  19. package/dist/bundles/compiler/Parsing/ObserverFilterParser.js +2 -0
  20. package/dist/bundles/compiler/Parsing/ObserverFilterParser.js.map +1 -0
  21. package/dist/bundles/compiler/Parsing/ObserverFilterValidator.js +2 -0
  22. package/dist/bundles/compiler/Parsing/ObserverFilterValidator.js.map +1 -0
  23. package/dist/bundles/compiler/Parsing/ProducesParser.js +1 -1
  24. package/dist/bundles/compiler/Parsing/ProducesParser.js.map +1 -1
  25. package/dist/bundles/compiler/Parsing/PropertyLineParser.js +1 -1
  26. package/dist/bundles/compiler/Parsing/PropertyLineParser.js.map +1 -1
  27. package/dist/bundles/compiler/Parsing/QueryParser.js +1 -1
  28. package/dist/bundles/compiler/Parsing/QueryParser.js.map +1 -1
  29. package/dist/bundles/compiler/Parsing/ReactionParser.js +1 -1
  30. package/dist/bundles/compiler/Parsing/ReactionParser.js.map +1 -1
  31. package/dist/bundles/compiler/Parsing/ReadModelKeyValidator.js +2 -0
  32. package/dist/bundles/compiler/Parsing/ReadModelKeyValidator.js.map +1 -0
  33. package/dist/bundles/compiler/Parsing/ReadsParser.js +2 -0
  34. package/dist/bundles/compiler/Parsing/ReadsParser.js.map +1 -0
  35. package/dist/bundles/compiler/Parsing/SpecificationStreamValidator.js +1 -1
  36. package/dist/bundles/compiler/Parsing/SpecificationStreamValidator.js.map +1 -1
  37. package/dist/bundles/compiler/Parsing/TriggerDataParser.js +1 -1
  38. package/dist/bundles/compiler/Parsing/TriggerDataParser.js.map +1 -1
  39. package/dist/bundles/compiler/ScreenplayCompiler.js +1 -1
  40. package/dist/bundles/compiler/ScreenplayCompiler.js.map +1 -1
  41. package/dist/bundles/compiler/Syntax/EventSourceCatalog.js +1 -1
  42. package/dist/bundles/compiler/Syntax/EventSourceCatalog.js.map +1 -1
  43. package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js +1 -1
  44. package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js.map +1 -1
  45. package/dist/bundles/compiler/Syntax/SyntaxCollections.js +1 -1
  46. package/dist/bundles/compiler/Syntax/SyntaxCollections.js.map +1 -1
  47. package/dist/bundles/compiler/Syntax/SyntaxInvariants.js +1 -1
  48. package/dist/bundles/compiler/Syntax/SyntaxInvariants.js.map +1 -1
  49. package/dist/bundles/compiler/Syntax/SyntaxJson.js +1 -1
  50. package/dist/bundles/compiler/Syntax/SyntaxJson.js.map +1 -1
  51. package/dist/bundles/compiler/Syntax/index.js +1 -1
  52. package/dist/bundles/compiler/index.js +1 -1
  53. package/dist/bundles/completion-items.js +2 -2
  54. package/dist/bundles/completion-items.js.map +1 -1
  55. package/dist/bundles/completion-planner.js +2 -2
  56. package/dist/bundles/completion-planner.js.map +1 -1
  57. package/dist/bundles/diagnostic-codes.js +1 -1
  58. package/dist/bundles/diagnostic-codes.js.map +1 -1
  59. package/dist/bundles/event-source-authoring.js +10 -10
  60. package/dist/bundles/event-source-authoring.js.map +1 -1
  61. package/dist/bundles/keyword-docs.js +1 -1
  62. package/dist/bundles/keyword-docs.js.map +1 -1
  63. package/dist/bundles/read-model-key-completions.js +2 -0
  64. package/dist/bundles/read-model-key-completions.js.map +1 -0
  65. package/dist/bundles/response-analysis.js +6 -6
  66. package/dist/bundles/response-analysis.js.map +1 -1
  67. package/dist/bundles/scope-items.js +1 -1
  68. package/dist/bundles/scope-items.js.map +1 -1
  69. package/dist/bundles/tokens.js +1 -1
  70. package/dist/bundles/tokens.js.map +1 -1
  71. package/dist/bundles/validation.js +1 -1
  72. package/dist/bundles/validation.js.map +1 -1
  73. package/dist/completion-items.d.ts.map +1 -1
  74. package/dist/completion-planner.d.ts.map +1 -1
  75. package/dist/diagnostic-codes.d.ts +7 -0
  76. package/dist/diagnostic-codes.d.ts.map +1 -1
  77. package/dist/event-source-authoring.d.ts.map +1 -1
  78. package/dist/keyword-docs.d.ts.map +1 -1
  79. package/dist/read-model-key-completions.d.ts +4 -0
  80. package/dist/read-model-key-completions.d.ts.map +1 -0
  81. package/dist/response-analysis.d.ts +2 -0
  82. package/dist/response-analysis.d.ts.map +1 -1
  83. package/dist/scope-items.d.ts.map +1 -1
  84. package/dist/tokens.d.ts.map +1 -1
  85. 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.',\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: 'Fills a query parameter 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 ESM v10 (claimed, unreleased); claims are unknown for this identity. Clock and application triggers have no Stage realization yet.',\n trigger: 'Declares a kind of occurrence a reaction can respond to, and the values it hands the reaction. What makes one occur belongs to whoever provides it, never to the compiler.',\n where: 'Narrows which occurrences actually run the reaction.',\n contains: 'Text comparison — true when the left string holds the right one anywhere.',\n every: 'Runs a reaction on an interval — `every 15 minutes`, `every 1 day`.',\n refused: 'Ordered invocation refusal branch: first match wins. Bare `on refused` covers validation and constraints, not authorization. Syntax-only, not yet executable (PLAY0268).',\n acknowledge: 'A refusal branch acknowledges alone, or produces events instead. Syntax-only, not yet executable (PLAY0268).',\n validation: 'In `on refused by validation`, selects property, concept and require refusals. Syntax-only, not yet executable (PLAY0268).',\n authorization: 'In `on refused by authorization`, explicitly selects unauthorized results, never Unsupported. Syntax-only, not yet executable (PLAY0268).',\n redelivered: '`when redelivered <Event> to <Reaction>` selects exactly one effective given occurrence by optional for, stated values and stream or no stream, without appending it again. Syntax-only, not yet executable (PLAY0268).',\n invokes: 'A command a reaction hands on. A command is asked for, not produced — it may still be rejected.',\n screen: 'A UI declaration. Supports intent, structure, and layout-with-code levels, or a full file reference.',\n constraint: 'A server-side rule enforced in the Chronicle kernel before events are committed.',\n authorize: 'References the policies that must all pass for the construct to execute.',\n validate: 'Declarative validation rules, or `validate` followed by ```csharp for imperative rules — on commands and concepts.',\n produces: 'References a declared event with `produces <Name>`, or declares one inline with `produces event <Name>`. An inline omitted `for` uses the command identifier only when all destinations are the same source; legacy plain omission allocates an identity.',\n reads: 'Declares a view consulted by a command or reaction trigger: `reads <View> [as <alias>] [by <value>]`. A reaction `by` names a value taken by its trigger; clock triggers cannot use `by`. Repeated views require unique aliases. Runtime binding is not yet supported for command or reaction reads.',\n as: 'Names an instance of a view in a command or reaction trigger reads declaration, for example `reads Account as source by sourceId`.',\n handler: 'A fully imperative command implementation — a `file <Path>` reference or an inline `csharp` block, instead of `produces`.',\n when: 'Guards a produced event or a capture append with a condition. In a labeled screen action, `when item.<field> == <literal> execute <Command>` selects the first matching command. Inside on click, double click or select, block-form `when <condition>` selects one whole action list at gesture time.',\n rule: 'Names a predicate. Bare, it states that a constraint exists without expressing what it computes — nothing resolves the name. Optionally followed by an indented `file <Path>` reference or inline `csharp` block giving it a body.',\n require: 'A policy condition: `authenticated`, `role \"...\"`, or `claim \"...\" matches ...`. Unary `not` negates a condition or group; precedence is not, and, or.',\n authenticated: 'Requires an authenticated caller.',\n role: 'Requires the caller to have the given role.',\n claim: 'Requires a claim on the caller to match a subject or value.',\n subject: 'In policy `matches subject`, the identifier of the thing acted on, not the caller. The caller is `$context.causedBy.subject`.',\n data: 'Binds a read model to a screen through a query.',\n action: 'Makes a command available on a screen. `action \"Label\"` declares one button with ordered `when … execute` alternatives over the nearest data item or selected row. No subject hides it; commands still enforce authorization and validation.',\n otherwise: 'The final fallback of a guarded action: `otherwise hidden` or `otherwise execute <Command>`. In an item interaction, bare `otherwise` opens a fallback action list. No subject runs nothing, including fallback; authorization never falls through.',\n hidden: 'Hides a guarded action when no condition matches. Without a subject the action is always hidden, even with an execute fallback.',\n execute: 'Executes a command. A guarded screen action selects it by the first matching condition; explicit `with … from` bindings precede same-name item fields, its declared form and renderer input.',\n navigate: 'Navigates to a screen, optionally passing a parameter with `by`.',\n section: 'A named structural section of a screen.',\n table: 'A table widget over a read model or child collection.',\n summary: 'A summary widget showing labeled fields.',\n column: 'A table column bound to a property.',\n field: 'A summary field bound to a property.',\n title: 'The display title of a screen or section.',\n label: 'The display label of an action, column, or field.',\n unique: 'A uniqueness constraint — `unique <property> on <EventType>` or `unique event <EventType>`.',\n concurrency: 'The concurrency scope enforced when the command appends events — dimensions: `eventSource`, `sourceType`, `streamType`, `streamId`, `events`.',\n eventSource: 'Concurrency dimension — scope the check to the event source id of the command.',\n sourceType: 'Concurrency dimension — scope the check to an event source type.',\n streamType: 'Concurrency dimension — scope the check to an event stream type.',\n streamId: 'Concurrency dimension — scope the check to an event stream id.',\n tag: 'Attaches a tag to appended events — a static identifier or string, or a `$context.` expression resolved at append time.',\n seed: 'Declares events to seed into the event store per event source id — multiple blocks accumulate.',\n for: 'Names the event source of a production or seed group. Inside `produces event`, omission uses the command identifier unless another production targets a different source.',\n readmodel: 'Declares a read model — its name and properties — in a slice, or, in a specification, read model state: `given readmodel` establishes it, `then readmodel` asserts it, `then no readmodel <View> for <key>` asserts keyed absence.',\n reducer: 'Builds a read model from events with imperative code — `reducer <Name> => <ReadModel>` with an `on <EventType>` rule per event. Use it when a projection cannot express the transition.',\n specification: 'Given/when/then acceptance criteria for a slice: prior events and state, the command, query or appended event under test, and the events, state, results, errors or denials that follow.',\n dialog: 'A dialog opened over the shell, or with `dialog template` a reusable dialog shape.',\n form: 'A form bound to a command — `form <Name> for <Command>` with a `field` per input.',\n contribute: 'Contributes entries to a slot of the shell — `contribute to Navigation` with `navigate to`, `label` and `order`.',\n theme: 'A named theme and the component packages it is compatible with.',\n ui: 'A UI profile — `ui profile <Name>` binds a target platform and size to a layout, theme and packages.',\n behavior: 'A named interaction wiring of `on <interaction>` handlers, attached to a screen, form or dialog with `uses`.',\n system: 'An application-scoped external system that operations use.',\n eventsource: 'An application-owned event source with nested streams.',\n operation: 'A reusable operation intent that uses one external system.',\n no: 'A keyed absence assertion: `then no readmodel <View> for <key>`.',\n arguments: 'The values supplied to a query asserted by `then query`.',\n result: 'One expected result - `then result [exactly]` after `when query`, or a `result` block inside `then query`. Repeat it to assert several results in authored order.',\n clock: 'The instant a specification happens at - `given clock \"2026-10-05T08:00:00Z\"` fixes when everything occurs; `when clock \"<instant>\"` is the clock reaching it, as the action.',\n exactly: 'Requires every property to match, rather than only the ones asserted - on `then readmodel`, `then query` and `then result`.',\n file: 'Delegates the implementation to an external file; the Screenplay contract stays visible.',\n by: 'Introduces the identifying parameter.',\n via: 'Connects screen data to the query that supplies it.',\n filter: 'An optional query filter parameter.',\n on: 'The event a constraint applies to, the day a schedule narrows to, or a widget interaction such as `on row-click`.',\n message: 'The validation message reported when the rule fails.',\n matches: 'Matches a value against a regular expression or a named pattern such as `email`.',\n all: 'Applies a comparison to every element of a collection.',\n max: 'Maximum length or value.',\n min: 'Minimum length or value.',\n length: 'Constrains the exact length of a value.',\n today: 'The current date.',\n empty: 'Used with `not empty` — the value must be present.',\n not: 'Negates a validation condition, as in `not empty`.',\n and: 'Both conditions must hold.',\n or: 'Either condition may hold.',\n csharp: 'An inline C# block whose opening fence is ```csharp.',\n sql: 'An inline SQL block between triple backticks — a query performer written against a relational store.',\n typescript: 'An inline TypeScript block between triple backticks.',\n react: 'An inline React/TSX block; receives the surrounding data contract as `Props`.',\n html: 'An inline static HTML block.',\n StateChange: 'Slice type — a command → events flow; something that changes the system.',\n StateView: 'Slice type — a query + projection + screen; something that reads the system.',\n Automation: 'Slice type — a reaction or reducer; something that runs when something happens.',\n Translate: 'Slice type — a capture; converts external data into events.',\n Uuid: 'Primitive type — a universally unique identifier.',\n String: 'Primitive type — a string of characters.',\n Int: 'Primitive type — an integer number.',\n Decimal: 'Primitive type — a decimal number.',\n Bool: 'Primitive type — true or false.',\n Date: 'Primitive type — a date without time.',\n DateTime: 'Primitive type — a date and time.',\n Enum: 'An enumeration concept with a fixed set of values.',\n};\n\n// What the words of a specification's steps mean there - where 'trigger', 'capture' and 'query' name what the\n// scenario exercises rather than declare one.\nexport const specificationKeywordDocs: Record<string, string> = {\n parameter: 'Declares a required typed case value: `parameter <name> <Type>`. Every case assigns it once. `optional` permits literal null but supplies no default.',\n case: 'One named complete row of a specification table. `case.<parameter>` substitutes a whole value after example overrides; each row runs as `<Specification>_<Case>`.',\n caller: '`given caller` states an explicit identity; `given caller as <Persona>` synthesizes an authenticated deterministic witness of the persona, with no body. Leftmost buildable policy alternatives are significant.',\n clock: keywordDocs.clock,\n redelivered: keywordDocs.redelivered,\n trigger: '`when trigger <Trigger>` - an application trigger fires, as the action, with the values on the lines beneath it.',\n capture: '`given capture <Capture>` - a record the capture\\'s source held before; `when capture <Capture>` - the record it sees now, as the action. The fields go on the lines beneath.',\n query: '`when query <Query>` - the query is performed, as the action, with its arguments on the lines beneath; assert what it returns with `then result` or `then no result`. `then query` instead asserts a query after another action.',\n events: '`then no events` - asserts no new events after a non-append action. Syntax-only, not yet executable (PLAY0268). Cannot accompany event, event-order, error or denial expectations.',\n result: '`then result [exactly]` - one result the query performed by `when query` returns, in order; `then no result` - it returns nothing.',\n};\n\nexport const attributeDocs: Record<string, string> = {\n pii: 'personal data (GDPR Art. 4(1)); renders Chronicle [PII]. Bare suffix marker; @pii is deprecated (PLAY0565). Not admitted by the executable model (PLAY0268).',\n personal: 'Alias of pii: personal data (GDPR Art. 4(1)); renders Chronicle [PII]. No diagnostic; canonical printing writes pii.',\n secret: 'Operational secret, not personal data: encrypted at rest without erasure and withheld from causation. Provider mapping: [Encrypted] + [NotAudited], or [PII] only with pii. Cannot be identity (PLAY0515). Not admitted by the executable model (PLAY0268).',\n sensitive: 'Deprecated spelling of secret (PLAY0565); repair to bare secret. Operational secret, not GDPR Art. 9 special-category data.',\n};\n\nexport const contextVariableDocs: Record<string, string> = {\n '$context.occurred': 'When the command or query was received.',\n '$context.tenant': 'The tenant the command or query is executing for.',\n '$context.command': 'The command being handled, shaped by its `command` declaration.',\n '$context.arguments': 'The arguments of the query being performed.',\n '$context.causedBy': 'The identity that caused the command or query — `subject`, `name`, `userName`.',\n '$context.causedBy.subject': 'The subject of the identity that caused the command or query.',\n '$context.causedBy.name': 'The display name of the identity that caused the command or query.',\n '$context.causedBy.userName': 'The user name of the identity that caused the command or query.',\n '$context.causation': 'What caused the command or query — `type`, `occurred`, `properties`.',\n '$context.causation.type': 'What caused the command or query — a command, a reactor, a schedule.',\n '$identity': 'The caller — token built-ins `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`, plus declared identity details. Built-ins are equivalent to `$context.identity`; details are authoring-only until admitted (#600).',\n '$identity.id': 'The identifier of the caller from the auth token; equivalent to `$context.identity.id`.',\n '$identity.name': 'The display name of the caller; equivalent to `$context.identity.name`.',\n '$identity.userName': 'The user name of the caller; equivalent to `$context.identity.userName`.',\n '$identity.isAuthenticated': 'Whether the caller is authenticated.',\n '$identity.roles': 'The roles the caller holds.',\n '$identity.claims': 'The claims the caller carries — `$identity.claims.<name>` reads one.',\n '$context.identity': 'The caller a decision is made about — `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`.',\n '$context.identity.id': 'The identifier of the caller from the auth token.',\n '$context.identity.name': 'The display name of the caller.',\n '$context.identity.userName': 'The user name of the caller.',\n '$context.identity.isAuthenticated': 'Whether the caller is authenticated.',\n '$context.identity.roles': 'The roles the caller holds.',\n '$context.identity.claims': 'The claims the caller carries — `$context.identity.claims.<name>` reads one.',\n '$env': 'An environment variable, e.g. `$env.SERVICE_NAME`.',\n '$secrets': 'An encrypted secret resolved at runtime, e.g. `$secrets.azureAdClientId` — stays symbolic in the compiled tree.',\n '$strings': 'A localized string resolved from the `.strings` file of the active locale, e.g. `$strings.invoices.title`.',\n // Every $eventContext path the event-context catalog lists, for projections.\n ...Object.fromEntries(eventContextPaths.map((path) => [`$eventContext.${path.path}`, path.description])),\n};\n\n// One-sentence descriptions of the `pii special` categories (GDPR Art. 9(1)) and `pii criminal` (Art. 10).\n// The same sentences appear in Documentation/screenplay/concepts.md.\nexport const specialCategoryDocs: Record<string, string> = {\n racialOrEthnicOrigin: 'Data revealing a person\\'s racial or ethnic origin (GDPR Art. 9(1)).',\n politicalOpinions: 'Data revealing a person\\'s political opinions (GDPR Art. 9(1)).',\n religiousOrPhilosophicalBeliefs: 'Data revealing a person\\'s religious or philosophical beliefs (GDPR Art. 9(1)).',\n tradeUnionMembership: 'Data revealing whether a person belongs to a trade union (GDPR Art. 9(1)).',\n genetic: 'Data about inherited or acquired genetic characteristics that gives unique information about a person\\'s physiology or health (GDPR Art. 9(1), Art. 4(13)).',\n biometric: 'Data from technical processing of physical, physiological or behavioral characteristics, special only when processed to uniquely identify a person (GDPR Art. 9(1), Art. 4(14)).',\n health: 'Data about a person\\'s physical or mental health, including health care services, that reveals their health status (GDPR Art. 9(1), Art. 4(15)).',\n sexLifeOrSexualOrientation: 'Data concerning a person\\'s sex life or sexual orientation (GDPR Art. 9(1)).'\n};\n"],"mappings":"2IAMA,MAAaA,EAAoB,CAC7B,eAAgB,qKAChB,KAAM,qHACV,EAEaC,EAAsC,CAC/C,UAAW,kKACX,KAAM,oIACN,QAAS,gTACT,OAAQ,2FACR,OAAQ,ggBACR,QAAS,iJACT,KAAM,kJACN,OAAQ,qIACR,SAAU,2LACV,WAAY,uIACZ,OAAQ,iGACR,QAAS,oMACT,MAAO,gKACP,SAAU,mFACV,UAAW,iFACX,SAAU,oEACV,UAAW,iFACX,UAAW,wDACX,SAAU,kFACV,UAAW,gEACX,QAAS,0GACT,UAAW,sHACX,QAAS,2GACT,SAAU,qNACV,eA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ywordDocs","specificationKeywordDocs","attributeDocs","contextVariableDocs","\"$identity\"","\"$env\"","\"$secrets\"","\"$strings\"","eventContextPaths","path","specialCategoryDocs"],"sources":["../../keyword-docs.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { eventContextPaths } from './event-context';\n\n// These words are contextual beneath a handler, never global property keywords.\nexport const handlerIntentDocs = {\n implementation: 'Handler-only intent with ordered hints and at most one file or tagged fence. No payload means pending. Handler execution is unsupported; this is not confirmation.',\n hint: 'One nonblank quoted implementation hint. Order and decoded text are retained; hints do not execute or confirm code.',\n};\n\nexport const keywordDocs: Record<string, string> = {\n parameter: 'A typed value declared by a specification table, or an argument of a named behavior. Table types are required; every case supplies each parameter exactly once.',\n case: 'One named concrete row of a specification table, expanded as <Specification>_<Case>. Use case.<parameter> for a whole step value.',\n example: 'One typed, possibly partial fixture: `example <Name> : <EventOrCommandOrReadModel>`. Use its name in a matching specification step; assignments override example values without changing matching or supplying defaults. Event examples may carry stream or no stream; a step replaces that route as a whole.',\n domain: 'The domain the file belongs to — optional, at most one per file, before everything else.',\n import: 'Imports a type from another module by its qualified name — `import Module.Type` — making it available by its short name; or, quoted, other `.play` files by path or glob — `import \"Orders/**/*.play\"`, relative to this file\\'s folder. Written inside a module or feature, a file import places the imported files there: their top level is that module\\'s or feature\\'s body. `import Module.Event from \"origin\"` is instead public contract metadata with an opaque origin; executable binding refuses it with PLAY0268.',\n concept: 'A formalized value type wrapping a primitive. Bare pii and secret markers travel with every usage, with optional concept notes and qualifiers.',\n type: 'A composite value type — a named shape built from several properties, referenced by events, commands and other types the same way a concept is.',\n reason: 'A free-text concept note, not a lawful basis. Written as pii reason \"...\" or secret reason \"...\"; migration preserves it verbatim.',\n optional: 'Allows a value to be absent. Write it after the type: `note String optional` or `lines InvoiceLine[] optional`. The collection itself may be absent; its items keep their declared type.',\n identifier: 'Marks the command property a runtime resolves the event source id from. At most one per command; without it a new Uuid is generated.',\n policy: 'A named authorization rule referenced by commands and queries. Multiple policies AND together.',\n purpose: 'A report-only processing declaration (GDPR Art. 30), referenced on modules, features and slices. Coverage is their union, not an authorization gate. Generated declarations are not legal advice.',\n basis: 'One declared Art. 6(1) basis: consent, contract, legalObligation, vitalInterests, publicTask or legitimateInterests; an optional quoted reference may follow.',\n interest: 'The legitimate-interest statement for basis legitimateInterests (Art. 13(1)(d)).',\n condition: 'One Art. 9(2) processing condition, optionally followed by a quoted reference.',\n subjects: 'Comma-separated categories of data subjects, as open identifiers.',\n retention: 'Declared retention period or criteria, not enforced by the model or Chronicle.',\n recipient: 'A quoted recipient category; repeatable on a purpose.',\n transfer: 'A declared destination followed by safeguard and quoted safeguards; repeatable.',\n safeguard: 'The declared safeguard accompanying a third-country transfer.',\n erasure: 'An erasure exception under Art. 17(3); Chronicle crypto-shredding remains per subject, not per purpose.',\n exception: 'One declared Art. 17(3) exception: expression, legalObligation, publicTask, publicHealth, archiving or legalClaims.',\n persona: 'A named role interacting with the application, with an optional description and its associated policies.',\n identity: 'Declares typed additional caller details from a claim, a keyed single-result query, inline code or a file. Authoring metadata only; executable use of `$identity.<detail>` reports PLAY0268 until admitted (#600).',\n authentication: 'Declares the identity providers of the application — at most one block per file.',\n provider: 'A named identity provider within `authentication`, with free-form `name value` settings.',\n description: 'A human-readable description, including the rule or case a specification witnesses, as a quoted single line or a fenced ```text block for multiple lines.',\n depends: 'Declares `depends on <Name>` on a module or feature. This opts only that container into checking counted explicit references against its own declarations; it does not change executable bytes.',\n module: 'The top-level namespace — maps to a bounded context.',\n layout: 'A reusable screen template with named slots.',\n template: 'Declares the named slots of a layout.',\n feature: 'A vertical slice grouping. Features nest arbitrarily deep.',\n slice: 'The atomic unit of behavior, aligned with Event Modeling. Has a type and a name.',\n public: 'Marks an event as a public contract. An event with from \"origin\" is also public. Origin is opaque, not a path or declaration reference. Public events and origins are admitted by executable semantic model (ESM) v9.',\n direction: 'Declare direction inbound or direction outbound once inside a Translate slice. Admitted by executable semantic model (ESM) v9; a Translate slice that uses public events must declare it (PLAY0614).',\n inbound: 'Inbound Translate direction metadata. No transport or delivery guarantee is implied.',\n outbound: 'Outbound Translate direction metadata. No transport or delivery guarantee is implied.',\n event: 'An immutable, past-tense fact. Declare it in a slice or inline with `produces event <Name>` in a command. Inline properties are typed mappings; inline tags belong to the event type.',\n documentation: 'Authoring-only reasoning on a module, feature, slice, command, event, read model or reaction in one nonempty fenced ```markdown block. It does not change executable model bytes.',\n id: 'Preserves the previous persisted event name after a rename. Leave absent on new events; repeating the current name is redundant.',\n command: 'An imperative intent. Declares authorization, validation, and what events it produces — declaratively, or via a full handler.',\n query: 'A read-side entry point mapping to a return type, with an optional description, parameters and performer.',\n observable: 'Qualifies a query return type as a live read — `query <Name> => observable <ReadModel>` keeps pushing as the read model changes, instead of answering once.',\n performer: 'The code that performs a query — a `file <Path>` reference or an inline `csharp`/`sql` block. The query\\'s counterpart to a command handler.',\n from: 'On a reaction or reducer, `from Source[.Stream]` observes only matching routed facts. It does not filter stream ids. Admitted by ESM v10. On a query parameter, fills it from the query context instead of the caller, as in `filter tenantId TenantId from $context.tenant`.',\n projection: 'Declares how events project into a read model, using the embedded Projection Declaration Language (PDL).',\n capture: 'Converts external data into events, using the embedded Change Data Capture Language (CDL).',\n reaction: 'Behavior that runs when something happens. Lives inside Automation slices. A trigger with no body states intent on its own — `file`/code is optional realization metadata.',\n runs: '`runs as system [role \"Role\" and role \"Role\"]` declares the identity for every returned or invoked command of a reaction, not imperative pipeline calls. Admitted by ESM v10 (claimed, unreleased); claims are unknown for this identity. Clock and application triggers have no Stage realization yet.',\n trigger: 'Declares a kind of occurrence a reaction can respond to, and the values it hands the reaction. What makes one occur belongs to whoever provides it, never to the compiler.',\n where: 'Narrows which occurrences actually run the reaction.',\n contains: 'Text comparison — true when the left string holds the right one anywhere.',\n every: 'Runs a reaction on an interval — `every 15 minutes`, `every 1 day`.',\n refused: 'Ordered invocation refusal branch: first match wins. Bare `on refused` covers validation and constraints, not authorization. Syntax-only, not yet executable (PLAY0268).',\n acknowledge: 'A refusal branch acknowledges alone, or produces events instead. Syntax-only, not yet executable (PLAY0268).',\n validation: 'In `on refused by validation`, selects property, concept and require refusals. Syntax-only, not yet executable (PLAY0268).',\n authorization: 'In `on refused by authorization`, explicitly selects unauthorized results, never Unsupported. Syntax-only, not yet executable (PLAY0268).',\n redelivered: '`when redelivered <Event> to <Reaction>` selects exactly one effective given occurrence by optional for, stated values and stream or no stream, without appending it again. Syntax-only, not yet executable (PLAY0268).',\n invokes: 'A command a reaction hands on. A command is asked for, not produced — it may still be rejected.',\n screen: 'A UI declaration. Supports intent, structure, and layout-with-code levels, or a full file reference.',\n constraint: 'A server-side rule enforced in the Chronicle kernel before events are committed.',\n authorize: 'References the policies that must all pass for the construct to execute.',\n validate: 'Declarative validation rules, or `validate` followed by ```csharp for imperative rules — on commands and concepts.',\n produces: 'References a declared event with `produces <Name>`, or declares one inline with `produces event <Name>`. An inline omitted `for` uses the command identifier only when all destinations are the same source; legacy plain omission allocates an identity.',\n reads: 'Declares a view consulted by a command or reaction trigger: `reads <View> [as <alias>] [by <value>]`. A reaction `by` names a value taken by its trigger; clock triggers cannot use `by`. A child by block supplies composite key parts by name, using part = source. Repeated views require unique aliases. Runtime binding is not yet supported for command or reaction reads.',\n as: 'Names an instance of a view in a command or reaction trigger reads declaration, for example `reads Account as source by sourceId`.',\n handler: 'A fully imperative command implementation — a `file <Path>` reference or an inline `csharp` block, instead of `produces`.',\n when: 'Guards a produced event or a capture append with a condition. In a labeled screen action, `when item.<field> == <literal> execute <Command>` selects the first matching command. Inside on click, double click or select, block-form `when <condition>` selects one whole action list at gesture time.',\n rule: 'Names a predicate. Bare, it states that a constraint exists without expressing what it computes — nothing resolves the name. Optionally followed by an indented `file <Path>` reference or inline `csharp` block giving it a body.',\n require: 'A policy condition: `authenticated`, `role \"...\"`, or `claim \"...\" matches ...`. Unary `not` negates a condition or group; precedence is not, and, or.',\n authenticated: 'Requires an authenticated caller.',\n role: 'Requires the caller to have the given role.',\n claim: 'Requires a claim on the caller to match a subject or value.',\n subject: 'In policy `matches subject`, the identifier of the thing acted on, not the caller. The caller is `$context.causedBy.subject`.',\n data: 'Binds a read model to a screen through a query.',\n action: 'Makes a command available on a screen. `action \"Label\"` declares one button with ordered `when … execute` alternatives over the nearest data item or selected row. No subject hides it; commands still enforce authorization and validation.',\n otherwise: 'The final fallback of a guarded action: `otherwise hidden` or `otherwise execute <Command>`. In an item interaction, bare `otherwise` opens a fallback action list. No subject runs nothing, including fallback; authorization never falls through.',\n hidden: 'Hides a guarded action when no condition matches. Without a subject the action is always hidden, even with an execute fallback.',\n execute: 'Executes a command. A guarded screen action selects it by the first matching condition; explicit `with … from` bindings precede same-name item fields, its declared form and renderer input.',\n navigate: 'Navigates to a screen, optionally passing a parameter with `by`.',\n section: 'A named structural section of a screen.',\n table: 'A table widget over a read model or child collection.',\n summary: 'A summary widget showing labeled fields.',\n column: 'A table column bound to a property.',\n field: 'A summary field bound to a property.',\n title: 'The display title of a screen or section.',\n label: 'The display label of an action, column, or field.',\n unique: 'A uniqueness constraint — `unique <property> on <EventType>` or `unique event <EventType>`.',\n concurrency: 'The concurrency scope enforced when the command appends events — dimensions: `eventSource`, `sourceType`, `streamType`, `streamId`, `events`.',\n eventSource: 'Concurrency dimension — scope the check to the event source id of the command.',\n sourceType: 'Concurrency dimension — scope the check to an event source type.',\n streamType: 'Concurrency dimension — scope the check to an event stream type.',\n streamId: 'Concurrency dimension — scope the check to an event stream id.',\n tag: 'Attaches a tag to appended events — a static identifier or string, or a `$context.` expression resolved at append time.',\n seed: 'Declares events to seed into the event store per event source id — multiple blocks accumulate.',\n for: 'Names the event source of a production or seed group. Inside `produces event`, omission uses the command identifier unless another production targets a different source.',\n readmodel: 'Declares a read model — its name and properties — in a slice, or, in a specification, read model state: `given readmodel` establishes it, `then readmodel` asserts it, `then no readmodel <View> for <key>` asserts keyed absence.',\n reducer: 'Builds a read model from events with imperative code — `reducer <Name> => <ReadModel>` with an `on <EventType>` rule per event. Use it when a projection cannot express the transition.',\n specification: 'Given/when/then acceptance criteria for a slice: prior events and state, the command, query or appended event under test, and the events, state, results, errors or denials that follow.',\n dialog: 'A dialog opened over the shell, or with `dialog template` a reusable dialog shape.',\n form: 'A form bound to a command — `form <Name> for <Command>` with a `field` per input.',\n contribute: 'Contributes entries to a slot of the shell — `contribute to Navigation` with `navigate to`, `label` and `order`.',\n theme: 'A named theme and the component packages it is compatible with.',\n ui: 'A UI profile — `ui profile <Name>` binds a target platform and size to a layout, theme and packages.',\n behavior: 'A named interaction wiring of `on <interaction>` handlers, attached to a screen, form or dialog with `uses`.',\n system: 'An application-scoped external system that operations use.',\n eventsource: 'An application-owned event source with nested streams.',\n operation: 'A reusable operation intent that uses one external system.',\n no: 'A keyed absence assertion: `then no readmodel <View> for <key>`.',\n arguments: 'The values supplied to a query asserted by `then query`.',\n result: 'One expected result - `then result [exactly]` after `when query`, or a `result` block inside `then query`. Repeat it to assert several results in authored order.',\n clock: 'The instant a specification happens at - `given clock \"2026-10-05T08:00:00Z\"` fixes when everything occurs; `when clock \"<instant>\"` is the clock reaching it, as the action.',\n exactly: 'Requires every property to match, rather than only the ones asserted - on `then readmodel`, `then query` and `then result`.',\n file: 'Delegates the implementation to an external file; the Screenplay contract stays visible.',\n key: 'Trailing modifier on a required top-level read-model property. Explicit keys replace inference. Composite keys remain authoring-only (PLAY0268, #599).',\n stream: 'On a command event production, replaces the whole command route for that event. Other productions keep the command route. Admitted by ESM v10.',\n by: 'Introduces one identifying parameter or a block of at least two named key parts. Reads use part = source; queries use part Type.',\n via: 'Connects screen data to the query that supplies it.',\n filter: 'An optional query filter parameter.',\n on: 'The event a constraint applies to, the day a schedule narrows to, or a widget interaction such as `on row-click`.',\n message: 'The validation message reported when the rule fails.',\n matches: 'Matches a value against a regular expression or a named pattern such as `email`.',\n all: 'Applies a comparison to every element of a collection.',\n max: 'Maximum length or value.',\n min: 'Minimum length or value.',\n length: 'Constrains the exact length of a value.',\n today: 'The current date.',\n empty: 'Used with `not empty` — the value must be present.',\n not: 'Negates a validation condition, as in `not empty`.',\n and: 'Both conditions must hold.',\n or: 'Either condition may hold.',\n csharp: 'An inline C# block whose opening fence is ```csharp.',\n sql: 'An inline SQL block between triple backticks — a query performer written against a relational store.',\n typescript: 'An inline TypeScript block between triple backticks.',\n react: 'An inline React/TSX block; receives the surrounding data contract as `Props`.',\n html: 'An inline static HTML block.',\n StateChange: 'Slice type — a command → events flow; something that changes the system.',\n StateView: 'Slice type — a query + projection + screen; something that reads the system.',\n Automation: 'Slice type — a reaction or reducer; something that runs when something happens.',\n Translate: 'Slice type — a capture; converts external data into events.',\n Uuid: 'Primitive type — a universally unique identifier.',\n String: 'Primitive type — a string of characters.',\n Int: 'Primitive type — an integer number.',\n Decimal: 'Primitive type — a decimal number.',\n Bool: 'Primitive type — true or false.',\n Date: 'Primitive type — a date without time.',\n DateTime: 'Primitive type — a date and time.',\n Enum: 'An enumeration concept with a fixed set of values.',\n};\n\n// What the words of a specification's steps mean there - where 'trigger', 'capture' and 'query' name what the\n// scenario exercises rather than declare one.\nexport const specificationKeywordDocs: Record<string, string> = {\n parameter: 'Declares a required typed case value: `parameter <name> <Type>`. Every case assigns it once. `optional` permits literal null but supplies no default.',\n case: 'One named complete row of a specification table. `case.<parameter>` substitutes a whole value after example overrides; each row runs as `<Specification>_<Case>`.',\n caller: '`given caller` states an explicit identity; `given caller as <Persona>` synthesizes an authenticated deterministic witness of the persona, with no body. Leftmost buildable policy alternatives are significant.',\n clock: keywordDocs.clock,\n redelivered: keywordDocs.redelivered,\n trigger: '`when trigger <Trigger>` - an application trigger fires, as the action, with the values on the lines beneath it.',\n capture: '`given capture <Capture>` - a record the capture\\'s source held before; `when capture <Capture>` - the record it sees now, as the action. The fields go on the lines beneath.',\n query: '`when query <Query>` - the query is performed, as the action, with its arguments on the lines beneath; assert what it returns with `then result` or `then no result`. `then query` instead asserts a query after another action.',\n events: '`then no events` - asserts no new events after a non-append action. Syntax-only, not yet executable (PLAY0268). Cannot accompany event, event-order, error or denial expectations.',\n result: '`then result [exactly]` - one result the query performed by `when query` returns, in order; `then no result` - it returns nothing.',\n};\n\nexport const attributeDocs: Record<string, string> = {\n pii: 'personal data (GDPR Art. 4(1)); renders Chronicle [PII]. Bare suffix marker; @pii is deprecated (PLAY0565). Not admitted by the executable model (PLAY0268).',\n personal: 'Alias of pii: personal data (GDPR Art. 4(1)); renders Chronicle [PII]. No diagnostic; canonical printing writes pii.',\n secret: 'Operational secret, not personal data: encrypted at rest without erasure and withheld from causation. Provider mapping: [Encrypted] + [NotAudited], or [PII] only with pii. Cannot be identity (PLAY0515). Not admitted by the executable model (PLAY0268).',\n sensitive: 'Deprecated spelling of secret (PLAY0565); repair to bare secret. Operational secret, not GDPR Art. 9 special-category data.',\n};\n\nexport const contextVariableDocs: Record<string, string> = {\n '$context.occurred': 'When the command or query was received.',\n '$context.tenant': 'The tenant the command or query is executing for.',\n '$context.command': 'The command being handled, shaped by its `command` declaration.',\n '$context.arguments': 'The arguments of the query being performed.',\n '$context.causedBy': 'The identity that caused the command or query — `subject`, `name`, `userName`.',\n '$context.causedBy.subject': 'The subject of the identity that caused the command or query.',\n '$context.causedBy.name': 'The display name of the identity that caused the command or query.',\n '$context.causedBy.userName': 'The user name of the identity that caused the command or query.',\n '$context.causation': 'What caused the command or query — `type`, `occurred`, `properties`.',\n '$context.causation.type': 'What caused the command or query — a command, a reactor, a schedule.',\n '$identity': 'The caller — token built-ins `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`, plus declared identity details. Built-ins are equivalent to `$context.identity`; details are authoring-only until admitted (#600).',\n '$identity.id': 'The identifier of the caller from the auth token; equivalent to `$context.identity.id`.',\n '$identity.name': 'The display name of the caller; equivalent to `$context.identity.name`.',\n '$identity.userName': 'The user name of the caller; equivalent to `$context.identity.userName`.',\n '$identity.isAuthenticated': 'Whether the caller is authenticated.',\n '$identity.roles': 'The roles the caller holds.',\n '$identity.claims': 'The claims the caller carries — `$identity.claims.<name>` reads one.',\n '$context.identity': 'The caller a decision is made about — `id`, `name`, `userName`, `isAuthenticated`, `roles`, `claims`.',\n '$context.identity.id': 'The identifier of the caller from the auth token.',\n '$context.identity.name': 'The display name of the caller.',\n '$context.identity.userName': 'The user name of the caller.',\n '$context.identity.isAuthenticated': 'Whether the caller is authenticated.',\n '$context.identity.roles': 'The roles the caller holds.',\n '$context.identity.claims': 'The claims the caller carries — `$context.identity.claims.<name>` reads one.',\n '$env': 'An environment variable, e.g. `$env.SERVICE_NAME`.',\n '$secrets': 'An encrypted secret resolved at runtime, e.g. `$secrets.azureAdClientId` — stays symbolic in the compiled tree.',\n '$strings': 'A localized string resolved from the `.strings` file of the active locale, e.g. `$strings.invoices.title`.',\n // Every $eventContext path the event-context catalog lists, for projections.\n ...Object.fromEntries(eventContextPaths.map((path) => [`$eventContext.${path.path}`, path.description])),\n};\n\n// One-sentence descriptions of the `pii special` categories (GDPR Art. 9(1)) and `pii criminal` (Art. 10).\n// The same sentences appear in Documentation/screenplay/concepts.md.\nexport const specialCategoryDocs: Record<string, string> = {\n racialOrEthnicOrigin: 'Data revealing a person\\'s racial or ethnic origin (GDPR Art. 9(1)).',\n politicalOpinions: 'Data revealing a person\\'s political opinions (GDPR Art. 9(1)).',\n religiousOrPhilosophicalBeliefs: 'Data revealing a person\\'s religious or philosophical beliefs (GDPR Art. 9(1)).',\n tradeUnionMembership: 'Data revealing whether a person belongs to a trade union (GDPR Art. 9(1)).',\n genetic: 'Data about inherited or acquired genetic characteristics that gives unique information about a person\\'s physiology or health (GDPR Art. 9(1), Art. 4(13)).',\n biometric: 'Data from technical processing of physical, physiological or behavioral characteristics, special only when processed to uniquely identify a person (GDPR Art. 9(1), Art. 4(14)).',\n health: 'Data about a person\\'s physical or mental health, including health care services, that reveals their health status (GDPR Art. 9(1), Art. 4(15)).',\n sexLifeOrSexualOrientation: 'Data concerning a person\\'s sex life or sexual orientation (GDPR Art. 9(1)).'\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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"}
@@ -0,0 +1,2 @@
1
+ import"./_virtual/_virtual/_rolldown/runtime.js";import{enclosingHeaders as e,fenceMap as t,indentOf as n}from"./document-context.js";import{responseAnalysis as r}from"./response-analysis.js";function readModelKeyCompletions(i,a,o,s){let c=e(i,t(i),a,n(o));if(c[0]!==`by`)return null;let l=c[1]??``,u=l.match(/^reads\s+([\w.]+)/),d=l.match(/^query\s+\w+\s*=>\s*(?:observable\s+)?([\w.]+)/);if(!u&&!d)return null;let f=r(i,s.authoringDocuments??s.authoringSources??[],s.authoringPlacement,s.authoringPath,s.authoringPlacementResolved),p=u?.[1]??d?.[1],m=f.readModels.filter(({model:e,scope:t})=>e.name===p||[...t,e.name].join(`.`)===p);return m.length===1?m[0].model.properties.filter(e=>e.isKey).map(e=>({label:e.name,insertText:u?`${e.name} = \${1:${e.name}}`:`${e.name} ${e.type.name}`,documentation:`Supply this read-model key part by name. Composite keys are authoring-only (PLAY0268, #599).`})):[]}export{readModelKeyCompletions};
2
+ //# sourceMappingURL=read-model-key-completions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-model-key-completions.js","names":["headers","enclosingHeaders","lines","fenceMap","line","indentOf","before","owner","read","query","analysis","responseAnalysis","symbols","name","models","model","scope","property","part"],"sources":["../../read-model-key-completions.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 { responseAnalysis } from './response-analysis';\nimport { DocumentSymbols } from './symbols';\nimport { CompletionEntry } from './completion-items';\nimport { enclosingHeaders, fenceMap, indentOf } from './document-context';\n\nexport function readModelKeyCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n const headers = enclosingHeaders(lines, fenceMap(lines), line, indentOf(before));\n if (headers[0] !== 'by') return null;\n const owner = headers[1] ?? '';\n const read = owner.match(/^reads\\s+([\\w.]+)/);\n const query = owner.match(/^query\\s+\\w+\\s*=>\\s*(?:observable\\s+)?([\\w.]+)/);\n if (!read && !query) return null;\n const analysis = responseAnalysis(lines, symbols.authoringDocuments ?? symbols.authoringSources ?? [], symbols.authoringPlacement, symbols.authoringPath, symbols.authoringPlacementResolved);\n const name = read?.[1] ?? query?.[1];\n const models = analysis.readModels.filter(({ model, scope }) => model.name === name || [...scope, model.name].join('.') === name);\n if (models.length !== 1) return [];\n const parts = models[0].model.properties.filter(property => property.isKey);\n return parts.map(part => ({ label: part.name, insertText: read ? `${part.name} = \\${1:${part.name}}` : `${part.name} ${part.type.name}`, documentation: 'Supply this read-model key part by name. Composite keys are authoring-only (PLAY0268, #599).' }));\n}\n"],"mappings":"gMAQA,SAAgB,wBAAwB,EAAiB,EAAc,EAAgB,EAAoD,CACvI,IAAMA,EAAUC,EAAiBC,EAAOC,EAASD,CAAK,EAAGE,EAAMC,EAASC,CAAM,CAAC,EAC/E,GAAIN,EAAQ,KAAO,KAAM,OAAO,KAChC,IAAMO,EAAQP,EAAQ,IAAM,GACtBQ,EAAOD,EAAM,MAAM,mBAAmB,EACtCE,EAAQF,EAAM,MAAM,gDAAgD,EAC1E,GAAI,CAACC,GAAQ,CAACC,EAAO,OAAO,KAC5B,IAAMC,EAAWC,EAAiBT,EAAOU,EAAQ,oBAAsBA,EAAQ,kBAAoB,CAAC,EAAGA,EAAQ,mBAAoBA,EAAQ,cAAeA,EAAQ,0BAA0B,EACtLC,EAAOL,IAAO,IAAMC,IAAQ,GAC5BK,EAASJ,EAAS,WAAW,QAAQ,CAAE,QAAO,WAAYK,EAAM,OAASF,GAAQ,CAAC,GAAGG,EAAOD,EAAM,IAAI,CAAC,CAAC,KAAK,GAAG,IAAMF,CAAI,EAGhI,OAFIC,EAAO,SAAW,EACRA,EAAO,EAAE,CAAC,MAAM,WAAW,OAAO,GAAYG,EAAS,KAC1D,CAAC,CAAC,IAAI,IAAS,CAAE,MAAOC,EAAK,KAAM,WAAYV,EAAO,GAAGU,EAAK,KAAK,UAAUA,EAAK,KAAK,GAAK,GAAGA,EAAK,KAAK,GAAGA,EAAK,KAAK,OAAQ,cAAe,8FAA+F,EAAE,EAFzN,CAAC,CAGrC"}
@@ -1,7 +1,7 @@
1
- import"./_virtual/_virtual/_rolldown/runtime.js";import{AuthoringProductionResolver as e}from"./compiler/Syntax/AuthoringProductionResolver.js";import{parseForAuthoring as t}from"./compiler/ScreenplayCompiler.js";import{EventSourceReadConfidence as n}from"./compiler/Syntax/EventSourceReadConfidence.js";import{parsePlacedDocuments as r}from"./compiler/Files/PlayApplicationAssembly.js";import"./compiler/index.js";import{fenceMap as i,indentOf as a,withoutComment as o}from"./document-context.js";import{exampleAnalysis as s}from"./example-analysis.js";import{personaAnalysis as c}from"./persona-analysis.js";import{dependencyTargetAnalysis as l}from"./dependency-target-analysis.js";const u=`Executable as ESM v7. Generated values require fixtures in reference execution; other unadmitted constructs still prevent binding.`,d=/* @__PURE__ */ new Map;function authoringSource(e,t){let n=i(e),r=e.flatMap((e,t)=>!n[t]&&a(e)===0&&/^\w/.test(e)?[e.split(/\s+/)[0]]:[]);if(r.includes(`module`)||!r.some(e=>[`feature`,`slice`,`command`,`event`,`operation`,`reaction`,`specification`].includes(e)))return{source:e.join(`
2
- `),locations:e.map((e,t)=>({line:t+1,column:0}))};let o=[],s=[],c=!1;e.forEach((e,t)=>{!n[t]&&a(e)===0&&/^\w/.test(e)&&(c=/^(?:concept|type|import|domain|system|eventsource|policy|persona|identity)\b/.test(e)),(c?o:s).push(t)});let l=r.includes(`feature`)?1:r.includes(`slice`)?2:3,u=t.slice(0,l);return{source:[...o.map(t=>e[t]),...u,...s.map(t=>` `.repeat(l*2)+e[t])].join(`
3
- `),locations:[...o.map(e=>({line:e+1,column:0})),...u.map(()=>({line:0,column:0})),...s.map(e=>({line:e+1,column:l*2}))]}}function analyze(u,d,f,p=`current.play`,m=!0){let h=d.map((e,t)=>typeof e==`string`?{path:`other-${t}.play`,source:e}:e).filter(e=>e.path!==p),g=[{path:p,source:u.join(`
4
- `),placement:f,isPlacementResolved:m},...h],_=new Set(g.flatMap(e=>[...e.source.matchAll(/\w+/g)].map(e=>e[0]).concat(e.placement??[]))),fresh=e=>{let t=e;for(let n=1;_.has(t);n++)t=`${e}${n}`;return _.add(t),t},v=fresh(`EditorAuthoring`),y=fresh(`FragmentFeature`),b=/* @__PURE__ */ new Set([v,y]),x=g.map((e,t)=>{let n=t===0?u:e.source.split(`
5
- `),r=fresh(`Fragment${t}`);b.add(r);let i=e.placement?.length?{source:e.source,locations:n.map((e,t)=>({line:t+1,column:0}))}:authoringSource(n,[`module ${v}`,` feature ${y}`,` slice StateChange ${r}`]);return{...e,...i,placement:e.placement??[]}}),S=x[0],C=new Map(x.map(e=>[e.path,e.locations])),w=r([...x.slice(1),S]),T=/* @__PURE__ */ new Map,E=/* @__PURE__ */ new Map,D=/* @__PURE__ */ new WeakSet,walk=e=>{if(typeof e!=`object`||!e||D.has(e))return;if(D.add(e),Array.isArray(e)){e.forEach(walk);return}let t=e;if(typeof t.path==`string`&&typeof t.line==`number`&&typeof t.column==`number`){let e=C.get(t.path)?.[t.line-1];e&&(t.line=e.line,t.column=Math.max(1,t.column-e.column))}else{for(let e of Object.values(t))walk(e);t.location?.path===p&&(t.kind===`CommandSyntax`&&T.set(t.location.line-1,e),t.kind===`SpecificationSyntax`&&E.set(t.location.line-1,e))}};walk(w.value),walk(w.physicalEventSources);for(let e of w.diagnostics)walk(e.location);let O=w.diagnostics.some(e=>{if(![`PLAY0022`,`PLAY0024`,`PLAY0029`].includes(e.code))return!1;let t=x.find(t=>t.path===e.location.path),n=g.find(t=>t.path===e.location.path)?.source.split(`
6
- `)[e.location.line-1];return t?.locations.some(e=>e.line===0)&&n!==void 0&&a(n)===0}),k=w.diagnostics.filter(e=>e.location.path===p).flatMap(e=>(walk(e.location),e.location.line>0?[e]:[])),A=new e(w.value),j=new Set(A.slices.flatMap(({slice:e})=>[...e.commands.flatMap(e=>e.produces),...e.reactions.flatMap(e=>e.triggers).flatMap(e=>e.produces)].filter(t=>t.location.path===p&&!A.isEventProduction(t,e)).map(e=>e.location.line-1)));for(let e of k)e.code===`PLAY0499`&&j.add(e.location.line-1);let M=A.declarations.filter(e=>e.kind===`operation`).map(e=>({...e.node,scope:e.scope.filter(e=>!b.has(e))})),N=/* @__PURE__ */ new Map,P=i(u),range=e=>{let t=[],n=a(u[e]);for(let r=e;r<u.length&&!(r>e&&!P[r]&&o(u[r]).trim()&&a(u[r])<=n);r++)t.push(r);return t};for(let{slice:e,scope:t}of A.slices){if(e.location.path===p&&e.location.line>0)for(let n of range(e.location.line-1))N.set(n,{scope:t});for(let n of e.specifications.filter(e=>e.location.path===p&&e.location.line>0))for(let e of range(n.location.line-1))N.set(e,{scope:t});for(let n of e.commands.filter(e=>e.location.path===p&&e.location.line>0))for(let e of range(n.location.line-1))N.set(e,{scope:t,commandLine:n.location.line-1})}let F=new Map(A.declarations.map(e=>[e.node.location,e.scope]));for(let e of M.filter(e=>e.location.path===p)){let t=F.get(e.location);for(let n of range(e.location.line-1))N.set(n,{...N.get(n),scope:t,operation:e})}let I=new Map(M.map(e=>[e.location,e])),referenceLocation=(e,t)=>{let n=o(u[e.line-1]??``),r=n.slice(e.column-1).match(/^(?:given\s+operation|then\s+(?:operation|compensated))\s+/)?.[0];return r&&n.slice(e.column-1+r.length,e.column-1+r.length+t.length)===t?{...e,column:e.column+r.length}:e},L=[];for(let{slice:e}of A.slices){for(let t of e.commands)for(let n of t.produces){if(n.location.path!==p)continue;let t=A.resolve(n.event,e),r=t.declaration?I.get(t.declaration.node.location)??null:null,i={name:n.event,location:n.location,targetLocation:n.targetLocation??n.location,kind:t.kind,declaration:r,mappings:n.mappings};if(L.push(i),t.kind===`operation`)for(let e of range(n.location.line-1)){let t=N.get(e);t&&N.set(e,{...t,production:i})}}for(let t of e.specifications)for(let n of[...t.givenOperationFailures??[],...t.thenOperations??[],...t.thenCompensated??[]]){if(n.location.path!==p)continue;let t=A.resolve(n.operation,e);L.push({name:n.operation,location:n.location,targetLocation:referenceLocation(n.location,n.operation),kind:t.kind,declaration:t.declaration?I.get(t.declaration.node.location)??null:null,mappings:[]})}}let R={declarations:M,systems:w.value.systems??[],references:L,contexts:N,types:w.value.types,concepts:w.value.concepts,targets:e=>{let t=A.slices.find(t=>t.scope.length===e.length&&t.scope.every((t,n)=>t===e[n]))?.slice;return t?M.flatMap(e=>{let n=A.resolve(e.name,t).declaration?.node.location===e.location?e.name:[...e.scope,e.name].join(`.`);return A.resolve(n,t).kind===`operation`&&A.resolve(n,t).declaration?.node.location===e.location?[{name:n,declaration:e}]:[]}):[]}},z=w.physicalEventSources.map(e=>e.source),B=new n(w.physicalEventSources,w.sourceInventoryComplete&&!O),V=/* @__PURE__ */ new Map,resolve=(e,t)=>{let n=JSON.stringify([e,t]),r=V.get(n);return r||(r=B.resolve(e,t),V.set(n,r)),{...r,source:r.state===`unique`?r.sources[0]:void 0,stream:r.state===`unique`?r.streams[0]:void 0}},H=new Set(w.value.imports.map(e=>e.qualifiedName)),U=z.flatMap(e=>e.streams.filter(t=>resolve(e.name,t.name).state===`unique`&&!H.has(`${e.name}.${t.name}`)).map(t=>({name:`${e.name}.${t.name}`,source:e,stream:t}))),W=/* @__PURE__ */ new Map,G=[];for(let e of T.values()){for(let t of range(e.location.line-1))W.set(t,{command:e});for(let t of[...e.produces,...e.validations,...e.handler?[e.handler]:[]])for(let e of range(t.location.line-1))W.delete(e);if(e.stream){G.push(e.stream);for(let t of range(e.stream.location.line-1))W.set(t,{command:e,route:e.stream})}}let K=s(w.value,p,u,range,b,w.diagnostics),q=[...[...E.values()].flatMap(e=>[...e.given.map(e=>({event:e,expectation:!1})),...e.whenAppended?[{event:e.whenAppended,expectation:!1}]:[],...e.thenEvents.map(e=>({event:e,expectation:!0})),...e.whenRedelivered?[{event:e.whenRedelivered,expectation:!0}]:[]]),...(K.eventExamples??[]).map(e=>({event:e,expectation:!0}))];for(let e of q){let t=e.event;for(let n of range(t.location.line-1))W.set(n,e);if(t.stream){G.push(t.stream);for(let n of range(t.stream.location.line-1))W.set(n,{...e,route:t.stream})}}for(let e of z.filter(e=>e.location.path===p)){for(let t of range(e.location.line-1))W.set(t,{source:e});for(let t of e.streams)for(let n of range(t.location.line-1))W.set(n,{source:e,stream:t})}let J={declarations:z,routes:G,ambiguousCandidates:[...T.values()].flatMap(e=>e.streamCandidates??[]).filter(e=>e.propertyCandidate!==null),contexts:W,targets:U,resolve},Y;return{identityDetails:(w.value.identity?.details??[]).map(e=>({name:e.name,type:`${e.type.name}${e.type.isCollection?`[]`:``}${e.type.isOptional?` optional`:``}`,line:e.location.line-1})),commands:T,specifications:E,diagnostics:k,operationProductionLines:j,operations:R,eventSources:J,examples:K,personas:c(w.value,u),dependencies:{completions(e,n,r){if(Y===void 0){let e=t(S.source,p,S.placement,!1).value,remapDependencyHeaders=e=>{walk(e.location),e.features.forEach(remapDependencyHeaders)};e.modules.forEach(remapDependencyHeaders),Y=l(w.value,e,p,range,b)}return Y.completions(e,n,r)}}}}function responseAnalysis(e,t=[],n,r=`current.play`,i=!0){let a=JSON.stringify([e,t,n,r,i]),o=d.get(a);return o===void 0&&(o=analyze(e,t,n,r,i),d.size>=16&&d.delete(d.keys().next().value),d.set(a,o)),o}export{responseAnalysis,u as responseAvailability};
1
+ import"./_virtual/_virtual/_rolldown/runtime.js";import{AuthoringProductionResolver as e}from"./compiler/Syntax/AuthoringProductionResolver.js";import{dependencySourcesOf as t}from"./compiler/Syntax/DependencySources.js";import{parseForAuthoring as n}from"./compiler/ScreenplayCompiler.js";import{EventSourceReadConfidence as r}from"./compiler/Syntax/EventSourceReadConfidence.js";import{parsePlacedDocuments as i}from"./compiler/Files/PlayApplicationAssembly.js";import"./compiler/index.js";import{fenceMap as a,indentOf as o,withoutComment as s}from"./document-context.js";import{exampleAnalysis as c}from"./example-analysis.js";import{personaAnalysis as l}from"./persona-analysis.js";import{dependencyTargetAnalysis as u}from"./dependency-target-analysis.js";const d=`Executable as ESM v7. Generated values require fixtures in reference execution; other unadmitted constructs still prevent binding.`,f=/* @__PURE__ */ new Map;function authoringSource(e,t){let n=a(e),r=e.flatMap((e,t)=>!n[t]&&o(e)===0&&/^\w/.test(e)?[e.split(/\s+/)[0]]:[]);if(r.includes(`module`)||!r.some(e=>[`feature`,`slice`,`command`,`event`,`operation`,`reaction`,`specification`].includes(e)))return{source:e.join(`
2
+ `),locations:e.map((e,t)=>({line:t+1,column:0}))};let i=[],s=[],c=!1;e.forEach((e,t)=>{!n[t]&&o(e)===0&&/^\w/.test(e)&&(c=/^(?:concept|type|import|domain|system|eventsource|policy|persona|identity)\b/.test(e)),(c?i:s).push(t)});let l=r.includes(`feature`)?1:r.includes(`slice`)?2:3,u=t.slice(0,l);return{source:[...i.map(t=>e[t]),...u,...s.map(t=>` `.repeat(l*2)+e[t])].join(`
3
+ `),locations:[...i.map(e=>({line:e+1,column:0})),...u.map(()=>({line:0,column:0})),...s.map(e=>({line:e+1,column:l*2}))]}}function analyze(d,f,p,m=`current.play`,h=!0){let g=f.map((e,t)=>typeof e==`string`?{path:`other-${t}.play`,source:e}:e).filter(e=>e.path!==m),_=[{path:m,source:d.join(`
4
+ `),placement:p,isPlacementResolved:h},...g],v=new Set(_.flatMap(e=>[...e.source.matchAll(/\w+/g)].map(e=>e[0]).concat(e.placement??[]))),fresh=e=>{let t=e;for(let n=1;v.has(t);n++)t=`${e}${n}`;return v.add(t),t},y=fresh(`EditorAuthoring`),b=fresh(`FragmentFeature`),x=/* @__PURE__ */ new Set([y,b]),S=_.map((e,t)=>{let n=t===0?d:e.source.split(`
5
+ `),r=fresh(`Fragment${t}`);x.add(r);let i=e.placement?.length?{source:e.source,locations:n.map((e,t)=>({line:t+1,column:0}))}:authoringSource(n,[`module ${y}`,` feature ${b}`,` slice StateChange ${r}`]);return{...e,...i,placement:e.placement??[]}}),C=S[0],w=new Map(S.map(e=>[e.path,e.locations])),T=i([...S.slice(1),C]),E=/* @__PURE__ */ new Map,D=/* @__PURE__ */ new Map,O=/* @__PURE__ */ new WeakSet,walk=e=>{if(typeof e!=`object`||!e||O.has(e))return;if(O.add(e),Array.isArray(e)){e.forEach(walk);return}let t=e;if(typeof t.path==`string`&&typeof t.line==`number`&&typeof t.column==`number`){let e=w.get(t.path)?.[t.line-1];e&&(t.line=e.line,t.column=Math.max(1,t.column-e.column))}else{for(let e of Object.values(t))walk(e);t.location?.path===m&&(t.kind===`CommandSyntax`&&E.set(t.location.line-1,e),t.kind===`SpecificationSyntax`&&D.set(t.location.line-1,e))}};walk(T.value),walk(T.physicalEventSources);for(let e of T.diagnostics)walk(e.location);let k=T.diagnostics.some(e=>{if(![`PLAY0022`,`PLAY0024`,`PLAY0029`].includes(e.code))return!1;let t=S.find(t=>t.path===e.location.path),n=_.find(t=>t.path===e.location.path)?.source.split(`
6
+ `)[e.location.line-1];return t?.locations.some(e=>e.line===0)&&n!==void 0&&o(n)===0}),A=T.diagnostics.filter(e=>e.location.path===m).flatMap(e=>(walk(e.location),e.location.line>0?[e]:[])),j=new e(T.value);for(let{slice:e}of j.slices)for(let n of t(e).reducers??[])walk(n);let M=new Set(j.slices.flatMap(({slice:e})=>[...e.commands.flatMap(e=>e.produces),...e.reactions.flatMap(e=>e.triggers).flatMap(e=>e.produces)].filter(t=>t.location.path===m&&!j.isEventProduction(t,e)).map(e=>e.location.line-1)));for(let e of A)e.code===`PLAY0499`&&M.add(e.location.line-1);let N=j.declarations.filter(e=>e.kind===`operation`).map(e=>({...e.node,scope:e.scope.filter(e=>!x.has(e))})),P=/* @__PURE__ */ new Map,F=a(d),range=e=>{let t=[],n=o(d[e]);for(let r=e;r<d.length&&!(r>e&&!F[r]&&s(d[r]).trim()&&o(d[r])<=n);r++)t.push(r);return t};for(let{slice:e,scope:t}of j.slices){if(e.location.path===m&&e.location.line>0)for(let n of range(e.location.line-1))P.set(n,{scope:t});for(let n of e.specifications.filter(e=>e.location.path===m&&e.location.line>0))for(let e of range(n.location.line-1))P.set(e,{scope:t});for(let n of e.commands.filter(e=>e.location.path===m&&e.location.line>0))for(let e of range(n.location.line-1))P.set(e,{scope:t,commandLine:n.location.line-1})}let I=new Map(j.declarations.map(e=>[e.node.location,e.scope]));for(let e of N.filter(e=>e.location.path===m)){let t=I.get(e.location);for(let n of range(e.location.line-1))P.set(n,{...P.get(n),scope:t,operation:e})}let L=new Map(N.map(e=>[e.location,e])),referenceLocation=(e,t)=>{let n=s(d[e.line-1]??``),r=n.slice(e.column-1).match(/^(?:given\s+operation|then\s+(?:operation|compensated))\s+/)?.[0];return r&&n.slice(e.column-1+r.length,e.column-1+r.length+t.length)===t?{...e,column:e.column+r.length}:e},R=[];for(let{slice:e}of j.slices){for(let t of e.commands)for(let n of t.produces){if(n.location.path!==m)continue;let t=j.resolve(n.event,e),r=t.declaration?L.get(t.declaration.node.location)??null:null,i={name:n.event,location:n.location,targetLocation:n.targetLocation??n.location,kind:t.kind,declaration:r,mappings:n.mappings};if(R.push(i),t.kind===`operation`)for(let e of range(n.location.line-1)){let t=P.get(e);t&&P.set(e,{...t,production:i})}}for(let t of e.specifications)for(let n of[...t.givenOperationFailures??[],...t.thenOperations??[],...t.thenCompensated??[]]){if(n.location.path!==m)continue;let t=j.resolve(n.operation,e);R.push({name:n.operation,location:n.location,targetLocation:referenceLocation(n.location,n.operation),kind:t.kind,declaration:t.declaration?L.get(t.declaration.node.location)??null:null,mappings:[]})}}let z={declarations:N,systems:T.value.systems??[],references:R,contexts:P,types:T.value.types,concepts:T.value.concepts,targets:e=>{let t=j.slices.find(t=>t.scope.length===e.length&&t.scope.every((t,n)=>t===e[n]))?.slice;return t?N.flatMap(e=>{let n=j.resolve(e.name,t).declaration?.node.location===e.location?e.name:[...e.scope,e.name].join(`.`);return j.resolve(n,t).kind===`operation`&&j.resolve(n,t).declaration?.node.location===e.location?[{name:n,declaration:e}]:[]}):[]}},B=T.physicalEventSources.map(e=>e.source),V=new r(T.physicalEventSources,T.sourceInventoryComplete&&!k),H=/* @__PURE__ */ new Map,resolve=(e,t)=>{let n=JSON.stringify([e,t]),r=H.get(n);return r||(r=V.resolve(e,t),H.set(n,r)),{...r,source:r.state===`unique`?r.sources[0]:void 0,stream:r.state===`unique`?r.streams[0]:void 0}},U=new Set(T.value.imports.map(e=>e.qualifiedName)),W=B.flatMap(e=>e.streams.filter(t=>resolve(e.name,t.name).state===`unique`&&!U.has(`${e.name}.${t.name}`)).map(t=>({name:`${e.name}.${t.name}`,source:e,stream:t}))),G=/* @__PURE__ */ new Map,K=[];for(let e of E.values()){for(let t of range(e.location.line-1))G.set(t,{command:e});for(let t of[...e.produces,...e.validations,...e.handler?[e.handler]:[]])for(let e of range(t.location.line-1))G.delete(e);if(e.stream){K.push(e.stream);for(let t of range(e.stream.location.line-1))G.set(t,{command:e,route:e.stream})}}let q=new Map(j.slices.flatMap(({slice:e})=>e.commands.map(t=>[t,e])));for(let e of E.values()){let t=q.get(e);if(t){for(let n of e.produces)if(j.isEventProduction(n,t)){for(let t of range(n.location.line-1))G.set(t,{command:e,production:!0});if(n.stream){K.push(n.stream);for(let t of range(n.stream.location.line-1))G.set(t,{command:e,production:!0,route:n.stream})}}}}for(let{slice:e}of j.slices)for(let n of[...e.reactions,...t(e).reducers??[]].filter(e=>e.location.path===m&&e.location.line>0))for(let e of range(n.location.line-1))G.set(e,{observer:n});let J=c(T.value,m,d,range,x,T.diagnostics),Y=[...[...D.values()].flatMap(e=>[...e.given.map(e=>({event:e,expectation:!1})),...e.whenAppended?[{event:e.whenAppended,expectation:!1}]:[],...e.thenEvents.map(e=>({event:e,expectation:!0})),...e.whenRedelivered?[{event:e.whenRedelivered,expectation:!0}]:[]]),...(J.eventExamples??[]).map(e=>({event:e,expectation:!0}))];for(let e of Y){let t=e.event;for(let n of range(t.location.line-1))G.set(n,e);if(t.stream){K.push(t.stream);for(let n of range(t.stream.location.line-1))G.set(n,{...e,route:t.stream})}}for(let e of B.filter(e=>e.location.path===m)){for(let t of range(e.location.line-1))G.set(t,{source:e});for(let t of e.streams)for(let n of range(t.location.line-1))G.set(n,{source:e,stream:t})}let X={declarations:B,routes:K,ambiguousCandidates:[...E.values()].flatMap(e=>e.streamCandidates??[]).filter(e=>e.propertyCandidate!==null),contexts:G,targets:W,resolve},Z;return{identityDetails:(T.value.identity?.details??[]).map(e=>({name:e.name,type:`${e.type.name}${e.type.isCollection?`[]`:``}${e.type.isOptional?` optional`:``}`,line:e.location.line-1})),commands:E,specifications:D,diagnostics:A,operationProductionLines:M,operations:z,eventSources:X,readModels:j.slices.flatMap(({slice:e,scope:t})=>(e.readModels??[]).map(e=>({model:e,scope:t.filter(e=>!x.has(e))}))),examples:J,personas:l(T.value,d),dependencies:{completions(e,t,r){if(Z===void 0){let e=n(C.source,m,C.placement,!1).value,remapDependencyHeaders=e=>{walk(e.location),e.features.forEach(remapDependencyHeaders)};e.modules.forEach(remapDependencyHeaders),Z=u(T.value,e,m,range,x)}return Z.completions(e,t,r)}}}}function responseAnalysis(e,t=[],n,r=`current.play`,i=!0){let a=JSON.stringify([e,t,n,r,i]),o=f.get(a);return o===void 0&&(o=analyze(e,t,n,r,i),f.size>=16&&f.delete(f.keys().next().value),f.set(a,o)),o}export{responseAnalysis,d as responseAvailability};
7
7
  //# sourceMappingURL=response-analysis.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"response-analysis.js","names":["responseAvailability","revisions","fences","fenceMap","lines","roots","index","indentOf","line","root","globals","body","global","depth","wrappers","headers","others","otherSources","document","path","documents","names","match","name","prefix","suffix","module","feature","syntheticScopes","preparedDocuments","sourceLines","fragment","prepared","locations","parsed","parsePlacedDocuments","commands","specifications","visited","value","node","original","child","diagnostic","unknownFragmentExtent","location","diagnostics","productions","AuthoringProductionResolver","operationProductionLines","slice","command","reaction","trigger","production","declarations","declaration","segment","contexts","result","indent","start","withoutComment","specification","declarationScopes","operation","scope","declarationsByLocation","source","references","resolved","reference","context","step","operations","entry","part","sourceDeclarations","sourceCatalog","EventSourceReadConfidence","resolutions","key","stream","importedTypeReferences","imported","targets","sourceContexts","routes","member","examples","exampleAnalysis","routeOwners","event","eventSources","candidate","dependencyAnalysis","detail","personaAnalysis","localDependencies","parseForAuthoring","dependencyTargetAnalysis","qualifier","placement","isPlacementResolved","analysis"],"sources":["../../response-analysis.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 { AuthoringProductionKind, AuthoringProductionResolver, CommandSyntax, Diagnostic, EventSourceReadConfidence, FeatureSyntax, OperationSyntax, parseForAuthoring, parsePlacedDocuments, SpecificationSyntax } from '@cratis/screenplay-compiler';\nimport { fenceMap, indentOf, withoutComment } from './document-context';\nimport { AuthoredSpecificationEvent } from './AuthoredSpecificationEvent';\nimport { ResponseAnalysis } from './ResponseAnalysis';\nimport { ExampleAnalysis } from './ExampleAnalysis';\nimport { exampleAnalysis } from './example-analysis';\nimport { personaAnalysis } from './persona-analysis';\nimport { dependencyTargetAnalysis } from './dependency-target-analysis';\nimport { EventSourceAnalysis } from './EventSourceAnalysis';\nimport { AuthoredCommandRoute } from './AuthoredCommandRoute';\nimport { AuthoringDocument } from './AuthoringDocument';\nimport { OperationAnalysis, OperationDeclaration, OperationReference } from './OperationAnalysis';\n\n// Public editor shapes are structural: packed declarations never expose the private compiler.\nexport type { AuthoringDocument } from './AuthoringDocument';\nexport type { AnalysisLocation } from './AnalysisLocation';\nexport type { AnalysisDiagnostic } from './AnalysisDiagnostic';\nexport type { AnalysisType } from './AnalysisType';\nexport type { AnalysisCommand } from './AnalysisCommand';\nexport type { AnalysisSpecification } from './AnalysisSpecification';\nexport type { CommandResponseSymbol } from './CommandResponseSymbol';\nexport type { ResponseFieldSymbol } from './ResponseFieldSymbol';\nexport type { ResponseSourceSymbol } from './ResponseSourceSymbol';\nexport type { ResponseAnalysis } from './ResponseAnalysis';\n\nexport const responseAvailability = 'Executable as ESM v7. Generated values require fixtures in reference execution; other unadmitted constructs still prevent binding.';\n\n// A bounded revision cache shared by symbols, validation, completion and hover. Index typed nodes\n// once, not by reparsing the document for each command or response field.\nconst revisions = new Map<string, ReturnType<typeof analyze>>();\n\nfunction authoringSource(lines: string[], headers: readonly string[]) {\n const fences = fenceMap(lines);\n const roots = lines.flatMap((line, index) => !fences[index] && indentOf(line) === 0 && /^\\w/.test(line) ? [line.split(/\\s+/)[0]] : []);\n if (roots.includes('module') || !roots.some(root => ['feature', 'slice', 'command', 'event', 'operation', 'reaction', 'specification'].includes(root))) {\n return { source: lines.join('\\n'), locations: lines.map((_, index) => ({ line: index + 1, column: 0 })) };\n }\n // Isolated slice/command fragments are a supported editor input. Global declarations stay global.\n const globals: number[] = [];\n const body: number[] = [];\n let global = false;\n lines.forEach((line, index) => {\n if (!fences[index] && indentOf(line) === 0 && /^\\w/.test(line)) global = /^(?:concept|type|import|domain|system|eventsource|policy|persona|identity)\\b/.test(line);\n (global ? globals : body).push(index);\n });\n const depth = roots.includes('feature') ? 1 : roots.includes('slice') ? 2 : 3;\n const wrappers = headers.slice(0, depth);\n const source = [...globals.map(index => lines[index]), ...wrappers, ...body.map(index => ' '.repeat(depth * 2) + lines[index])].join('\\n');\n const locations = [...globals.map(index => ({ line: index + 1, column: 0 })), ...wrappers.map(() => ({ line: 0, column: 0 })), ...body.map(index => ({ line: index + 1, column: depth * 2 }))];\n return { source, locations };\n}\n\nfunction analyze(lines: string[], otherSources: readonly (string | AuthoringDocument)[], placement?: readonly string[], path = 'current.play', isPlacementResolved = true): ResponseAnalysis & { readonly operations: OperationAnalysis; readonly eventSources: EventSourceAnalysis; readonly examples: ExampleAnalysis; readonly personas: ReturnType<typeof personaAnalysis>; readonly dependencies: ReturnType<typeof dependencyTargetAnalysis> } {\n const others = otherSources.map((document, index) => typeof document === 'string' ? { path: `other-${index}.play`, source: document } : document).filter(document => document.path !== path);\n const documents: AuthoringDocument[] = [{ path, source: lines.join('\\n'), placement, isPlacementResolved }, ...others];\n // Modules/features merge, but slices are real declarations: equal slice names discard later\n // documents. Share only fresh synthetic module/feature names, with a distinct synthetic slice\n // per fragment. This retains all commands for normal (including ambiguous) scope resolution,\n // without combining source texts or renaming real declarations/explicit placements. Reserve\n // source/placement names once so even a real Editor.Authoring.Fragment cannot collide.\n const names = new Set(documents.flatMap(document => [...document.source.matchAll(/\\w+/g)].map(match => match[0]).concat(document.placement ?? [])));\n const fresh = (prefix: string): string => {\n let name = prefix;\n for (let suffix = 1; names.has(name); suffix++) name = `${prefix}${suffix}`;\n names.add(name);\n return name;\n };\n const module = fresh('EditorAuthoring');\n const feature = fresh('FragmentFeature');\n const syntheticScopes = new Set([module, feature]);\n const preparedDocuments = documents.map((document, index) => {\n const sourceLines = index === 0 ? lines : document.source.split('\\n');\n const fragment = fresh(`Fragment${index}`);\n syntheticScopes.add(fragment);\n const prepared = document.placement?.length ? { source: document.source, locations: sourceLines.map((_, line) => ({ line: line + 1, column: 0 })) }\n : authoringSource(sourceLines, [`module ${module}`, ` feature ${feature}`, ` slice StateChange ${fragment}`]);\n return { ...document, ...prepared, placement: document.placement ?? [] };\n });\n const prepared = preparedDocuments[0];\n const locations = new Map(preparedDocuments.map(document => [document.path, document.locations]));\n // Put the buffer after its supplied context so duplicate real declarations are reported at\n // the current source, not silently dropped from its source-local diagnostic view.\n const parsed = parsePlacedDocuments([...preparedDocuments.slice(1), prepared]);\n const commands = new Map<number, CommandSyntax>();\n const specifications = new Map<number, SpecificationSyntax>();\n const visited = new WeakSet<object>();\n const walk = (value: unknown): void => {\n if (value === null || typeof value !== 'object' || visited.has(value)) return;\n visited.add(value);\n if (Array.isArray(value)) { value.forEach(walk); return; }\n const node = value as Record<string, unknown>;\n // Source locations also occur as standalone members (usesLocation, targetLocation).\n // Mutate each original identity once: shared locations must not be shifted twice.\n if (typeof node.path === 'string' && typeof node.line === 'number' && typeof node.column === 'number') {\n const original = locations.get(node.path)?.[node.line - 1];\n if (original) { node.line = original.line; node.column = Math.max(1, node.column - original.column); }\n return;\n }\n for (const child of Object.values(node)) walk(child);\n if ((node.location as { path?: string; line: number } | undefined)?.path === path) {\n if (node.kind === 'CommandSyntax') commands.set((node.location as { line: number }).line - 1, value as CommandSyntax);\n if (node.kind === 'SpecificationSyntax') specifications.set((node.location as { line: number }).line - 1, value as SpecificationSyntax);\n }\n };\n walk(parsed.value);\n walk(parsed.physicalEventSources);\n // Fragment wrappers must not turn an unread original root into confidence evidence.\n // Retain the parser's unknown-owner diagnostic at its original physical root location.\n for (const diagnostic of parsed.diagnostics) walk(diagnostic.location);\n const unknownFragmentExtent = parsed.diagnostics.some(diagnostic => {\n if (!['PLAY0022', 'PLAY0024', 'PLAY0029'].includes(diagnostic.code)) return false;\n const document = preparedDocuments.find(document => document.path === diagnostic.location.path);\n const original = documents.find(document => document.path === diagnostic.location.path)?.source.split('\\n')[diagnostic.location.line - 1];\n return document?.locations.some(location => location.line === 0) && original !== undefined && indentOf(original) === 0;\n });\n const diagnostics: Diagnostic[] = parsed.diagnostics.filter(diagnostic => diagnostic.location.path === path).flatMap(diagnostic => {\n walk(diagnostic.location);\n return diagnostic.location.line > 0 ? [diagnostic] : [];\n });\n const productions = new AuthoringProductionResolver(parsed.value);\n const operationProductionLines = new Set(productions.slices.flatMap(({ slice }) => [...slice.commands.flatMap(command => command.produces), ...slice.reactions.flatMap(reaction => reaction.triggers).flatMap(trigger => trigger.produces)]\n .filter(production => production.location.path === path && !productions.isEventProduction(production, slice))\n .map(production => production.location.line - 1)));\n // Rejected inline operation declarations have no syntax node, but the core parser still owns\n // the command-only kind fact. Retain it rather than suggesting an event declaration repair.\n for (const diagnostic of diagnostics) if (diagnostic.code === 'PLAY0499') operationProductionLines.add(diagnostic.location.line - 1);\n const declarations: OperationDeclaration[] = productions.declarations.filter(declaration => declaration.kind === AuthoringProductionKind.Operation)\n .map(declaration => ({ ...declaration.node as OperationSyntax, scope: declaration.scope.filter(segment => !syntheticScopes.has(segment)) }));\n const contexts = new Map<number, { scope: readonly string[]; commandLine?: number; operation?: OperationDeclaration; production?: OperationReference }>();\n // Index source ownership once per revision. Typed headers, not keyword-shaped properties,\n // define the ranges; greater-indented legacy properties remain leaves.\n const fences = fenceMap(lines);\n const range = (start: number): number[] => {\n const result: number[] = [];\n const indent = indentOf(lines[start]);\n for (let line = start; line < lines.length; line++) {\n if (line > start && !fences[line] && withoutComment(lines[line]).trim() && indentOf(lines[line]) <= indent) break;\n result.push(line);\n }\n return result;\n };\n for (const { slice, scope } of productions.slices) {\n if (slice.location.path === path && slice.location.line > 0) for (const line of range(slice.location.line - 1)) contexts.set(line, { scope });\n for (const specification of slice.specifications.filter(specification => specification.location.path === path && specification.location.line > 0)) {\n for (const line of range(specification.location.line - 1)) contexts.set(line, { scope });\n }\n for (const command of slice.commands.filter(command => command.location.path === path && command.location.line > 0)) {\n for (const line of range(command.location.line - 1)) contexts.set(line, { scope, commandLine: command.location.line - 1 });\n }\n }\n const declarationScopes = new Map(productions.declarations.map(declaration => [declaration.node.location, declaration.scope]));\n for (const operation of declarations.filter(operation => operation.location.path === path)) {\n const scope = declarationScopes.get(operation.location)!;\n for (const line of range(operation.location.line - 1)) contexts.set(line, { ...contexts.get(line), scope, operation });\n }\n const declarationsByLocation = new Map(declarations.map(declaration => [declaration.location, declaration]));\n const referenceLocation = (location: { path?: string; line: number; column: number }, name: string) => {\n const source = withoutComment(lines[location.line - 1] ?? '');\n const prefix = source.slice(location.column - 1).match(/^(?:given\\s+operation|then\\s+(?:operation|compensated))\\s+/)?.[0];\n return prefix && source.slice(location.column - 1 + prefix.length, location.column - 1 + prefix.length + name.length) === name\n ? { ...location, column: location.column + prefix.length } : location;\n };\n const references: OperationReference[] = [];\n for (const { slice } of productions.slices) {\n for (const command of slice.commands) for (const production of command.produces) {\n if (production.location.path !== path) continue;\n const resolved = productions.resolve(production.event, slice);\n const declaration = resolved.declaration ? declarationsByLocation.get(resolved.declaration.node.location) ?? null : null;\n const reference = { name: production.event, location: production.location, targetLocation: production.targetLocation ?? production.location, kind: resolved.kind, declaration, mappings: production.mappings };\n references.push(reference);\n if (resolved.kind === AuthoringProductionKind.Operation) {\n for (const line of range(production.location.line - 1)) {\n const context = contexts.get(line);\n if (context) contexts.set(line, { ...context, production: reference });\n }\n }\n }\n for (const specification of slice.specifications) {\n for (const step of [...specification.givenOperationFailures ?? [], ...specification.thenOperations ?? [], ...specification.thenCompensated ?? []]) {\n if (step.location.path !== path) continue;\n const resolved = productions.resolve(step.operation, slice);\n references.push({ name: step.operation, location: step.location, targetLocation: referenceLocation(step.location, step.operation), kind: resolved.kind,\n declaration: resolved.declaration ? declarationsByLocation.get(resolved.declaration.node.location) ?? null : null,\n mappings: [] });\n }\n }\n }\n const operations: OperationAnalysis = { declarations, systems: parsed.value.systems ?? [], references, contexts, types: parsed.value.types, concepts: parsed.value.concepts,\n targets: scope => {\n const slice = productions.slices.find(entry => entry.scope.length === scope.length && entry.scope.every((part, index) => part === scope[index]))?.slice;\n if (!slice) return [];\n return declarations.flatMap(declaration => {\n const name = productions.resolve(declaration.name, slice).declaration?.node.location === declaration.location\n ? declaration.name : [...declaration.scope, declaration.name].join('.');\n return productions.resolve(name, slice).kind === AuthoringProductionKind.Operation &&\n productions.resolve(name, slice).declaration?.node.location === declaration.location ? [{ name, declaration }] : [];\n });\n }\n };\n const sourceDeclarations = parsed.physicalEventSources.map(entry => entry.source);\n const sourceCatalog = new EventSourceReadConfidence(parsed.physicalEventSources, parsed.sourceInventoryComplete && !unknownFragmentExtent);\n const resolutions = new Map<string, ReturnType<EventSourceReadConfidence['resolve']>>();\n const resolve = (source: string, stream?: string) => {\n const key = JSON.stringify([source, stream]);\n let result = resolutions.get(key);\n if (!result) { result = sourceCatalog.resolve(source, stream); resolutions.set(key, result); }\n return { ...result, source: result.state === 'unique' ? result.sources[0] : undefined, stream: result.state === 'unique' ? result.streams[0] : undefined };\n };\n const importedTypeReferences = new Set(parsed.value.imports.map(imported => imported.qualifiedName));\n const targets = sourceDeclarations.flatMap(source => {\n return source.streams.filter(stream => resolve(source.name, stream.name).state === 'unique' && !importedTypeReferences.has(`${source.name}.${stream.name}`)).map(stream => ({ name: `${source.name}.${stream.name}`, source, stream }));\n });\n const sourceContexts = new Map<number, { command?: CommandSyntax; event?: AuthoredSpecificationEvent; expectation?: boolean; route?: AuthoredCommandRoute; source?: typeof sourceDeclarations[number]; stream?: typeof sourceDeclarations[number]['streams'][number] }>();\n const routes: AuthoredCommandRoute[] = [];\n for (const command of commands.values()) {\n for (const line of range(command.location.line - 1)) sourceContexts.set(line, { command });\n for (const member of [...command.produces, ...command.validations, ...(command.handler ? [command.handler] : [])])\n for (const line of range(member.location.line - 1)) sourceContexts.delete(line);\n // Retained ambiguity candidates are not selected authored routes.\n if (command.stream) {\n routes.push(command.stream);\n for (const line of range(command.stream.location.line - 1)) sourceContexts.set(line, { command, route: command.stream });\n }\n }\n const examples = exampleAnalysis(parsed.value, path, lines, range, syntheticScopes, parsed.diagnostics);\n const routeOwners = [\n ...[...specifications.values()].flatMap(specification => [\n ...specification.given.map(event => ({ event, expectation: false })),\n ...(specification.whenAppended ? [{ event: specification.whenAppended, expectation: false }] : []),\n ...specification.thenEvents.map(event => ({ event, expectation: true })),\n ...(specification.whenRedelivered ? [{ event: specification.whenRedelivered, expectation: true }] : [])\n ]),\n ...(examples.eventExamples ?? []).map(event => ({ event, expectation: true }))\n ];\n for (const context of routeOwners) {\n const event = context.event;\n for (const line of range(event.location.line - 1)) sourceContexts.set(line, context);\n if (event.stream) {\n routes.push(event.stream);\n for (const line of range(event.stream.location.line - 1)) sourceContexts.set(line, { ...context, route: event.stream });\n }\n }\n for (const source of sourceDeclarations.filter(source => source.location.path === path)) {\n for (const line of range(source.location.line - 1)) sourceContexts.set(line, { source });\n for (const stream of source.streams) for (const line of range(stream.location.line - 1)) sourceContexts.set(line, { source, stream });\n }\n const ambiguousCandidates = [...commands.values()].flatMap(command => command.streamCandidates ?? []).filter(candidate => candidate.propertyCandidate !== null);\n const eventSources: EventSourceAnalysis = { declarations: sourceDeclarations, routes, ambiguousCandidates, contexts: sourceContexts, targets, resolve };\n let dependencyAnalysis: ReturnType<typeof dependencyTargetAnalysis> | undefined;\n const dependencies: ReturnType<typeof dependencyTargetAnalysis> = {\n completions(line, qualifier, placement) {\n if (dependencyAnalysis === undefined) {\n // Merging restated headers retains the first header's location. Index physical typed\n // headers only when needed, so later fragments still own their incomplete lines.\n const localDependencies = parseForAuthoring(prepared.source, path, prepared.placement, false).value;\n const remapDependencyHeaders = (node: typeof localDependencies.modules[number] | FeatureSyntax): void => {\n walk(node.location);\n node.features.forEach(remapDependencyHeaders);\n };\n localDependencies.modules.forEach(remapDependencyHeaders);\n dependencyAnalysis = dependencyTargetAnalysis(parsed.value, localDependencies, path, range, syntheticScopes);\n }\n return dependencyAnalysis.completions(line, qualifier, placement);\n },\n };\n const identityDetails = (parsed.value.identity?.details ?? []).map(detail => ({ name: detail.name, type: `${detail.type.name}${detail.type.isCollection ? '[]' : ''}${detail.type.isOptional ? ' optional' : ''}`, line: detail.location.line - 1 }));\n return { identityDetails, commands, specifications, diagnostics, operationProductionLines, operations, eventSources, examples, personas: personaAnalysis(parsed.value, lines), dependencies };\n}\n\nexport function responseAnalysis(lines: string[], otherSources: readonly (string | AuthoringDocument)[] = [], placement?: readonly string[], path = 'current.play', isPlacementResolved = true): ResponseAnalysis & { readonly operations: OperationAnalysis; readonly eventSources: EventSourceAnalysis; readonly examples: ExampleAnalysis; readonly personas: ReturnType<typeof personaAnalysis>; readonly dependencies: ReturnType<typeof dependencyTargetAnalysis> } {\n const key = JSON.stringify([lines, otherSources, placement, path, isPlacementResolved]);\n let analysis = revisions.get(key);\n if (analysis === undefined) {\n analysis = analyze(lines, otherSources, placement, path, isPlacementResolved);\n if (revisions.size >= 16) revisions.delete(revisions.keys().next().value!);\n revisions.set(key, analysis);\n }\n return analysis;\n}\n"],"mappings":"6qBA4BA,MAAaA,EAAuB,qIAI9BC,kBAAY,IAAI,IAEtB,SAAS,gBAAgB,EAAiB,EAA4B,CAClE,IAAMC,EAASC,EAASC,CAAK,EACvBC,EAAQD,EAAM,SAAS,EAAM,IAAU,CAACF,EAAOI,IAAUC,EAASC,CAAI,IAAM,GAAK,MAAM,KAAKA,CAAI,EAAI,CAACA,EAAK,MAAM,KAAK,CAAC,CAAC,EAAE,EAAI,CAAC,CAAC,EACrI,GAAIH,EAAM,SAAS,QAAQ,GAAK,CAACA,EAAM,KAAK,GAAQ,CAAC,UAAW,QAAS,UAAW,QAAS,YAAa,WAAY,eAAe,CAAC,CAAC,SAASI,CAAI,CAAC,EACjJ,MAAO,CAAE,OAAQL,EAAM,KAAK;CAAI,EAAG,UAAWA,EAAM,KAAK,EAAG,KAAW,CAAE,KAAME,EAAQ,EAAG,OAAQ,CAAE,EAAE,CAAE,EAG5G,IAAMI,EAAoB,CAAC,EACrBC,EAAiB,CAAC,EACpBC,EAAS,GACbR,EAAM,SAAS,EAAM,IAAU,CACvB,CAACF,EAAOI,IAAUC,EAASC,CAAI,IAAM,GAAK,MAAM,KAAKA,CAAI,IAAG,EAAS,+EAA+E,KAAKA,CAAI,IAChKI,EAASF,EAAUC,EAAA,CAAM,KAAKL,CAAK,CACxC,CAAC,EACD,IAAMO,EAAQR,EAAM,SAAS,SAAS,EAAI,EAAIA,EAAM,SAAS,OAAO,EAAI,EAAI,EACtES,EAAWC,EAAQ,MAAM,EAAGF,CAAK,EAGvC,MAAO,CAAE,OAFM,CAAC,GAAGH,EAAQ,IAAI,GAASN,EAAME,EAAM,EAAG,GAAGQ,EAAU,GAAGH,EAAK,IAAI,GAAS,IAAI,OAAOE,EAAQ,CAAC,EAAI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K,WAAa,YAAc,KAAM,KAAMA,EAAO,SAAS,KAAO,CAAE,EAC3N,EAAG,WAAU,iBAAgB,cAAa,2BAA0B,aAAY,eAAc,WAAU,SAAUC,EAAgB/D,EAAO,MAAO9B,CAAK,EAAG,aAAA,CAhB3K,YAAY,EAAM,EAAW,EAAW,CACpC,GAAI2F,IAAuB,IAAA,GAAW,CAGlC,IAAMG,EAAoBC,EAAkBnE,EAAS,OAAQb,EAAMa,EAAS,UAAW,EAAK,CAAC,CAAC,MACxF,uBAA0B,GAAyE,CACrG,KAAKQ,EAAK,QAAQ,EAClBA,EAAK,SAAS,QAAQ,sBAAsB,CAChD,EACA0D,EAAkB,QAAQ,QAAQ,sBAAsB,EACxD,EAAqBE,EAAyBlE,EAAO,MAAOgE,EAAmB/E,EAAM,MAAOS,CAAe,CAC/G,CACA,OAAOmE,EAAmB,YAAYvF,EAAM6F,EAAWC,CAAS,CACpE,CAGsL,CAAE,CAChM,CAEA,SAAgB,iBAAiB,EAAiB,EAAwD,CAAC,EAAG,EAA+B,EAAO,eAAgB,EAAsB,GAAgR,CACtc,IAAMrB,EAAM,KAAK,UAAU,CAAC7E,EAAOa,EAAcqF,EAAWnF,EAAMoF,CAAmB,CAAC,EAClFC,EAAWvG,EAAU,IAAIgF,CAAG,EAMhC,OALIuB,IAAa,IAAA,KACb,EAAW,QAAQpG,EAAOa,EAAcqF,EAAWnF,EAAMoF,CAAmB,EACxEtG,EAAU,MAAQ,IAAIA,EAAU,OAAOA,EAAU,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAM,EACzEA,EAAU,IAAIgF,EAAKuB,CAAQ,GAExBA,CACX"}
1
+ {"version":3,"file":"response-analysis.js","names":["responseAvailability","revisions","fences","fenceMap","lines","roots","index","indentOf","line","root","globals","body","global","depth","wrappers","headers","others","otherSources","document","path","documents","names","match","name","prefix","suffix","module","feature","syntheticScopes","preparedDocuments","sourceLines","fragment","prepared","locations","parsed","parsePlacedDocuments","commands","specifications","visited","value","node","original","child","diagnostic","unknownFragmentExtent","location","diagnostics","productions","AuthoringProductionResolver","reducer","dependencySourcesOf","slice","operationProductionLines","command","reaction","trigger","production","declarations","declaration","segment","contexts","result","indent","start","withoutComment","specification","declarationScopes","operation","scope","declarationsByLocation","source","references","resolved","reference","context","step","operations","entry","part","sourceDeclarations","sourceCatalog","EventSourceReadConfidence","resolutions","key","stream","importedTypeReferences","imported","targets","sourceContexts","routes","member","commandSlices","observer","examples","exampleAnalysis","routeOwners","event","eventSources","candidate","dependencyAnalysis","detail","personaAnalysis","localDependencies","parseForAuthoring","dependencyTargetAnalysis","qualifier","placement","isPlacementResolved","analysis"],"sources":["../../response-analysis.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 { AuthoringProductionKind, AuthoringProductionResolver, CommandSyntax, dependencySourcesOf, Diagnostic, EventSourceReadConfidence, FeatureSyntax, OperationSyntax, parseForAuthoring, parsePlacedDocuments, SpecificationSyntax } from '@cratis/screenplay-compiler';\nimport { fenceMap, indentOf, withoutComment } from './document-context';\nimport { ResponseAnalysis } from './ResponseAnalysis';\nimport { ExampleAnalysis } from './ExampleAnalysis';\nimport { exampleAnalysis } from './example-analysis';\nimport { personaAnalysis } from './persona-analysis';\nimport { dependencyTargetAnalysis } from './dependency-target-analysis';\nimport { EventSourceAnalysis } from './EventSourceAnalysis';\nimport { AuthoredCommandRoute } from './AuthoredCommandRoute';\nimport { AuthoredReadModelKeys } from './AuthoredReadModelKeys';\nimport { AuthoringDocument } from './AuthoringDocument';\nimport { OperationAnalysis, OperationDeclaration, OperationReference } from './OperationAnalysis';\n\n// Public editor shapes are structural: packed declarations never expose the private compiler.\nexport type { AuthoringDocument } from './AuthoringDocument';\nexport type { AnalysisLocation } from './AnalysisLocation';\nexport type { AnalysisDiagnostic } from './AnalysisDiagnostic';\nexport type { AnalysisType } from './AnalysisType';\nexport type { AnalysisCommand } from './AnalysisCommand';\nexport type { AnalysisSpecification } from './AnalysisSpecification';\nexport type { CommandResponseSymbol } from './CommandResponseSymbol';\nexport type { ResponseFieldSymbol } from './ResponseFieldSymbol';\nexport type { ResponseSourceSymbol } from './ResponseSourceSymbol';\nexport type { ResponseAnalysis } from './ResponseAnalysis';\n\nexport const responseAvailability = 'Executable as ESM v7. Generated values require fixtures in reference execution; other unadmitted constructs still prevent binding.';\n\n// A bounded revision cache shared by symbols, validation, completion and hover. Index typed nodes\n// once, not by reparsing the document for each command or response field.\nconst revisions = new Map<string, ReturnType<typeof analyze>>();\n\nfunction authoringSource(lines: string[], headers: readonly string[]) {\n const fences = fenceMap(lines);\n const roots = lines.flatMap((line, index) => !fences[index] && indentOf(line) === 0 && /^\\w/.test(line) ? [line.split(/\\s+/)[0]] : []);\n if (roots.includes('module') || !roots.some(root => ['feature', 'slice', 'command', 'event', 'operation', 'reaction', 'specification'].includes(root))) {\n return { source: lines.join('\\n'), locations: lines.map((_, index) => ({ line: index + 1, column: 0 })) };\n }\n // Isolated slice/command fragments are a supported editor input. Global declarations stay global.\n const globals: number[] = [];\n const body: number[] = [];\n let global = false;\n lines.forEach((line, index) => {\n if (!fences[index] && indentOf(line) === 0 && /^\\w/.test(line)) global = /^(?:concept|type|import|domain|system|eventsource|policy|persona|identity)\\b/.test(line);\n (global ? globals : body).push(index);\n });\n const depth = roots.includes('feature') ? 1 : roots.includes('slice') ? 2 : 3;\n const wrappers = headers.slice(0, depth);\n const source = [...globals.map(index => lines[index]), ...wrappers, ...body.map(index => ' '.repeat(depth * 2) + lines[index])].join('\\n');\n const locations = [...globals.map(index => ({ line: index + 1, column: 0 })), ...wrappers.map(() => ({ line: 0, column: 0 })), ...body.map(index => ({ line: index + 1, column: depth * 2 }))];\n return { source, locations };\n}\n\nfunction analyze(lines: string[], otherSources: readonly (string | AuthoringDocument)[], placement?: readonly string[], path = 'current.play', isPlacementResolved = true): ResponseAnalysis & { readonly operations: OperationAnalysis; readonly eventSources: EventSourceAnalysis; readonly readModels: readonly AuthoredReadModelKeys[]; readonly examples: ExampleAnalysis; readonly personas: ReturnType<typeof personaAnalysis>; readonly dependencies: ReturnType<typeof dependencyTargetAnalysis> } {\n const others = otherSources.map((document, index) => typeof document === 'string' ? { path: `other-${index}.play`, source: document } : document).filter(document => document.path !== path);\n const documents: AuthoringDocument[] = [{ path, source: lines.join('\\n'), placement, isPlacementResolved }, ...others];\n // Modules/features merge, but slices are real declarations: equal slice names discard later\n // documents. Share only fresh synthetic module/feature names, with a distinct synthetic slice\n // per fragment. This retains all commands for normal (including ambiguous) scope resolution,\n // without combining source texts or renaming real declarations/explicit placements. Reserve\n // source/placement names once so even a real Editor.Authoring.Fragment cannot collide.\n const names = new Set(documents.flatMap(document => [...document.source.matchAll(/\\w+/g)].map(match => match[0]).concat(document.placement ?? [])));\n const fresh = (prefix: string): string => {\n let name = prefix;\n for (let suffix = 1; names.has(name); suffix++) name = `${prefix}${suffix}`;\n names.add(name);\n return name;\n };\n const module = fresh('EditorAuthoring');\n const feature = fresh('FragmentFeature');\n const syntheticScopes = new Set([module, feature]);\n const preparedDocuments = documents.map((document, index) => {\n const sourceLines = index === 0 ? lines : document.source.split('\\n');\n const fragment = fresh(`Fragment${index}`);\n syntheticScopes.add(fragment);\n const prepared = document.placement?.length ? { source: document.source, locations: sourceLines.map((_, line) => ({ line: line + 1, column: 0 })) }\n : authoringSource(sourceLines, [`module ${module}`, ` feature ${feature}`, ` slice StateChange ${fragment}`]);\n return { ...document, ...prepared, placement: document.placement ?? [] };\n });\n const prepared = preparedDocuments[0];\n const locations = new Map(preparedDocuments.map(document => [document.path, document.locations]));\n // Put the buffer after its supplied context so duplicate real declarations are reported at\n // the current source, not silently dropped from its source-local diagnostic view.\n const parsed = parsePlacedDocuments([...preparedDocuments.slice(1), prepared]);\n const commands = new Map<number, CommandSyntax>();\n const specifications = new Map<number, SpecificationSyntax>();\n const visited = new WeakSet<object>();\n const walk = (value: unknown): void => {\n if (value === null || typeof value !== 'object' || visited.has(value)) return;\n visited.add(value);\n if (Array.isArray(value)) { value.forEach(walk); return; }\n const node = value as Record<string, unknown>;\n // Source locations also occur as standalone members (usesLocation, targetLocation).\n // Mutate each original identity once: shared locations must not be shifted twice.\n if (typeof node.path === 'string' && typeof node.line === 'number' && typeof node.column === 'number') {\n const original = locations.get(node.path)?.[node.line - 1];\n if (original) { node.line = original.line; node.column = Math.max(1, node.column - original.column); }\n return;\n }\n for (const child of Object.values(node)) walk(child);\n if ((node.location as { path?: string; line: number } | undefined)?.path === path) {\n if (node.kind === 'CommandSyntax') commands.set((node.location as { line: number }).line - 1, value as CommandSyntax);\n if (node.kind === 'SpecificationSyntax') specifications.set((node.location as { line: number }).line - 1, value as SpecificationSyntax);\n }\n };\n walk(parsed.value);\n walk(parsed.physicalEventSources);\n // Fragment wrappers must not turn an unread original root into confidence evidence.\n // Retain the parser's unknown-owner diagnostic at its original physical root location.\n for (const diagnostic of parsed.diagnostics) walk(diagnostic.location);\n const unknownFragmentExtent = parsed.diagnostics.some(diagnostic => {\n if (!['PLAY0022', 'PLAY0024', 'PLAY0029'].includes(diagnostic.code)) return false;\n const document = preparedDocuments.find(document => document.path === diagnostic.location.path);\n const original = documents.find(document => document.path === diagnostic.location.path)?.source.split('\\n')[diagnostic.location.line - 1];\n return document?.locations.some(location => location.line === 0) && original !== undefined && indentOf(original) === 0;\n });\n const diagnostics: Diagnostic[] = parsed.diagnostics.filter(diagnostic => diagnostic.location.path === path).flatMap(diagnostic => {\n walk(diagnostic.location);\n return diagnostic.location.line > 0 ? [diagnostic] : [];\n });\n const productions = new AuthoringProductionResolver(parsed.value);\n for (const { slice } of productions.slices) for (const reducer of dependencySourcesOf(slice).reducers ?? []) walk(reducer);\n const operationProductionLines = new Set(productions.slices.flatMap(({ slice }) => [...slice.commands.flatMap(command => command.produces), ...slice.reactions.flatMap(reaction => reaction.triggers).flatMap(trigger => trigger.produces)]\n .filter(production => production.location.path === path && !productions.isEventProduction(production, slice))\n .map(production => production.location.line - 1)));\n // Rejected inline operation declarations have no syntax node, but the core parser still owns\n // the command-only kind fact. Retain it rather than suggesting an event declaration repair.\n for (const diagnostic of diagnostics) if (diagnostic.code === 'PLAY0499') operationProductionLines.add(diagnostic.location.line - 1);\n const declarations: OperationDeclaration[] = productions.declarations.filter(declaration => declaration.kind === AuthoringProductionKind.Operation)\n .map(declaration => ({ ...declaration.node as OperationSyntax, scope: declaration.scope.filter(segment => !syntheticScopes.has(segment)) }));\n const contexts = new Map<number, { scope: readonly string[]; commandLine?: number; operation?: OperationDeclaration; production?: OperationReference }>();\n // Index source ownership once per revision. Typed headers, not keyword-shaped properties,\n // define the ranges; greater-indented legacy properties remain leaves.\n const fences = fenceMap(lines);\n const range = (start: number): number[] => {\n const result: number[] = [];\n const indent = indentOf(lines[start]);\n for (let line = start; line < lines.length; line++) {\n if (line > start && !fences[line] && withoutComment(lines[line]).trim() && indentOf(lines[line]) <= indent) break;\n result.push(line);\n }\n return result;\n };\n for (const { slice, scope } of productions.slices) {\n if (slice.location.path === path && slice.location.line > 0) for (const line of range(slice.location.line - 1)) contexts.set(line, { scope });\n for (const specification of slice.specifications.filter(specification => specification.location.path === path && specification.location.line > 0)) {\n for (const line of range(specification.location.line - 1)) contexts.set(line, { scope });\n }\n for (const command of slice.commands.filter(command => command.location.path === path && command.location.line > 0)) {\n for (const line of range(command.location.line - 1)) contexts.set(line, { scope, commandLine: command.location.line - 1 });\n }\n }\n const declarationScopes = new Map(productions.declarations.map(declaration => [declaration.node.location, declaration.scope]));\n for (const operation of declarations.filter(operation => operation.location.path === path)) {\n const scope = declarationScopes.get(operation.location)!;\n for (const line of range(operation.location.line - 1)) contexts.set(line, { ...contexts.get(line), scope, operation });\n }\n const declarationsByLocation = new Map(declarations.map(declaration => [declaration.location, declaration]));\n const referenceLocation = (location: { path?: string; line: number; column: number }, name: string) => {\n const source = withoutComment(lines[location.line - 1] ?? '');\n const prefix = source.slice(location.column - 1).match(/^(?:given\\s+operation|then\\s+(?:operation|compensated))\\s+/)?.[0];\n return prefix && source.slice(location.column - 1 + prefix.length, location.column - 1 + prefix.length + name.length) === name\n ? { ...location, column: location.column + prefix.length } : location;\n };\n const references: OperationReference[] = [];\n for (const { slice } of productions.slices) {\n for (const command of slice.commands) for (const production of command.produces) {\n if (production.location.path !== path) continue;\n const resolved = productions.resolve(production.event, slice);\n const declaration = resolved.declaration ? declarationsByLocation.get(resolved.declaration.node.location) ?? null : null;\n const reference = { name: production.event, location: production.location, targetLocation: production.targetLocation ?? production.location, kind: resolved.kind, declaration, mappings: production.mappings };\n references.push(reference);\n if (resolved.kind === AuthoringProductionKind.Operation) {\n for (const line of range(production.location.line - 1)) {\n const context = contexts.get(line);\n if (context) contexts.set(line, { ...context, production: reference });\n }\n }\n }\n for (const specification of slice.specifications) {\n for (const step of [...specification.givenOperationFailures ?? [], ...specification.thenOperations ?? [], ...specification.thenCompensated ?? []]) {\n if (step.location.path !== path) continue;\n const resolved = productions.resolve(step.operation, slice);\n references.push({ name: step.operation, location: step.location, targetLocation: referenceLocation(step.location, step.operation), kind: resolved.kind,\n declaration: resolved.declaration ? declarationsByLocation.get(resolved.declaration.node.location) ?? null : null,\n mappings: [] });\n }\n }\n }\n const operations: OperationAnalysis = { declarations, systems: parsed.value.systems ?? [], references, contexts, types: parsed.value.types, concepts: parsed.value.concepts,\n targets: scope => {\n const slice = productions.slices.find(entry => entry.scope.length === scope.length && entry.scope.every((part, index) => part === scope[index]))?.slice;\n if (!slice) return [];\n return declarations.flatMap(declaration => {\n const name = productions.resolve(declaration.name, slice).declaration?.node.location === declaration.location\n ? declaration.name : [...declaration.scope, declaration.name].join('.');\n return productions.resolve(name, slice).kind === AuthoringProductionKind.Operation &&\n productions.resolve(name, slice).declaration?.node.location === declaration.location ? [{ name, declaration }] : [];\n });\n }\n };\n const sourceDeclarations = parsed.physicalEventSources.map(entry => entry.source);\n const sourceCatalog = new EventSourceReadConfidence(parsed.physicalEventSources, parsed.sourceInventoryComplete && !unknownFragmentExtent);\n const resolutions = new Map<string, ReturnType<EventSourceReadConfidence['resolve']>>();\n const resolve = (source: string, stream?: string) => {\n const key = JSON.stringify([source, stream]);\n let result = resolutions.get(key);\n if (!result) { result = sourceCatalog.resolve(source, stream); resolutions.set(key, result); }\n return { ...result, source: result.state === 'unique' ? result.sources[0] : undefined, stream: result.state === 'unique' ? result.streams[0] : undefined };\n };\n const importedTypeReferences = new Set(parsed.value.imports.map(imported => imported.qualifiedName));\n const targets = sourceDeclarations.flatMap(source => {\n return source.streams.filter(stream => resolve(source.name, stream.name).state === 'unique' && !importedTypeReferences.has(`${source.name}.${stream.name}`)).map(stream => ({ name: `${source.name}.${stream.name}`, source, stream }));\n });\n const sourceContexts = new Map<number, EventSourceAnalysis['contexts'] extends ReadonlyMap<number, infer Context> ? Context : never>();\n const routes: AuthoredCommandRoute[] = [];\n for (const command of commands.values()) {\n for (const line of range(command.location.line - 1)) sourceContexts.set(line, { command });\n for (const member of [...command.produces, ...command.validations, ...(command.handler ? [command.handler] : [])])\n for (const line of range(member.location.line - 1)) sourceContexts.delete(line);\n // Retained ambiguity candidates are not selected authored routes.\n if (command.stream) {\n routes.push(command.stream);\n for (const line of range(command.stream.location.line - 1)) sourceContexts.set(line, { command, route: command.stream });\n }\n }\n const commandSlices = new Map(productions.slices.flatMap(({ slice }) => slice.commands.map(command => [command, slice] as const)));\n for (const command of commands.values()) {\n const slice = commandSlices.get(command);\n if (!slice) continue;\n for (const production of command.produces) {\n if (!productions.isEventProduction(production, slice)) continue;\n for (const line of range(production.location.line - 1)) sourceContexts.set(line, { command, production: true });\n if (production.stream) {\n routes.push(production.stream);\n for (const line of range(production.stream.location.line - 1)) sourceContexts.set(line, { command, production: true, route: production.stream });\n }\n }\n }\n for (const { slice } of productions.slices) {\n for (const observer of [...slice.reactions, ...dependencySourcesOf(slice).reducers ?? []].filter(observer => observer.location.path === path && observer.location.line > 0)) {\n for (const line of range(observer.location.line - 1)) sourceContexts.set(line, { observer });\n }\n }\n const examples = exampleAnalysis(parsed.value, path, lines, range, syntheticScopes, parsed.diagnostics);\n const routeOwners = [\n ...[...specifications.values()].flatMap(specification => [\n ...specification.given.map(event => ({ event, expectation: false })),\n ...(specification.whenAppended ? [{ event: specification.whenAppended, expectation: false }] : []),\n ...specification.thenEvents.map(event => ({ event, expectation: true })),\n ...(specification.whenRedelivered ? [{ event: specification.whenRedelivered, expectation: true }] : [])\n ]),\n ...(examples.eventExamples ?? []).map(event => ({ event, expectation: true }))\n ];\n for (const context of routeOwners) {\n const event = context.event;\n for (const line of range(event.location.line - 1)) sourceContexts.set(line, context);\n if (event.stream) {\n routes.push(event.stream);\n for (const line of range(event.stream.location.line - 1)) sourceContexts.set(line, { ...context, route: event.stream });\n }\n }\n for (const source of sourceDeclarations.filter(source => source.location.path === path)) {\n for (const line of range(source.location.line - 1)) sourceContexts.set(line, { source });\n for (const stream of source.streams) for (const line of range(stream.location.line - 1)) sourceContexts.set(line, { source, stream });\n }\n const ambiguousCandidates = [...commands.values()].flatMap(command => command.streamCandidates ?? []).filter(candidate => candidate.propertyCandidate !== null);\n const eventSources: EventSourceAnalysis = { declarations: sourceDeclarations, routes, ambiguousCandidates, contexts: sourceContexts, targets, resolve };\n let dependencyAnalysis: ReturnType<typeof dependencyTargetAnalysis> | undefined;\n const dependencies: ReturnType<typeof dependencyTargetAnalysis> = {\n completions(line, qualifier, placement) {\n if (dependencyAnalysis === undefined) {\n // Merging restated headers retains the first header's location. Index physical typed\n // headers only when needed, so later fragments still own their incomplete lines.\n const localDependencies = parseForAuthoring(prepared.source, path, prepared.placement, false).value;\n const remapDependencyHeaders = (node: typeof localDependencies.modules[number] | FeatureSyntax): void => {\n walk(node.location);\n node.features.forEach(remapDependencyHeaders);\n };\n localDependencies.modules.forEach(remapDependencyHeaders);\n dependencyAnalysis = dependencyTargetAnalysis(parsed.value, localDependencies, path, range, syntheticScopes);\n }\n return dependencyAnalysis.completions(line, qualifier, placement);\n },\n };\n const identityDetails = (parsed.value.identity?.details ?? []).map(detail => ({ name: detail.name, type: `${detail.type.name}${detail.type.isCollection ? '[]' : ''}${detail.type.isOptional ? ' optional' : ''}`, line: detail.location.line - 1 }));\n return { identityDetails, commands, specifications, diagnostics, operationProductionLines, operations, eventSources, readModels: productions.slices.flatMap(({ slice, scope }) => (slice.readModels ?? []).map(model => ({ model, scope: scope.filter(segment => !syntheticScopes.has(segment)) }))), examples, personas: personaAnalysis(parsed.value, lines), dependencies };\n}\n\nexport function responseAnalysis(lines: string[], otherSources: readonly (string | AuthoringDocument)[] = [], placement?: readonly string[], path = 'current.play', isPlacementResolved = true): ResponseAnalysis & { readonly operations: OperationAnalysis; readonly eventSources: EventSourceAnalysis; readonly readModels: readonly AuthoredReadModelKeys[]; readonly examples: ExampleAnalysis; readonly personas: ReturnType<typeof personaAnalysis>; readonly dependencies: ReturnType<typeof dependencyTargetAnalysis> } {\n const key = JSON.stringify([lines, otherSources, placement, path, isPlacementResolved]);\n let analysis = revisions.get(key);\n if (analysis === undefined) {\n analysis = analyze(lines, otherSources, placement, path, isPlacementResolved);\n if (revisions.size >= 16) revisions.delete(revisions.keys().next().value!);\n revisions.set(key, analysis);\n }\n return analysis;\n}\n"],"mappings":"0vBA4BA,MAAaA,EAAuB,qIAI9BC,kBAAY,IAAI,IAEtB,SAAS,gBAAgB,EAAiB,EAA4B,CAClE,IAAMC,EAASC,EAASC,CAAK,EACvBC,EAAQD,EAAM,SAAS,EAAM,IAAU,CAACF,EAAOI,IAAUC,EAASC,CAAI,IAAM,GAAK,MAAM,KAAKA,CAAI,EAAI,CAACA,EAAK,MAAM,KAAK,CAAC,CAAC,EAAE,EAAI,CAAC,CAAC,EACrI,GAAIH,EAAM,SAAS,QAAQ,GAAK,CAACA,EAAM,KAAK,GAAQ,CAAC,UAAW,QAAS,UAAW,QAAS,YAAa,WAAY,eAAe,CAAC,CAAC,SAASI,CAAI,CAAC,EACjJ,MAAO,CAAE,OAAQL,EAAM,KAAK;CAAI,EAAG,UAAWA,EAAM,KAAK,EAAG,KAAW,CAAE,K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AAiB,EAAiB,EAAwD,CAAC,EAAG,EAA+B,EAAO,eAAgB,EAAsB,GAAuU,CAC7f,IAAMvB,EAAM,KAAK,UAAU,CAAC/E,EAAOa,EAAcyF,EAAWvF,EAAMwF,CAAmB,CAAC,EAClFC,EAAW3G,EAAU,IAAIkF,CAAG,EAMhC,OALIyB,IAAa,IAAA,KACb,EAAW,QAAQxG,EAAOa,EAAcyF,EAAWvF,EAAMwF,CAAmB,EACxE1G,EAAU,MAAQ,IAAIA,EAAU,OAAOA,EAAU,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAM,EACzEA,EAAU,IAAIkF,EAAKyB,CAAQ,GAExBA,CACX"}
@@ -7,7 +7,7 @@ import"./_virtual/_virtual/_rolldown/runtime.js";import{documentationItem as e}f
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}
9
9
  `,documentation:`A reaction or reducer; something that runs when something happens.`},{label:`slice Translate`,insertText:`slice Translate \${1:Name}
10
- `,documentation:`A capture; converts external data into events.`},{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],o=[e,{label:`description`,insertText:'description "${1:what one instance holds}"',documentation:`A human-readable description.`},{label:`file`,insertText:"file ${1:Path}",documentation:`Names the file this read model is realized by.`},{label:`property`,insertText:"${1:property} ${2:Type}",documentation:`A property of the read model — a name and a type reference.`}],s=[{label:`description`,insertText:'description "${1:what the reducer does}"',documentation:`A human-readable description.`},{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.`}],c=[{label:`description`,insertText:'description "${1:input surface intent}"',documentation:`Report-only description of the form.`},{label:`populate via query`,insertText:"populate via query ${1:Query} by ${2:parameter}",documentation:`Fills the form from a query before it is shown.`},{label:`populate from item`,insertText:`populate from item`,documentation:`Fills the form from the item the screen was opened for.`},{label:`field`,insertText:'field ${1:property} label "${2:Label}"',documentation:`A form field bound to a command property.`},...r],l=[{label:`navigate to`,insertText:"navigate to ${1:Screen}",documentation:`The screen the entry opens.`},{label:`label`,insertText:'label "${1:Label}"',documentation:`The text of the entry.`},{label:`order`,insertText:"order ${1:10}",documentation:`Where the entry sits among the others; lower comes first.`}],u=[{label:`description`,insertText:'description "${1:what the behavior does}"',documentation:`A human-readable description.`},{label:`parameter`,insertText:"parameter ${1:name} ${2:Type}",documentation:`A value the behavior is given where it is attached.`},{label:`order`,insertText:"order ${1:10}",documentation:`The order behaviors attached to the same element run in.`},{label:`on`,insertText:"on ${1|click,select,submit,change,load,unload,enter,leave|}\n ${2:execute command}",documentation:`Wires what happens on an interaction.`}],step=(e,t,n)=>({label:e,insertText:t,documentation:n}),d=[step(`execute`,"execute ${1:command}",`Runs a command.`),step(`navigate to`,"navigate to ${1:Screen}",`Opens a screen.`),step(`open`,"open ${1:Dialog}",`Opens a dialog.`),step(`close`,`close`,`Closes the dialog.`),step(`refresh`,"refresh ${1:query}",`Reloads a query.`),step(`set`,"set ${1:name} ${2:value}",`Sets a value.`),step(`notify`,'notify ${1|info,warning,error|} "${2:message}"',`Shows a notification.`),step(`confirm`,`confirm \${1:message}
10
+ `,documentation:`A capture; converts external data into events.`},{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],o=[e,{label:`description`,insertText:'description "${1:what one instance holds}"',documentation:`A human-readable description.`},{label:`file`,insertText:"file ${1:Path}",documentation:`Names the file this read model is realized by.`},{label:`property`,insertText:"${1:property} ${2:Type}",documentation:`A property of the read model — a name and a type reference.`}],s=[{label:`from`,insertText:"from ${1:Source.Stream}",documentation:`Observe matching routed facts only, without filtering stream ids. ESM v10.`},{label:`description`,insertText:'description "${1:what the reducer does}"',documentation:`A human-readable description.`},{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.`}],c=[{label:`description`,insertText:'description "${1:input surface intent}"',documentation:`Report-only description of the form.`},{label:`populate via query`,insertText:"populate via query ${1:Query} by ${2:parameter}",documentation:`Fills the form from a query before it is shown.`},{label:`populate from item`,insertText:`populate from item`,documentation:`Fills the form from the item the screen was opened for.`},{label:`field`,insertText:'field ${1:property} label "${2:Label}"',documentation:`A form field bound to a command property.`},...r],l=[{label:`navigate to`,insertText:"navigate to ${1:Screen}",documentation:`The screen the entry opens.`},{label:`label`,insertText:'label "${1:Label}"',documentation:`The text of the entry.`},{label:`order`,insertText:"order ${1:10}",documentation:`Where the entry sits among the others; lower comes first.`}],u=[{label:`description`,insertText:'description "${1:what the behavior does}"',documentation:`A human-readable description.`},{label:`parameter`,insertText:"parameter ${1:name} ${2:Type}",documentation:`A value the behavior is given where it is attached.`},{label:`order`,insertText:"order ${1:10}",documentation:`The order behaviors attached to the same element run in.`},{label:`on`,insertText:"on ${1|click,select,submit,change,load,unload,enter,leave|}\n ${2:execute command}",documentation:`Wires what happens on an interaction.`}],step=(e,t,n)=>({label:e,insertText:t,documentation:n}),d=[step(`execute`,"execute ${1:command}",`Runs a command.`),step(`navigate to`,"navigate to ${1:Screen}",`Opens a screen.`),step(`open`,"open ${1:Dialog}",`Opens a dialog.`),step(`close`,`close`,`Closes the dialog.`),step(`refresh`,"refresh ${1:query}",`Reloads a query.`),step(`set`,"set ${1:name} ${2:value}",`Sets a value.`),step(`notify`,'notify ${1|info,warning,error|} "${2:message}"',`Shows a notification.`),step(`confirm`,`confirm \${1:message}
11
11
  on success
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
@@ -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: '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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,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,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","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 interaction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B,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,2 +1,2 @@
1
- import"./_virtual/_virtual/_rolldown/runtime.js";import{clauseKeywords as e,codeBlockTags as t,constructKeywords as n,primitiveTypes as r,sliceTypes as i}from"./language.js";import{bmpWordCharacters as a}from"./bmp-word-characters.js";const o=/* @__PURE__ */ new Set([`operation`,`system`,`eventsource`,`purpose`,`runs`]),s={csharp:`csharp`,typescript:`typescript`,react:`typescript`,html:`html`,sql:`sql`};function subLanguageState(e){return`subLanguage_${e}`}function subLanguageExitRule(e){let t=[...n.filter(e=>!o.has(e)),...e.map(e=>e.keyword)];return[RegExp(`^\\s*(?:${t.join(`|`)})\\b`),{token:`@rematch`,next:`@pop`}]}const c=[[/\/\/.*$/,`comment`],[/\$(?:context|identity|eventContext|eventSourceId|causedBy|refusal)(?:\.\w+)*/,`variable.predefined`],[/\$(?:env|secrets|strings)\.[\w.]+/,`variable.predefined`],[/\$\.[\w.]*/,`variable.predefined`],[/"(?:[^"\\]|\\.)*"/,`string`],[/"(?:[^"\\]|\\.)*$/,`string.invalid`],[/\d+(?:ms|s|m|h|d)\b/,`number`],[/-?\d+\.\d+/,`number.float`],[/-?\d+/,`number`],[/=>|==|!=|>=|<=|[><=:?]/,`operator`],[/[[\](),.]/,`delimiter`],[/\s+/,`white`]];function createTokensProvider(l){let u={root:[[RegExp(`^(\\s*)(example)(\\s+)([A-Z][${a}]*)(\\s*)(:)(\\s*)([A-Z][${a}.]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,`type.identifier`,`white`,`operator`,`white`,`type.identifier`]],[/^(\s*)(direction)(\s+)(inbound|outbound)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`]],[RegExp(`^()(purpose)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@purposeBody.$1`}]],[/^(\s*)(parameter)(\s+)([a-z_]\w*)(\s+)([\w.]+(?:\[\])?(?:\s+optional)?)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`identifier`,`white`,`type.identifier`]],[/^(\s*)(case)(\s+)([A-Za-z_]\w*)(?=\s*(?:[a-z_]\w*\s*=|\/\/|$))/,[`white`,`keyword`,`white`,`type.identifier`]],[/\b(case)(\.)([a-z_]\w*)\b/,[`keyword`,`delimiter`,`identifier`]],[/^(\s*)(concept)(\s+)([^\s:]+)(\s*:\s*)(\w+)((?:\s+(?:@?pii|personal|@?sensitive|secret))*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`,`operator`,{token:`type.identifier`,next:`@conceptBody.$1`},`keyword`]],[/^(numbers)([ \t]+)(exact)(?=[ \t]*(?:(?:\/\/|#).*)?$)/,[`keyword`,`white`,`keyword`]],[/^(eventsource)(\s+)([A-Za-z_]\w*)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,`type.identifier`]],[/^(system)(\s+)([A-Z]\w*)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,`type.identifier`]],[/^(\s*)(runs)(\s+)(as)(\s+)(system)\b/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(produces\s+operation)(\s+)([A-Z]\w*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@operationBody.$1`}]],[/^(\s*)(given\s+operation)(\s+)([\w.]+)(\s+)(fails)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`]],[/^(\s*)(then\s+(?:operation|compensated))(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`]],[RegExp(`^(\\s*)(command)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@commandBody.$1`}]],[/^(\s*)(handler)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@handlerBody.$1`}]],[/^(\s*@?[a-z_]\w*\s+)([\w.]+(?:\[\])?(?:\?|\s+optional)?)(\s+)(generated)(\s+identifier|)(?=\s*(?:\/\/.*)?$)/,[`identifier`,`type.identifier`,`white`,`keyword`,`keyword`]],[/^(\s*)(generated)(\s+)([a-z_]\w*)(\s*=(?!=|>))/,[`white`,`keyword`,`white`,`identifier`,`operator`]],[/^(\s*)(then)(\s+)(returns)\b/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(returns)(?=\s*(?:\/\/.*)?$|\s+@\w+\s*(?:\/\/.*)?$)/,[`white`,`keyword`]],[/^(\s*(?:by|filter)\s+[a-z_]\w*\s+)([\w.]+(?:\[\])?)(\s+)(optional)\b(?=\s*(?:from\b|\/\/|$))/,[`identifier`,`type.identifier`,`white`,`keyword`]],[/^(?!\s*(?:by|filter)\s+)(\s*@?[a-z_]\w*\s+)([\w.]+(?:\[\])?)(\s+)(optional)\b(?=\s*(?:identifier\b|from\b|=(?!=|>)|\/\/|$))/,[`identifier`,`type.identifier`,`white`,`keyword`]],[/^(\s*query\s+[A-Za-z_]\w*\s*=>\s*(?!observable\s+optional\s*(?:\/\/.*)?$)(?:observable\s+)?)([\w.]+(?:\[\])?)(\s+)(optional)\b(?=\s*(?:\/\/.*)?$)/,[`keyword`,`type.identifier`,`white`,`keyword`]],[RegExp(`^(\\s*)(given)(\\s+)(caller)(\\s+)(as)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(given|when)(\s+)(clock|capture|trigger|query)\b/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(then)(\s+)(result|no\s+(?:result|events))\b/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(then)(\s+)(events)(\s+)(in any order)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(when)(\s+)(redelivered)(\s+)([\w.]+)(\s+)(to)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(otherwise)(\s+)(hidden)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(otherwise)(\s+)(execute)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(when)(\s+)(?=.+\s+execute\s+[\w.]+\s*(?:\/\/.*)?$)/,[`white`,`keyword`,{token:`white`,next:`@guardedActionCondition`}]],[/^(\s*)(behavior)(\s+)([A-Za-z_]\w*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@behaviorBody.$1`}]],[/^(\s*)(on)(\s+)(refused)(\s+)(by)(\s+)(validation|constraint|authorization)\b/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(on)(\s+)(refused)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(on)(\s+)([\w-]+)\b/,[`white`,`keyword`,`white`,{token:`keyword`,next:`@interactionBody.$1`}]],[/^(\s*)(acknowledge)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`]],[/^(\s*)(import)(\s+)("[^"\\]*")/,[`white`,`keyword`,`white`,`string.link`]],[/^(\s*)((?:(?:produces|public)\s+)?event)(\s+)([A-Za-z_]\w*)(\s+)(generation)(\s+)(\d+)(?=\s*(?:from\s+"(?:[^"\\]|\\.)*"\s*)?(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`,`white`,{token:`number`,next:`@eventBody.$1`}]],[/^(\s*)((?:(?:produces|public)\s+)?event)(\s+)([A-Za-z_]\w*)(?=\s*(?:from\s+"(?:[^"\\]|\\.)*"\s*)?(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@eventBody.$1`}]],...t.map(e=>[RegExp(`^\\s*\\x60\\x60\\x60${e}\\s*$`),{token:`string.quote`,next:`@codeBlock.${s[e]}`,nextEmbedded:s[e]}]),...t.map(e=>[RegExp(`\\b${e}\\b(?=\\s*$)`),{token:`keyword.tag`,next:`@codeBlockPending.${s[e]}`}]),...l.map(e=>[RegExp(`\\b${e.keyword}\\b`),{token:`keyword`,next:`@${subLanguageState(e.keyword)}`}]),[/^(\s*)(documentation)(?=\s+[\w.]+(?:\[\])?(?:\?|\s+optional)?\s*(?:identifier\b|generated\b|=(?!=|>)|\/\/|$))/,[`white`,`identifier`]],[/\b(?:description|documentation)\b(?=\s*(?:\/\/.*)?$)/,{token:`keyword`,next:`@descriptionBlockPending`}],[/\brow-click\b/,`keyword`],[/^\s*@[a-z_]\w*/,`identifier`],[/@\w+/,`annotation`],[/[A-Z]\w*/,{cases:{"@sliceTypes":`keyword.type`,"@primitiveTypes":`type`,"@default":`type.identifier`}}],[/[a-z_]\w*/,{cases:{"@keywords":`keyword`,"@default":`identifier`}}],{include:`@common`}],guardedActionCondition:[[/(execute)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,{token:`type.identifier`,next:`@pop`}]],{include:`@root`}],behaviorBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],{include:`@root`}],interactionBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(otherwise)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`]],[/^(\s*)(when)(\s+)(?=item\.|\()/,[`white`,`keyword`,`white`]],[/^(\s*)(execute)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`]],{include:`@root`}],purposeBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(basis|interest|condition|authorization|subjects|retention|recipient|transfer|erasure)(\s+)/,[`white`,`keyword`,`white`]],[/\b(safeguard|exception)\b/,`keyword`],{include:`@root`}],conceptBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(@?pii|personal|@?sensitive|secret)(\s+)(reason|scope|special|criminal)\b/,[`white`,`keyword`,`white`,`keyword`]],{include:`@root`}],commandBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(validate)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@commandValidation.$1`}]],{include:`@root`}],commandValidation:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[RegExp(`^(\\s*)([${a}.]+)(\\s+)(rule)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?:severity\\s+\\w+|message\\s+.*|//.*|$))`),[`white`,`identifier`,`white`,`keyword`,`white`,{token:`type.identifier`,next:`@namedRuleBody.$1`}]],{include:`@root`}],namedRuleBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(implementation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@implementationBody.$1`}]],{include:`@root`}],operationBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(execute|compensate)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@operationPhase.$1`}]],[/^(\s*)(uses)(\s+)([A-Z]\w*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(@?[a-z_]\w*)(\s+)([\w.]+(?:\[\])?(?:\?|\s+optional)?)(?=\s*(?:=(?!=|>)|\/\/|$))/,[`white`,`identifier`,`white`,`type.identifier`]],{include:`@root`}],operationPhase:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(implementation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@implementationBody.$1`}]],{include:`@root`}],handlerBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(implementation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@implementationBody.$1`}]],{include:`@root`}],implementationBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(hint)(?=\s+")/,[`white`,`keyword`]],{include:`@root`}],eventBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(id)(?=\s+")/,[`white`,`keyword`]],[/^(\s*)(documentation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@descriptionBlockPending`}]],{include:`@root`}],common:c,codeBlockPending:[[/^\s*```\s*$/,{token:`string.quote`,switchTo:`@codeBlock.$S2`,nextEmbedded:`$S2`}],[/^\s*[^\s`].*$/,{token:`@rematch`,next:`@pop`}],[/\s+/,`white`]],codeBlock:[[/^\s*```\s*$/,{token:`string.quote`,next:`@pop`,nextEmbedded:`@pop`}],[/[^`]+/,``],[/`/,``]],descriptionBlockPending:[[/\/\/.*$/,`comment`],[/^\s*```(?:text|markdown)?\s*$/,{token:`string.quote`,switchTo:`@descriptionBlock`}],[/^\s*[^\s`].*$/,{token:`@rematch`,next:`@pop`}],[/\s+/,`white`]],descriptionBlock:[[/^\s*```\s*$/,{token:`string.quote`,next:`@pop`}],[/.+/,`string`]]};for(let e of l)u[subLanguageState(e.keyword)]=[subLanguageExitRule(l),...e.tokens,{include:`@common`},[/[A-Z]\w*/,`type.identifier`],[/[a-z_]\w*/,`identifier`]];return{defaultToken:``,tokenPostfix:`.play`,ignoreCase:!1,keywords:[...n.filter(e=>!o.has(e)),...e,...t],sliceTypes:i,primitiveTypes:r,tokenizer:u}}export{c as commonTokenRules,createTokensProvider};
1
+ import"./_virtual/_virtual/_rolldown/runtime.js";import{clauseKeywords as e,codeBlockTags as t,constructKeywords as n,primitiveTypes as r,sliceTypes as i}from"./language.js";import{bmpWordCharacters as a}from"./bmp-word-characters.js";const o=/* @__PURE__ */ new Set([`operation`,`system`,`eventsource`,`purpose`,`runs`]),s={csharp:`csharp`,typescript:`typescript`,react:`typescript`,html:`html`,sql:`sql`};function subLanguageState(e){return`subLanguage_${e}`}function subLanguageExitRule(e){let t=[...n.filter(e=>!o.has(e)),...e.map(e=>e.keyword)];return[RegExp(`^\\s*(?:${t.join(`|`)})\\b`),{token:`@rematch`,next:`@pop`}]}const c=[[/\/\/.*$/,`comment`],[/\$(?:context|identity|eventContext|eventSourceId|causedBy|refusal)(?:\.\w+)*/,`variable.predefined`],[/\$(?:env|secrets|strings)\.[\w.]+/,`variable.predefined`],[/\$\.[\w.]*/,`variable.predefined`],[/"(?:[^"\\]|\\.)*"/,`string`],[/"(?:[^"\\]|\\.)*$/,`string.invalid`],[/\d+(?:ms|s|m|h|d)\b/,`number`],[/-?\d+\.\d+/,`number.float`],[/-?\d+/,`number`],[/=>|==|!=|>=|<=|[><=:?]/,`operator`],[/[[\](),.]/,`delimiter`],[/\s+/,`white`]];function createTokensProvider(l){let u={root:[[RegExp(`^(\\s*)(example)(\\s+)([A-Z][${a}]*)(\\s*)(:)(\\s*)([A-Z][${a}.]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,`type.identifier`,`white`,`operator`,`white`,`type.identifier`]],[/^(\s*)(direction)(\s+)(inbound|outbound)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`]],[RegExp(`^()(purpose)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@purposeBody.$1`}]],[/^(\s*)(parameter)(\s+)([a-z_]\w*)(\s+)([\w.]+(?:\[\])?(?:\s+optional)?)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`identifier`,`white`,`type.identifier`]],[/^(\s*)(case)(\s+)([A-Za-z_]\w*)(?=\s*(?:[a-z_]\w*\s*=|\/\/|$))/,[`white`,`keyword`,`white`,`type.identifier`]],[/\b(case)(\.)([a-z_]\w*)\b/,[`keyword`,`delimiter`,`identifier`]],[/^(\s*)(concept)(\s+)([^\s:]+)(\s*:\s*)(\w+)((?:\s+(?:@?pii|personal|@?sensitive|secret))*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`,`operator`,{token:`type.identifier`,next:`@conceptBody.$1`},`keyword`]],[/^(numbers)([ \t]+)(exact)(?=[ \t]*(?:(?:\/\/|#).*)?$)/,[`keyword`,`white`,`keyword`]],[/^(eventsource)(\s+)([A-Za-z_]\w*)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,`type.identifier`]],[/^(system)(\s+)([A-Z]\w*)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,`type.identifier`]],[/^(\s*)(runs)(\s+)(as)(\s+)(system)\b/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(produces\s+operation)(\s+)([A-Z]\w*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@operationBody.$1`}]],[/^(\s*)(given\s+operation)(\s+)([\w.]+)(\s+)(fails)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`]],[/^(\s*)(then\s+(?:operation|compensated))(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`]],[RegExp(`^(\\s*)(command)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@commandBody.$1`}]],[/^(\s*)(handler)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@handlerBody.$1`}]],[/^(\s*@?[a-z_]\w*\s+)([\w.]+(?:\[\])?(?:\?|\s+optional)?)(\s+)(generated)(\s+identifier|)(?=\s*(?:\/\/.*)?$)/,[`identifier`,`type.identifier`,`white`,`keyword`,`keyword`]],[/^(\s*)(generated)(\s+)([a-z_]\w*)(\s*=(?!=|>))/,[`white`,`keyword`,`white`,`identifier`,`operator`]],[/^(\s*)(then)(\s+)(returns)\b/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(returns)(?=\s*(?:\/\/.*)?$|\s+@\w+\s*(?:\/\/.*)?$)/,[`white`,`keyword`]],[/^(\s*@?[a-z_]\w*\s+)([\w.]+)(\s+)(key)(?=\s*(?:\/\/.*)?$)/,[`identifier`,`type.identifier`,`white`,`keyword`]],[/^(\s*(?:by|filter)\s+[a-z_]\w*\s+)([\w.]+(?:\[\])?)(\s+)(optional)\b(?=\s*(?:from\b|\/\/|$))/,[`identifier`,`type.identifier`,`white`,`keyword`]],[/^(?!\s*(?:by|filter)\s+)(\s*@?[a-z_]\w*\s+)([\w.]+(?:\[\])?)(\s+)(optional)\b(?=\s*(?:identifier\b|from\b|=(?!=|>)|\/\/|$))/,[`identifier`,`type.identifier`,`white`,`keyword`]],[/^(\s*query\s+[A-Za-z_]\w*\s*=>\s*(?!observable\s+optional\s*(?:\/\/.*)?$)(?:observable\s+)?)([\w.]+(?:\[\])?)(\s+)(optional)\b(?=\s*(?:\/\/.*)?$)/,[`keyword`,`type.identifier`,`white`,`keyword`]],[RegExp(`^(\\s*)(given)(\\s+)(caller)(\\s+)(as)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?://.*)?$)`),[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(given|when)(\s+)(clock|capture|trigger|query)\b/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(then)(\s+)(result|no\s+(?:result|events))\b/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(then)(\s+)(events)(\s+)(in any order)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(when)(\s+)(redelivered)(\s+)([\w.]+)(\s+)(to)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(otherwise)(\s+)(hidden)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(otherwise)(\s+)(execute)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(when)(\s+)(?=.+\s+execute\s+[\w.]+\s*(?:\/\/.*)?$)/,[`white`,`keyword`,{token:`white`,next:`@guardedActionCondition`}]],[/^(\s*)(behavior)(\s+)([A-Za-z_]\w*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@behaviorBody.$1`}]],[/^(\s*)(on)(\s+)(refused)(\s+)(by)(\s+)(validation|constraint|authorization)\b/,[`white`,`keyword`,`white`,`keyword`,`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(on)(\s+)(refused)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`keyword`]],[/^(\s*)(on)(\s+)([\w-]+)\b/,[`white`,`keyword`,`white`,{token:`keyword`,next:`@interactionBody.$1`}]],[/^(\s*)(acknowledge)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`]],[/^(\s*)(import)(\s+)("[^"\\]*")/,[`white`,`keyword`,`white`,`string.link`]],[/^(\s*)((?:(?:produces|public)\s+)?event)(\s+)([A-Za-z_]\w*)(\s+)(generation)(\s+)(\d+)(?=\s*(?:from\s+"(?:[^"\\]|\\.)*"\s*)?(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`,`white`,`keyword`,`white`,{token:`number`,next:`@eventBody.$1`}]],[/^(\s*)((?:(?:produces|public)\s+)?event)(\s+)([A-Za-z_]\w*)(?=\s*(?:from\s+"(?:[^"\\]|\\.)*"\s*)?(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,{token:`type.identifier`,next:`@eventBody.$1`}]],...t.map(e=>[RegExp(`^\\s*\\x60\\x60\\x60${e}\\s*$`),{token:`string.quote`,next:`@codeBlock.${s[e]}`,nextEmbedded:s[e]}]),...t.map(e=>[RegExp(`\\b${e}\\b(?=\\s*$)`),{token:`keyword.tag`,next:`@codeBlockPending.${s[e]}`}]),...l.map(e=>[RegExp(`\\b${e.keyword}\\b`),{token:`keyword`,next:`@${subLanguageState(e.keyword)}`}]),[/^(\s*)(documentation)(?=\s+[\w.]+(?:\[\])?(?:\?|\s+optional)?\s*(?:identifier\b|generated\b|=(?!=|>)|\/\/|$))/,[`white`,`identifier`]],[/\b(?:description|documentation)\b(?=\s*(?:\/\/.*)?$)/,{token:`keyword`,next:`@descriptionBlockPending`}],[/\brow-click\b/,`keyword`],[/^\s*@[a-z_]\w*/,`identifier`],[/@\w+/,`annotation`],[/[A-Z]\w*/,{cases:{"@sliceTypes":`keyword.type`,"@primitiveTypes":`type`,"@default":`type.identifier`}}],[/[a-z_]\w*/,{cases:{"@keywords":`keyword`,"@default":`identifier`}}],{include:`@common`}],guardedActionCondition:[[/(execute)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`keyword`,`white`,{token:`type.identifier`,next:`@pop`}]],{include:`@root`}],behaviorBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],{include:`@root`}],interactionBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(otherwise)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`]],[/^(\s*)(when)(\s+)(?=item\.|\()/,[`white`,`keyword`,`white`]],[/^(\s*)(execute)(\s+)([\w.]+)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`]],{include:`@root`}],purposeBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(basis|interest|condition|authorization|subjects|retention|recipient|transfer|erasure)(\s+)/,[`white`,`keyword`,`white`]],[/\b(safeguard|exception)\b/,`keyword`],{include:`@root`}],conceptBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(@?pii|personal|@?sensitive|secret)(\s+)(reason|scope|special|criminal)\b/,[`white`,`keyword`,`white`,`keyword`]],{include:`@root`}],commandBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(validate)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@commandValidation.$1`}]],{include:`@root`}],commandValidation:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[RegExp(`^(\\s*)([${a}.]+)(\\s+)(rule)(\\s+)([A-Za-z_][${a}]*)(?=\\s*(?:severity\\s+\\w+|message\\s+.*|//.*|$))`),[`white`,`identifier`,`white`,`keyword`,`white`,{token:`type.identifier`,next:`@namedRuleBody.$1`}]],{include:`@root`}],namedRuleBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(implementation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@implementationBody.$1`}]],{include:`@root`}],operationBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(execute|compensate)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@operationPhase.$1`}]],[/^(\s*)(uses)(\s+)([A-Z]\w*)(?=\s*(?:\/\/.*)?$)/,[`white`,`keyword`,`white`,`type.identifier`]],[/^(\s*)(@?[a-z_]\w*)(\s+)([\w.]+(?:\[\])?(?:\?|\s+optional)?)(?=\s*(?:=(?!=|>)|\/\/|$))/,[`white`,`identifier`,`white`,`type.identifier`]],{include:`@root`}],operationPhase:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(implementation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@implementationBody.$1`}]],{include:`@root`}],handlerBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(implementation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@implementationBody.$1`}]],{include:`@root`}],implementationBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(hint)(?=\s+")/,[`white`,`keyword`]],{include:`@root`}],eventBody:[[/^(?!$S2[ \t]+|\s*$)/,{token:`@rematch`,next:`@pop`}],[/^(\s*)(id)(?=\s+")/,[`white`,`keyword`]],[/^(\s*)(documentation)(?=\s*(?:\/\/.*)?$)/,[`white`,{token:`keyword`,next:`@descriptionBlockPending`}]],{include:`@root`}],common:c,codeBlockPending:[[/^\s*```\s*$/,{token:`string.quote`,switchTo:`@codeBlock.$S2`,nextEmbedded:`$S2`}],[/^\s*[^\s`].*$/,{token:`@rematch`,next:`@pop`}],[/\s+/,`white`]],codeBlock:[[/^\s*```\s*$/,{token:`string.quote`,next:`@pop`,nextEmbedded:`@pop`}],[/[^`]+/,``],[/`/,``]],descriptionBlockPending:[[/\/\/.*$/,`comment`],[/^\s*```(?:text|markdown)?\s*$/,{token:`string.quote`,switchTo:`@descriptionBlock`}],[/^\s*[^\s`].*$/,{token:`@rematch`,next:`@pop`}],[/\s+/,`white`]],descriptionBlock:[[/^\s*```\s*$/,{token:`string.quote`,next:`@pop`}],[/.+/,`string`]]};for(let e of l)u[subLanguageState(e.keyword)]=[subLanguageExitRule(l),...e.tokens,{include:`@common`},[/[A-Z]\w*/,`type.identifier`],[/[a-z_]\w*/,`identifier`]];return{defaultToken:``,tokenPostfix:`.play`,ignoreCase:!1,keywords:[...n.filter(e=>!o.has(e)),...e,...t],sliceTypes:i,primitiveTypes:r,tokenizer:u}}export{c as commonTokenRules,createTokensProvider};
2
2
  //# sourceMappingURL=tokens.js.map