@cratis/screenplay-language 4.251.0 → 4.252.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles/declarations.js +2 -0
- package/dist/bundles/declarations.js.map +1 -0
- package/dist/bundles/index.js +1 -1
- package/dist/bundles/index.js.map +1 -1
- package/dist/bundles/validation.js +2 -2
- package/dist/bundles/validation.js.map +1 -1
- package/dist/declarations.d.ts +19 -0
- package/dist/declarations.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/validation.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{fenceMap as e}from"./document-context.js";const t=RegExp(`^(\\s*(?:public\\s+)?(?:`+(/* @__PURE__ */ `screen\\s+template.dialog\\s+template.slice\\s+\\w+.ui\\s+profile.sample\\s+data.toolbar.concept.type.policy.purpose.persona.module.layout.theme.feature.event.system.eventsource.operation.command.query.projection.reaction.reducer.readmodel.trigger.screen.dialog.form.constraint.specification.behavior.exposure.instance`.split(`.`)).join(`|`)+`)\\s+)([A-Za-z_][\\w.]*)`);function declarationHeaders(n){let r=e([...n]),i=[];return n.forEach((e,n)=>{if(r[n]||/^\s*\/\//.test(e))return;let a=t.exec(e);if(a===null)return;let o=a[1].trim().replace(/^public\s+/,``).replace(/\s+/g,` `);i.push({keyword:o,name:a[2],line:n,column:a[1].length})}),i}export{declarationHeaders};
|
|
2
|
+
//# sourceMappingURL=declarations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declarations.js","names":["header","fences","fenceMap","lines","headers","line","text","match","keyword"],"sources":["../../declarations.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 { fenceMap } from './document-context';\n\n/** Where a named construct is declared. */\nexport interface DeclarationHeader {\n /** The construct keyword, such as `concept`, `screen template` or `slice StateChange`. */\n readonly keyword: string;\n\n /** The name the construct declares. */\n readonly name: string;\n\n /** The zero-based line of the header. */\n readonly line: number;\n\n /** The zero-based column the name starts at. */\n readonly column: number;\n}\n\n// Every construct that is declared by a header line naming it: `concept TalkId : Uuid`, `screen template ReviewDesk`,\n// `slice StateChange SubmitTalk`. References to a name (`navigate to TalkList`, `template ReviewDesk`, `authorize\n// IsSpeaker`) are not headers, so a reference never reads as a second declaration.\nconst header = new RegExp(\n '^(\\\\s*(?:public\\\\s+)?(?:' + [\n 'screen\\\\s+template', 'dialog\\\\s+template', 'slice\\\\s+\\\\w+', 'ui\\\\s+profile', 'sample\\\\s+data', 'toolbar',\n 'concept', 'type', 'policy', 'purpose', 'persona', 'module', 'layout', 'theme', 'feature', 'event', 'system', 'eventsource',\n 'operation', 'command', 'query', 'projection', 'reaction', 'reducer', 'readmodel', 'trigger', 'screen', 'dialog', 'form',\n 'constraint', 'specification', 'behavior', 'exposure', 'instance',\n ].join('|') + ')\\\\s+)([A-Za-z_][\\\\w.]*)');\n\n/**\n * Finds the headers that declare constructs in a document.\n *\n * @param lines The document's lines.\n * @returns The headers, in document order.\n */\nexport function declarationHeaders(lines: readonly string[]): DeclarationHeader[] {\n const fences = fenceMap([...lines]);\n const headers: DeclarationHeader[] = [];\n lines.forEach((text, line) => {\n if (fences[line] || /^\\s*\\/\\//.test(text)) return;\n const match = header.exec(text);\n if (match === null) return;\n const keyword = match[1].trim().replace(/^public\\s+/, '').replace(/\\s+/g, ' ');\n headers.push({ keyword, name: match[2], line, column: match[1].length });\n });\n\n return headers;\n}\n"],"mappings":"kGAuBA,MAAMA,EAAa,OACf,4BAA6B,0VAK7B,EAAC,CAAC,KAAK,GAAG,EAAI,0BAA0B,EAQ5C,SAAgB,mBAAmB,EAA+C,CAC9E,IAAMC,EAASC,EAAS,CAAC,GAAGC,CAAK,CAAC,EAC5BC,EAA+B,CAAC,EAStC,OARAD,EAAM,SAAS,EAAM,IAAS,CAC1B,GAAIF,EAAOI,IAAS,WAAW,KAAKC,CAAI,EAAG,OAC3C,IAAMC,EAAQP,EAAO,KAAKM,CAAI,EAC9B,GAAIC,IAAU,KAAM,OACpB,IAAMC,EAAUD,EAAM,EAAE,CAAC,KAAK,CAAC,CAAC,QAAQ,aAAc,EAAE,CAAC,CAAC,QAAQ,OAAQ,GAAG,EAC7EH,EAAQ,KAAK,CAAE,UAAS,KAAMG,EAAM,GAAI,OAAM,OAAQA,EAAM,EAAE,CAAC,MAAO,CAAC,CAC3E,CAAC,EAEMH,CACX"}
|
package/dist/bundles/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./_virtual/_virtual/_rolldown/runtime.js";import{blockHeaderPattern as e,causedByProperties as t,clauseKeywords as n,codeBlockTags as r,conceptAttributes as i,constructKeywords as a,contextRoots as o,languageConfiguration as s,languageExtensionPoint as c,languageId as l,primitiveTypes as u,sliceTypes as d}from"./language.js";import{createTokensProvider as f}from"./tokens.js";import{typeReferenceSymbol as p,typeReferenceText as m}from"./TypeReferenceSymbol.js";import{enclosingChain as ee,fenceMap as te,firstWord as ne,indentOf as re,withoutComment as ie}from"./document-context.js";import{eventContextPaths as ae}from"./event-context-catalog.js";import{eventContextMemberAt as oe,eventContextMembers as se,eventContextMembersAfter as ce,namesEventContextMember as le}from"./event-context.js";import{contextVariableEntries as ue,contextVariableItems as de,producesItems as fe,specificationStepItems as pe}from"./completion-items.js";import{responseAnalysis as me,responseAvailability as he}from"./response-analysis.js";import{fileReferenceKeyword as h,fileReferenceOn as g,fileReferences as _,isAbsoluteFileReferencePath as v}from"./file-references.js";import{builtInTriggerNames as y,knownEventNames as b,knownTriggerNames as x,knownTypeNames as S,mergeSymbols as C,scanDocument as w,symbolsForBuffer as T}from"./symbols.js";import{responseCompletions as E}from"./response-completions.js";import{exampleCompletions as D,exampleHover as O}from"./example-authoring.js";import{analyzeOperations as k,operationAvailability as A,operationCompletions as j,operationDetails as M,operationHover as N,operationReferenceAt as P,phaseState as F}from"./operation-authoring.js";import{analyzeEventSources as I,eventSourceAvailability as L,eventSourceCompletions as R,eventSourceDetails as ge,eventSourceHover as _e,eventSourceIdentifier as z,eventSourceReferenceAt as B}from"./event-source-authoring.js";import{structureCompletion as ve}from"./structure-completions.js";import{getSubLanguage as V,getSubLanguages as H,onSubLanguagesChanged as ye,registerSubLanguage as U}from"./sub-language-registry.js";import{completionEntriesFor as be,planCompletions as xe}from"./completion-planner.js";import{createCompletionProvider as Se}from"./completions.js";import{createInlineCompletionProvider as Ce}from"./inline-completions.js";import{responseTokenTypes as W,responseTokens as G}from"./response-tokens.js";import{reactionReferenceAt as K}from"./reaction-authoring.js";import{attributeDocs as we,contextVariableDocs as Te,keywordDocs as Ee,specificationKeywordDocs as De}from"./keyword-docs.js";import{hoverContent as Oe}from"./hover-content.js";import{createHoverProvider as ke}from"./hover.js";import{destinationHints as Ae,productionDestinations as je}from"./production-destinations.js";import{createInlayHintsProvider as Me}from"./inlay-hints.js";import{createCodeActionProvider as q}from"./code-actions.js";import{diagnosticCodes as
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{blockHeaderPattern as e,causedByProperties as t,clauseKeywords as n,codeBlockTags as r,conceptAttributes as i,constructKeywords as a,contextRoots as o,languageConfiguration as s,languageExtensionPoint as c,languageId as l,primitiveTypes as u,sliceTypes as d}from"./language.js";import{createTokensProvider as f}from"./tokens.js";import{typeReferenceSymbol as p,typeReferenceText as m}from"./TypeReferenceSymbol.js";import{enclosingChain as ee,fenceMap as te,firstWord as ne,indentOf as re,withoutComment as ie}from"./document-context.js";import{eventContextPaths as ae}from"./event-context-catalog.js";import{eventContextMemberAt as oe,eventContextMembers as se,eventContextMembersAfter as ce,namesEventContextMember as le}from"./event-context.js";import{contextVariableEntries as ue,contextVariableItems as de,producesItems as fe,specificationStepItems as pe}from"./completion-items.js";import{responseAnalysis as me,responseAvailability as he}from"./response-analysis.js";import{fileReferenceKeyword as h,fileReferenceOn as g,fileReferences as _,isAbsoluteFileReferencePath as v}from"./file-references.js";import{builtInTriggerNames as y,knownEventNames as b,knownTriggerNames as x,knownTypeNames as S,mergeSymbols as C,scanDocument as w,symbolsForBuffer as T}from"./symbols.js";import{responseCompletions as E}from"./response-completions.js";import{exampleCompletions as D,exampleHover as O}from"./example-authoring.js";import{analyzeOperations as k,operationAvailability as A,operationCompletions as j,operationDetails as M,operationHover as N,operationReferenceAt as P,phaseState as F}from"./operation-authoring.js";import{analyzeEventSources as I,eventSourceAvailability as L,eventSourceCompletions as R,eventSourceDetails as ge,eventSourceHover as _e,eventSourceIdentifier as z,eventSourceReferenceAt as B}from"./event-source-authoring.js";import{structureCompletion as ve}from"./structure-completions.js";import{getSubLanguage as V,getSubLanguages as H,onSubLanguagesChanged as ye,registerSubLanguage as U}from"./sub-language-registry.js";import{completionEntriesFor as be,planCompletions as xe}from"./completion-planner.js";import{createCompletionProvider as Se}from"./completions.js";import{createInlineCompletionProvider as Ce}from"./inline-completions.js";import{responseTokenTypes as W,responseTokens as G}from"./response-tokens.js";import{reactionReferenceAt as K}from"./reaction-authoring.js";import{attributeDocs as we,contextVariableDocs as Te,keywordDocs as Ee,specificationKeywordDocs as De}from"./keyword-docs.js";import{hoverContent as Oe}from"./hover-content.js";import{createHoverProvider as ke}from"./hover.js";import{destinationHints as Ae,productionDestinations as je}from"./production-destinations.js";import{createInlayHintsProvider as Me}from"./inlay-hints.js";import{createCodeActionProvider as q}from"./code-actions.js";import{diagnosticCodes as Ne}from"./diagnostic-codes.js";import{fileImportOn as Pe,fileImports as Fe,importablePaths as Ie,isFileImportLine as J}from"./file-imports.js";import{validateLines as Le}from"./validation.js";import{attachDiagnostics as Re}from"./diagnostics.js";import{pdl as Y}from"./sub-languages/pdl.js";import{cdl as X}from"./sub-languages/cdl.js";import{screenplayDark as ze,screenplayDarkThemeName as Z}from"./themes/screenplay-dark.js";import{screenplayLight as Be,screenplayLightThemeName as Q}from"./themes/screenplay-light.js";import{declarationHeaders as Ve}from"./declarations.js";const $=/* @__PURE__ */ new Set;function applyTokensProvider(e){e.languages.setMonarchTokensProvider(l,f(H()))}ye(()=>$.forEach(applyTokensProvider));function ensureBuiltInSubLanguages(){V(`projection`)||U(`projection`,Y),V(`capture`)||U(`capture`,X)}function register(e,t={}){$.has(e)||(ensureBuiltInSubLanguages(),$.add(e),e.languages.register(c),e.languages.setLanguageConfiguration(l,s),applyTokensProvider(e),e.languages.registerCompletionItemProvider(l,Se(e,t)),e.languages.registerInlineCompletionsProvider(l,Ce(t)),e.languages.registerHoverProvider(l,ke(t)),e.languages.registerDefinitionProvider(l,{provideDefinition(n,r){let i=n.getWordAtPosition(r);if(!i)return[];let a=t.application?.(n),o=B(n.getLinesContent(),r.lineNumber-1,i.startColumn,i.endColumn,a),s=K(n.getLinesContent(),r.lineNumber-1,i.startColumn,i.endColumn,a),c=s?s.target:o?.target;if(!c)return[];let l=a?.authoringPath??`current.play`,u=c.location.path===l?n.getValue():a?.authoringDocuments?.find(e=>e.path===c.location.path)?.source,d=s?s.target?.location:u&&z(c.location,c.name,u);if(!d)return[];let f=c.location.path&&n.uri.path.endsWith(`/${l}`)?n.uri.with({path:n.uri.path.slice(0,-l.length)+c.location.path}):void 0,p=f?e.editor.getModels().filter(e=>e.uri.toString()===f.toString()):[],m=c.location.path===l?n:p.length===1?p[0]:void 0;return m?[{uri:m.uri,range:new e.Range(d.line,d.column,d.line,d.column+c.name.length)}]:[]}}),e.languages.registerDocumentSemanticTokensProvider(l,{getLegend:()=>({tokenTypes:[...W],tokenModifiers:[]}),provideDocumentSemanticTokens(e){let n=[],r=0,i=0;for(let a of G(e.getLinesContent(),t.application?.(e)))n.push(a.line-r,a.line===r?a.column-i:a.column,a.length,a.type,0),r=a.line,i=a.column;return{data:new Uint32Array(n)}},releaseDocumentSemanticTokens(){}}),e.languages.registerInlayHintsProvider(l,Me(t)),e.languages.registerCodeActionProvider(l,q()),e.editor.defineTheme(Z,ze),e.editor.defineTheme(Q,Be),Re(e,t))}export{I as analyzeEventSources,k as analyzeOperations,we as attributeDocs,e as blockHeaderPattern,y as builtInTriggerNames,t as causedByProperties,X as cdl,n as clauseKeywords,r as codeBlockTags,be as completionEntriesFor,i as conceptAttributes,a as constructKeywords,o as contextRoots,Te as contextVariableDocs,ue as contextVariableEntries,de as contextVariableItems,q as createCodeActionProvider,Ve as declarationHeaders,Ae as destinationHints,Ne as diagnosticCodes,ee as enclosingChain,ensureBuiltInSubLanguages,oe as eventContextMemberAt,se as eventContextMembers,ce as eventContextMembersAfter,ae as eventContextPaths,L as eventSourceAvailability,R as eventSourceCompletions,ge as eventSourceDetails,_e as eventSourceHover,z as eventSourceIdentifier,B as eventSourceReferenceAt,D as exampleCompletions,O as exampleHover,te as fenceMap,Pe as fileImportOn,Fe as fileImports,h as fileReferenceKeyword,g as fileReferenceOn,_ as fileReferences,ne as firstWord,V as getSubLanguage,H as getSubLanguages,Oe as hoverContent,Ie as importablePaths,re as indentOf,v as isAbsoluteFileReferencePath,J as isFileImportLine,Ee as keywordDocs,b as knownEventNames,x as knownTriggerNames,S as knownTypeNames,l as languageId,C as mergeSymbols,le as namesEventContextMember,A as operationAvailability,j as operationCompletions,M as operationDetails,N as operationHover,P as operationReferenceAt,Y as pdl,F as phaseState,xe as planCompletions,u as primitiveTypes,fe as producesItems,je as productionDestinations,K as reactionReferenceAt,register,U as registerSubLanguage,me as responseAnalysis,he as responseAvailability,E as responseCompletions,W as responseTokenTypes,G as responseTokens,w as scanDocument,Z as screenplayDarkThemeName,Q as screenplayLightThemeName,d as sliceTypes,De as specificationKeywordDocs,pe as specificationStepItems,ve as structureCompletion,T as symbolsForBuffer,p as typeReferenceSymbol,m as typeReferenceText,Le as validateLines,ie as withoutComment};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["registeredInstances","monaco","languageId","createTokensProvider","getSubLanguages","onSubLanguagesChanged","getSubLanguage","registerSubLanguage","pdl","cdl","languageExtensionPoint","languageConfiguration","createCompletionProvider","options","createInlineCompletionProvider","createHoverProvider","word","model","position","symbols","reference","eventSourceReferenceAt","reaction","reactionReferenceAt","target","current","source","document","location","eventSourceIdentifier","targetUri","targetModels","candidate","targetModel","responseTokenTypes","data","previousLine","previousColumn","token","responseTokens","createInlayHintsProvider","createCodeActionProvider","screenplayDarkThemeName","screenplayDark","screenplayLightThemeName","screenplayLight","attachDiagnostics","analyzeEventSources","analyzeOperations","attributeDocs","blockHeaderPattern","builtInTriggerNames","causedByProperties","clauseKeywords","codeBlockTags","completionEntriesFor","conceptAttributes","constructKeywords","contextRoots","contextVariableDocs","contextVariableEntries","contextVariableItems","destinationHints","diagnosticCodes","enclosingChain","eventContextMemberAt","eventContextMembers","eventContextMembersAfter","eventContextPaths","eventSourceAvailability","eventSourceCompletions","eventSourceDetails","eventSourceHover","exampleCompletions","exampleHover","fenceMap","fileImportOn","fileImports","fileReferenceKeyword","fileReferenceOn","fileReferences","firstWord","hoverContent","importablePaths","indentOf","isAbsoluteFileReferencePath","isFileImportLine","keywordDocs","knownEventNames","knownTriggerNames","knownTypeNames","mergeSymbols","namesEventContextMember","operationAvailability","operationCompletions","operationDetails","operationHover","operationReferenceAt","phaseState","planCompletions","primitiveTypes","producesItems","productionDestinations","responseAnalysis","responseAvailability","responseCompletions","scanDocument","sliceTypes","specificationKeywordDocs","specificationStepItems","structureCompletion","symbolsForBuffer","typeReferenceSymbol","typeReferenceText","validateLines","withoutComment"],"sources":["../../index.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 {\n Monaco,\n languageConfiguration,\n languageExtensionPoint,\n languageId,\n} from './language';\nimport { createTokensProvider } from './tokens';\nimport { CompletionOptions, createCompletionProvider } from './completions';\nimport { createInlineCompletionProvider } from './inline-completions';\nimport { responseTokens, responseTokenTypes } from './response-tokens';\nimport { reactionReferenceAt } from './reaction-authoring';\nimport { createHoverProvider } from './hover';\nimport { createInlayHintsProvider } from './inlay-hints';\nimport { eventSourceIdentifier, eventSourceReferenceAt } from './event-source-authoring';\nimport { createCodeActionProvider } from './code-actions';\nimport { attachDiagnostics } from './diagnostics';\nimport {\n getSubLanguage,\n getSubLanguages,\n onSubLanguagesChanged,\n registerSubLanguage,\n} from './sub-language-registry';\nimport { pdl } from './sub-languages/pdl';\nimport { cdl } from './sub-languages/cdl';\nimport { screenplayDark, screenplayDarkThemeName } from './themes/screenplay-dark';\nimport { screenplayLight, screenplayLightThemeName } from './themes/screenplay-light';\n\nconst registeredInstances = new Set<Monaco>();\n\nfunction applyTokensProvider(monaco: Monaco): void {\n monaco.languages.setMonarchTokensProvider(languageId, createTokensProvider(getSubLanguages()));\n}\n\n// Sub-languages registered after register() recompose the tokenizer on the fly.\nonSubLanguagesChanged(() => registeredInstances.forEach(applyTokensProvider));\n\n// Registers the built-in PDL and CDL sub-languages. Hosts that do not go through\n// register() — such as the VSCode extension — call this before using the registry.\nexport function ensureBuiltInSubLanguages(): void {\n if (!getSubLanguage('projection')) registerSubLanguage('projection', pdl);\n if (!getSubLanguage('capture')) registerSubLanguage('capture', cdl);\n}\n\n// What a host can tell the language service beyond the models it holds.\nexport type LanguageServiceOptions = CompletionOptions;\n\nexport function register(monaco: Monaco, options: LanguageServiceOptions = {}): void {\n if (registeredInstances.has(monaco)) return;\n\n ensureBuiltInSubLanguages();\n\n registeredInstances.add(monaco);\n\n monaco.languages.register(languageExtensionPoint);\n monaco.languages.setLanguageConfiguration(languageId, languageConfiguration);\n applyTokensProvider(monaco);\n monaco.languages.registerCompletionItemProvider(languageId, createCompletionProvider(monaco, options));\n monaco.languages.registerInlineCompletionsProvider(languageId, createInlineCompletionProvider(options));\n monaco.languages.registerHoverProvider(languageId, createHoverProvider(options));\n monaco.languages.registerDefinitionProvider(languageId, {\n provideDefinition(model, position) {\n const word = model.getWordAtPosition(position);\n if (!word) return [];\n const symbols = options.application?.(model);\n const reference = eventSourceReferenceAt(model.getLinesContent(), position.lineNumber - 1, word.startColumn, word.endColumn, symbols);\n const reaction = reactionReferenceAt(model.getLinesContent(), position.lineNumber - 1, word.startColumn, word.endColumn, symbols);\n const target = reaction ? reaction.target : reference?.target;\n if (!target) return [];\n const current = symbols?.authoringPath ?? 'current.play';\n const source = target.location.path === current ? model.getValue() : symbols?.authoringDocuments?.find(document => document.path === target.location.path)?.source;\n const location = reaction ? reaction.target?.location : source && eventSourceIdentifier(target.location, target.name, source);\n if (!location) return [];\n // Foreign navigation requires an actual host model, not a guessed path or merged line.\n const targetUri = target.location.path && model.uri.path.endsWith(`/${current}`)\n ? model.uri.with({ path: model.uri.path.slice(0, -current.length) + target.location.path }) : undefined;\n const targetModels = targetUri ? monaco.editor.getModels().filter(candidate => candidate.uri.toString() === targetUri.toString()) : [];\n const targetModel = target.location.path === current ? model : targetModels.length === 1 ? targetModels[0] : undefined;\n return targetModel ? [{ uri: targetModel.uri, range: new monaco.Range(location.line, location.column, location.line, location.column + target.name.length) }] : [];\n }\n });\n monaco.languages.registerDocumentSemanticTokensProvider(languageId, {\n getLegend: () => ({ tokenTypes: [...responseTokenTypes], tokenModifiers: [] }),\n provideDocumentSemanticTokens(model) {\n const data: number[] = [];\n let previousLine = 0;\n let previousColumn = 0;\n for (const token of responseTokens(model.getLinesContent(), options.application?.(model))) {\n data.push(token.line - previousLine, token.line === previousLine ? token.column - previousColumn : token.column, token.length, token.type, 0);\n previousLine = token.line;\n previousColumn = token.column;\n }\n return { data: new Uint32Array(data) };\n },\n releaseDocumentSemanticTokens() {},\n });\n monaco.languages.registerInlayHintsProvider(languageId, createInlayHintsProvider(options));\n monaco.languages.registerCodeActionProvider(languageId, createCodeActionProvider());\n monaco.editor.defineTheme(screenplayDarkThemeName, screenplayDark);\n monaco.editor.defineTheme(screenplayLightThemeName, screenplayLight);\n attachDiagnostics(monaco, options);\n}\n\nexport { reactionReferenceAt } from './reaction-authoring';\n\nexport {\n causedByProperties,\n clauseKeywords,\n codeBlockTags,\n conceptAttributes,\n constructKeywords,\n contextRoots,\n languageId,\n primitiveTypes,\n sliceTypes,\n} from './language';\nexport type { Monaco } from './language';\nexport { getSubLanguage, getSubLanguages, registerSubLanguage } from './sub-language-registry';\nexport type {\n MonarchTokenRules,\n SubLanguage,\n SubLanguageCompletion,\n SubLanguageDefinition,\n} from './sub-language-registry';\nexport { pdl } from './sub-languages/pdl';\nexport { cdl } from './sub-languages/cdl';\nexport { screenplayDarkThemeName } from './themes/screenplay-dark';\nexport { screenplayLightThemeName } from './themes/screenplay-light';\nexport { enclosingChain, fenceMap, firstWord, indentOf, withoutComment } from './document-context';\nexport { exampleCompletions, exampleHover } from './example-authoring';\nexport {\n fileReferenceKeyword,\n fileReferenceOn,\n fileReferences,\n isAbsoluteFileReferencePath,\n} from './file-references';\nexport type { FileReference } from './file-references';\nexport { fileImportOn, fileImports, importablePaths, isFileImportLine } from './file-imports';\nexport type { FileImport } from './file-imports';\nexport type { CompletionOptions } from './completions';\nexport { builtInTriggerNames, knownEventNames, knownTriggerNames, knownTypeNames, mergeSymbols, scanDocument, symbolsForBuffer } from './symbols';\nexport type {\n CommandSymbol,\n ConceptSymbol,\n DocumentSymbols,\n EventSymbol,\n ImportSymbol,\n NamedSymbol,\n PolicySymbol,\n PropertySymbol,\n ReadSymbol,\n QuerySymbol,\n TypeSymbol,\n} from './symbols';\nexport { attributeDocs, contextVariableDocs, keywordDocs, specificationKeywordDocs } from './keyword-docs';\nexport { eventContextMemberAt, eventContextMembers, eventContextMembersAfter, eventContextPaths, namesEventContextMember } from './event-context';\nexport type { EventContextMember, EventContextPath } from './event-context';\nexport { contextVariableEntries, contextVariableItems, producesItems, specificationStepItems } from './completion-items';\nexport type { CompletionEntry } from './completion-items';\nexport { completionEntriesFor, planCompletions } from './completion-planner';\nexport type { CompletionPlan } from './completion-planner';\nexport { responseTokens, responseTokenTypes } from './response-tokens';\nexport { responseCompletions } from './response-completions';\nexport { structureCompletion } from './structure-completions';\nexport { blockHeaderPattern } from './language';\nexport type { StructureCompletion } from './structure-completions';\nexport { analyzeEventSources, eventSourceAvailability, eventSourceCompletions, eventSourceDetails, eventSourceHover, eventSourceIdentifier, eventSourceReferenceAt } from './event-source-authoring';\nexport type { EventSourceAnalysis } from './EventSourceAnalysis';\nexport type { AuthoredEventSource } from './AuthoredEventSource';\nexport type { AuthoredStream } from './AuthoredStream';\nexport type { AuthoredCommandRoute } from './AuthoredCommandRoute';\nexport type { AuthoredSpecificationEvent } from './AuthoredSpecificationEvent';\nexport { analyzeOperations, operationCompletions, operationDetails, operationAvailability, operationHover, operationReferenceAt, phaseState } from './operation-authoring';\nexport type { OperationAnalysis, OperationDeclaration, OperationInput, OperationPhase, OperationReference, SystemDeclaration } from './OperationAnalysis';\nexport { responseAvailability, responseAnalysis } from './response-analysis';\nexport { hoverContent } from './hover-content';\nexport { validateLines } from './validation';\nexport { destinationHints, productionDestinations } from './production-destinations';\nexport type { DestinationHint } from './DestinationHint';\nexport type { ProductionSymbol } from './ProductionSymbol';\nexport type { ValidationContext, ValidationIssue, ValidationSeverity } from './validation';\nexport { createCodeActionProvider } from './code-actions';\nexport { typeReferenceSymbol, typeReferenceText } from './TypeReferenceSymbol';\nexport type { TypeReferenceSymbol } from './TypeReferenceSymbol';\nexport { diagnosticCodes } from './diagnostic-codes';\nexport type { DiagnosticCode } from './diagnostic-codes';\n"],"mappings":"83GA8BA,MAAMA,kBAAsB,IAAI,IAEhC,SAAS,oBAAoB,EAAsB,CAC/CC,EAAO,UAAU,yBAAyBC,EAAYC,EAAqBC,EAAgB,CAAC,CAAC,CACjG,CAGAC,OAA4BL,EAAoB,QAAQ,mBAAmB,CAAC,EAI5E,SAAgB,2BAAkC,CACzCM,EAAe,YAAY,GAAGC,EAAoB,aAAcC,CAAG,EACnEF,EAAe,SAAS,GAAGC,EAAoB,UAAWE,CAAG,CACtE,CAKA,SAAgB,SAAS,EAAgB,EAAkC,CAAC,EAAS,CAC7ET,EAAoB,IAAIC,CAAM,IAElC,0BA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stances","monaco","languageId","createTokensProvider","getSubLanguages","onSubLanguagesChanged","getSubLanguage","registerSubLanguage","pdl","cdl","languageExtensionPoint","languageConfiguration","createCompletionProvider","options","createInlineCompletionProvider","createHoverProvider","word","model","position","symbols","reference","eventSourceReferenceAt","reaction","reactionReferenceAt","target","current","source","document","location","eventSourceIdentifier","targetUri","targetModels","candidate","targetModel","responseTokenTypes","data","previousLine","previousColumn","token","responseTokens","createInlayHintsProvider","createCodeActionProvider","screenplayDarkThemeName","screenplayDark","screenplayLightThemeName","screenplayLight","attachDiagnostics","analyzeEventSources","analyzeOperations","attributeDocs","blockHeaderPattern","builtInTriggerNames","causedByProperties","clauseKeywords","codeBlockTags","completionEntriesFor","conceptAttributes","constructKeywords","contextRoots","contextVariableDocs","contextVariableEntries","contextVariableItems","declarationHeaders","destinationHints","diagnosticCodes","enclosingChain","eventContextMemberAt","eventContextMembers","eventContextMembersAfter","eventContextPaths","eventSourceAvailability","eventSourceCompletions","eventSourceDetails","eventSourceHover","exampleCompletions","exampleHover","fenceMap","fileImportOn","fileImports","fileReferenceKeyword","fileReferenceOn","fileReferences","firstWord","hoverContent","importablePaths","indentOf","isAbsoluteFileReferencePath","isFileImportLine","keywordDocs","knownEventNames","knownTriggerNames","knownTypeNames","mergeSymbols","namesEventContextMember","operationAvailability","operationCompletions","operationDetails","operationHover","operationReferenceAt","phaseState","planCompletions","primitiveTypes","producesItems","productionDestinations","responseAnalysis","responseAvailability","responseCompletions","scanDocument","sliceTypes","specificationKeywordDocs","specificationStepItems","structureCompletion","symbolsForBuffer","typeReferenceSymbol","typeReferenceText","validateLines","withoutComment"],"sources":["../../index.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 {\n Monaco,\n languageConfiguration,\n languageExtensionPoint,\n languageId,\n} from './language';\nimport { createTokensProvider } from './tokens';\nimport { CompletionOptions, createCompletionProvider } from './completions';\nimport { createInlineCompletionProvider } from './inline-completions';\nimport { responseTokens, responseTokenTypes } from './response-tokens';\nimport { reactionReferenceAt } from './reaction-authoring';\nimport { createHoverProvider } from './hover';\nimport { createInlayHintsProvider } from './inlay-hints';\nimport { eventSourceIdentifier, eventSourceReferenceAt } from './event-source-authoring';\nimport { createCodeActionProvider } from './code-actions';\nimport { attachDiagnostics } from './diagnostics';\nimport {\n getSubLanguage,\n getSubLanguages,\n onSubLanguagesChanged,\n registerSubLanguage,\n} from './sub-language-registry';\nimport { pdl } from './sub-languages/pdl';\nimport { cdl } from './sub-languages/cdl';\nimport { screenplayDark, screenplayDarkThemeName } from './themes/screenplay-dark';\nimport { screenplayLight, screenplayLightThemeName } from './themes/screenplay-light';\n\nconst registeredInstances = new Set<Monaco>();\n\nfunction applyTokensProvider(monaco: Monaco): void {\n monaco.languages.setMonarchTokensProvider(languageId, createTokensProvider(getSubLanguages()));\n}\n\n// Sub-languages registered after register() recompose the tokenizer on the fly.\nonSubLanguagesChanged(() => registeredInstances.forEach(applyTokensProvider));\n\n// Registers the built-in PDL and CDL sub-languages. Hosts that do not go through\n// register() — such as the VSCode extension — call this before using the registry.\nexport function ensureBuiltInSubLanguages(): void {\n if (!getSubLanguage('projection')) registerSubLanguage('projection', pdl);\n if (!getSubLanguage('capture')) registerSubLanguage('capture', cdl);\n}\n\n// What a host can tell the language service beyond the models it holds.\nexport type LanguageServiceOptions = CompletionOptions;\n\nexport function register(monaco: Monaco, options: LanguageServiceOptions = {}): void {\n if (registeredInstances.has(monaco)) return;\n\n ensureBuiltInSubLanguages();\n\n registeredInstances.add(monaco);\n\n monaco.languages.register(languageExtensionPoint);\n monaco.languages.setLanguageConfiguration(languageId, languageConfiguration);\n applyTokensProvider(monaco);\n monaco.languages.registerCompletionItemProvider(languageId, createCompletionProvider(monaco, options));\n monaco.languages.registerInlineCompletionsProvider(languageId, createInlineCompletionProvider(options));\n monaco.languages.registerHoverProvider(languageId, createHoverProvider(options));\n monaco.languages.registerDefinitionProvider(languageId, {\n provideDefinition(model, position) {\n const word = model.getWordAtPosition(position);\n if (!word) return [];\n const symbols = options.application?.(model);\n const reference = eventSourceReferenceAt(model.getLinesContent(), position.lineNumber - 1, word.startColumn, word.endColumn, symbols);\n const reaction = reactionReferenceAt(model.getLinesContent(), position.lineNumber - 1, word.startColumn, word.endColumn, symbols);\n const target = reaction ? reaction.target : reference?.target;\n if (!target) return [];\n const current = symbols?.authoringPath ?? 'current.play';\n const source = target.location.path === current ? model.getValue() : symbols?.authoringDocuments?.find(document => document.path === target.location.path)?.source;\n const location = reaction ? reaction.target?.location : source && eventSourceIdentifier(target.location, target.name, source);\n if (!location) return [];\n // Foreign navigation requires an actual host model, not a guessed path or merged line.\n const targetUri = target.location.path && model.uri.path.endsWith(`/${current}`)\n ? model.uri.with({ path: model.uri.path.slice(0, -current.length) + target.location.path }) : undefined;\n const targetModels = targetUri ? monaco.editor.getModels().filter(candidate => candidate.uri.toString() === targetUri.toString()) : [];\n const targetModel = target.location.path === current ? model : targetModels.length === 1 ? targetModels[0] : undefined;\n return targetModel ? [{ uri: targetModel.uri, range: new monaco.Range(location.line, location.column, location.line, location.column + target.name.length) }] : [];\n }\n });\n monaco.languages.registerDocumentSemanticTokensProvider(languageId, {\n getLegend: () => ({ tokenTypes: [...responseTokenTypes], tokenModifiers: [] }),\n provideDocumentSemanticTokens(model) {\n const data: number[] = [];\n let previousLine = 0;\n let previousColumn = 0;\n for (const token of responseTokens(model.getLinesContent(), options.application?.(model))) {\n data.push(token.line - previousLine, token.line === previousLine ? token.column - previousColumn : token.column, token.length, token.type, 0);\n previousLine = token.line;\n previousColumn = token.column;\n }\n return { data: new Uint32Array(data) };\n },\n releaseDocumentSemanticTokens() {},\n });\n monaco.languages.registerInlayHintsProvider(languageId, createInlayHintsProvider(options));\n monaco.languages.registerCodeActionProvider(languageId, createCodeActionProvider());\n monaco.editor.defineTheme(screenplayDarkThemeName, screenplayDark);\n monaco.editor.defineTheme(screenplayLightThemeName, screenplayLight);\n attachDiagnostics(monaco, options);\n}\n\nexport { reactionReferenceAt } from './reaction-authoring';\n\nexport {\n causedByProperties,\n clauseKeywords,\n codeBlockTags,\n conceptAttributes,\n constructKeywords,\n contextRoots,\n languageId,\n primitiveTypes,\n sliceTypes,\n} from './language';\nexport type { Monaco } from './language';\nexport { getSubLanguage, getSubLanguages, registerSubLanguage } from './sub-language-registry';\nexport type {\n MonarchTokenRules,\n SubLanguage,\n SubLanguageCompletion,\n SubLanguageDefinition,\n} from './sub-language-registry';\nexport { pdl } from './sub-languages/pdl';\nexport { cdl } from './sub-languages/cdl';\nexport { screenplayDarkThemeName } from './themes/screenplay-dark';\nexport { screenplayLightThemeName } from './themes/screenplay-light';\nexport { enclosingChain, fenceMap, firstWord, indentOf, withoutComment } from './document-context';\nexport { exampleCompletions, exampleHover } from './example-authoring';\nexport {\n fileReferenceKeyword,\n fileReferenceOn,\n fileReferences,\n isAbsoluteFileReferencePath,\n} from './file-references';\nexport type { FileReference } from './file-references';\nexport { fileImportOn, fileImports, importablePaths, isFileImportLine } from './file-imports';\nexport type { FileImport } from './file-imports';\nexport type { CompletionOptions } from './completions';\nexport { declarationHeaders, type DeclarationHeader } from './declarations';\nexport { builtInTriggerNames, knownEventNames, knownTriggerNames, knownTypeNames, mergeSymbols, scanDocument, symbolsForBuffer } from './symbols';\nexport type {\n CommandSymbol,\n ConceptSymbol,\n DocumentSymbols,\n EventSymbol,\n ImportSymbol,\n NamedSymbol,\n PolicySymbol,\n PropertySymbol,\n ReadSymbol,\n QuerySymbol,\n TypeSymbol,\n} from './symbols';\nexport { attributeDocs, contextVariableDocs, keywordDocs, specificationKeywordDocs } from './keyword-docs';\nexport { eventContextMemberAt, eventContextMembers, eventContextMembersAfter, eventContextPaths, namesEventContextMember } from './event-context';\nexport type { EventContextMember, EventContextPath } from './event-context';\nexport { contextVariableEntries, contextVariableItems, producesItems, specificationStepItems } from './completion-items';\nexport type { CompletionEntry } from './completion-items';\nexport { completionEntriesFor, planCompletions } from './completion-planner';\nexport type { CompletionPlan } from './completion-planner';\nexport { responseTokens, responseTokenTypes } from './response-tokens';\nexport { responseCompletions } from './response-completions';\nexport { structureCompletion } from './structure-completions';\nexport { blockHeaderPattern } from './language';\nexport type { StructureCompletion } from './structure-completions';\nexport { analyzeEventSources, eventSourceAvailability, eventSourceCompletions, eventSourceDetails, eventSourceHover, eventSourceIdentifier, eventSourceReferenceAt } from './event-source-authoring';\nexport type { EventSourceAnalysis } from './EventSourceAnalysis';\nexport type { AuthoredEventSource } from './AuthoredEventSource';\nexport type { AuthoredStream } from './AuthoredStream';\nexport type { AuthoredCommandRoute } from './AuthoredCommandRoute';\nexport type { AuthoredSpecificationEvent } from './AuthoredSpecificationEvent';\nexport { analyzeOperations, operationCompletions, operationDetails, operationAvailability, operationHover, operationReferenceAt, phaseState } from './operation-authoring';\nexport type { OperationAnalysis, OperationDeclaration, OperationInput, OperationPhase, OperationReference, SystemDeclaration } from './OperationAnalysis';\nexport { responseAvailability, responseAnalysis } from './response-analysis';\nexport { hoverContent } from './hover-content';\nexport { validateLines } from './validation';\nexport { destinationHints, productionDestinations } from './production-destinations';\nexport type { DestinationHint } from './DestinationHint';\nexport type { ProductionSymbol } from './ProductionSymbol';\nexport type { ValidationContext, ValidationIssue, ValidationSeverity } from './validation';\nexport { createCodeActionProvider } from './code-actions';\nexport { typeReferenceSymbol, typeReferenceText } from './TypeReferenceSymbol';\nexport type { TypeReferenceSymbol } from './TypeReferenceSymbol';\nexport { diagnosticCodes } from './diagnostic-codes';\nexport type { DiagnosticCode } from './diagnostic-codes';\n"],"mappings":"s7GA8BA,MAAMA,kBAAsB,IAAI,IAEhC,SAAS,oBAAoB,EAAsB,CAC/CC,EAAO,UAAU,yBAAyBC,EAAYC,EAAqBC,EAAgB,CAAC,CAAC,CACjG,CAGAC,OAA4BL,EAAoB,QAAQ,mBAAmB,CAAC,EAI5E,SAAgB,2BAAkC,CACzCM,EAAe,YAAY,GAAGC,EAAoB,aAAcC,CAAG,EACnEF,EAAe,SAAS,GA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E1C,EAAO,OAAO,YAAY2C,EAA0BC,EAAe,EACnEC,GAAkB7C,EAAQY,CAAO,EACrC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"./_virtual/_virtual/_rolldown/runtime.js";import{causedByProperties as e,contextRoots as t,identityProperties as n,primitiveTypes as r,sliceTypes as i}from"./language.js";import{DiagnosticCodes as a}from"./compiler/Diagnostics/DiagnosticCodes.js";import{legacyOptionalTypeLength as o}from"./compiler/Authoring/QuickFixes.js";import"./compiler/index.js";import{enclosingChain as s,fenceMap as c,indentOf as l}from"./document-context.js";import{eventAnalysisSource as u}from"./event-analysis-source.js";import{resolveEventContextPath as d}from"./event-context.js";import{responseAnalysis as f}from"./response-analysis.js";import{knownEventNames as p,knownTypeNames as m,mergeSymbols as h,propertyTypeReference as g,scanDocument as _,symbolsForBuffer as v}from"./symbols.js";import{diagnosticCodes as y}from"./diagnostic-codes.js";import{validateInlineEvents as b}from"./inline-event-validation.js";import{fileImportOn as x,isFileImportLine as S}from"./file-imports.js";function issue(e,t,n,r,i,a){return{severity:e,message:i,line:t,startColumn:n,endColumn:n+r,code:a}}function tokenIssue(e,t,n,r,i,a){return issue(e,t,n.indexOf(r)+1,r.length,i,a)}function validateDeclarations(e,t,n){let i=[],a=/* @__PURE__ */ new Set([...m(t,r),...m(n,[])]),checkProperties=(e,t)=>{for(let n of e.filter(e=>!a.has(g(e).name))){let e=g(n).name;i.push(issue(`warning`,n.line,n.sourceType.startColumn,n.sourceType.text.length,e===`optional`?`Unknown type 'optional' on '${n.name}' of ${t} — did you forget the type before 'optional'?`:`Unknown type '${e}' on '${n.name}' of ${t} — declare it with 'concept ${e} : <Primitive>' or 'type ${e}'.`,y.unknownType))}};for(let e of t.types)checkProperties(e.properties,`type '${e.name}'`);for(let e of t.events)checkProperties(e.properties,`event '${e.name}'`);for(let e of t.queries)checkProperties(e.parameters,`query '${e.name}'`);for(let n of t.commands){checkProperties(n.properties,`command '${n.name}'`);let t=n.properties.filter(e=>e.isIdentifier);for(let r of t.slice(1))i.push(tokenIssue(`error`,r.line,e[r.line],`identifier`,`Command '${n.name}' already marks '${t[0].name}' as identifier — only one property can be the identifier.`,y.duplicateCommandIdentifier))}let o=/* @__PURE__ */ new Map;for(let n of[...t.concepts,...t.types])o.get(n.name)===void 0?o.set(n.name,n.line):i.push(tokenIssue(`error`,n.line,e[n.line],n.name,`Duplicate declaration of '${n.name}' — concept and type names must be unique.`,y.duplicateDeclaration));return i}function validateLines(s,u={}){let d=c(s),m=_(s),g=u.application??h(),x=v(s,{...g,authoringPath:u.path??g.authoringPath,authoringPlacement:u.placement??g.authoringPlacement}),S=f(s,x.authoringDocuments??x.authoringSources?.filter(e=>e!==s.join(`
|
|
2
|
-
`)),x.authoringPlacement,x.authoringPath,x.authoringPlacementResolved),C=new Set(S.eventSources.routes.map(e=>e.location.line-1)),w={...m,commands:m.commands.map(e=>({...e,properties:e.properties.filter(e=>!C.has(e.line)),produces:e.produces?.filter(e=>!S.operationProductionLines?.has(e.line)),productionHeaders:e.productionHeaders?.filter(e=>!S.operationProductionLines?.has(e))}))},T=/* @__PURE__ */ new Set([...p(w),...p(g)]),E=new Set([...w.policies,...g.policies].map(e=>e.name)),D=validateDeclarations(s,w,g);D.push(...validateProductionDestinations(s,w));let O=/* @__PURE__ */ new Set([a.UnknownGenerationStrategy,a.InvalidGenerationArgument,a.InvalidGenerationModifier,a.DuplicateGenerationModifier,a.DuplicateGeneration,a.InvalidGenerationPrimitive,a.InvalidGenerationPrefix,a.InvalidGenerationAlphabet,a.InvalidTypeIdPrefix,a.GenerationSizeOutsideRange,a.ReservedSequenceGeneration,a.LowGenerationEntropy,a.LowGeneratedIdentifierEntropy,a.RefutedGeneratedConceptRule,a.UnprovenGeneratedConceptRule,a.GenerationSupportBudgetExceeded,a.EmptyGenerationSupport]),k=/* @__PURE__ */ new Set([a.MixedEnumerationNumbering,a.DuplicateEnumerationNumber,a.EnumerationNumberOutsideInt32,a.MalformedEnumerationNumber,a.UnpinnedStoredEnumeration]),A=/* @__PURE__ */ new Set([a.LegacyOptionalSuffix,a.InvalidOptionalModifierOrder,a.OptionalReadsNotSupported]),j=/* @__PURE__ */ new Set([a.UnexpectedTokenInPolicyCondition,a.ExpectedPolicyCondition,a.UnclosedPolicyConditionGroup,a.ExpectedRoleName,a.ExpectedClaimName,a.ExpectedClaimMatches,a.ExpectedClaimMatchTarget,a.AnonymousPolicyCombined,a.NegatedAnonymousPolicy]),M=/* @__PURE__ */ new Set([a.UnknownEvent,a.UnknownReadModelProperty,a.PiiNotSupportedOnIdentifier]),N=/* @__PURE__ */ new Set([a.EventFromLaterSlice,a.TimelineCycleGroup]),P=/* @__PURE__ */ new Set([a.UndeclaredDependency,a.UnusedDependencyDeclaration,a.InvalidDependencyTarget,a.RepeatedDependencyDeclaration,a.MutualDependencyDeclarations,a.AmbiguousReference]),F=/* @__PURE__ */ new Set([a.InvalidSpecificationInvocation,a.InvalidActionSubjectClause,a.InferredActionSubject,a.ChangedActionSubject,a.AmbiguousActionInputBinding,a.UnsupportedActionSubjectContext,a.InvalidTimeZoneDeclaration,a.InvalidCommandCalendar,a.InvalidSpecificationTimeZone,a.InvalidCommandReadsDeclaration,a.UnknownMatchPattern,a.InvalidMatchPattern,a.PatternOutsidePortableMatchDialect,a.AmbiguousMatchPattern,a.DeprecatedStudioTextRulePattern,a.MismatchedSpecificationQueryResult,a.DirectionlessTranslationReactsToOwnCapture,a.CaptureEventsFromSeveralOrigins,a.CaptureEventsKeyNotRequired,a.CaptureEventsRecordFixture,a.CaptureEventSourceKeyOutsideEvents,a.EventIdPinNotCarriedToRenderers,a.ResponseNameUsedOnFailure,a.InvalidEventDeclaration,a.InvalidImportDeclaration,a.InvalidSliceDeclaration,a.InvalidDescription,a.DuplicateDescription,a.EmptyDescription,a.DuplicateEventSubject,a.InvalidSubjectType,a.ProtectedSubjectType,a.InvalidSubjectOwner,a.ReadModelSubjectNotSupported,a.InvalidSubjectModifierOrder,a.UnsupportedInteractionAlternatives,a.MixedInteractionAlternatives,a.InteractionAlternativeWithoutActions,a.InlineInteractionAlternative,a.LegacyInteractionWhere,a.InvalidSpecificationParameter,a.InvalidSpecificationCase,a.DuplicateSpecificationParameter,a.DuplicateSpecificationCase,a.IncompleteSpecificationTable,a.InvalidSpecificationCaseAssignment,a.InvalidSpecificationCaseValue,a.InvalidSpecificationCaseReference,a.OptionalSpecificationParameterTarget,a.SpecificationCaseNameCollision,a.IncompatibleSpecificationParameterType,a.UnusedSpecificationParameter,a.SingularSpecificationTableExpansion,a.InvalidSpecificationCallerPersona,a.UnsynthesizablePersonaCaller,a.PersonaWithoutGate,a.GateWithoutPersona,a.AmbiguousPersonaCaller,a.InvalidDocumentation,a.ConflictingDocumentationAcrossFiles,a.InvalidAbsentReadModelStep,a.UnknownConstraintProperty,a.OmittedProductionDestination,a.InvalidSpecificationExample,a.DuplicateSpecificationAssignment,a.InvalidReactionBatchesDeclaration,a.DescribedCommandNotImplemented,a.DescribedCommandWithoutProductions,a.DescribedCommandCardinalityNotAdmitted,a.CommandHandlerRequiresAttachment,a.PendingIntentWithOtherHandler,a.DuplicateEventInProjectionScope,a.ReservedStoredName,a.ContextSourcedPerformedQueryArgument]),I=/* @__PURE__ */ new Set([a.InvalidPurposeDeclaration,a.InvalidPurposeVocabulary,a.DuplicatePurposeField,a.DuplicatePurposeDeclaration,a.UnknownPurpose,a.PurposeInterestMismatch,a.PersonalDataWithoutPurpose,a.SpecialDataWithoutCondition,a.CriminalDataWithoutAuthorization,a.PurposeWithoutBasis,a.UnusedPurpose,a.UnknownConceptDirective,a.AttributeReasonWithoutAttribute,a.DuplicateAttributeReason,a.LegacyComplianceMarker,a.DuplicateComplianceMarker,a.UnknownComplianceMarker,a.InvalidSecretScope,a.DuplicateSecretScope,a.SecretScopeIgnoredForPii,a.InvalidPersonalDataQualifier,a.DuplicateSpecialCategory]),L=/* @__PURE__ */ new Set;for(let e of u.compilerDiagnostics??S.diagnostics){let t=e.code===a.UnknownType&&(S.identityDetails??[]).some(t=>t.line===e.location.line-1),n=e.code===a.RepeatedSingularDeclarationAcrossFiles&&e.message.includes(`identity block`);if(!(e.code===a.DuplicateDeclaration&&e.message.startsWith(`Duplicate declaration of policy `))&&!t&&!n&&!O.has(e.code)&&!k.has(e.code)&&!I.has(e.code)&&!A.has(e.code)&&!j.has(e.code)&&!M.has(e.code)&&!N.has(e.code)&&!P.has(e.code)&&!F.has(e.code)&&e.code!==a.ReducerIdentityMismatch&&e.code!==a.InvalidSpecificationExampleBody&&e.code!==a.UnknownRuleImplementationDirective&&e.code!==a.InvalidValidationRule&&e.code!==a.RepeatedDeclarationAcrossFiles&&!/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$|^PLAY060[7-9]$|^PLAY061[0-9]$|^PLAY0620$|^PLAY062[1-9]$|^PLAY063[0-9]$|^PLAY064[0-9]$|^PLAY065[0-2]$|^PLAY065[4-6]$|^PLAY066[0-6]$|^PLAY072[0-2]$/.test(e.code))continue;let r=e.location.line-1;if(e.code===a.OmittedProductionDestination&&D.some(t=>t.code===e.code&&t.line===r))continue;if(e.code===a.UnknownEvent){if(L.has(r))continue;L.add(r)}let i=o(s[r],e)||s[r].length-e.location.column+1;D.push(issue(e.severity,r,e.location.column,i,e.message,e.code))}let checkEvent=(e,t,n)=>{!T.has(n)&&!L.has(e)&&D.push(tokenIssue(`warning`,e,t,n,`Unknown event type '${n}' — declare it in a slice or import it.`,y.unknownEvent))},R=-1;for(let a=0;a<s.length;a++){let o=s[a],c=o.trim();if(d[a]||c.length===0)continue;let u=o.match(/^[ ]*(\t+)/);if(u&&D.push(issue(`warning`,a,u[0].length-u[1].length+1,u[1].length,`Screenplay is indentation-based — use spaces, not tabs.`,y.tabIndentation)),R>=0){if(l(o)>R&&/^(?:or\s+)?[A-Z]\w*(?:\s+or\s+[A-Z]\w*)*$/.test(c)){for(let e of c.split(/\s+/).filter(e=>e!==`or`))E.has(e)||D.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy));continue}R=-1}let f=validateImport(s,d,a);f&&D.push(f);let p=c.match(/^slice\s+(\w+)/);p&&!i.includes(p[1])&&D.push(tokenIssue(`error`,a,o,p[1],`Unknown slice type '${p[1]}' — expected ${i.join(`, `)}.`,y.unknownSliceType));let m=c.match(/^concept\s+\w+\s*:\s*(\w+)/);m&&m[1]!==`Enum`&&!r.includes(m[1])&&D.push(tokenIssue(`error`,a,o,m[1],`Unknown primitive type '${m[1]}' — expected ${r.join(`, `)} or Enum.`,y.unknownPrimitiveType));let h=c.match(/^authorize\s+(.*)$/);if(h){R=l(o);for(let e of h[1].split(/\s+/).filter(e=>e!==`or`&&e.length>0))E.has(e)||D.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy))}let g=c.match(/^on\s+([A-Z]\w*)\s*$/);g&&checkEvent(a,o,g[1]);let _=c.match(/^produces\s+([A-Z]\w*)\s*$/);if(_&&!S.operationProductionLines?.has(a)&&checkEvent(a,o,_[1]),/^produces\s+when\b/.test(c)&&!S.operationProductionLines?.has(a))for(let e=a+1;e<s.length;e++){let t=s[e];if(!(d[e]||t.trim().length===0)){if(l(t)>l(o)){let n=t.trim().match(/^([A-Z]\w*)\s*$/);n&&checkEvent(e,t,n[1])}break}}let v=c.match(/^unique\s+event\s+([A-Z]\w*)/);v&&checkEvent(a,o,v[1]);let b=c.match(/^unique\s+[a-z_]\w*\s+on\s+([A-Z]\w*)/);b&&checkEvent(a,o,b[1]);for(let e of o.match(/\$identity\.[\w.]+/g)??[]){let t=e.substring(10).split(`.`)[0],r=[...n,...(S.identityDetails??[]).map(e=>e.name)];r.includes(t)||D.push(tokenIssue(`warning`,a,o,e,`Unknown $identity property '${t}' — expected ${r.join(`, `)}.`,y.unknownContextIdentityProperty))}for(let r of o.match(/\$context\.[\w.]+/g)??[]){let i=r.substring(9).split(`.`);t.includes(i[0])?i[0]===`causedBy`&&i.length>1&&!e.includes(i[1])?D.push(tokenIssue(`warning`,a,o,r,`Unknown $context.causedBy property '${i[1]}' — expected ${e.join(`, `)}.`,y.unknownContextCausedByProperty)):i[0]===`identity`&&i.length>1&&!n.includes(i[1])&&D.push(tokenIssue(`warning`,a,o,r,`Unknown $context.identity property '${i[1]}' — expected ${n.join(`, `)}.`,y.unknownContextIdentityProperty)):D.push(tokenIssue(`warning`,a,o,r,`Unknown $context path '${i.join(`.`)}' — expected one of ${t.join(`, `)}.`,y.unknownContextPath))}}D.push(...validateEventContextPaths(s,d)),D.push(...b(s,w,g,S.operationProductionLines));let z=s.map((e,t)=>({line:e,index:t})).filter(({line:e})=>/^\s*```(?:[a-z]+)?\s*$/.test(e));if(z.length%2==1){let e=z[z.length-1];D.push(issue(`error`,e.index,1,e.line.length+1,"Unclosed inline code block — expected a closing ``` line.",y.unclosedCodeBlock))}return D}function validateProductionDestinations(e,t){let n=[];e=u(e);for(let r of t.commands){let t=r.properties.filter(e=>e.isIdentifier&&!g(e).isOptional&&!g(e).isCollection);if(t.length===1)for(let i of r.produces??[]){if(i.inline||i.conditional||i.target!==void 0)continue;let r=i.line;n.push(issue(`information`,r,l(e[r])+1,e[r].trim().length,`Plain 'produces ${i.name}' omits its destination — use 'for ${t[0].name}' to explicitly select the command's identifier.`,y.omittedProductionDestination))}}return n}function validateImport(e,t,n){let r=e[n],i=r.trim().replace(/\s*\/\/.*$/,``);if(!/^import\b/.test(i)||x(r,n))return;let a=l(r);if(a>0&&[`module`,`feature`].includes(s(e,t,n,a)[0])||S(r))return issue(`error`,n,a+1,i.length,`Invalid import '${i}' — inside a module or feature, import names files: 'import "<path or glob>"'.`,y.invalidFileImport)}const C=/^(?:(?:increment|decrement|count|clear|add|subtract|set)\s+)?@?([$\w.]+)(?=\s|=|$)/;function validateEventContextPaths(e,t){let n=[],names=e=>e.map(e=>e.name).join(`, `);for(let r=0;r<e.length;r++){let i=e[r];if(t[r])continue;for(let e of i.matchAll(/(\.)?\$eventContext((?:\.(?:\w+(?:\(\))?)?)*)/g)){let t=e[0].substring(e[1]?.length??0),i=e[2];if(i.length===0){e[1]&&n.push(issue(`error`,r,(e.index??0)+2,t.length,`'$eventContext' names no member - expected one of ${names(d(``).expected)}.`,y.missingEventContextPath));continue}let a=i.substring(1),o=d(a),s=(e.index??0)+(e[1]?.length??0)+1;switch(o.status){case`missing`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' names no member - expected one of ${names(o.expected)}.`,y.missingEventContextPath));break;case`unknownMember`:n.push(issue(`warning`,r,s,t.length,`Unknown event context member '${o.segment}' in '$eventContext.${a}' - expected one of ${names(o.expected)}.`,y.unknownEventContextMember));break;case`unknownSubPath`:{let e=o.expected.length===0?`no members to address`:`members ${names(o.expected)}`;n.push(issue(`warning`,r,s,t.length,`Unknown event context path '$eventContext.${a}' - '${o.member?.name}' (${o.member?.type}) has ${e}.`,y.unknownEventContextPath));break}case`belowCollection`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' cannot resolve - '${o.member?.name}' is a collection (${o.member?.type}) and cannot be addressed below.`,y.eventContextPathBelowCollection))}}let a=i.trim().match(C)?.[1],o=a?.match(/\.\$(\w+)/)?.[1];a&&o&&o!==`eventContext`&&n.push(tokenIssue(`warning`,r,i,a,`Dynamic dictionary key '$${o}' in '${a}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${o}' becomes the key.`,y.unresolvedDynamicKeySource))}return n}export{validateEventContextPaths,validateLines};
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{causedByProperties as e,contextRoots as t,identityProperties as n,primitiveTypes as r,sliceTypes as i}from"./language.js";import{DiagnosticCodes as a}from"./compiler/Diagnostics/DiagnosticCodes.js";import{legacyOptionalTypeLength as o}from"./compiler/Authoring/QuickFixes.js";import"./compiler/index.js";import{enclosingChain as s,fenceMap as c,indentOf as l}from"./document-context.js";import{eventAnalysisSource as u}from"./event-analysis-source.js";import{resolveEventContextPath as d}from"./event-context.js";import{responseAnalysis as f}from"./response-analysis.js";import{knownEventNames as p,knownTypeNames as m,mergeSymbols as h,propertyTypeReference as g,scanDocument as _,symbolsForBuffer as v}from"./symbols.js";import{diagnosticCodes as y}from"./diagnostic-codes.js";import{validateInlineEvents as b}from"./inline-event-validation.js";import{fileImportOn as x,isFileImportLine as S}from"./file-imports.js";function issue(e,t,n,r,i,a){return{severity:e,message:i,line:t,startColumn:n,endColumn:n+r,code:a}}function tokenIssue(e,t,n,r,i,a){return issue(e,t,n.indexOf(r)+1,r.length,i,a)}function validateDeclarations(e,t,n){let i=[],a=/* @__PURE__ */ new Set([...m(t,r),...m(n,[])]),checkProperties=(e,t)=>{for(let n of e.filter(e=>!a.has(g(e).name))){let e=g(n).name;i.push(issue(`warning`,n.line,n.sourceType.startColumn,n.sourceType.text.length,e===`optional`?`Unknown type 'optional' on '${n.name}' of ${t} — did you forget the type before 'optional'?`:`Unknown type '${e}' on '${n.name}' of ${t} — declare it with 'concept ${e} : <Primitive>' or 'type ${e}'.`,y.unknownType))}};for(let e of t.types)checkProperties(e.properties,`type '${e.name}'`);for(let e of t.events)checkProperties(e.properties,`event '${e.name}'`);for(let e of t.queries)checkProperties(e.parameters,`query '${e.name}'`);for(let n of t.commands){checkProperties(n.properties,`command '${n.name}'`);let t=n.properties.filter(e=>e.isIdentifier);for(let r of t.slice(1))i.push(tokenIssue(`error`,r.line,e[r.line],`identifier`,`Command '${n.name}' already marks '${t[0].name}' as identifier — only one property can be the identifier.`,y.duplicateCommandIdentifier))}let o=/* @__PURE__ */ new Map;for(let n of[...t.concepts,...t.types])o.get(n.name)===void 0?o.set(n.name,n.line):i.push(tokenIssue(`error`,n.line,e[n.line],n.name,`Duplicate declaration of '${n.name}' — concept and type names must be unique.`,y.duplicateDeclaration));return i}const C=/* @__PURE__ */ new Set([`and`,`or`,`not`]),w=/^(?:(?:and|or|not)\s+|\()*[A-Z]\w*\)*(?:\s+(?:(?:and|or|not)\s+|\()*[A-Z]\w*\)*)*$/;function policyNames(e){return(e.match(/[A-Za-z_]\w*/g)??[]).filter(e=>!C.has(e))}function validateLines(s,u={}){let d=c(s),m=_(s),g=u.application??h(),x=v(s,{...g,authoringPath:u.path??g.authoringPath,authoringPlacement:u.placement??g.authoringPlacement}),S=f(s,x.authoringDocuments??x.authoringSources?.filter(e=>e!==s.join(`
|
|
2
|
+
`)),x.authoringPlacement,x.authoringPath,x.authoringPlacementResolved),C=new Set(S.eventSources.routes.map(e=>e.location.line-1)),T={...m,commands:m.commands.map(e=>({...e,properties:e.properties.filter(e=>!C.has(e.line)),produces:e.produces?.filter(e=>!S.operationProductionLines?.has(e.line)),productionHeaders:e.productionHeaders?.filter(e=>!S.operationProductionLines?.has(e))}))},E=/* @__PURE__ */ new Set([...p(T),...p(g)]),D=new Set([...T.policies,...g.policies].map(e=>e.name)),O=validateDeclarations(s,T,g);O.push(...validateProductionDestinations(s,T));let k=/* @__PURE__ */ new Set([a.UnknownGenerationStrategy,a.InvalidGenerationArgument,a.InvalidGenerationModifier,a.DuplicateGenerationModifier,a.DuplicateGeneration,a.InvalidGenerationPrimitive,a.InvalidGenerationPrefix,a.InvalidGenerationAlphabet,a.InvalidTypeIdPrefix,a.GenerationSizeOutsideRange,a.ReservedSequenceGeneration,a.LowGenerationEntropy,a.LowGeneratedIdentifierEntropy,a.RefutedGeneratedConceptRule,a.UnprovenGeneratedConceptRule,a.GenerationSupportBudgetExceeded,a.EmptyGenerationSupport]),A=/* @__PURE__ */ new Set([a.MixedEnumerationNumbering,a.DuplicateEnumerationNumber,a.EnumerationNumberOutsideInt32,a.MalformedEnumerationNumber,a.UnpinnedStoredEnumeration]),j=/* @__PURE__ */ new Set([a.LegacyOptionalSuffix,a.InvalidOptionalModifierOrder,a.OptionalReadsNotSupported]),M=/* @__PURE__ */ new Set([a.UnexpectedTokenInPolicyCondition,a.ExpectedPolicyCondition,a.UnclosedPolicyConditionGroup,a.ExpectedRoleName,a.ExpectedClaimName,a.ExpectedClaimMatches,a.ExpectedClaimMatchTarget,a.AnonymousPolicyCombined,a.NegatedAnonymousPolicy]),N=/* @__PURE__ */ new Set([a.UnknownEvent,a.UnknownReadModelProperty,a.PiiNotSupportedOnIdentifier]),P=/* @__PURE__ */ new Set([a.EventFromLaterSlice,a.TimelineCycleGroup]),F=/* @__PURE__ */ new Set([a.UndeclaredDependency,a.UnusedDependencyDeclaration,a.InvalidDependencyTarget,a.RepeatedDependencyDeclaration,a.MutualDependencyDeclarations,a.AmbiguousReference]),I=/* @__PURE__ */ new Set([a.InvalidSpecificationInvocation,a.InvalidActionSubjectClause,a.InferredActionSubject,a.ChangedActionSubject,a.AmbiguousActionInputBinding,a.UnsupportedActionSubjectContext,a.InvalidTimeZoneDeclaration,a.InvalidCommandCalendar,a.InvalidSpecificationTimeZone,a.InvalidCommandReadsDeclaration,a.UnknownMatchPattern,a.InvalidMatchPattern,a.PatternOutsidePortableMatchDialect,a.AmbiguousMatchPattern,a.DeprecatedStudioTextRulePattern,a.MismatchedSpecificationQueryResult,a.DirectionlessTranslationReactsToOwnCapture,a.CaptureEventsFromSeveralOrigins,a.CaptureEventsKeyNotRequired,a.CaptureEventsRecordFixture,a.CaptureEventSourceKeyOutsideEvents,a.EventIdPinNotCarriedToRenderers,a.ResponseNameUsedOnFailure,a.InvalidEventDeclaration,a.InvalidImportDeclaration,a.InvalidSliceDeclaration,a.InvalidDescription,a.DuplicateDescription,a.EmptyDescription,a.DuplicateEventSubject,a.InvalidSubjectType,a.ProtectedSubjectType,a.InvalidSubjectOwner,a.ReadModelSubjectNotSupported,a.InvalidSubjectModifierOrder,a.UnsupportedInteractionAlternatives,a.MixedInteractionAlternatives,a.InteractionAlternativeWithoutActions,a.InlineInteractionAlternative,a.LegacyInteractionWhere,a.InvalidSpecificationParameter,a.InvalidSpecificationCase,a.DuplicateSpecificationParameter,a.DuplicateSpecificationCase,a.IncompleteSpecificationTable,a.InvalidSpecificationCaseAssignment,a.InvalidSpecificationCaseValue,a.InvalidSpecificationCaseReference,a.OptionalSpecificationParameterTarget,a.SpecificationCaseNameCollision,a.IncompatibleSpecificationParameterType,a.UnusedSpecificationParameter,a.SingularSpecificationTableExpansion,a.InvalidSpecificationCallerPersona,a.UnsynthesizablePersonaCaller,a.PersonaWithoutGate,a.GateWithoutPersona,a.AmbiguousPersonaCaller,a.InvalidDocumentation,a.ConflictingDocumentationAcrossFiles,a.InvalidAbsentReadModelStep,a.UnknownConstraintProperty,a.OmittedProductionDestination,a.InvalidSpecificationExample,a.DuplicateSpecificationAssignment,a.InvalidReactionBatchesDeclaration,a.DescribedCommandNotImplemented,a.DescribedCommandWithoutProductions,a.DescribedCommandCardinalityNotAdmitted,a.CommandHandlerRequiresAttachment,a.PendingIntentWithOtherHandler,a.DuplicateEventInProjectionScope,a.ReservedStoredName,a.ContextSourcedPerformedQueryArgument]),L=/* @__PURE__ */ new Set([a.InvalidPurposeDeclaration,a.InvalidPurposeVocabulary,a.DuplicatePurposeField,a.DuplicatePurposeDeclaration,a.UnknownPurpose,a.PurposeInterestMismatch,a.PersonalDataWithoutPurpose,a.SpecialDataWithoutCondition,a.CriminalDataWithoutAuthorization,a.PurposeWithoutBasis,a.UnusedPurpose,a.UnknownConceptDirective,a.AttributeReasonWithoutAttribute,a.DuplicateAttributeReason,a.LegacyComplianceMarker,a.DuplicateComplianceMarker,a.UnknownComplianceMarker,a.InvalidSecretScope,a.DuplicateSecretScope,a.SecretScopeIgnoredForPii,a.InvalidPersonalDataQualifier,a.DuplicateSpecialCategory]),R=/* @__PURE__ */ new Set;for(let e of u.compilerDiagnostics??S.diagnostics){let t=e.code===a.UnknownType&&(S.identityDetails??[]).some(t=>t.line===e.location.line-1),n=e.code===a.RepeatedSingularDeclarationAcrossFiles&&e.message.includes(`identity block`);if(!(e.code===a.DuplicateDeclaration&&e.message.startsWith(`Duplicate declaration of policy `))&&!t&&!n&&!k.has(e.code)&&!A.has(e.code)&&!L.has(e.code)&&!j.has(e.code)&&!M.has(e.code)&&!N.has(e.code)&&!P.has(e.code)&&!F.has(e.code)&&!I.has(e.code)&&e.code!==a.ReducerIdentityMismatch&&e.code!==a.InvalidSpecificationExampleBody&&e.code!==a.UnknownRuleImplementationDirective&&e.code!==a.InvalidValidationRule&&e.code!==a.RepeatedDeclarationAcrossFiles&&!/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$|^PLAY060[7-9]$|^PLAY061[0-9]$|^PLAY0620$|^PLAY062[1-9]$|^PLAY063[0-9]$|^PLAY064[0-9]$|^PLAY065[0-2]$|^PLAY065[4-6]$|^PLAY066[0-6]$|^PLAY072[0-2]$/.test(e.code))continue;let r=e.location.line-1;if(e.code===a.OmittedProductionDestination&&O.some(t=>t.code===e.code&&t.line===r))continue;if(e.code===a.UnknownEvent){if(R.has(r))continue;R.add(r)}let i=o(s[r],e)||s[r].length-e.location.column+1;O.push(issue(e.severity,r,e.location.column,i,e.message,e.code))}let checkEvent=(e,t,n)=>{!E.has(n)&&!R.has(e)&&O.push(tokenIssue(`warning`,e,t,n,`Unknown event type '${n}' — declare it in a slice or import it.`,y.unknownEvent))},z=-1;for(let a=0;a<s.length;a++){let o=s[a],c=o.trim();if(d[a]||c.length===0)continue;let u=o.match(/^[ ]*(\t+)/);if(u&&O.push(issue(`warning`,a,u[0].length-u[1].length+1,u[1].length,`Screenplay is indentation-based — use spaces, not tabs.`,y.tabIndentation)),z>=0){if(l(o)>z&&w.test(c)){for(let e of policyNames(c))D.has(e)||O.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy));continue}z=-1}let f=validateImport(s,d,a);f&&O.push(f);let p=c.match(/^slice\s+(\w+)/);p&&!i.includes(p[1])&&O.push(tokenIssue(`error`,a,o,p[1],`Unknown slice type '${p[1]}' — expected ${i.join(`, `)}.`,y.unknownSliceType));let m=c.match(/^concept\s+\w+\s*:\s*(\w+)/);m&&m[1]!==`Enum`&&!r.includes(m[1])&&O.push(tokenIssue(`error`,a,o,m[1],`Unknown primitive type '${m[1]}' — expected ${r.join(`, `)} or Enum.`,y.unknownPrimitiveType));let h=c.match(/^authorize\s+(.*)$/);if(h){z=l(o);for(let e of policyNames(h[1]))D.has(e)||O.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy))}let g=c.match(/^on\s+([A-Z]\w*)\s*$/);g&&checkEvent(a,o,g[1]);let _=c.match(/^produces\s+([A-Z]\w*)\s*$/);if(_&&!S.operationProductionLines?.has(a)&&checkEvent(a,o,_[1]),/^produces\s+when\b/.test(c)&&!S.operationProductionLines?.has(a))for(let e=a+1;e<s.length;e++){let t=s[e];if(!(d[e]||t.trim().length===0)){if(l(t)>l(o)){let n=t.trim().match(/^([A-Z]\w*)\s*$/);n&&checkEvent(e,t,n[1])}break}}let v=c.match(/^unique\s+event\s+([A-Z]\w*)/);v&&checkEvent(a,o,v[1]);let b=c.match(/^unique\s+[a-z_]\w*\s+on\s+([A-Z]\w*)/);b&&checkEvent(a,o,b[1]);for(let e of o.match(/\$identity\.[\w.]+/g)??[]){let t=e.substring(10).split(`.`)[0],r=[...n,...(S.identityDetails??[]).map(e=>e.name)];r.includes(t)||O.push(tokenIssue(`warning`,a,o,e,`Unknown $identity property '${t}' — expected ${r.join(`, `)}.`,y.unknownContextIdentityProperty))}for(let r of o.match(/\$context\.[\w.]+/g)??[]){let i=r.substring(9).split(`.`);t.includes(i[0])?i[0]===`causedBy`&&i.length>1&&!e.includes(i[1])?O.push(tokenIssue(`warning`,a,o,r,`Unknown $context.causedBy property '${i[1]}' — expected ${e.join(`, `)}.`,y.unknownContextCausedByProperty)):i[0]===`identity`&&i.length>1&&!n.includes(i[1])&&O.push(tokenIssue(`warning`,a,o,r,`Unknown $context.identity property '${i[1]}' — expected ${n.join(`, `)}.`,y.unknownContextIdentityProperty)):O.push(tokenIssue(`warning`,a,o,r,`Unknown $context path '${i.join(`.`)}' — expected one of ${t.join(`, `)}.`,y.unknownContextPath))}}O.push(...validateEventContextPaths(s,d)),O.push(...b(s,T,g,S.operationProductionLines));let B=s.map((e,t)=>({line:e,index:t})).filter(({line:e})=>/^\s*```(?:[a-z]+)?\s*$/.test(e));if(B.length%2==1){let e=B[B.length-1];O.push(issue(`error`,e.index,1,e.line.length+1,"Unclosed inline code block — expected a closing ``` line.",y.unclosedCodeBlock))}return O}function validateProductionDestinations(e,t){let n=[];e=u(e);for(let r of t.commands){let t=r.properties.filter(e=>e.isIdentifier&&!g(e).isOptional&&!g(e).isCollection);if(t.length===1)for(let i of r.produces??[]){if(i.inline||i.conditional||i.target!==void 0)continue;let r=i.line;n.push(issue(`information`,r,l(e[r])+1,e[r].trim().length,`Plain 'produces ${i.name}' omits its destination — use 'for ${t[0].name}' to explicitly select the command's identifier.`,y.omittedProductionDestination))}}return n}function validateImport(e,t,n){let r=e[n],i=r.trim().replace(/\s*\/\/.*$/,``);if(!/^import\b/.test(i)||x(r,n))return;let a=l(r);if(a>0&&[`module`,`feature`].includes(s(e,t,n,a)[0])||S(r))return issue(`error`,n,a+1,i.length,`Invalid import '${i}' — inside a module or feature, import names files: 'import "<path or glob>"'.`,y.invalidFileImport)}const T=/^(?:(?:increment|decrement|count|clear|add|subtract|set)\s+)?@?([$\w.]+)(?=\s|=|$)/;function validateEventContextPaths(e,t){let n=[],names=e=>e.map(e=>e.name).join(`, `);for(let r=0;r<e.length;r++){let i=e[r];if(t[r])continue;for(let e of i.matchAll(/(\.)?\$eventContext((?:\.(?:\w+(?:\(\))?)?)*)/g)){let t=e[0].substring(e[1]?.length??0),i=e[2];if(i.length===0){e[1]&&n.push(issue(`error`,r,(e.index??0)+2,t.length,`'$eventContext' names no member - expected one of ${names(d(``).expected)}.`,y.missingEventContextPath));continue}let a=i.substring(1),o=d(a),s=(e.index??0)+(e[1]?.length??0)+1;switch(o.status){case`missing`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' names no member - expected one of ${names(o.expected)}.`,y.missingEventContextPath));break;case`unknownMember`:n.push(issue(`warning`,r,s,t.length,`Unknown event context member '${o.segment}' in '$eventContext.${a}' - expected one of ${names(o.expected)}.`,y.unknownEventContextMember));break;case`unknownSubPath`:{let e=o.expected.length===0?`no members to address`:`members ${names(o.expected)}`;n.push(issue(`warning`,r,s,t.length,`Unknown event context path '$eventContext.${a}' - '${o.member?.name}' (${o.member?.type}) has ${e}.`,y.unknownEventContextPath));break}case`belowCollection`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' cannot resolve - '${o.member?.name}' is a collection (${o.member?.type}) and cannot be addressed below.`,y.eventContextPathBelowCollection))}}let a=i.trim().match(T)?.[1],o=a?.match(/\.\$(\w+)/)?.[1];a&&o&&o!==`eventContext`&&n.push(tokenIssue(`warning`,r,i,a,`Dynamic dictionary key '$${o}' in '${a}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${o}' becomes the key.`,y.unresolvedDynamicKeySource))}return n}export{validateEventContextPaths,validateLines};
|
|
3
3
|
//# sourceMappingURL=validation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","names":["startColumn","length","severity","line","text","token","message","code","issues","types","knownTypeNames","symbols","primitiveTypes","application","property","properties","propertyTypeReference","candidate","bare","owner","diagnosticCodes","type","event","query","command","identifiers","extra","lines","declared","declaration","fences","fenceMap","scanned","scanDocument","context","mergeSymbols","input","symbolsForBuffer","analysis","responseAnalysis","source","routeLines","route","production","events","knownEventNames","policies","policy","generationCodes","DiagnosticCodes","enumerationCodes","optionalCodes","policyCodes","consistencyCodes","timelineCodes","dependencyCodes","authoringCodes","complianceCodes","compilerUnknownEventLines","diagnostic","identityType","detail","identityDuplicate","existing","legacyOptionalTypeLength","name","authorizeIndent","index","trimmed","leading","indentOf","fileImportIssue","slice","sliceTypes","concept","authorize","reactsOn","produces","next","uniqueEvent","uniqueProperty","path","member","knownIdentity","identityProperties","segments","contextRoots","causedByProperties","validateInlineEvents","fenceLines","last","eventAnalysisSource","fileImportOn","indent","enclosingChain","isFileImportLine","mappingTarget","members","match","written","resolveEventContextPath","resolution","column","has","target"],"sources":["../../validation.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 { DiagnosticCodes, legacyOptionalTypeLength } from '@cratis/screenplay-compiler';\nimport { AnalysisDiagnostic, responseAnalysis } from './response-analysis';\nimport { validateInlineEvents } from './inline-event-validation';\nimport { causedByProperties, contextRoots, identityProperties, primitiveTypes, sliceTypes } from './language';\nimport { DiagnosticCode, diagnosticCodes } from './diagnostic-codes';\nimport { enclosingChain, fenceMap, indentOf } from './document-context';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { resolveEventContextPath } from './event-context';\nimport {\n DocumentSymbols,\n PropertySymbol,\n propertyTypeReference,\n knownEventNames,\n knownTypeNames,\n mergeSymbols,\n scanDocument,\n symbolsForBuffer,\n} from './symbols';\nimport { fileImportOn, isFileImportLine } from './file-imports';\n\nexport type ValidationSeverity = 'error' | 'warning' | 'information';\n\nexport interface ValidationIssue {\n line: number;\n startColumn: number;\n endColumn: number;\n message: string;\n severity: ValidationSeverity;\n\n // The compiler code for this condition, absent on the structural checks the editor makes and the\n // compiler does not. See ./diagnostic-codes.ts.\n code?: DiagnosticCode;\n}\n\n// What a document is validated against beyond itself.\nexport interface ValidationContext {\n // What the rest of the application declares - the other .play files of a folder, or the files an import\n // brings in - so a name declared in another file is not reported unknown. Merge the scanned symbols of\n // those files with mergeSymbols. The document's own declarations are always known.\n application?: DocumentSymbols;\n placement?: readonly string[];\n path?: string;\n compilerDiagnostics?: readonly AnalysisDiagnostic[];\n}\n\nfunction issue(\n severity: ValidationSeverity,\n line: number,\n startColumn: number,\n length: number,\n message: string,\n code: DiagnosticCode,\n): ValidationIssue {\n return { severity, message, line, startColumn, endColumn: startColumn + length, code };\n}\n\nfunction tokenIssue(\n severity: ValidationSeverity,\n line: number,\n text: string,\n token: string,\n message: string,\n code: DiagnosticCode,\n): ValidationIssue {\n const column = text.indexOf(token) + 1;\n return issue(severity, line, column, token.length, message, code);\n}\n\n// Reports every property whose type reference names nothing the document declares, and\n// every command that marks more than one property as its identifier.\nfunction validateDeclarations(lines: string[], symbols: DocumentSymbols, application: DocumentSymbols): ValidationIssue[] {\n const issues: ValidationIssue[] = [];\n const types = new Set([...knownTypeNames(symbols, primitiveTypes), ...knownTypeNames(application, [])]);\n\n const checkProperties = (properties: PropertySymbol[], owner: string) => {\n for (const property of properties.filter(\n (candidate) => !types.has(propertyTypeReference(candidate).name),\n )) {\n const bare = propertyTypeReference(property).name;\n issues.push(\n issue(\n 'warning',\n property.line,\n property.sourceType!.startColumn,\n property.sourceType!.text.length,\n bare === 'optional'\n ? `Unknown type 'optional' on '${property.name}' of ${owner} — did you forget the type before 'optional'?`\n : `Unknown type '${bare}' on '${property.name}' of ${owner} — declare it with 'concept ${bare} : <Primitive>' or 'type ${bare}'.`,\n diagnosticCodes.unknownType,\n ),\n );\n }\n };\n\n for (const type of symbols.types) checkProperties(type.properties, `type '${type.name}'`);\n for (const event of symbols.events) checkProperties(event.properties, `event '${event.name}'`);\n for (const query of symbols.queries) checkProperties(query.parameters, `query '${query.name}'`);\n for (const command of symbols.commands) {\n checkProperties(command.properties, `command '${command.name}'`);\n const identifiers = command.properties.filter((property) => property.isIdentifier);\n for (const extra of identifiers.slice(1)) {\n issues.push(\n tokenIssue(\n 'error',\n extra.line,\n lines[extra.line],\n 'identifier',\n `Command '${command.name}' already marks '${identifiers[0].name}' as identifier — only one property can be the identifier.`,\n diagnosticCodes.duplicateCommandIdentifier,\n ),\n );\n }\n }\n\n const declared = new Map<string, number>();\n for (const declaration of [...symbols.concepts, ...symbols.types]) {\n const first = declared.get(declaration.name);\n if (first === undefined) {\n declared.set(declaration.name, declaration.line);\n continue;\n }\n issues.push(\n tokenIssue(\n 'error',\n declaration.line,\n lines[declaration.line],\n declaration.name,\n `Duplicate declaration of '${declaration.name}' — concept and type names must be unique.`,\n diagnosticCodes.duplicateDeclaration,\n ),\n );\n }\n\n return issues;\n}\n\n// Validates a Screenplay document without any editor dependency — both the Monaco\n// service and the VSCode extension adapt these issues to their marker/diagnostic APIs.\n//\n// The checks read the document line by line, never as a whole document's top level, so a file an import\n// places in a module or feature - holding slices or features at its top level - validates as it is written.\n// Where it is placed, and whether its imports resolve, is the compiler's to say.\nexport function validateLines(lines: string[], context: ValidationContext = {}): ValidationIssue[] {\n const fences = fenceMap(lines);\n const scanned = scanDocument(lines);\n const application = context.application ?? mergeSymbols();\n const input = symbolsForBuffer(lines, { ...application, authoringPath: context.path ?? application.authoringPath, authoringPlacement: context.placement ?? application.authoringPlacement });\n const analysis = responseAnalysis(lines, input.authoringDocuments ?? input.authoringSources?.filter(source => source !== lines.join('\\n')), input.authoringPlacement, input.authoringPath, input.authoringPlacementResolved);\n const routeLines = new Set(analysis.eventSources.routes.map(route => route.location.line - 1));\n const symbols = { ...scanned, commands: scanned.commands.map(command => ({ ...command,\n properties: command.properties.filter(property => !routeLines.has(property.line)),\n produces: command.produces?.filter(production => !analysis.operationProductionLines?.has(production.line)),\n productionHeaders: command.productionHeaders?.filter(line => !analysis.operationProductionLines?.has(line)),\n })) };\n const events = new Set([...knownEventNames(symbols), ...knownEventNames(application)]);\n const policies = new Set([...symbols.policies, ...application.policies].map((policy) => policy.name));\n const issues: ValidationIssue[] = validateDeclarations(lines, symbols, application);\n issues.push(...validateProductionDestinations(lines, symbols));\n // One parser pass covers committed types, including query results and trigger data, without\n // speculative property scans mistaking tags, paths, strings or code for optionality.\n const generationCodes = new Set<string>([DiagnosticCodes.UnknownGenerationStrategy, DiagnosticCodes.InvalidGenerationArgument, DiagnosticCodes.InvalidGenerationModifier, DiagnosticCodes.DuplicateGenerationModifier, DiagnosticCodes.DuplicateGeneration, DiagnosticCodes.InvalidGenerationPrimitive, DiagnosticCodes.InvalidGenerationPrefix, DiagnosticCodes.InvalidGenerationAlphabet, DiagnosticCodes.InvalidTypeIdPrefix, DiagnosticCodes.GenerationSizeOutsideRange, DiagnosticCodes.ReservedSequenceGeneration, DiagnosticCodes.LowGenerationEntropy, DiagnosticCodes.LowGeneratedIdentifierEntropy, DiagnosticCodes.RefutedGeneratedConceptRule, DiagnosticCodes.UnprovenGeneratedConceptRule, DiagnosticCodes.GenerationSupportBudgetExceeded, DiagnosticCodes.EmptyGenerationSupport]);\n const enumerationCodes = new Set<string>([DiagnosticCodes.MixedEnumerationNumbering, DiagnosticCodes.DuplicateEnumerationNumber, DiagnosticCodes.EnumerationNumberOutsideInt32, DiagnosticCodes.MalformedEnumerationNumber, DiagnosticCodes.UnpinnedStoredEnumeration]);\n const optionalCodes = new Set<string>([DiagnosticCodes.LegacyOptionalSuffix, DiagnosticCodes.InvalidOptionalModifierOrder, DiagnosticCodes.OptionalReadsNotSupported]);\n const policyCodes = new Set<string>([DiagnosticCodes.UnexpectedTokenInPolicyCondition, DiagnosticCodes.ExpectedPolicyCondition, DiagnosticCodes.UnclosedPolicyConditionGroup, DiagnosticCodes.ExpectedRoleName, DiagnosticCodes.ExpectedClaimName, DiagnosticCodes.ExpectedClaimMatches, DiagnosticCodes.ExpectedClaimMatchTarget, DiagnosticCodes.AnonymousPolicyCombined, DiagnosticCodes.NegatedAnonymousPolicy]);\n const consistencyCodes = new Set<string>([DiagnosticCodes.UnknownEvent, DiagnosticCodes.UnknownReadModelProperty, DiagnosticCodes.PiiNotSupportedOnIdentifier]);\n const timelineCodes = new Set<string>([DiagnosticCodes.EventFromLaterSlice, DiagnosticCodes.TimelineCycleGroup]);\n const dependencyCodes = new Set<string>([DiagnosticCodes.UndeclaredDependency, DiagnosticCodes.UnusedDependencyDeclaration, DiagnosticCodes.InvalidDependencyTarget, DiagnosticCodes.RepeatedDependencyDeclaration, DiagnosticCodes.MutualDependencyDeclarations, DiagnosticCodes.AmbiguousReference]);\n // These parser diagnostics must reach the marker adapter. C#-only completeness and reference\n // checks are not synthesized here, but are preserved when a caller supplies compiler diagnostics.\n const authoringCodes = new Set<string>([DiagnosticCodes.InvalidSpecificationInvocation, DiagnosticCodes.InvalidActionSubjectClause, DiagnosticCodes.InferredActionSubject, DiagnosticCodes.ChangedActionSubject, DiagnosticCodes.AmbiguousActionInputBinding, DiagnosticCodes.UnsupportedActionSubjectContext, DiagnosticCodes.InvalidTimeZoneDeclaration, DiagnosticCodes.InvalidCommandCalendar, DiagnosticCodes.InvalidSpecificationTimeZone, DiagnosticCodes.InvalidCommandReadsDeclaration, DiagnosticCodes.UnknownMatchPattern, DiagnosticCodes.InvalidMatchPattern, DiagnosticCodes.PatternOutsidePortableMatchDialect, DiagnosticCodes.AmbiguousMatchPattern, DiagnosticCodes.DeprecatedStudioTextRulePattern, DiagnosticCodes.MismatchedSpecificationQueryResult, DiagnosticCodes.DirectionlessTranslationReactsToOwnCapture, DiagnosticCodes.CaptureEventsFromSeveralOrigins, DiagnosticCodes.CaptureEventsKeyNotRequired, DiagnosticCodes.CaptureEventsRecordFixture, DiagnosticCodes.CaptureEventSourceKeyOutsideEvents, DiagnosticCodes.EventIdPinNotCarriedToRenderers, DiagnosticCodes.ResponseNameUsedOnFailure, DiagnosticCodes.InvalidEventDeclaration, DiagnosticCodes.InvalidImportDeclaration, DiagnosticCodes.InvalidSliceDeclaration, DiagnosticCodes.InvalidDescription, DiagnosticCodes.DuplicateDescription, DiagnosticCodes.EmptyDescription, DiagnosticCodes.DuplicateEventSubject, DiagnosticCodes.InvalidSubjectType, DiagnosticCodes.ProtectedSubjectType, DiagnosticCodes.InvalidSubjectOwner, DiagnosticCodes.ReadModelSubjectNotSupported, DiagnosticCodes.InvalidSubjectModifierOrder, DiagnosticCodes.UnsupportedInteractionAlternatives, DiagnosticCodes.MixedInteractionAlternatives, DiagnosticCodes.InteractionAlternativeWithoutActions, DiagnosticCodes.InlineInteractionAlternative, DiagnosticCodes.LegacyInteractionWhere, DiagnosticCodes.InvalidSpecificationParameter, DiagnosticCodes.InvalidSpecificationCase, DiagnosticCodes.DuplicateSpecificationParameter, DiagnosticCodes.DuplicateSpecificationCase, DiagnosticCodes.IncompleteSpecificationTable, DiagnosticCodes.InvalidSpecificationCaseAssignment, DiagnosticCodes.InvalidSpecificationCaseValue, DiagnosticCodes.InvalidSpecificationCaseReference, DiagnosticCodes.OptionalSpecificationParameterTarget, DiagnosticCodes.SpecificationCaseNameCollision, DiagnosticCodes.IncompatibleSpecificationParameterType, DiagnosticCodes.UnusedSpecificationParameter, DiagnosticCodes.SingularSpecificationTableExpansion, DiagnosticCodes.InvalidSpecificationCallerPersona, DiagnosticCodes.UnsynthesizablePersonaCaller, DiagnosticCodes.PersonaWithoutGate, DiagnosticCodes.GateWithoutPersona, DiagnosticCodes.AmbiguousPersonaCaller, DiagnosticCodes.InvalidDocumentation, DiagnosticCodes.ConflictingDocumentationAcrossFiles, DiagnosticCodes.InvalidAbsentReadModelStep, DiagnosticCodes.UnknownConstraintProperty, DiagnosticCodes.OmittedProductionDestination, DiagnosticCodes.InvalidSpecificationExample, DiagnosticCodes.DuplicateSpecificationAssignment, DiagnosticCodes.InvalidReactionBatchesDeclaration, DiagnosticCodes.DescribedCommandNotImplemented, DiagnosticCodes.DescribedCommandWithoutProductions, DiagnosticCodes.DescribedCommandCardinalityNotAdmitted, DiagnosticCodes.CommandHandlerRequiresAttachment, DiagnosticCodes.PendingIntentWithOtherHandler, DiagnosticCodes.DuplicateEventInProjectionScope, DiagnosticCodes.ReservedStoredName, DiagnosticCodes.ContextSourcedPerformedQueryArgument]);\n const complianceCodes = new Set<string>([DiagnosticCodes.InvalidPurposeDeclaration, DiagnosticCodes.InvalidPurposeVocabulary, DiagnosticCodes.DuplicatePurposeField, DiagnosticCodes.DuplicatePurposeDeclaration, DiagnosticCodes.UnknownPurpose, DiagnosticCodes.PurposeInterestMismatch, DiagnosticCodes.PersonalDataWithoutPurpose, DiagnosticCodes.SpecialDataWithoutCondition, DiagnosticCodes.CriminalDataWithoutAuthorization, DiagnosticCodes.PurposeWithoutBasis, DiagnosticCodes.UnusedPurpose, DiagnosticCodes.UnknownConceptDirective, DiagnosticCodes.AttributeReasonWithoutAttribute, DiagnosticCodes.DuplicateAttributeReason, DiagnosticCodes.LegacyComplianceMarker, DiagnosticCodes.DuplicateComplianceMarker, DiagnosticCodes.UnknownComplianceMarker, DiagnosticCodes.InvalidSecretScope, DiagnosticCodes.DuplicateSecretScope, DiagnosticCodes.SecretScopeIgnoredForPii, DiagnosticCodes.InvalidPersonalDataQualifier, DiagnosticCodes.DuplicateSpecialCategory]);\n const compilerUnknownEventLines = new Set<number>();\n for (const diagnostic of context.compilerDiagnostics ?? analysis.diagnostics) {\n const identityType = diagnostic.code === DiagnosticCodes.UnknownType && (analysis.identityDetails ?? []).some(detail => detail.line === diagnostic.location.line - 1);\n const identityDuplicate = diagnostic.code === DiagnosticCodes.RepeatedSingularDeclarationAcrossFiles && diagnostic.message.includes('identity block');\n const policyDuplicate = diagnostic.code === DiagnosticCodes.DuplicateDeclaration && diagnostic.message.startsWith('Duplicate declaration of policy ');\n if (!policyDuplicate && !identityType && !identityDuplicate && !generationCodes.has(diagnostic.code) && !enumerationCodes.has(diagnostic.code) && !complianceCodes.has(diagnostic.code) && !optionalCodes.has(diagnostic.code) && !policyCodes.has(diagnostic.code) && !consistencyCodes.has(diagnostic.code) && !timelineCodes.has(diagnostic.code) && !dependencyCodes.has(diagnostic.code) && !authoringCodes.has(diagnostic.code) && diagnostic.code !== DiagnosticCodes.ReducerIdentityMismatch && diagnostic.code !== DiagnosticCodes.InvalidSpecificationExampleBody && diagnostic.code !== DiagnosticCodes.UnknownRuleImplementationDirective && diagnostic.code !== DiagnosticCodes.InvalidValidationRule && diagnostic.code !== DiagnosticCodes.RepeatedDeclarationAcrossFiles && !/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$|^PLAY060[7-9]$|^PLAY061[0-9]$|^PLAY0620$|^PLAY062[1-9]$|^PLAY063[0-9]$|^PLAY064[0-9]$|^PLAY065[0-2]$|^PLAY065[4-6]$|^PLAY066[0-6]$|^PLAY072[0-2]$/.test(diagnostic.code)) continue;\n const line = diagnostic.location.line - 1;\n if (diagnostic.code === DiagnosticCodes.OmittedProductionDestination && issues.some(existing => existing.code === diagnostic.code && existing.line === line)) continue;\n if (diagnostic.code === DiagnosticCodes.UnknownEvent) {\n if (compilerUnknownEventLines.has(line)) continue;\n compilerUnknownEventLines.add(line);\n }\n const length = legacyOptionalTypeLength(lines[line], diagnostic) || lines[line].length - diagnostic.location.column + 1;\n issues.push(issue(diagnostic.severity, line, diagnostic.location.column, length, diagnostic.message, diagnostic.code as DiagnosticCode));\n }\n\n const checkEvent = (line: number, text: string, name: string) => {\n if (!events.has(name) && !compilerUnknownEventLines.has(line)) {\n issues.push(\n tokenIssue(\n 'warning',\n line,\n text,\n name,\n `Unknown event type '${name}' — declare it in a slice or import it.`,\n diagnosticCodes.unknownEvent,\n ),\n );\n }\n };\n\n let authorizeIndent = -1;\n\n for (let index = 0; index < lines.length; index++) {\n const line = lines[index];\n const trimmed = line.trim();\n\n if (fences[index] || trimmed.length === 0) continue;\n\n const leading = line.match(/^[ ]*(\\t+)/);\n if (leading) {\n issues.push(\n issue(\n 'warning',\n index,\n leading[0].length - leading[1].length + 1,\n leading[1].length,\n 'Screenplay is indentation-based — use spaces, not tabs.',\n diagnosticCodes.tabIndentation,\n ),\n );\n }\n\n // Policy references continue on indented lines below an authorize clause.\n if (authorizeIndent >= 0) {\n if (\n indentOf(line) > authorizeIndent &&\n /^(?:or\\s+)?[A-Z]\\w*(?:\\s+or\\s+[A-Z]\\w*)*$/.test(trimmed)\n ) {\n for (const name of trimmed.split(/\\s+/).filter((token) => token !== 'or')) {\n if (!policies.has(name)) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n name,\n `Unknown policy '${name}' — declare it with 'policy ${name}'.`,\n diagnosticCodes.unknownPolicy,\n ),\n );\n }\n }\n continue;\n }\n authorizeIndent = -1;\n }\n\n const fileImportIssue = validateImport(lines, fences, index);\n if (fileImportIssue) issues.push(fileImportIssue);\n\n const slice = trimmed.match(/^slice\\s+(\\w+)/);\n if (slice && !sliceTypes.includes(slice[1])) {\n issues.push(\n tokenIssue(\n 'error',\n index,\n line,\n slice[1],\n `Unknown slice type '${slice[1]}' — expected ${sliceTypes.join(', ')}.`,\n diagnosticCodes.unknownSliceType,\n ),\n );\n }\n\n const concept = trimmed.match(/^concept\\s+\\w+\\s*:\\s*(\\w+)/);\n if (concept && concept[1] !== 'Enum' && !primitiveTypes.includes(concept[1])) {\n issues.push(\n tokenIssue(\n 'error',\n index,\n line,\n concept[1],\n `Unknown primitive type '${concept[1]}' — expected ${primitiveTypes.join(', ')} or Enum.`,\n diagnosticCodes.unknownPrimitiveType,\n ),\n );\n }\n\n const authorize = trimmed.match(/^authorize\\s+(.*)$/);\n if (authorize) {\n authorizeIndent = indentOf(line);\n for (const name of authorize[1].split(/\\s+/).filter((token) => token !== 'or' && token.length > 0)) {\n if (!policies.has(name)) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n name,\n `Unknown policy '${name}' — declare it with 'policy ${name}'.`,\n diagnosticCodes.unknownPolicy,\n ),\n );\n }\n }\n }\n\n const reactsOn = trimmed.match(/^on\\s+([A-Z]\\w*)\\s*$/);\n if (reactsOn) checkEvent(index, line, reactsOn[1]);\n\n const produces = trimmed.match(/^produces\\s+([A-Z]\\w*)\\s*$/);\n if (produces && !analysis.operationProductionLines?.has(index)) checkEvent(index, line, produces[1]);\n\n if (/^produces\\s+when\\b/.test(trimmed) && !analysis.operationProductionLines?.has(index)) {\n for (let next = index + 1; next < lines.length; next++) {\n const candidate = lines[next];\n if (fences[next] || candidate.trim().length === 0) continue;\n if (indentOf(candidate) > indentOf(line)) {\n const name = candidate.trim().match(/^([A-Z]\\w*)\\s*$/);\n if (name) checkEvent(next, candidate, name[1]);\n }\n break;\n }\n }\n\n const uniqueEvent = trimmed.match(/^unique\\s+event\\s+([A-Z]\\w*)/);\n if (uniqueEvent) checkEvent(index, line, uniqueEvent[1]);\n\n const uniqueProperty = trimmed.match(/^unique\\s+[a-z_]\\w*\\s+on\\s+([A-Z]\\w*)/);\n if (uniqueProperty) checkEvent(index, line, uniqueProperty[1]);\n\n // Every $identity. path must name a member of the caller; anything after 'claims.' is a claim name.\n // A bare $identity is left to the compilers, which see it only where an expression is expected.\n for (const path of line.match(/\\$identity\\.[\\w.]+/g) ?? []) {\n const member = path.substring('$identity.'.length).split('.')[0];\n const knownIdentity = [...identityProperties, ...(analysis.identityDetails ?? []).map(detail => detail.name)];\n if (!knownIdentity.includes(member)) {\n issues.push(tokenIssue('warning', index, line, path,\n `Unknown $identity property '${member}' — expected ${knownIdentity.join(', ')}.`,\n diagnosticCodes.unknownContextIdentityProperty));\n }\n }\n\n // Every $context. path must name something CommandContext or QueryContext carries.\n for (const path of line.match(/\\$context\\.[\\w.]+/g) ?? []) {\n const segments = path.substring('$context.'.length).split('.');\n if (!contextRoots.includes(segments[0])) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n path,\n `Unknown $context path '${segments.join('.')}' — expected one of ${contextRoots.join(', ')}.`,\n diagnosticCodes.unknownContextPath,\n ),\n );\n } else if (\n segments[0] === 'causedBy' &&\n segments.length > 1 &&\n !causedByProperties.includes(segments[1])\n ) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n path,\n `Unknown $context.causedBy property '${segments[1]}' — expected ${causedByProperties.join(', ')}.`,\n diagnosticCodes.unknownContextCausedByProperty,\n ),\n );\n } else if (\n segments[0] === 'identity' &&\n segments.length > 1 &&\n !identityProperties.includes(segments[1])\n ) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n path,\n `Unknown $context.identity property '${segments[1]}' — expected ${identityProperties.join(', ')}.`,\n diagnosticCodes.unknownContextIdentityProperty,\n ),\n );\n }\n }\n }\n\n issues.push(...validateEventContextPaths(lines, fences));\n issues.push(...validateInlineEvents(lines, symbols, application, analysis.operationProductionLines));\n\n const fenceLines = lines\n .map((line, index) => ({ line, index }))\n .filter(({ line }) => /^\\s*```(?:[a-z]+)?\\s*$/.test(line));\n if (fenceLines.length % 2 === 1) {\n const last = fenceLines[fenceLines.length - 1];\n issues.push(\n issue(\n 'error',\n last.index,\n 1,\n last.line.length + 1,\n 'Unclosed inline code block — expected a closing ``` line.',\n diagnosticCodes.unclosedCodeBlock,\n ),\n );\n }\n\n return issues;\n}\n\n// This is advice, not a semantic default: accepting the typed workspace repair changes routing.\nfunction validateProductionDestinations(lines: string[], symbols: DocumentSymbols): ValidationIssue[] {\n const issues: ValidationIssue[] = [];\n lines = eventAnalysisSource(lines);\n for (const command of symbols.commands) {\n const identifiers = command.properties.filter(property => property.isIdentifier && !propertyTypeReference(property).isOptional && !propertyTypeReference(property).isCollection);\n if (identifiers.length !== 1) continue;\n for (const production of command.produces ?? []) {\n if (production.inline || production.conditional || production.target !== undefined) continue;\n const line = production.line;\n issues.push(issue('information', line, indentOf(lines[line]) + 1, lines[line].trim().length,\n `Plain 'produces ${production.name}' omits its destination — use 'for ${identifiers[0].name}' to explicitly select the command's identifier.`,\n diagnosticCodes.omittedProductionDestination));\n }\n }\n return issues;\n}\n\n// Inside a module or feature an import names files, and a quoted import anywhere has the compiler's shape.\nfunction validateImport(lines: string[], fences: boolean[], index: number): ValidationIssue | undefined {\n const line = lines[index];\n const trimmed = line.trim().replace(/\\s*\\/\\/.*$/, '');\n if (!/^import\\b/.test(trimmed) || fileImportOn(line, index)) return undefined;\n const indent = indentOf(line);\n const inBody = indent > 0 && ['module', 'feature'].includes(enclosingChain(lines, fences, index, indent)[0]);\n if (!inBody && !isFileImportLine(line)) return undefined;\n return issue(\n 'error',\n index,\n indent + 1,\n trimmed.length,\n `Invalid import '${trimmed}' — inside a module or feature, import names files: 'import \"<path or glob>\"'.`,\n diagnosticCodes.invalidFileImport,\n );\n}\n\n// A mapping target: the first word of a mapping line, after the keyword that opens it if there is one.\nconst mappingTarget = /^(?:(?:increment|decrement|count|clear|add|subtract|set)\\s+)?@?([$\\w.]+)(?=\\s|=|$)/;\n\n// Every $eventContext.<path> - in an expression or as the dynamic key of a mapping target - checked against the\n// event-context catalog the way the compiler checks it (Parsing/EventContextPathValidator.cs).\nexport function validateEventContextPaths(lines: string[], fences: boolean[]): ValidationIssue[] {\n const issues: ValidationIssue[] = [];\n const names = (members: readonly { name: string }[]) => members.map((member) => member.name).join(', ');\n\n for (let index = 0; index < lines.length; index++) {\n const line = lines[index];\n if (fences[index]) continue;\n\n for (const match of line.matchAll(/(\\.)?\\$eventContext((?:\\.(?:\\w+(?:\\(\\))?)?)*)/g)) {\n const token = match[0].substring(match[1]?.length ?? 0);\n const written = match[2];\n if (written.length === 0) {\n // A bare $eventContext names nothing only as a dynamic key; in an expression the compiler rejects it as invalid.\n if (match[1]) {\n issues.push(issue('error', index, (match.index ?? 0) + 2, token.length, `'$eventContext' names no member - expected one of ${names(resolveEventContextPath('').expected)}.`, diagnosticCodes.missingEventContextPath));\n }\n continue;\n }\n\n const path = written.substring(1);\n const resolution = resolveEventContextPath(path);\n const column = (match.index ?? 0) + (match[1]?.length ?? 0) + 1;\n switch (resolution.status) {\n case 'missing':\n issues.push(issue('error', index, column, token.length, `'$eventContext.${path}' names no member - expected one of ${names(resolution.expected)}.`, diagnosticCodes.missingEventContextPath));\n break;\n case 'unknownMember':\n issues.push(issue('warning', index, column, token.length, `Unknown event context member '${resolution.segment}' in '$eventContext.${path}' - expected one of ${names(resolution.expected)}.`, diagnosticCodes.unknownEventContextMember));\n break;\n case 'unknownSubPath': {\n const has = resolution.expected.length === 0 ? 'no members to address' : `members ${names(resolution.expected)}`;\n issues.push(issue('warning', index, column, token.length, `Unknown event context path '$eventContext.${path}' - '${resolution.member?.name}' (${resolution.member?.type}) has ${has}.`, diagnosticCodes.unknownEventContextPath));\n break;\n }\n case 'belowCollection':\n issues.push(issue('error', index, column, token.length, `'$eventContext.${path}' cannot resolve - '${resolution.member?.name}' is a collection (${resolution.member?.type}) and cannot be addressed below.`, diagnosticCodes.eventContextPathBelowCollection));\n break;\n }\n }\n\n // Only $eventContext resolves in a dynamic key; any other $ source is kept as the literal key text.\n const target = line.trim().match(mappingTarget)?.[1];\n const source = target?.match(/\\.\\$(\\w+)/)?.[1];\n if (target && source && source !== 'eventContext') {\n issues.push(tokenIssue('warning', index, line, target, `Dynamic dictionary key '$${source}' in '${target}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${source}' becomes the key.`, diagnosticCodes.unresolvedDynamicKeySource));\n }\n }\n\n return issues;\n}\n"],"mappings":"88BAgDA,SAAS,MACL,EACA,EACA,EACA,EACA,EACA,EACe,CACf,MAAO,CAAE,WAAU,UAAS,OAAM,cAAa,UAAWA,EAAcC,EAAQ,MAAK,CACzF,CAEA,SAAS,WACL,EACA,EACA,EACA,EACA,EACA,EACe,CAEf,OAAO,MAAMC,EAAUC,EADRC,EAAK,QAAQC,CAAK,EAAI,EACAA,EAAM,OAAQC,EAASC,CAAI,CACpE,CAIA,SAAS,qBAAqB,EAAiB,EAA0B,EAAiD,CACtH,IAAMC,EAA4B,CAAC,EAC7BC,kBAAQ,IAAI,IAAI,CAAC,GAAGC,EAAeC,EAASC,CAAc,EAAG,GAAGF,EAAeG,EAAa,CAAC,CAAC,CAAC,CAAC,EAEhG,iBAAmB,EAA8B,IAAkB,CACrE,IAAK,IAAMC,KAAYC,EAAW,OAC7B,GAAc,CAACN,EAAM,IAAIO,EAAsBC,CAAS,CAAC,CAAC,IAAI,CACnE,EAAG,CACC,IAAMC,EAAOF,EAAsBF,CAAQ,CAAC,CAAC,KAC7CN,EAAO,KACH,MACI,UACAM,EAAS,KACTA,EAAS,WAAY,YACrBA,EAAS,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MAAM,QAAS2D,EAAOmC,EAAQjG,EAAM,OAAQ,kBAAkB4E,EAAK,sBAAsBoB,EAAW,QAAQ,KAAK,qBAAqBA,EAAW,QAAQ,KAAK,kCAAmCjF,EAAgB,+BAA+B,CAAC,CAErQ,CACJ,CAGA,IAAMoF,EAASrG,EAAK,KAAK,CAAC,CAAC,MAAM6F,CAAa,CAAC,GAAG,GAC5CxD,EAASgE,GAAQ,MAAM,WAAW,CAAC,GAAG,GACxCA,GAAUhE,GAAUA,IAAW,gBAC/BhC,EAAO,KAAK,WAAW,UAAW2D,EAAOhE,EAAMqG,EAAQ,4BAA4BhE,EAAO,QAAQgE,EAAO,8EAA8EhE,EAAO,oBAAqBpB,EAAgB,0BAA0B,CAAC,CAEtQ,CAEA,OAAOZ,CACX"}
|
|
1
|
+
{"version":3,"file":"validation.js","names":["startColumn","length","severity","line","text","token","message","code","issues","types","knownTypeNames","symbols","primitiveTypes","application","property","properties","propertyTypeReference","candidate","bare","owner","diagnosticCodes","type","event","query","command","identifiers","extra","lines","declared","declaration","policyOperators","policyContinuation","expression","fences","fenceMap","scanned","scanDocument","context","mergeSymbols","input","symbolsForBuffer","analysis","responseAnalysis","source","routeLines","route","production","events","knownEventNames","policies","policy","generationCodes","DiagnosticCodes","enumerationCodes","optionalCodes","policyCodes","consistencyCodes","timelineCodes","dependencyCodes","authoringCodes","complianceCodes","compilerUnknownEventLines","diagnostic","identityType","detail","identityDuplicate","existing","legacyOptionalTypeLength","name","authorizeIndent","index","trimmed","leading","indentOf","fileImportIssue","slice","sliceTypes","concept","authorize","reactsOn","produces","next","uniqueEvent","uniqueProperty","path","member","knownIdentity","identityProperties","segments","contextRoots","causedByProperties","validateInlineEvents","fenceLines","last","eventAnalysisSource","fileImportOn","indent","enclosingChain","isFileImportLine","mappingTarget","members","match","written","resolveEventContextPath","resolution","column","has","target"],"sources":["../../validation.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 { DiagnosticCodes, legacyOptionalTypeLength } from '@cratis/screenplay-compiler';\nimport { AnalysisDiagnostic, responseAnalysis } from './response-analysis';\nimport { validateInlineEvents } from './inline-event-validation';\nimport { causedByProperties, contextRoots, identityProperties, primitiveTypes, sliceTypes } from './language';\nimport { DiagnosticCode, diagnosticCodes } from './diagnostic-codes';\nimport { enclosingChain, fenceMap, indentOf } from './document-context';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { resolveEventContextPath } from './event-context';\nimport {\n DocumentSymbols,\n PropertySymbol,\n propertyTypeReference,\n knownEventNames,\n knownTypeNames,\n mergeSymbols,\n scanDocument,\n symbolsForBuffer,\n} from './symbols';\nimport { fileImportOn, isFileImportLine } from './file-imports';\n\nexport type ValidationSeverity = 'error' | 'warning' | 'information';\n\nexport interface ValidationIssue {\n line: number;\n startColumn: number;\n endColumn: number;\n message: string;\n severity: ValidationSeverity;\n\n // The compiler code for this condition, absent on the structural checks the editor makes and the\n // compiler does not. See ./diagnostic-codes.ts.\n code?: DiagnosticCode;\n}\n\n// What a document is validated against beyond itself.\nexport interface ValidationContext {\n // What the rest of the application declares - the other .play files of a folder, or the files an import\n // brings in - so a name declared in another file is not reported unknown. Merge the scanned symbols of\n // those files with mergeSymbols. The document's own declarations are always known.\n application?: DocumentSymbols;\n placement?: readonly string[];\n path?: string;\n compilerDiagnostics?: readonly AnalysisDiagnostic[];\n}\n\nfunction issue(\n severity: ValidationSeverity,\n line: number,\n startColumn: number,\n length: number,\n message: string,\n code: DiagnosticCode,\n): ValidationIssue {\n return { severity, message, line, startColumn, endColumn: startColumn + length, code };\n}\n\nfunction tokenIssue(\n severity: ValidationSeverity,\n line: number,\n text: string,\n token: string,\n message: string,\n code: DiagnosticCode,\n): ValidationIssue {\n const column = text.indexOf(token) + 1;\n return issue(severity, line, column, token.length, message, code);\n}\n\n// Reports every property whose type reference names nothing the document declares, and\n// every command that marks more than one property as its identifier.\nfunction validateDeclarations(lines: string[], symbols: DocumentSymbols, application: DocumentSymbols): ValidationIssue[] {\n const issues: ValidationIssue[] = [];\n const types = new Set([...knownTypeNames(symbols, primitiveTypes), ...knownTypeNames(application, [])]);\n\n const checkProperties = (properties: PropertySymbol[], owner: string) => {\n for (const property of properties.filter(\n (candidate) => !types.has(propertyTypeReference(candidate).name),\n )) {\n const bare = propertyTypeReference(property).name;\n issues.push(\n issue(\n 'warning',\n property.line,\n property.sourceType!.startColumn,\n property.sourceType!.text.length,\n bare === 'optional'\n ? `Unknown type 'optional' on '${property.name}' of ${owner} — did you forget the type before 'optional'?`\n : `Unknown type '${bare}' on '${property.name}' of ${owner} — declare it with 'concept ${bare} : <Primitive>' or 'type ${bare}'.`,\n diagnosticCodes.unknownType,\n ),\n );\n }\n };\n\n for (const type of symbols.types) checkProperties(type.properties, `type '${type.name}'`);\n for (const event of symbols.events) checkProperties(event.properties, `event '${event.name}'`);\n for (const query of symbols.queries) checkProperties(query.parameters, `query '${query.name}'`);\n for (const command of symbols.commands) {\n checkProperties(command.properties, `command '${command.name}'`);\n const identifiers = command.properties.filter((property) => property.isIdentifier);\n for (const extra of identifiers.slice(1)) {\n issues.push(\n tokenIssue(\n 'error',\n extra.line,\n lines[extra.line],\n 'identifier',\n `Command '${command.name}' already marks '${identifiers[0].name}' as identifier — only one property can be the identifier.`,\n diagnosticCodes.duplicateCommandIdentifier,\n ),\n );\n }\n }\n\n const declared = new Map<string, number>();\n for (const declaration of [...symbols.concepts, ...symbols.types]) {\n const first = declared.get(declaration.name);\n if (first === undefined) {\n declared.set(declaration.name, declaration.line);\n continue;\n }\n issues.push(\n tokenIssue(\n 'error',\n declaration.line,\n lines[declaration.line],\n declaration.name,\n `Duplicate declaration of '${declaration.name}' — concept and type names must be unique.`,\n diagnosticCodes.duplicateDeclaration,\n ),\n );\n }\n\n return issues;\n}\n\n// Validates a Screenplay document without any editor dependency — both the Monaco\n// service and the VSCode extension adapt these issues to their marker/diagnostic APIs.\n//\n// The checks read the document line by line, never as a whole document's top level, so a file an import\n// places in a module or feature - holding slices or features at its top level - validates as it is written.\n// Where it is placed, and whether its imports resolve, is the compiler's to say.\n// A policy expression joins policy names with `and` and `or`, groups them with parentheses, and may put `not` before a\n// name. Only the names are policies: the operators and the parentheses are not.\nconst policyOperators = new Set(['and', 'or', 'not']);\n\n// A line that continues an `authorize` expression: names, operators and parentheses, and nothing else.\nconst policyContinuation = /^(?:(?:and|or|not)\\s+|\\()*[A-Z]\\w*\\)*(?:\\s+(?:(?:and|or|not)\\s+|\\()*[A-Z]\\w*\\)*)*$/;\n\nfunction policyNames(expression: string): string[] {\n return (expression.match(/[A-Za-z_]\\w*/g) ?? []).filter((token) => !policyOperators.has(token));\n}\n\nexport function validateLines(lines: string[], context: ValidationContext = {}): ValidationIssue[] {\n const fences = fenceMap(lines);\n const scanned = scanDocument(lines);\n const application = context.application ?? mergeSymbols();\n const input = symbolsForBuffer(lines, { ...application, authoringPath: context.path ?? application.authoringPath, authoringPlacement: context.placement ?? application.authoringPlacement });\n const analysis = responseAnalysis(lines, input.authoringDocuments ?? input.authoringSources?.filter(source => source !== lines.join('\\n')), input.authoringPlacement, input.authoringPath, input.authoringPlacementResolved);\n const routeLines = new Set(analysis.eventSources.routes.map(route => route.location.line - 1));\n const symbols = { ...scanned, commands: scanned.commands.map(command => ({ ...command,\n properties: command.properties.filter(property => !routeLines.has(property.line)),\n produces: command.produces?.filter(production => !analysis.operationProductionLines?.has(production.line)),\n productionHeaders: command.productionHeaders?.filter(line => !analysis.operationProductionLines?.has(line)),\n })) };\n const events = new Set([...knownEventNames(symbols), ...knownEventNames(application)]);\n const policies = new Set([...symbols.policies, ...application.policies].map((policy) => policy.name));\n const issues: ValidationIssue[] = validateDeclarations(lines, symbols, application);\n issues.push(...validateProductionDestinations(lines, symbols));\n // One parser pass covers committed types, including query results and trigger data, without\n // speculative property scans mistaking tags, paths, strings or code for optionality.\n const generationCodes = new Set<string>([DiagnosticCodes.UnknownGenerationStrategy, DiagnosticCodes.InvalidGenerationArgument, DiagnosticCodes.InvalidGenerationModifier, DiagnosticCodes.DuplicateGenerationModifier, DiagnosticCodes.DuplicateGeneration, DiagnosticCodes.InvalidGenerationPrimitive, DiagnosticCodes.InvalidGenerationPrefix, DiagnosticCodes.InvalidGenerationAlphabet, DiagnosticCodes.InvalidTypeIdPrefix, DiagnosticCodes.GenerationSizeOutsideRange, DiagnosticCodes.ReservedSequenceGeneration, DiagnosticCodes.LowGenerationEntropy, DiagnosticCodes.LowGeneratedIdentifierEntropy, DiagnosticCodes.RefutedGeneratedConceptRule, DiagnosticCodes.UnprovenGeneratedConceptRule, DiagnosticCodes.GenerationSupportBudgetExceeded, DiagnosticCodes.EmptyGenerationSupport]);\n const enumerationCodes = new Set<string>([DiagnosticCodes.MixedEnumerationNumbering, DiagnosticCodes.DuplicateEnumerationNumber, DiagnosticCodes.EnumerationNumberOutsideInt32, DiagnosticCodes.MalformedEnumerationNumber, DiagnosticCodes.UnpinnedStoredEnumeration]);\n const optionalCodes = new Set<string>([DiagnosticCodes.LegacyOptionalSuffix, DiagnosticCodes.InvalidOptionalModifierOrder, DiagnosticCodes.OptionalReadsNotSupported]);\n const policyCodes = new Set<string>([DiagnosticCodes.UnexpectedTokenInPolicyCondition, DiagnosticCodes.ExpectedPolicyCondition, DiagnosticCodes.UnclosedPolicyConditionGroup, DiagnosticCodes.ExpectedRoleName, DiagnosticCodes.ExpectedClaimName, DiagnosticCodes.ExpectedClaimMatches, DiagnosticCodes.ExpectedClaimMatchTarget, DiagnosticCodes.AnonymousPolicyCombined, DiagnosticCodes.NegatedAnonymousPolicy]);\n const consistencyCodes = new Set<string>([DiagnosticCodes.UnknownEvent, DiagnosticCodes.UnknownReadModelProperty, DiagnosticCodes.PiiNotSupportedOnIdentifier]);\n const timelineCodes = new Set<string>([DiagnosticCodes.EventFromLaterSlice, DiagnosticCodes.TimelineCycleGroup]);\n const dependencyCodes = new Set<string>([DiagnosticCodes.UndeclaredDependency, DiagnosticCodes.UnusedDependencyDeclaration, DiagnosticCodes.InvalidDependencyTarget, DiagnosticCodes.RepeatedDependencyDeclaration, DiagnosticCodes.MutualDependencyDeclarations, DiagnosticCodes.AmbiguousReference]);\n // These parser diagnostics must reach the marker adapter. C#-only completeness and reference\n // checks are not synthesized here, but are preserved when a caller supplies compiler diagnostics.\n const authoringCodes = new Set<string>([DiagnosticCodes.InvalidSpecificationInvocation, DiagnosticCodes.InvalidActionSubjectClause, DiagnosticCodes.InferredActionSubject, DiagnosticCodes.ChangedActionSubject, DiagnosticCodes.AmbiguousActionInputBinding, DiagnosticCodes.UnsupportedActionSubjectContext, DiagnosticCodes.InvalidTimeZoneDeclaration, DiagnosticCodes.InvalidCommandCalendar, DiagnosticCodes.InvalidSpecificationTimeZone, DiagnosticCodes.InvalidCommandReadsDeclaration, DiagnosticCodes.UnknownMatchPattern, DiagnosticCodes.InvalidMatchPattern, DiagnosticCodes.PatternOutsidePortableMatchDialect, DiagnosticCodes.AmbiguousMatchPattern, DiagnosticCodes.DeprecatedStudioTextRulePattern, DiagnosticCodes.MismatchedSpecificationQueryResult, DiagnosticCodes.DirectionlessTranslationReactsToOwnCapture, DiagnosticCodes.CaptureEventsFromSeveralOrigins, DiagnosticCodes.CaptureEventsKeyNotRequired, DiagnosticCodes.CaptureEventsRecordFixture, DiagnosticCodes.CaptureEventSourceKeyOutsideEvents, DiagnosticCodes.EventIdPinNotCarriedToRenderers, DiagnosticCodes.ResponseNameUsedOnFailure, DiagnosticCodes.InvalidEventDeclaration, DiagnosticCodes.InvalidImportDeclaration, DiagnosticCodes.InvalidSliceDeclaration, DiagnosticCodes.InvalidDescription, DiagnosticCodes.DuplicateDescription, DiagnosticCodes.EmptyDescription, DiagnosticCodes.DuplicateEventSubject, DiagnosticCodes.InvalidSubjectType, DiagnosticCodes.ProtectedSubjectType, DiagnosticCodes.InvalidSubjectOwner, DiagnosticCodes.ReadModelSubjectNotSupported, DiagnosticCodes.InvalidSubjectModifierOrder, DiagnosticCodes.UnsupportedInteractionAlternatives, DiagnosticCodes.MixedInteractionAlternatives, DiagnosticCodes.InteractionAlternativeWithoutActions, DiagnosticCodes.InlineInteractionAlternative, DiagnosticCodes.LegacyInteractionWhere, DiagnosticCodes.InvalidSpecificationParameter, DiagnosticCodes.InvalidSpecificationCase, DiagnosticCodes.DuplicateSpecificationParameter, DiagnosticCodes.DuplicateSpecificationCase, DiagnosticCodes.IncompleteSpecificationTable, DiagnosticCodes.InvalidSpecificationCaseAssignment, DiagnosticCodes.InvalidSpecificationCaseValue, DiagnosticCodes.InvalidSpecificationCaseReference, DiagnosticCodes.OptionalSpecificationParameterTarget, DiagnosticCodes.SpecificationCaseNameCollision, DiagnosticCodes.IncompatibleSpecificationParameterType, DiagnosticCodes.UnusedSpecificationParameter, DiagnosticCodes.SingularSpecificationTableExpansion, DiagnosticCodes.InvalidSpecificationCallerPersona, DiagnosticCodes.UnsynthesizablePersonaCaller, DiagnosticCodes.PersonaWithoutGate, DiagnosticCodes.GateWithoutPersona, DiagnosticCodes.AmbiguousPersonaCaller, DiagnosticCodes.InvalidDocumentation, DiagnosticCodes.ConflictingDocumentationAcrossFiles, DiagnosticCodes.InvalidAbsentReadModelStep, DiagnosticCodes.UnknownConstraintProperty, DiagnosticCodes.OmittedProductionDestination, DiagnosticCodes.InvalidSpecificationExample, DiagnosticCodes.DuplicateSpecificationAssignment, DiagnosticCodes.InvalidReactionBatchesDeclaration, DiagnosticCodes.DescribedCommandNotImplemented, DiagnosticCodes.DescribedCommandWithoutProductions, DiagnosticCodes.DescribedCommandCardinalityNotAdmitted, DiagnosticCodes.CommandHandlerRequiresAttachment, DiagnosticCodes.PendingIntentWithOtherHandler, DiagnosticCodes.DuplicateEventInProjectionScope, DiagnosticCodes.ReservedStoredName, DiagnosticCodes.ContextSourcedPerformedQueryArgument]);\n const complianceCodes = new Set<string>([DiagnosticCodes.InvalidPurposeDeclaration, DiagnosticCodes.InvalidPurposeVocabulary, DiagnosticCodes.DuplicatePurposeField, DiagnosticCodes.DuplicatePurposeDeclaration, DiagnosticCodes.UnknownPurpose, DiagnosticCodes.PurposeInterestMismatch, DiagnosticCodes.PersonalDataWithoutPurpose, DiagnosticCodes.SpecialDataWithoutCondition, DiagnosticCodes.CriminalDataWithoutAuthorization, DiagnosticCodes.PurposeWithoutBasis, DiagnosticCodes.UnusedPurpose, DiagnosticCodes.UnknownConceptDirective, DiagnosticCodes.AttributeReasonWithoutAttribute, DiagnosticCodes.DuplicateAttributeReason, DiagnosticCodes.LegacyComplianceMarker, DiagnosticCodes.DuplicateComplianceMarker, DiagnosticCodes.UnknownComplianceMarker, DiagnosticCodes.InvalidSecretScope, DiagnosticCodes.DuplicateSecretScope, DiagnosticCodes.SecretScopeIgnoredForPii, DiagnosticCodes.InvalidPersonalDataQualifier, DiagnosticCodes.DuplicateSpecialCategory]);\n const compilerUnknownEventLines = new Set<number>();\n for (const diagnostic of context.compilerDiagnostics ?? analysis.diagnostics) {\n const identityType = diagnostic.code === DiagnosticCodes.UnknownType && (analysis.identityDetails ?? []).some(detail => detail.line === diagnostic.location.line - 1);\n const identityDuplicate = diagnostic.code === DiagnosticCodes.RepeatedSingularDeclarationAcrossFiles && diagnostic.message.includes('identity block');\n const policyDuplicate = diagnostic.code === DiagnosticCodes.DuplicateDeclaration && diagnostic.message.startsWith('Duplicate declaration of policy ');\n if (!policyDuplicate && !identityType && !identityDuplicate && !generationCodes.has(diagnostic.code) && !enumerationCodes.has(diagnostic.code) && !complianceCodes.has(diagnostic.code) && !optionalCodes.has(diagnostic.code) && !policyCodes.has(diagnostic.code) && !consistencyCodes.has(diagnostic.code) && !timelineCodes.has(diagnostic.code) && !dependencyCodes.has(diagnostic.code) && !authoringCodes.has(diagnostic.code) && diagnostic.code !== DiagnosticCodes.ReducerIdentityMismatch && diagnostic.code !== DiagnosticCodes.InvalidSpecificationExampleBody && diagnostic.code !== DiagnosticCodes.UnknownRuleImplementationDirective && diagnostic.code !== DiagnosticCodes.InvalidValidationRule && diagnostic.code !== DiagnosticCodes.RepeatedDeclarationAcrossFiles && !/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$|^PLAY060[7-9]$|^PLAY061[0-9]$|^PLAY0620$|^PLAY062[1-9]$|^PLAY063[0-9]$|^PLAY064[0-9]$|^PLAY065[0-2]$|^PLAY065[4-6]$|^PLAY066[0-6]$|^PLAY072[0-2]$/.test(diagnostic.code)) continue;\n const line = diagnostic.location.line - 1;\n if (diagnostic.code === DiagnosticCodes.OmittedProductionDestination && issues.some(existing => existing.code === diagnostic.code && existing.line === line)) continue;\n if (diagnostic.code === DiagnosticCodes.UnknownEvent) {\n if (compilerUnknownEventLines.has(line)) continue;\n compilerUnknownEventLines.add(line);\n }\n const length = legacyOptionalTypeLength(lines[line], diagnostic) || lines[line].length - diagnostic.location.column + 1;\n issues.push(issue(diagnostic.severity, line, diagnostic.location.column, length, diagnostic.message, diagnostic.code as DiagnosticCode));\n }\n\n const checkEvent = (line: number, text: string, name: string) => {\n if (!events.has(name) && !compilerUnknownEventLines.has(line)) {\n issues.push(\n tokenIssue(\n 'warning',\n line,\n text,\n name,\n `Unknown event type '${name}' — declare it in a slice or import it.`,\n diagnosticCodes.unknownEvent,\n ),\n );\n }\n };\n\n let authorizeIndent = -1;\n\n for (let index = 0; index < lines.length; index++) {\n const line = lines[index];\n const trimmed = line.trim();\n\n if (fences[index] || trimmed.length === 0) continue;\n\n const leading = line.match(/^[ ]*(\\t+)/);\n if (leading) {\n issues.push(\n issue(\n 'warning',\n index,\n leading[0].length - leading[1].length + 1,\n leading[1].length,\n 'Screenplay is indentation-based — use spaces, not tabs.',\n diagnosticCodes.tabIndentation,\n ),\n );\n }\n\n // Policy references continue on indented lines below an authorize clause.\n if (authorizeIndent >= 0) {\n if (\n indentOf(line) > authorizeIndent &&\n policyContinuation.test(trimmed)\n ) {\n for (const name of policyNames(trimmed)) {\n if (!policies.has(name)) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n name,\n `Unknown policy '${name}' — declare it with 'policy ${name}'.`,\n diagnosticCodes.unknownPolicy,\n ),\n );\n }\n }\n continue;\n }\n authorizeIndent = -1;\n }\n\n const fileImportIssue = validateImport(lines, fences, index);\n if (fileImportIssue) issues.push(fileImportIssue);\n\n const slice = trimmed.match(/^slice\\s+(\\w+)/);\n if (slice && !sliceTypes.includes(slice[1])) {\n issues.push(\n tokenIssue(\n 'error',\n index,\n line,\n slice[1],\n `Unknown slice type '${slice[1]}' — expected ${sliceTypes.join(', ')}.`,\n diagnosticCodes.unknownSliceType,\n ),\n );\n }\n\n const concept = trimmed.match(/^concept\\s+\\w+\\s*:\\s*(\\w+)/);\n if (concept && concept[1] !== 'Enum' && !primitiveTypes.includes(concept[1])) {\n issues.push(\n tokenIssue(\n 'error',\n index,\n line,\n concept[1],\n `Unknown primitive type '${concept[1]}' — expected ${primitiveTypes.join(', ')} or Enum.`,\n diagnosticCodes.unknownPrimitiveType,\n ),\n );\n }\n\n const authorize = trimmed.match(/^authorize\\s+(.*)$/);\n if (authorize) {\n authorizeIndent = indentOf(line);\n for (const name of policyNames(authorize[1])) {\n if (!policies.has(name)) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n name,\n `Unknown policy '${name}' — declare it with 'policy ${name}'.`,\n diagnosticCodes.unknownPolicy,\n ),\n );\n }\n }\n }\n\n const reactsOn = trimmed.match(/^on\\s+([A-Z]\\w*)\\s*$/);\n if (reactsOn) checkEvent(index, line, reactsOn[1]);\n\n const produces = trimmed.match(/^produces\\s+([A-Z]\\w*)\\s*$/);\n if (produces && !analysis.operationProductionLines?.has(index)) checkEvent(index, line, produces[1]);\n\n if (/^produces\\s+when\\b/.test(trimmed) && !analysis.operationProductionLines?.has(index)) {\n for (let next = index + 1; next < lines.length; next++) {\n const candidate = lines[next];\n if (fences[next] || candidate.trim().length === 0) continue;\n if (indentOf(candidate) > indentOf(line)) {\n const name = candidate.trim().match(/^([A-Z]\\w*)\\s*$/);\n if (name) checkEvent(next, candidate, name[1]);\n }\n break;\n }\n }\n\n const uniqueEvent = trimmed.match(/^unique\\s+event\\s+([A-Z]\\w*)/);\n if (uniqueEvent) checkEvent(index, line, uniqueEvent[1]);\n\n const uniqueProperty = trimmed.match(/^unique\\s+[a-z_]\\w*\\s+on\\s+([A-Z]\\w*)/);\n if (uniqueProperty) checkEvent(index, line, uniqueProperty[1]);\n\n // Every $identity. path must name a member of the caller; anything after 'claims.' is a claim name.\n // A bare $identity is left to the compilers, which see it only where an expression is expected.\n for (const path of line.match(/\\$identity\\.[\\w.]+/g) ?? []) {\n const member = path.substring('$identity.'.length).split('.')[0];\n const knownIdentity = [...identityProperties, ...(analysis.identityDetails ?? []).map(detail => detail.name)];\n if (!knownIdentity.includes(member)) {\n issues.push(tokenIssue('warning', index, line, path,\n `Unknown $identity property '${member}' — expected ${knownIdentity.join(', ')}.`,\n diagnosticCodes.unknownContextIdentityProperty));\n }\n }\n\n // Every $context. path must name something CommandContext or QueryContext carries.\n for (const path of line.match(/\\$context\\.[\\w.]+/g) ?? []) {\n const segments = path.substring('$context.'.length).split('.');\n if (!contextRoots.includes(segments[0])) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n path,\n `Unknown $context path '${segments.join('.')}' — expected one of ${contextRoots.join(', ')}.`,\n diagnosticCodes.unknownContextPath,\n ),\n );\n } else if (\n segments[0] === 'causedBy' &&\n segments.length > 1 &&\n !causedByProperties.includes(segments[1])\n ) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n path,\n `Unknown $context.causedBy property '${segments[1]}' — expected ${causedByProperties.join(', ')}.`,\n diagnosticCodes.unknownContextCausedByProperty,\n ),\n );\n } else if (\n segments[0] === 'identity' &&\n segments.length > 1 &&\n !identityProperties.includes(segments[1])\n ) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n path,\n `Unknown $context.identity property '${segments[1]}' — expected ${identityProperties.join(', ')}.`,\n diagnosticCodes.unknownContextIdentityProperty,\n ),\n );\n }\n }\n }\n\n issues.push(...validateEventContextPaths(lines, fences));\n issues.push(...validateInlineEvents(lines, symbols, application, analysis.operationProductionLines));\n\n const fenceLines = lines\n .map((line, index) => ({ line, index }))\n .filter(({ line }) => /^\\s*```(?:[a-z]+)?\\s*$/.test(line));\n if (fenceLines.length % 2 === 1) {\n const last = fenceLines[fenceLines.length - 1];\n issues.push(\n issue(\n 'error',\n last.index,\n 1,\n last.line.length + 1,\n 'Unclosed inline code block — expected a closing ``` line.',\n diagnosticCodes.unclosedCodeBlock,\n ),\n );\n }\n\n return issues;\n}\n\n// This is advice, not a semantic default: accepting the typed workspace repair changes routing.\nfunction validateProductionDestinations(lines: string[], symbols: DocumentSymbols): ValidationIssue[] {\n const issues: ValidationIssue[] = [];\n lines = eventAnalysisSource(lines);\n for (const command of symbols.commands) {\n const identifiers = command.properties.filter(property => property.isIdentifier && !propertyTypeReference(property).isOptional && !propertyTypeReference(property).isCollection);\n if (identifiers.length !== 1) continue;\n for (const production of command.produces ?? []) {\n if (production.inline || production.conditional || production.target !== undefined) continue;\n const line = production.line;\n issues.push(issue('information', line, indentOf(lines[line]) + 1, lines[line].trim().length,\n `Plain 'produces ${production.name}' omits its destination — use 'for ${identifiers[0].name}' to explicitly select the command's identifier.`,\n diagnosticCodes.omittedProductionDestination));\n }\n }\n return issues;\n}\n\n// Inside a module or feature an import names files, and a quoted import anywhere has the compiler's shape.\nfunction validateImport(lines: string[], fences: boolean[], index: number): ValidationIssue | undefined {\n const line = lines[index];\n const trimmed = line.trim().replace(/\\s*\\/\\/.*$/, '');\n if (!/^import\\b/.test(trimmed) || fileImportOn(line, index)) return undefined;\n const indent = indentOf(line);\n const inBody = indent > 0 && ['module', 'feature'].includes(enclosingChain(lines, fences, index, indent)[0]);\n if (!inBody && !isFileImportLine(line)) return undefined;\n return issue(\n 'error',\n index,\n indent + 1,\n trimmed.length,\n `Invalid import '${trimmed}' — inside a module or feature, import names files: 'import \"<path or glob>\"'.`,\n diagnosticCodes.invalidFileImport,\n );\n}\n\n// A mapping target: the first word of a mapping line, after the keyword that opens it if there is one.\nconst mappingTarget = /^(?:(?:increment|decrement|count|clear|add|subtract|set)\\s+)?@?([$\\w.]+)(?=\\s|=|$)/;\n\n// Every $eventContext.<path> - in an expression or as the dynamic key of a mapping target - checked against the\n// event-context catalog the way the compiler checks it (Parsing/EventContextPathValidator.cs).\nexport function validateEventContextPaths(lines: string[], fences: boolean[]): ValidationIssue[] {\n const issues: ValidationIssue[] = [];\n const names = (members: readonly { name: string }[]) => members.map((member) => member.name).join(', ');\n\n for (let index = 0; index < lines.length; index++) {\n const line = lines[index];\n if (fences[index]) continue;\n\n for (const match of line.matchAll(/(\\.)?\\$eventContext((?:\\.(?:\\w+(?:\\(\\))?)?)*)/g)) {\n const token = match[0].substring(match[1]?.length ?? 0);\n const written = match[2];\n if (written.length === 0) {\n // A bare $eventContext names nothing only as a dynamic key; in an expression the compiler rejects it as invalid.\n if (match[1]) {\n issues.push(issue('error', index, (match.index ?? 0) + 2, token.length, `'$eventContext' names no member - expected one of ${names(resolveEventContextPath('').expected)}.`, diagnosticCodes.missingEventContextPath));\n }\n continue;\n }\n\n const path = written.substring(1);\n const resolution = resolveEventContextPath(path);\n const column = (match.index ?? 0) + (match[1]?.length ?? 0) + 1;\n switch (resolution.status) {\n case 'missing':\n issues.push(issue('error', index, column, token.length, `'$eventContext.${path}' names no member - expected one of ${names(resolution.expected)}.`, diagnosticCodes.missingEventContextPath));\n break;\n case 'unknownMember':\n issues.push(issue('warning', index, column, token.length, `Unknown event context member '${resolution.segment}' in '$eventContext.${path}' - expected one of ${names(resolution.expected)}.`, diagnosticCodes.unknownEventContextMember));\n break;\n case 'unknownSubPath': {\n const has = resolution.expected.length === 0 ? 'no members to address' : `members ${names(resolution.expected)}`;\n issues.push(issue('warning', index, column, token.length, `Unknown event context path '$eventContext.${path}' - '${resolution.member?.name}' (${resolution.member?.type}) has ${has}.`, diagnosticCodes.unknownEventContextPath));\n break;\n }\n case 'belowCollection':\n issues.push(issue('error', index, column, token.length, `'$eventContext.${path}' cannot resolve - '${resolution.member?.name}' is a collection (${resolution.member?.type}) and cannot be addressed below.`, diagnosticCodes.eventContextPathBelowCollection));\n break;\n }\n }\n\n // Only $eventContext resolves in a dynamic key; any other $ source is kept as the literal key text.\n const target = line.trim().match(mappingTarget)?.[1];\n const source = target?.match(/\\.\\$(\\w+)/)?.[1];\n if (target && source && source !== 'eventContext') {\n issues.push(tokenIssue('warning', index, line, target, `Dynamic dictionary key '$${source}' in '${target}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${source}' becomes the key.`, diagnosticCodes.unresolvedDynamicKeySource));\n }\n }\n\n return issues;\n}\n"],"mappings":"88BAgDA,SAAS,MACL,EACA,EACA,EACA,EACA,EACA,EACe,CACf,MAAO,CAAE,WAAU,UAAS,OAAM,cAAa,UAAWA,EAAcC,EAAQ,MAAK,CACzF,CAEA,SAAS,WACL,EACA,EACA,EACA,EACA,EACA,EACe,CAEf,OAAO,MAAMC,EAAUC,EADRC,EAAK,QAAQC,CAAK,EAAI,EACAA,EAAM,OAAQC,EAASC,CAAI,CACpE,CAIA,SAAS,qBAAqB,EAAiB,EAA0B,EAAiD,CACtH,IAAMC,EAA4B,CAAC,EAC7BC,kBAAQ,IAAI,IAAI,CAAC,GAAGC,EAAeC,EAASC,CAAc,EAAG,GAAGF,EAAeG,EAAa,CAAC,CAAC,CAAC,CAAC,EAEhG,iBAAmB,EAA8B,IAAkB,CACrE,IAAK,IAAMC,KAAYC,EAAW,OAC7B,GAAc,CAACN,EAAM,IAAIO,EAAsBC,CAAS,CAAC,CAAC,IAAI,CACnE,EAAG,CACC,IAAMC,EAAOF,EAAsBF,CAAQ,CAAC,CAAC,KAC7CN,EAAO,KACH,MACI,UACAM,EAAS,KACTA,EAAS,WAAY,YACrBA,EAAS,WAAY,KAAK,OAC1BI,IAAS,WACH,+BAA+BJ,EAA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,CAAC,EAChO,KACJ,CACA,IAAK,kBACDZ,EAAO,KAAK,MAAM,QAAS8D,EAAOmC,EAAQpG,EAAM,OAAQ,kBAAkB+E,EAAK,sBAAsBoB,EAAW,QAAQ,KAAK,qBAAqBA,EAAW,QAAQ,KAAK,kCAAmCpF,EAAgB,+BAA+B,CAAC,CAErQ,CACJ,CAGA,IAAMuF,EAASxG,EAAK,KAAK,CAAC,CAAC,MAAMgG,CAAa,CAAC,GAAG,GAC5CxD,EAASgE,GAAQ,MAAM,WAAW,CAAC,GAAG,GACxCA,GAAUhE,GAAUA,IAAW,gBAC/BnC,EAAO,KAAK,WAAW,UAAW8D,EAAOnE,EAAMwG,EAAQ,4BAA4BhE,EAAO,QAAQgE,EAAO,8EAA8EhE,EAAO,oBAAqBvB,EAAgB,0BAA0B,CAAC,CAEtQ,CAEA,OAAOZ,CACX"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Where a named construct is declared. */
|
|
2
|
+
export interface DeclarationHeader {
|
|
3
|
+
/** The construct keyword, such as `concept`, `screen template` or `slice StateChange`. */
|
|
4
|
+
readonly keyword: string;
|
|
5
|
+
/** The name the construct declares. */
|
|
6
|
+
readonly name: string;
|
|
7
|
+
/** The zero-based line of the header. */
|
|
8
|
+
readonly line: number;
|
|
9
|
+
/** The zero-based column the name starts at. */
|
|
10
|
+
readonly column: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Finds the headers that declare constructs in a document.
|
|
14
|
+
*
|
|
15
|
+
* @param lines The document's lines.
|
|
16
|
+
* @returns The headers, in document order.
|
|
17
|
+
*/
|
|
18
|
+
export declare function declarationHeaders(lines: readonly string[]): DeclarationHeader[];
|
|
19
|
+
//# sourceMappingURL=declarations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declarations.d.ts","sourceRoot":"","sources":["../declarations.ts"],"names":[],"mappings":"AAKA,2CAA2C;AAC3C,MAAM,WAAW,iBAAiB;IAC9B,0FAA0F;IAC1F,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,gDAAgD;IAChD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B;AAaD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAYhF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export type { FileReference } from './file-references';
|
|
|
19
19
|
export { fileImportOn, fileImports, importablePaths, isFileImportLine } from './file-imports';
|
|
20
20
|
export type { FileImport } from './file-imports';
|
|
21
21
|
export type { CompletionOptions } from './completions';
|
|
22
|
+
export { declarationHeaders, type DeclarationHeader } from './declarations';
|
|
22
23
|
export { builtInTriggerNames, knownEventNames, knownTriggerNames, knownTypeNames, mergeSymbols, scanDocument, symbolsForBuffer } from './symbols';
|
|
23
24
|
export type { CommandSymbol, ConceptSymbol, DocumentSymbols, EventSymbol, ImportSymbol, NamedSymbol, PolicySymbol, PropertySymbol, ReadSymbol, QuerySymbol, TypeSymbol, } from './symbols';
|
|
24
25
|
export { attributeDocs, contextVariableDocs, keywordDocs, specificationKeywordDocs } from './keyword-docs';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,MAAM,EAIT,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAA4B,MAAM,eAAe,CAAC;AA+B5E,wBAAgB,yBAAyB,IAAI,IAAI,CAGhD;AAGD,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;AAEvD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,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,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/validation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../validation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAoB,MAAM,qBAAqB,CAAC;AAG3E,OAAO,EAAE,cAAc,EAAmB,MAAM,oBAAoB,CAAC;AAIrE,OAAO,EACH,eAAe,EAQlB,MAAM,WAAW,CAAC;AAGnB,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,CAAC;AAErE,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,kBAAkB,CAAC;IAI7B,IAAI,CAAC,EAAE,cAAc,CAAC;CACzB;AAGD,MAAM,WAAW,iBAAiB;IAI9B,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mBAAmB,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACvD;
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../validation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAoB,MAAM,qBAAqB,CAAC;AAG3E,OAAO,EAAE,cAAc,EAAmB,MAAM,oBAAoB,CAAC;AAIrE,OAAO,EACH,eAAe,EAQlB,MAAM,WAAW,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