@cratis/screenplay-language 0.1.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 (147) hide show
  1. package/README.md +52 -0
  2. package/completion-items.ts +128 -0
  3. package/completion-planner.ts +111 -0
  4. package/completions.ts +112 -0
  5. package/diagnostics.ts +52 -0
  6. package/dist/completion-items.d.ts +23 -0
  7. package/dist/completion-items.d.ts.map +1 -0
  8. package/dist/completion-items.js +105 -0
  9. package/dist/completion-items.js.map +1 -0
  10. package/dist/completion-planner.d.ts +25 -0
  11. package/dist/completion-planner.d.ts.map +1 -0
  12. package/dist/completion-planner.js +90 -0
  13. package/dist/completion-planner.js.map +1 -0
  14. package/dist/completions.d.ts +4 -0
  15. package/dist/completions.d.ts.map +1 -0
  16. package/dist/completions.js +78 -0
  17. package/dist/completions.js.map +1 -0
  18. package/dist/diagnostics.d.ts +5 -0
  19. package/dist/diagnostics.d.ts.map +1 -0
  20. package/dist/diagnostics.js +47 -0
  21. package/dist/diagnostics.js.map +1 -0
  22. package/dist/document-context.d.ts +5 -0
  23. package/dist/document-context.d.ts.map +1 -0
  24. package/dist/document-context.js +45 -0
  25. package/dist/document-context.js.map +1 -0
  26. package/dist/hover-content.d.ts +2 -0
  27. package/dist/hover-content.d.ts.map +1 -0
  28. package/dist/hover-content.js +64 -0
  29. package/dist/hover-content.js.map +1 -0
  30. package/dist/hover.d.ts +3 -0
  31. package/dist/hover.d.ts.map +1 -0
  32. package/dist/hover.js +15 -0
  33. package/dist/hover.js.map +1 -0
  34. package/dist/index.d.ts +23 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +54 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/keyword-docs.d.ts +4 -0
  39. package/dist/keyword-docs.d.ts.map +1 -0
  40. package/dist/keyword-docs.js +100 -0
  41. package/dist/keyword-docs.js.map +1 -0
  42. package/dist/language.d.ts +12 -0
  43. package/dist/language.d.ts.map +1 -0
  44. package/dist/language.js +117 -0
  45. package/dist/language.js.map +1 -0
  46. package/dist/sub-language-registry.d.ts +20 -0
  47. package/dist/sub-language-registry.d.ts.map +1 -0
  48. package/dist/sub-language-registry.js +18 -0
  49. package/dist/sub-language-registry.js.map +1 -0
  50. package/dist/sub-languages/capture/CompletionProvider.d.ts +32 -0
  51. package/dist/sub-languages/capture/CompletionProvider.d.ts.map +1 -0
  52. package/dist/sub-languages/capture/CompletionProvider.js +332 -0
  53. package/dist/sub-languages/capture/CompletionProvider.js.map +1 -0
  54. package/dist/sub-languages/capture/HoverProvider.d.ts +8 -0
  55. package/dist/sub-languages/capture/HoverProvider.d.ts.map +1 -0
  56. package/dist/sub-languages/capture/HoverProvider.js +87 -0
  57. package/dist/sub-languages/capture/HoverProvider.js.map +1 -0
  58. package/dist/sub-languages/capture/Validator.d.ts +6 -0
  59. package/dist/sub-languages/capture/Validator.d.ts.map +1 -0
  60. package/dist/sub-languages/capture/Validator.js +72 -0
  61. package/dist/sub-languages/capture/Validator.js.map +1 -0
  62. package/dist/sub-languages/capture/index.d.ts +6 -0
  63. package/dist/sub-languages/capture/index.d.ts.map +1 -0
  64. package/dist/sub-languages/capture/index.js +58 -0
  65. package/dist/sub-languages/capture/index.js.map +1 -0
  66. package/dist/sub-languages/capture/language.d.ts +6 -0
  67. package/dist/sub-languages/capture/language.d.ts.map +1 -0
  68. package/dist/sub-languages/capture/language.js +160 -0
  69. package/dist/sub-languages/capture/language.js.map +1 -0
  70. package/dist/sub-languages/cdl.d.ts +3 -0
  71. package/dist/sub-languages/cdl.d.ts.map +1 -0
  72. package/dist/sub-languages/cdl.js +74 -0
  73. package/dist/sub-languages/cdl.js.map +1 -0
  74. package/dist/sub-languages/pdl.d.ts +3 -0
  75. package/dist/sub-languages/pdl.d.ts.map +1 -0
  76. package/dist/sub-languages/pdl.js +67 -0
  77. package/dist/sub-languages/pdl.js.map +1 -0
  78. package/dist/sub-languages/projection/CodeActionProvider.d.ts +18 -0
  79. package/dist/sub-languages/projection/CodeActionProvider.d.ts.map +1 -0
  80. package/dist/sub-languages/projection/CodeActionProvider.js +93 -0
  81. package/dist/sub-languages/projection/CodeActionProvider.js.map +1 -0
  82. package/dist/sub-languages/projection/CompletionProvider.d.ts +41 -0
  83. package/dist/sub-languages/projection/CompletionProvider.d.ts.map +1 -0
  84. package/dist/sub-languages/projection/CompletionProvider.js +591 -0
  85. package/dist/sub-languages/projection/CompletionProvider.js.map +1 -0
  86. package/dist/sub-languages/projection/HoverProvider.d.ts +24 -0
  87. package/dist/sub-languages/projection/HoverProvider.d.ts.map +1 -0
  88. package/dist/sub-languages/projection/HoverProvider.js +298 -0
  89. package/dist/sub-languages/projection/HoverProvider.js.map +1 -0
  90. package/dist/sub-languages/projection/Validator.d.ts +22 -0
  91. package/dist/sub-languages/projection/Validator.d.ts.map +1 -0
  92. package/dist/sub-languages/projection/Validator.js +339 -0
  93. package/dist/sub-languages/projection/Validator.js.map +1 -0
  94. package/dist/sub-languages/projection/index.d.ts +49 -0
  95. package/dist/sub-languages/projection/index.d.ts.map +1 -0
  96. package/dist/sub-languages/projection/index.js +160 -0
  97. package/dist/sub-languages/projection/index.js.map +1 -0
  98. package/dist/sub-languages/projection/language.d.ts +5 -0
  99. package/dist/sub-languages/projection/language.d.ts.map +1 -0
  100. package/dist/sub-languages/projection/language.js +171 -0
  101. package/dist/sub-languages/projection/language.js.map +1 -0
  102. package/dist/symbols.d.ts +45 -0
  103. package/dist/symbols.d.ts.map +1 -0
  104. package/dist/symbols.js +100 -0
  105. package/dist/symbols.js.map +1 -0
  106. package/dist/themes/screenplay-dark.d.ts +4 -0
  107. package/dist/themes/screenplay-dark.d.ts.map +1 -0
  108. package/dist/themes/screenplay-dark.js +29 -0
  109. package/dist/themes/screenplay-dark.js.map +1 -0
  110. package/dist/themes/screenplay-light.d.ts +4 -0
  111. package/dist/themes/screenplay-light.d.ts.map +1 -0
  112. package/dist/themes/screenplay-light.js +29 -0
  113. package/dist/themes/screenplay-light.js.map +1 -0
  114. package/dist/tokens.d.ts +5 -0
  115. package/dist/tokens.d.ts.map +1 -0
  116. package/dist/tokens.js +121 -0
  117. package/dist/tokens.js.map +1 -0
  118. package/dist/validation.d.ts +10 -0
  119. package/dist/validation.d.ts.map +1 -0
  120. package/dist/validation.js +101 -0
  121. package/dist/validation.js.map +1 -0
  122. package/document-context.ts +51 -0
  123. package/hover-content.ts +76 -0
  124. package/hover.ts +23 -0
  125. package/index.ts +98 -0
  126. package/keyword-docs.ts +102 -0
  127. package/language.ts +130 -0
  128. package/package.json +44 -0
  129. package/sub-language-registry.ts +42 -0
  130. package/sub-languages/capture/CompletionProvider.ts +365 -0
  131. package/sub-languages/capture/HoverProvider.ts +99 -0
  132. package/sub-languages/capture/Validator.ts +97 -0
  133. package/sub-languages/capture/index.ts +72 -0
  134. package/sub-languages/capture/language.ts +176 -0
  135. package/sub-languages/cdl.ts +76 -0
  136. package/sub-languages/pdl.ts +69 -0
  137. package/sub-languages/projection/CodeActionProvider.ts +123 -0
  138. package/sub-languages/projection/CompletionProvider.ts +653 -0
  139. package/sub-languages/projection/HoverProvider.ts +338 -0
  140. package/sub-languages/projection/Validator.ts +387 -0
  141. package/sub-languages/projection/index.ts +223 -0
  142. package/sub-languages/projection/language.ts +193 -0
  143. package/symbols.ts +161 -0
  144. package/themes/screenplay-dark.ts +32 -0
  145. package/themes/screenplay-light.ts +32 -0
  146. package/tokens.ts +145 -0
  147. package/validation.ts +145 -0
@@ -0,0 +1,100 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export const keywordDocs = {
4
+ domain: 'The domain the file belongs to — optional, at most one per file, before everything else.',
5
+ import: 'Imports a type from another module; it becomes available by its short name.',
6
+ concept: 'A formalized value type wrapping a primitive. Attributes such as `@pii` travel with every usage.',
7
+ policy: 'A named authorization rule referenced by commands and queries. Multiple policies AND together.',
8
+ persona: 'A named role interacting with the application, with an optional description and its associated policies.',
9
+ authentication: 'Declares the identity providers of the application — at most one block per file.',
10
+ provider: 'A named identity provider within `authentication`, with free-form `name value` settings.',
11
+ description: 'A human-readable description of a module, feature, slice, persona, or command — the first body line, as a quoted single line or a fenced ``` block for multiple lines.',
12
+ module: 'The top-level namespace — maps to a bounded context.',
13
+ layout: 'A reusable screen template with named slots.',
14
+ template: 'Declares the named slots of a layout.',
15
+ feature: 'A vertical slice grouping. Features nest arbitrarily deep.',
16
+ slice: 'The atomic unit of behavior, aligned with Event Modeling. Has a type and a name.',
17
+ event: 'An event type — an immutable, past-tense fact. Properties use concepts or primitives.',
18
+ command: 'An imperative intent. Declares authorization, validation, and what events it produces — declaratively, or via a full handler.',
19
+ query: 'A read-side entry point mapping to a return type.',
20
+ projection: 'Declares how events project into a read model, using the embedded Projection Declaration Language (PDL).',
21
+ capture: 'Converts external data into events, using the embedded Change Data Capture Language (CDL).',
22
+ reactor: 'Reacts to events and produces side effects. Lives inside Automation slices.',
23
+ screen: 'A UI declaration. Supports intent, structure, and layout-with-code levels, or a full file reference.',
24
+ constraint: 'A server-side rule enforced in the Chronicle kernel before events are committed.',
25
+ authorize: 'References the policies that must all pass for the construct to execute.',
26
+ validate: 'Declarative validation rules, or `validate csharp` for imperative rules — on commands and concepts.',
27
+ produces: 'Declares the events a command emits — single, multiple, or conditional.',
28
+ handler: 'A fully imperative command implementation — a `file <Path>` reference or an inline `csharp` block, instead of `produces`.',
29
+ when: 'Guards a produced event or a capture append with a condition.',
30
+ require: 'A policy condition: `authenticated`, `role "..."`, or `claim "..." matches ...`.',
31
+ authenticated: 'Requires an authenticated caller.',
32
+ role: 'Requires the caller to have the given role.',
33
+ claim: 'Requires a claim on the caller to match a subject or value.',
34
+ subject: 'The subject (identity) of the caller.',
35
+ data: 'Binds a read model to a screen through a query.',
36
+ action: 'Makes a command available as an action on a screen.',
37
+ navigate: 'Navigates to a screen, optionally passing a parameter with `by`.',
38
+ section: 'A named structural section of a screen.',
39
+ table: 'A table widget over a read model or child collection.',
40
+ summary: 'A summary widget showing labeled fields.',
41
+ column: 'A table column bound to a property.',
42
+ field: 'A summary field bound to a property.',
43
+ title: 'The display title of a screen or section.',
44
+ label: 'The display label of an action, column, or field.',
45
+ unique: 'A uniqueness constraint — `unique <property> on <EventType>` or `unique event <EventType>`.',
46
+ concurrency: 'The concurrency scope enforced when the command appends events — dimensions: `eventSource`, `sourceType`, `streamType`, `streamId`, `events`.',
47
+ eventSource: 'Concurrency dimension — scope the check to the event source id of the command.',
48
+ sourceType: 'Concurrency dimension — scope the check to an event source type.',
49
+ streamType: 'Concurrency dimension — scope the check to an event stream type.',
50
+ streamId: 'Concurrency dimension — scope the check to an event stream id.',
51
+ tag: 'Attaches a tag to appended events — a static identifier or string, or a `$context.` expression resolved at append time.',
52
+ seed: 'Declares events to seed into the event store per event source id — multiple blocks accumulate.',
53
+ for: 'Introduces a seed group — the events to seed for one event source id.',
54
+ readmodel: 'Read model state in a specification — `given readmodel` establishes it, `then readmodel` asserts it.',
55
+ file: 'Delegates the implementation to an external file; the Screenplay contract stays visible.',
56
+ by: 'Introduces the identifying parameter.',
57
+ via: 'Connects screen data to the query that supplies it.',
58
+ filter: 'An optional query filter parameter.',
59
+ on: 'The event a reactor or constraint applies to, or a widget interaction such as `on row-click`.',
60
+ message: 'The validation message reported when the rule fails.',
61
+ matches: 'Matches a value against a regular expression or a named pattern such as `email`.',
62
+ all: 'Applies a comparison to every element of a collection.',
63
+ max: 'Maximum length or value.',
64
+ min: 'Minimum length or value.',
65
+ length: 'Constrains the exact length of a value.',
66
+ today: 'The current date.',
67
+ empty: 'Used with `not empty` — the value must be present.',
68
+ not: 'Negates a validation condition, as in `not empty`.',
69
+ and: 'Both conditions must hold.',
70
+ or: 'Either condition may hold.',
71
+ csharp: 'An inline C# block between triple backticks.',
72
+ typescript: 'An inline TypeScript block between triple backticks.',
73
+ react: 'An inline React/TSX block; receives the surrounding data contract as `Props`.',
74
+ html: 'An inline static HTML block.',
75
+ StateChange: 'Slice type — a command → events flow; something that changes the system.',
76
+ StateView: 'Slice type — a query + projection + screen; something that reads the system.',
77
+ Automation: 'Slice type — a reactor or reducer; something that reacts to events.',
78
+ Translate: 'Slice type — a capture; converts external data into events.',
79
+ Uuid: 'Primitive type — a universally unique identifier.',
80
+ String: 'Primitive type — a string of characters.',
81
+ Int: 'Primitive type — an integer number.',
82
+ Decimal: 'Primitive type — a decimal number.',
83
+ Bool: 'Primitive type — true or false.',
84
+ Date: 'Primitive type — a date without time.',
85
+ DateTime: 'Primitive type — a date and time.',
86
+ Enum: 'An enumeration concept with a fixed set of values.',
87
+ };
88
+ export const attributeDocs = {
89
+ pii: '`@pii` — the value is personally identifiable information; Chronicle manages and erases it automatically wherever the concept is used.',
90
+ sensitive: '`@sensitive` — the value is sensitive; Chronicle applies its sensitivity rules automatically wherever the concept is used.',
91
+ };
92
+ export const contextVariableDocs = {
93
+ '$context.occurred': 'The timestamp of the event.',
94
+ '$context.identity.id': 'The subject of the caller from the auth token.',
95
+ '$env': 'An environment variable, e.g. `$env.SERVICE_NAME`.',
96
+ '$secrets': 'An encrypted secret resolved at runtime, e.g. `$secrets.azureAdClientId` — stays symbolic in the compiled tree.',
97
+ '$strings': 'A localized string resolved from the `.strings` file of the active locale, e.g. `$strings.invoices.title`.',
98
+ '$eventContext.occurred': 'The timestamp of the event being projected.',
99
+ };
100
+ //# sourceMappingURL=keyword-docs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyword-docs.js","sourceRoot":"","sources":["../keyword-docs.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,MAAM,CAAC,MAAM,WAAW,GAA2B;IAC/C,MAAM,EAAE,0FAA0F;IAClG,MAAM,EAAE,6EAA6E;IACrF,OAAO,EAAE,kGAAkG;IAC3G,MAAM,EAAE,gGAAgG;IACxG,OAAO,EAAE,0GAA0G;IACnH,cAAc,EAAE,kFAAkF;IAClG,QAAQ,EAAE,0FAA0F;IACpG,WAAW,EAAE,wKAAwK;IACrL,MA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qDAAqD;IAC1D,MAAM,EAAE,qCAAqC;IAC7C,EAAE,EAAE,+FAA+F;IACnG,OAAO,EAAE,sDAAsD;IAC/D,OAAO,EAAE,kFAAkF;IAC3F,GAAG,EAAE,wDAAwD;IAC7D,GAAG,EAAE,0BAA0B;IAC/B,GAAG,EAAE,0BAA0B;IAC/B,MAAM,EAAE,yCAAyC;IACjD,KAAK,EAAE,mBAAmB;IAC1B,KAAK,EAAE,oDAAoD;IAC3D,GAAG,EAAE,oDAAoD;IACzD,GAAG,EAAE,4BAA4B;IACjC,EAAE,EAAE,4BAA4B;IAChC,MAAM,EAAE,8CAA8C;IACtD,UAAU,EAAE,sDAAsD;IAClE,KAAK,EAAE,+EAA+E;IACtF,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,0EAA0E;IACvF,SAAS,EAAE,8EAA8E;IACzF,UAAU,EAAE,qEAAqE;IACjF,SAAS,EAAE,6DAA6D;IACxE,IAAI,EAAE,mDAAmD;IACzD,MAAM,EAAE,0CAA0C;IAClD,GAAG,EAAE,qCAAqC;IAC1C,OAAO,EAAE,oCAAoC;IAC7C,IAAI,EAAE,iCAAiC;IACvC,IAAI,EAAE,uCAAuC;IAC7C,QAAQ,EAAE,mCAAmC;IAC7C,IAAI,EAAE,oDAAoD;CAC7D,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAA2B;IACjD,GAAG,EAAE,wIAAwI;IAC7I,SAAS,EAAE,4HAA4H;CAC1I,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAA2B;IACvD,mBAAmB,EAAE,6BAA6B;IAClD,sBAAsB,EAAE,gDAAgD;IACxE,MAAM,EAAE,oDAAoD;IAC5D,UAAU,EAAE,iHAAiH;IAC7H,UAAU,EAAE,4GAA4G;IACxH,wBAAwB,EAAE,6CAA6C;CAC1E,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { languages } from 'monaco-editor';
2
+ export type Monaco = typeof import('monaco-editor');
3
+ export declare const languageId = "screenplay";
4
+ export declare const languageExtensionPoint: languages.ILanguageExtensionPoint;
5
+ export declare const constructKeywords: string[];
6
+ export declare const clauseKeywords: string[];
7
+ export declare const codeBlockTags: string[];
8
+ export declare const sliceTypes: string[];
9
+ export declare const primitiveTypes: string[];
10
+ export declare const conceptAttributes: string[];
11
+ export declare const languageConfiguration: languages.LanguageConfiguration;
12
+ //# sourceMappingURL=language.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../language.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,MAAM,MAAM,GAAG,cAAc,eAAe,CAAC,CAAC;AAEpD,eAAO,MAAM,UAAU,eAAe,CAAC;AAEvC,eAAO,MAAM,sBAAsB,EAAE,SAAS,CAAC,uBAK9C,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAmB7B,CAAC;AAEF,eAAO,MAAM,cAAc,UAuD1B,CAAC;AAEF,eAAO,MAAM,aAAa,UAA4C,CAAC;AAEvE,eAAO,MAAM,UAAU,UAA0D,CAAC;AAElF,eAAO,MAAM,cAAc,UAAmE,CAAC;AAE/F,eAAO,MAAM,iBAAiB,UAAyB,CAAC;AAExD,eAAO,MAAM,qBAAqB,EAAE,SAAS,CAAC,qBA2B7C,CAAC"}
@@ -0,0 +1,117 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export const languageId = 'screenplay';
4
+ export const languageExtensionPoint = {
5
+ id: languageId,
6
+ extensions: ['.play'],
7
+ aliases: ['Screenplay', 'screenplay', 'play'],
8
+ mimetypes: ['text/x-screenplay'],
9
+ };
10
+ export const constructKeywords = [
11
+ 'domain',
12
+ 'import',
13
+ 'concept',
14
+ 'policy',
15
+ 'persona',
16
+ 'authentication',
17
+ 'module',
18
+ 'layout',
19
+ 'feature',
20
+ 'slice',
21
+ 'event',
22
+ 'command',
23
+ 'query',
24
+ 'reactor',
25
+ 'screen',
26
+ 'constraint',
27
+ 'specification',
28
+ 'seed',
29
+ ];
30
+ export const clauseKeywords = [
31
+ 'description',
32
+ 'template',
33
+ 'require',
34
+ 'authenticated',
35
+ 'role',
36
+ 'claim',
37
+ 'subject',
38
+ 'authorize',
39
+ 'validate',
40
+ 'produces',
41
+ 'handler',
42
+ 'when',
43
+ 'given',
44
+ 'then',
45
+ 'error',
46
+ 'message',
47
+ 'not',
48
+ 'empty',
49
+ 'matches',
50
+ 'all',
51
+ 'max',
52
+ 'min',
53
+ 'length',
54
+ 'today',
55
+ 'true',
56
+ 'false',
57
+ 'and',
58
+ 'or',
59
+ 'by',
60
+ 'filter',
61
+ 'data',
62
+ 'via',
63
+ 'action',
64
+ 'navigate',
65
+ 'to',
66
+ 'label',
67
+ 'section',
68
+ 'table',
69
+ 'summary',
70
+ 'title',
71
+ 'column',
72
+ 'field',
73
+ 'on',
74
+ 'unique',
75
+ 'file',
76
+ 'concurrency',
77
+ 'eventSource',
78
+ 'sourceType',
79
+ 'streamType',
80
+ 'streamId',
81
+ 'tag',
82
+ 'for',
83
+ 'readmodel',
84
+ 'provider',
85
+ ];
86
+ export const codeBlockTags = ['csharp', 'typescript', 'react', 'html'];
87
+ export const sliceTypes = ['StateChange', 'StateView', 'Automation', 'Translate'];
88
+ export const primitiveTypes = ['Uuid', 'String', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime'];
89
+ export const conceptAttributes = ['@pii', '@sensitive'];
90
+ export const languageConfiguration = {
91
+ comments: {
92
+ lineComment: '//',
93
+ },
94
+ brackets: [
95
+ ['(', ')'],
96
+ ['[', ']'],
97
+ ],
98
+ autoClosingPairs: [
99
+ { open: '(', close: ')' },
100
+ { open: '[', close: ']' },
101
+ { open: '"', close: '"' },
102
+ ],
103
+ surroundingPairs: [
104
+ { open: '(', close: ')' },
105
+ { open: '[', close: ']' },
106
+ { open: '"', close: '"' },
107
+ ],
108
+ folding: {
109
+ offSide: true,
110
+ },
111
+ indentationRules: {
112
+ increaseIndentPattern: /^\s*(module|feature|slice|policy|persona|authentication|provider|event|command|screen|projection|capture|reactor|constraint|layout|template|validate|produces|handler|section|concurrency|seed|for)\b.*$/,
113
+ // Dedents are always explicit in an offside language — never auto-dedent.
114
+ decreaseIndentPattern: /(?!)/,
115
+ },
116
+ };
117
+ //# sourceMappingURL=language.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language.js","sourceRoot":"","sources":["../language.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAMrG,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC;AAEvC,MAAM,CAAC,MAAM,sBAAsB,GAAsC;IACrE,EAAE,EAAE,UAAU;IACd,UAAU,EAAE,CAAC,OAAO,CAAC;IACrB,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,MAAM,CAAC;IAC7C,SAAS,EAAE,CAAC,mBAAmB,CAAC;CACnC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,SAAS;IACT,gBAAgB;IAChB,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,OAAO;IACP,OAAO;IACP,SAAS;IACT,OAAO;IACP,SAAS;IACT,QAAQ;IACR,YAAY;IACZ,eAAe;IACf,MAAM;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,aAAa;IACb,UAAU;IACV,SAAS;IACT,eAAe;IACf,MAAM;IACN,OAAO;IACP,SAAS;IACT,WAAW;IACX,UAAU;IACV,UAAU;IACV,SAAS;IACT,MAAM;IACN,OAAO;IACP,MAAM;IACN,OAAO;IACP,SAAS;IACT,KAAK;IACL,OAAO;IACP,SAAS;IACT,KAAK;IACL,KAAK;IACL,KAAK;IACL,QAAQ;IACR,OAAO;IACP,MAAM;IACN,OAAO;IACP,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,M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EAAE,KAAK,EAAE,GAAG,EAAE;KAC5B;IACD,OAAO,EAAE;QACL,OAAO,EAAE,IAAI;KAChB;IACD,gBAAgB,EAAE;QACd,qBAAqB,EACjB,0MAA0M;QAC9M,0EAA0E;QAC1E,qBAAqB,EAAE,MAAM;KAChC;CACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { languages } from 'monaco-editor';
2
+ export type MonarchTokenRules = languages.IMonarchLanguage['tokenizer'][string];
3
+ export interface SubLanguageCompletion {
4
+ label: string;
5
+ insertText: string;
6
+ documentation: string;
7
+ }
8
+ export interface SubLanguageDefinition {
9
+ tokens: MonarchTokenRules;
10
+ completions?: SubLanguageCompletion[];
11
+ hovers?: Record<string, string>;
12
+ }
13
+ export interface SubLanguage extends SubLanguageDefinition {
14
+ keyword: string;
15
+ }
16
+ export declare function registerSubLanguage(keyword: string, definition: SubLanguageDefinition): void;
17
+ export declare function getSubLanguages(): SubLanguage[];
18
+ export declare function getSubLanguage(keyword: string): SubLanguage | undefined;
19
+ export declare function onSubLanguagesChanged(listener: () => void): void;
20
+ //# sourceMappingURL=sub-language-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sub-language-registry.d.ts","sourceRoot":"","sources":["../sub-language-registry.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,MAAM,iBAAiB,GAAG,SAAS,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhF,MAAM,WAAW,qBAAqB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IAClC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,WAAW,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,WAAY,SAAQ,qBAAqB;IACtD,OAAO,EAAE,MAAM,CAAC;CACnB;AAKD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,qBAAqB,GAAG,IAAI,CAG5F;AAED,wBAAgB,eAAe,IAAI,WAAW,EAAE,CAE/C;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEvE;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAEhE"}
@@ -0,0 +1,18 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ const subLanguages = new Map();
4
+ const listeners = new Set();
5
+ export function registerSubLanguage(keyword, definition) {
6
+ subLanguages.set(keyword, { keyword, ...definition });
7
+ listeners.forEach((listener) => listener());
8
+ }
9
+ export function getSubLanguages() {
10
+ return [...subLanguages.values()];
11
+ }
12
+ export function getSubLanguage(keyword) {
13
+ return subLanguages.get(keyword);
14
+ }
15
+ export function onSubLanguagesChanged(listener) {
16
+ listeners.add(listener);
17
+ }
18
+ //# sourceMappingURL=sub-language-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sub-language-registry.js","sourceRoot":"","sources":["../sub-language-registry.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAsBrG,MAAM,YAAY,GAAG,IAAI,GAAG,EAAuB,CAAC;AACpD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAc,CAAC;AAExC,MAAM,UAAU,mBAAmB,CAAC,OAAe,EAAE,UAAiC;IAClF,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,CAAC,CAAC;IACtD,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,eAAe;IAC3B,OAAO,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,OAAe;IAC1C,OAAO,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,QAAoB;IACtD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { languages, type editor, type Position } from 'monaco-editor';
2
+ export declare class CompletionProvider implements languages.CompletionItemProvider {
3
+ triggerCharacters: string[];
4
+ provideCompletionItems(model: editor.ITextModel, position: Position): languages.ProviderResult<languages.CompletionList>;
5
+ private buildContext;
6
+ private getIndentLevel;
7
+ private isStartOfLine;
8
+ private isAfterIndent;
9
+ private isAfterKeyword;
10
+ private isAfterAppendKeyword;
11
+ private isAfterWhenKeyword;
12
+ private isAfterWhenFrom;
13
+ private isAfterWhenTo;
14
+ private isAfterAssignment;
15
+ private isAfterContextPrefix;
16
+ private addCaptureLineCompletions;
17
+ private addCaptureNameCompletions;
18
+ private addSourceTypeCompletions;
19
+ private addSourceBlockCompletions;
20
+ private addTopLevelStatementCompletions;
21
+ private addAppendNameCompletions;
22
+ private addWhenCompletions;
23
+ private addFromValueCompletions;
24
+ private addToValueCompletions;
25
+ private addAssignmentValueCompletions;
26
+ private addPathCompletions;
27
+ private addContextCompletions;
28
+ private addEnvironmentCompletions;
29
+ private getCurrentSourceType;
30
+ private getRangeForWord;
31
+ }
32
+ //# sourceMappingURL=CompletionProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CompletionProvider.d.ts","sourceRoot":"","sources":["../../../sub-languages/capture/CompletionProvider.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAe,MAAM,eAAe,CAAC;AAyBnF,qBAAa,kBAAmB,YAAW,SAAS,CAAC,sBAAsB;IACvE,iBAAiB,WAAwB;IAEzC,sBAAsB,CAClB,KAAK,EAAE,MAAM,CAAC,UAAU,EACxB,QAAQ,EAAE,QAAQ,GACnB,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,cAAc,CAAC;IAqCrD,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,yBAAyB;IAkBjC,OAAO,CAAC,yBAAyB;IAWjC,OAAO,CAAC,wBAAwB;IAoBhC,OAAO,CAAC,yBAAyB;IA2BjC,OAAO,CAAC,+BAA+B;IAmBvC,OAAO,CAAC,wBAAwB;IAWhC,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,uBAAuB;IAmB/B,OAAO,CAAC,qBAAqB;IAa7B,OAAO,CAAC,6BAA6B;IAmBrC,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,qBAAqB;IAgB7B,OAAO,CAAC,yBAAyB;IAWjC,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,eAAe;CAQ1B"}