@cratis/screenplay-language 4.135.0 → 4.136.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js +1 -1
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PolicyParser.js +1 -1
- package/dist/bundles/compiler/Parsing/PolicyParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCommandExamples.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCommandExamples.js.map +1 -1
- package/dist/bundles/compiler/ScreenplayCompiler.js +1 -1
- package/dist/bundles/compiler/ScreenplayCompiler.js.map +1 -1
- package/dist/bundles/response-analysis.js +1 -1
- package/dist/bundles/response-analysis.js.map +1 -1
- package/dist/response-analysis.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";import{splitLines as e}from"../Parsing/SourceLineSplitter.js";import{expandSpecificationExamples as t}from"../Parsing/SpecificationCommandExamples.js";import{validateResponses as
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{splitLines as e}from"../Parsing/SourceLineSplitter.js";import{expandSpecificationExamples as t,validateSpecificationExampleTypes as n}from"../Parsing/SpecificationCommandExamples.js";import{validateResponses as r}from"../Parsing/ResponseValidator.js";import{validateSpecificationCases as i}from"../Parsing/SpecificationCaseValidator.js";import{productionDestinationDiagnostics as a}from"../Diagnostics/ProductionDestinationDiagnostics.js";import{validateConstraintProperties as o}from"../Parsing/ConstraintPropertyValidator.js";import{validateDependencyDeclarations as s}from"../Dependencies/DeclaredDependencyTargets.js";import{LineReader as c}from"../Parsing/LineReader.js";import{ParserContext as l}from"../Parsing/ParserContext.js";import"./AuthoredOrder.js";import{DeclaredDependencies as u}from"../Dependencies/DeclaredDependencies.js";import{validatePublicEventUsage as d}from"../Parsing/PublicEventUsageValidator.js";import{validateInlineEvents as f}from"../Parsing/InlineEventValidator.js";import{validateOperations as p}from"../Parsing/OperationValidator.js";import{CommandStreamCandidates as m}from"../Parsing/CommandStreamCandidates.js";import{validateEventSources as h}from"../Parsing/EventSourceValidator.js";import{validateProjectionTargets as g}from"../Parsing/ProjectionTargetValidator.js";import{validateIdentifierCompliance as _}from"../Parsing/IdentifierComplianceValidator.js";import{validateEventSubjects as v}from"../Parsing/EventSubjectValidator.js";import{validateReadModelKeys as y}from"../Parsing/ReadModelKeyValidator.js";import{validateReactionRefusals as b}from"../Parsing/ReactionRefusalValidator.js";import{validateSpecificationRedelivery as x}from"../Parsing/SpecificationRedeliveryValidator.js";import{validateGuardedActions as S}from"../Parsing/GuardedActionValidator.js";import{validatePersonaCallers as C}from"../Parsing/PersonaCallerValidator.js";import{validatePurposes as w}from"../Parsing/PurposeValidator.js";import"./TimelineOrder.js";import{parseForAuthoring as T}from"../ScreenplayCompiler.js";import{EventSourceReadConfidence as E}from"../Syntax/EventSourceReadConfidence.js";import"./OrderingRoot.js";import{mergeDocuments as D}from"./PlayFolderMerge.js";import"./PlayImports.js";function parsePlacedDocuments(e,t,n=!1){return parsePlacedDocumentsWithSyntax(e,t,n).result}function parsePlacedDocumentsWithSyntax(O,k,A=!1){let j=m.capturePlaced(O.filter(e=>e.isPlacementResolved!==!1).map(t=>({lines:e(t.source,!1,t.path),placement:t.placement})),k),M=O.map(e=>T(e.source,e.path,e.isPlacementResolved===!1?[]:e.placement,!1,j,k)),N=M.flatMap((e,t)=>(e.value.eventSources??[]).map(e=>({source:e,placementResolved:O[t].isPlacementResolved!==!1}))),P=O.every(e=>e.isPlacementResolved!==!1)&&M.every(e=>!E.hasUnknownExtent(e.diagnostics)),F=M.map((e,t)=>O[t].isPlacementResolved===!1?{...e,value:{...e.value,eventSources:[]}}:e),I=D(F),L=new l(new c([]),void 0,k);I.value.sourceOptions!==void 0&&(L.sourceOptions=I.value.sourceOptions),L.guardedInteractions.push(...F.flatMap(e=>e.guardedInteractions)),i(I.value,L),n(I.value,L,A);let R=t(I.value);h(I.value,L),p(I.value,L),d(I.value,L),f(I.value,L),o(I.value,L),r(R,L,F.flatMap(e=>e.inputUses)),g(I.value,L),_(R,L),v(I.value,L),y(I.value,L),b(I.value,L),x(I.value,L),S(I.value,L),C(I.value,L),w(I.value,L);let z=s(I.value,L);u.validate(z,L);for(let e of a(z))L.information(e.code,e.message,e.location);let B=I.diagnostics,V=new Set(B.map(diagnosticKey)),H=[...B,...L.diagnostics.filter(e=>!V.has(diagnosticKey(e)))];return{result:{...I,value:z,diagnostics:H,success:!H.some(e=>e.severity===`error`),physicalEventSources:N,sourceInventoryComplete:P},syntax:new Map(F.map((e,t)=>[O[t].path,e.value]))}}function diagnosticKey(e){return JSON.stringify([e.code,e.location.path,e.location.line,e.location.column])}export{parsePlacedDocuments};
|
|
2
2
|
//# sourceMappingURL=PlayApplicationAssembly.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlayApplicationAssembly.js","names":["documents","languages","candidates","CommandStreamCandidates","document","splitLines","physical","parseForAuthoring","physicalEventSources","result","index","sourceInventoryComplete","EventSourceReadConfidence","parsed","merged","mergeDocuments","context","ParserContext","LineReader","validateSpecificationCases","effective","expandSpecificationExamples","validateEventSources","validateOperations","validatePublicEventUsage","validateInlineEvents","validateConstraintProperties","validateResponses","validateProjectionTargets","validateIdentifierCompliance","validateEventSubjects","validateReadModelKeys","validateReactionRefusals","validateSpecificationRedelivery","validateGuardedActions","validatePersonaCallers","validatePurposes","value","validateDependencyDeclarations","DeclaredDependencies","diagnostic","productionDestinationDiagnostics","existing","reported","all"],"sources":["../../../../../../Compiler/Files/PlayApplicationAssembly.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 { Diagnostic } from '../Diagnostics/Diagnostic';\nimport { validateSpecificationCases } from '../Parsing/SpecificationCaseValidator';\nimport { expandSpecificationExamples } from '../Parsing/SpecificationCommandExamples';\nimport { productionDestinationDiagnostics } from '../Diagnostics/ProductionDestinationDiagnostics';\nimport { validateConstraintProperties } from '../Parsing/ConstraintPropertyValidator';\nimport { validateDependencyDeclarations } from '../Dependencies/DeclaredDependencyTargets';\nimport { DeclaredDependencies } from '../Dependencies/DeclaredDependencies';\nimport { validateInlineEvents } from '../Parsing/InlineEventValidator';\nimport { LineReader } from '../Parsing/LineReader';\nimport { CommandStreamCandidates } from '../Parsing/CommandStreamCandidates';\nimport { validateEventSources } from '../Parsing/EventSourceValidator';\nimport { validateProjectionTargets } from '../Parsing/ProjectionTargetValidator';\nimport { validateIdentifierCompliance } from '../Parsing/IdentifierComplianceValidator';\nimport { validateEventSubjects } from '../Parsing/EventSubjectValidator';\nimport { validateReadModelKeys } from '../Parsing/ReadModelKeyValidator';\nimport { validateReactionRefusals } from '../Parsing/ReactionRefusalValidator';\nimport { validateSpecificationRedelivery } from '../Parsing/SpecificationRedeliveryValidator';\nimport { validateGuardedActions } from '../Parsing/GuardedActionValidator';\nimport { validatePersonaCallers } from '../Parsing/PersonaCallerValidator';\nimport { validatePurposes } from '../Parsing/PurposeValidator';\nimport { splitLines } from '../Parsing/SourceLineSplitter';\nimport { ParserContext } from '../Parsing/ParserContext';\nimport { validateResponses } from '../Parsing/ResponseValidator';\nimport { validatePublicEventUsage } from '../Parsing/PublicEventUsageValidator';\nimport { validateOperations } from '../Parsing/OperationValidator';\nimport { CompilationResult, discoverImports, parseForAuthoring } from '../ScreenplayCompiler';\nimport { ApplicationSyntax } from '../Syntax/Structure';\nimport { EventSourceSyntax } from '../Syntax/EventSources';\nimport { EventSourceReadConfidence } from '../Syntax/EventSourceReadConfidence';\nimport { mergeDocuments } from './PlayFolderMerge';\nimport { inMemoryDocumentSource, PlacedPlayDocument, PlayDocumentSource } from './PlayDocumentSource';\nimport { normalizePlayPath } from './PlayGlob';\nimport { resolveImports } from './PlayImports';\nimport { recordAuthoredOrder } from './AuthoredOrder';\nimport { selectOrderingRoot } from './OrderingRoot';\nimport { timelineOrderDiagnostics } from './TimelineOrder';\n\n// One .play document of a folder: its path relative to the folder, and its text.\nexport interface PlayFileSource {\n readonly path: string;\n readonly source: string;\n}\n\n// One application compiled from documents: the documents that make it up, each with where its top level\n// belongs, and the merged syntax with every diagnostic - resolving, parsing and merging.\nexport interface ApplicationCompilation extends CompilationResult<ApplicationSyntax> {\n readonly documents: readonly PlacedPlayDocument[];\n}\n\n// Assembles one application from documents - following their imports from the roots, parsing each where it is\n// placed, and merging the lot. The port of the C# PlayApplicationAssembly.Compile.\nexport function assembleApplication(roots: Iterable<string>, source: PlayDocumentSource, languages?: ReadonlySet<string>, presentationRoot?: string | null): ApplicationCompilation {\n const rootPaths = [...roots];\n const { documents, diagnostics } = resolveImports(rootPaths, source, languages);\n const { result: merged, syntax } = parsePlacedDocumentsWithSyntax(documents, languages);\n // Resolution owns its import inventory; share one discovery between the presentation passes.\n const imports = new Map(documents.map(document => [document.path, discoverImports(document.source, document.path, languages)]));\n const orderingRoot = presentationRoot === null ? undefined : selectOrderingRoot(presentationRoot === undefined ? rootPaths : [presentationRoot], documents, languages, imports);\n if (orderingRoot !== undefined) recordAuthoredOrder(merged.value, [orderingRoot], documents, languages, syntax, imports);\n const timeline = orderingRoot === undefined ? [] : timelineOrderDiagnostics(merged.value);\n const all = [...diagnostics, ...merged.diagnostics, ...timeline];\n return { ...merged, documents, diagnostics: all, success: !all.some(diagnostic => diagnostic.severity === 'error') };\n}\n\n// Parses documents whose source identities and placements are already known (for example unsaved\n// editor buffers), then validates contracts against the merged declaration inventory.\nexport function parsePlacedDocuments(documents: readonly PlacedPlayDocument[], languages?: ReadonlySet<string>): CompilationResult<ApplicationSyntax> & {\n readonly physicalEventSources: readonly { source: EventSourceSyntax; placementResolved: boolean }[];\n readonly sourceInventoryComplete: boolean;\n} {\n return parsePlacedDocumentsWithSyntax(documents, languages).result;\n}\n\nfunction parsePlacedDocumentsWithSyntax(documents: readonly PlacedPlayDocument[], languages?: ReadonlySet<string>) {\n const candidates = CommandStreamCandidates.capturePlaced(documents.filter(document => document.isPlacementResolved !== false).map(document => ({ lines: splitLines(document.source, false, document.path), placement: document.placement })), languages);\n const physical = documents.map(document => parseForAuthoring(document.source, document.path, document.isPlacementResolved === false ? [] : document.placement, false, candidates, languages));\n const physicalEventSources = physical.flatMap((result, index) => (result.value.eventSources ?? []).map(source => ({ source, placementResolved: documents[index].isPlacementResolved !== false })));\n const sourceInventoryComplete = documents.every(document => document.isPlacementResolved !== false) && physical.every(result => !EventSourceReadConfidence.hasUnknownExtent(result.diagnostics));\n const parsed = physical.map((result, index) => documents[index].isPlacementResolved === false ? { ...result, value: { ...result.value, eventSources: [] } } : result);\n const merged = mergeDocuments(parsed);\n const context = new ParserContext(new LineReader([]), undefined, languages);\n if (merged.value.sourceOptions !== undefined) context.sourceOptions = merged.value.sourceOptions;\n context.guardedInteractions.push(...parsed.flatMap(document => document.guardedInteractions));\n validateSpecificationCases(merged.value, context);\n const effective = expandSpecificationExamples(merged.value);\n validateEventSources(merged.value, context);\n validateOperations(merged.value, context);\n validatePublicEventUsage(merged.value, context);\n validateInlineEvents(merged.value, context);\n validateConstraintProperties(merged.value, context);\n validateResponses(effective, context, parsed.flatMap(document => document.inputUses));\n validateProjectionTargets(merged.value, context);\n validateIdentifierCompliance(effective, context);\n validateEventSubjects(merged.value, context);\n validateReadModelKeys(merged.value, context);\n validateReactionRefusals(merged.value, context);\n validateSpecificationRedelivery(merged.value, context);\n validateGuardedActions(merged.value, context);\n validatePersonaCallers(merged.value, context);\n validatePurposes(merged.value, context);\n const value = validateDependencyDeclarations(merged.value, context);\n DeclaredDependencies.validate(value, context);\n for (const diagnostic of productionDestinationDiagnostics(value)) context.information(diagnostic.code, diagnostic.message, diagnostic.location);\n const existing = merged.diagnostics;\n const reported = new Set(existing.map(diagnosticKey));\n const all = [...existing, ...context.diagnostics.filter(diagnostic => !reported.has(diagnosticKey(diagnostic)))];\n return {\n result: { ...merged, value, diagnostics: all, success: !all.some(diagnostic => diagnostic.severity === 'error'), physicalEventSources, sourceInventoryComplete },\n syntax: new Map(parsed.map((result, index) => [documents[index].path, result.value])),\n };\n}\n\nfunction diagnosticKey(diagnostic: Diagnostic): string {\n return JSON.stringify([diagnostic.code, diagnostic.location.path, diagnostic.location.line, diagnostic.location.column]);\n}\n\n// Compiles documents held in memory, keyed by portable path, as one application. Without roots every\n// document is a root, in ordinal order of its path - a folder compiled as one application, where a file an\n// import places in a module or feature is placed there. With roots, only those documents and what they import\n// make up the application - a single file compiled with its imports followed. The default sort compares\n// UTF-16 code units, which is the C# ordinal order.\nexport function compileApplication(documents: ReadonlyMap<string, string>, roots?: readonly string[], languages?: ReadonlySet<string>, presentationRoot?: string | null): ApplicationCompilation {\n const normalized = new Map([...documents].map(([path, source]) => [normalizePlayPath(path), source]));\n return assembleApplication(roots ?? [...normalized.keys()].sort(), inMemoryDocumentSource(normalized), languages, presentationRoot);\n}\n\n// Compiles the documents of a folder as one application - the counterpart of the C# CompileFolder. Every\n// document is a root, read in ordinal order of its relative path as the C# compiler reads them, so a merge\n// keeps the same first declaration in either language; one an import places in a module or feature is\n// placed there.\nexport function parseFolder(files: readonly PlayFileSource[], languages?: ReadonlySet<string>): ApplicationCompilation {\n return compileApplication(new Map(files.map(file => [file.path, file.source])), undefined, languages);\n}\n\n"],"mappings":"wsEAqEA,SAAgB,qBAAqB,EAA0C,EAG7E,CACE,OAAO,+BAA+BA,EAAWC,CAAS,CAAC,CAAC,MAChE,CAEA,SAAS,+BAA+B,EAA0C,EAAiC,CAC/G,IAAMC,EAAaC,EAAwB,cAAcH,EAAU,OAAO,GAAYI,EAAS,sBAAwB,EAAK,CAAC,CAAC,IAAI,IAAa,CAAE,MAAOC,EAAWD,EAAS,OAAQ,GAAOA,EAAS,IAAI,EAAG,UAAWA,EAAS,SAAU,EAAE,EAAGH,CAAS,EACjPK,EAAWN,EAAU,IAAI,GAAYO,EAAkBH,EAAS,OAAQA,EAAS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BjB,EAAO,MAAOE,CAAO,EAC3CgB,EAAyBlB,EAAO,MAAOE,CAAO,EAC9CiB,EAAgCnB,EAAO,MAAOE,CAAO,EACrDkB,EAAuBpB,EAAO,MAAOE,CAAO,EAC5CmB,EAAuBrB,EAAO,MAAOE,CAAO,EAC5CoB,EAAiBtB,EAAO,MAAOE,CAAO,EACtC,IAAMqB,EAAQC,EAA+BxB,EAAO,MAAOE,CAAO,EAClEuB,EAAqB,SAASF,EAAOrB,CAAO,EAC5C,IAAK,IAAMwB,KAAcC,EAAiCJ,CAAK,EAAGrB,EAAQ,YAAYwB,EAAW,KAAMA,EAAW,QAASA,EAAW,QAAQ,EAC9I,IAAME,EAAW5B,EAAO,YAClB6B,EAAW,IAAI,IAAID,EAAS,IAAI,aAAa,CAAC,EAC9CE,EAAM,CAAC,GAAGF,EAAU,GAAG1B,EAAQ,YAAY,OAAO,GAAc,CAAC2B,EAAS,IAAI,cAAcH,CAAU,CAAC,CAAC,CAAC,EAC/G,MAAO,CACH,OAAQ,CAAE,GAAG1B,EAAQ,QAAO,YAAa8B,EAAK,QAAS,CAACA,EAAI,KAAK,GAAcJ,EAAW,WAAa,OAAO,EAAG,uBAAsB,yBAAwB,EAC/J,OAAQ,IAAI,IAAI3B,EAAO,KAAK,EAAQ,IAAU,CAACb,EAAUU,EAAM,CAAC,KAAMD,EAAO,KAAK,CAAC,CAAC,CACxF,CACJ,CAEA,SAAS,cAAc,EAAgC,CACnD,OAAO,KAAK,UAAU,CAAC+B,EAAW,KAAMA,EAAW,SAAS,KAAMA,EAAW,SAAS,KAAMA,EAAW,SAAS,MAAM,CAAC,CAC3H"}
|
|
1
|
+
{"version":3,"file":"PlayApplicationAssembly.js","names":["documents","languages","deferImportedExampleTypes","candidates","CommandStreamCandidates","document","splitLines","physical","parseForAuthoring","physicalEventSources","result","index","sourceInventoryComplete","EventSourceReadConfidence","parsed","merged","mergeDocuments","context","ParserContext","LineReader","validateSpecificationCases","validateSpecificationExampleTypes","effective","expandSpecificationExamples","validateEventSources","validateOperations","validatePublicEventUsage","validateInlineEvents","validateConstraintProperties","validateResponses","validateProjectionTargets","validateIdentifierCompliance","validateEventSubjects","validateReadModelKeys","validateReactionRefusals","validateSpecificationRedelivery","validateGuardedActions","validatePersonaCallers","validatePurposes","value","validateDependencyDeclarations","DeclaredDependencies","diagnostic","productionDestinationDiagnostics","existing","reported","all"],"sources":["../../../../../../Compiler/Files/PlayApplicationAssembly.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 { Diagnostic } from '../Diagnostics/Diagnostic';\nimport { validateSpecificationCases } from '../Parsing/SpecificationCaseValidator';\nimport { expandSpecificationExamples, validateSpecificationExampleTypes } from '../Parsing/SpecificationCommandExamples';\nimport { productionDestinationDiagnostics } from '../Diagnostics/ProductionDestinationDiagnostics';\nimport { validateConstraintProperties } from '../Parsing/ConstraintPropertyValidator';\nimport { validateDependencyDeclarations } from '../Dependencies/DeclaredDependencyTargets';\nimport { DeclaredDependencies } from '../Dependencies/DeclaredDependencies';\nimport { validateInlineEvents } from '../Parsing/InlineEventValidator';\nimport { LineReader } from '../Parsing/LineReader';\nimport { CommandStreamCandidates } from '../Parsing/CommandStreamCandidates';\nimport { validateEventSources } from '../Parsing/EventSourceValidator';\nimport { validateProjectionTargets } from '../Parsing/ProjectionTargetValidator';\nimport { validateIdentifierCompliance } from '../Parsing/IdentifierComplianceValidator';\nimport { validateEventSubjects } from '../Parsing/EventSubjectValidator';\nimport { validateReadModelKeys } from '../Parsing/ReadModelKeyValidator';\nimport { validateReactionRefusals } from '../Parsing/ReactionRefusalValidator';\nimport { validateSpecificationRedelivery } from '../Parsing/SpecificationRedeliveryValidator';\nimport { validateGuardedActions } from '../Parsing/GuardedActionValidator';\nimport { validatePersonaCallers } from '../Parsing/PersonaCallerValidator';\nimport { validatePurposes } from '../Parsing/PurposeValidator';\nimport { splitLines } from '../Parsing/SourceLineSplitter';\nimport { ParserContext } from '../Parsing/ParserContext';\nimport { validateResponses } from '../Parsing/ResponseValidator';\nimport { validatePublicEventUsage } from '../Parsing/PublicEventUsageValidator';\nimport { validateOperations } from '../Parsing/OperationValidator';\nimport { CompilationResult, discoverImports, parseForAuthoring } from '../ScreenplayCompiler';\nimport { ApplicationSyntax } from '../Syntax/Structure';\nimport { EventSourceSyntax } from '../Syntax/EventSources';\nimport { EventSourceReadConfidence } from '../Syntax/EventSourceReadConfidence';\nimport { mergeDocuments } from './PlayFolderMerge';\nimport { inMemoryDocumentSource, PlacedPlayDocument, PlayDocumentSource } from './PlayDocumentSource';\nimport { normalizePlayPath } from './PlayGlob';\nimport { resolveImports } from './PlayImports';\nimport { recordAuthoredOrder } from './AuthoredOrder';\nimport { selectOrderingRoot } from './OrderingRoot';\nimport { timelineOrderDiagnostics } from './TimelineOrder';\n\n// One .play document of a folder: its path relative to the folder, and its text.\nexport interface PlayFileSource {\n readonly path: string;\n readonly source: string;\n}\n\n// One application compiled from documents: the documents that make it up, each with where its top level\n// belongs, and the merged syntax with every diagnostic - resolving, parsing and merging.\nexport interface ApplicationCompilation extends CompilationResult<ApplicationSyntax> {\n readonly documents: readonly PlacedPlayDocument[];\n}\n\n// Assembles one application from documents - following their imports from the roots, parsing each where it is\n// placed, and merging the lot. The port of the C# PlayApplicationAssembly.Compile.\nexport function assembleApplication(roots: Iterable<string>, source: PlayDocumentSource, languages?: ReadonlySet<string>, presentationRoot?: string | null): ApplicationCompilation {\n const rootPaths = [...roots];\n const { documents, diagnostics } = resolveImports(rootPaths, source, languages);\n const { result: merged, syntax } = parsePlacedDocumentsWithSyntax(documents, languages);\n // Resolution owns its import inventory; share one discovery between the presentation passes.\n const imports = new Map(documents.map(document => [document.path, discoverImports(document.source, document.path, languages)]));\n const orderingRoot = presentationRoot === null ? undefined : selectOrderingRoot(presentationRoot === undefined ? rootPaths : [presentationRoot], documents, languages, imports);\n if (orderingRoot !== undefined) recordAuthoredOrder(merged.value, [orderingRoot], documents, languages, syntax, imports);\n const timeline = orderingRoot === undefined ? [] : timelineOrderDiagnostics(merged.value);\n const all = [...diagnostics, ...merged.diagnostics, ...timeline];\n return { ...merged, documents, diagnostics: all, success: !all.some(diagnostic => diagnostic.severity === 'error') };\n}\n\n// Parses documents whose source identities and placements are already known (for example unsaved\n// editor buffers), then validates contracts against the merged declaration inventory. Editor callers may\n// defer example types whose imports are not in that inventory; resolved types are still checked.\nexport function parsePlacedDocuments(documents: readonly PlacedPlayDocument[], languages?: ReadonlySet<string>, deferImportedExampleTypes = false): CompilationResult<ApplicationSyntax> & {\n readonly physicalEventSources: readonly { source: EventSourceSyntax; placementResolved: boolean }[];\n readonly sourceInventoryComplete: boolean;\n} {\n return parsePlacedDocumentsWithSyntax(documents, languages, deferImportedExampleTypes).result;\n}\n\nfunction parsePlacedDocumentsWithSyntax(documents: readonly PlacedPlayDocument[], languages?: ReadonlySet<string>, deferImportedExampleTypes = false) {\n const candidates = CommandStreamCandidates.capturePlaced(documents.filter(document => document.isPlacementResolved !== false).map(document => ({ lines: splitLines(document.source, false, document.path), placement: document.placement })), languages);\n const physical = documents.map(document => parseForAuthoring(document.source, document.path, document.isPlacementResolved === false ? [] : document.placement, false, candidates, languages));\n const physicalEventSources = physical.flatMap((result, index) => (result.value.eventSources ?? []).map(source => ({ source, placementResolved: documents[index].isPlacementResolved !== false })));\n const sourceInventoryComplete = documents.every(document => document.isPlacementResolved !== false) && physical.every(result => !EventSourceReadConfidence.hasUnknownExtent(result.diagnostics));\n const parsed = physical.map((result, index) => documents[index].isPlacementResolved === false ? { ...result, value: { ...result.value, eventSources: [] } } : result);\n const merged = mergeDocuments(parsed);\n const context = new ParserContext(new LineReader([]), undefined, languages);\n if (merged.value.sourceOptions !== undefined) context.sourceOptions = merged.value.sourceOptions;\n context.guardedInteractions.push(...parsed.flatMap(document => document.guardedInteractions));\n validateSpecificationCases(merged.value, context);\n validateSpecificationExampleTypes(merged.value, context, deferImportedExampleTypes);\n const effective = expandSpecificationExamples(merged.value);\n validateEventSources(merged.value, context);\n validateOperations(merged.value, context);\n validatePublicEventUsage(merged.value, context);\n validateInlineEvents(merged.value, context);\n validateConstraintProperties(merged.value, context);\n validateResponses(effective, context, parsed.flatMap(document => document.inputUses));\n validateProjectionTargets(merged.value, context);\n validateIdentifierCompliance(effective, context);\n validateEventSubjects(merged.value, context);\n validateReadModelKeys(merged.value, context);\n validateReactionRefusals(merged.value, context);\n validateSpecificationRedelivery(merged.value, context);\n validateGuardedActions(merged.value, context);\n validatePersonaCallers(merged.value, context);\n validatePurposes(merged.value, context);\n const value = validateDependencyDeclarations(merged.value, context);\n DeclaredDependencies.validate(value, context);\n for (const diagnostic of productionDestinationDiagnostics(value)) context.information(diagnostic.code, diagnostic.message, diagnostic.location);\n const existing = merged.diagnostics;\n const reported = new Set(existing.map(diagnosticKey));\n const all = [...existing, ...context.diagnostics.filter(diagnostic => !reported.has(diagnosticKey(diagnostic)))];\n return {\n result: { ...merged, value, diagnostics: all, success: !all.some(diagnostic => diagnostic.severity === 'error'), physicalEventSources, sourceInventoryComplete },\n syntax: new Map(parsed.map((result, index) => [documents[index].path, result.value])),\n };\n}\n\nfunction diagnosticKey(diagnostic: Diagnostic): string {\n return JSON.stringify([diagnostic.code, diagnostic.location.path, diagnostic.location.line, diagnostic.location.column]);\n}\n\n// Compiles documents held in memory, keyed by portable path, as one application. Without roots every\n// document is a root, in ordinal order of its path - a folder compiled as one application, where a file an\n// import places in a module or feature is placed there. With roots, only those documents and what they import\n// make up the application - a single file compiled with its imports followed. The default sort compares\n// UTF-16 code units, which is the C# ordinal order.\nexport function compileApplication(documents: ReadonlyMap<string, string>, roots?: readonly string[], languages?: ReadonlySet<string>, presentationRoot?: string | null): ApplicationCompilation {\n const normalized = new Map([...documents].map(([path, source]) => [normalizePlayPath(path), source]));\n return assembleApplication(roots ?? [...normalized.keys()].sort(), inMemoryDocumentSource(normalized), languages, presentationRoot);\n}\n\n// Compiles the documents of a folder as one application - the counterpart of the C# CompileFolder. Every\n// document is a root, read in ordinal order of its relative path as the C# compiler reads them, so a merge\n// keeps the same first declaration in either language; one an import places in a module or feature is\n// placed there.\nexport function parseFolder(files: readonly PlayFileSource[], languages?: ReadonlySet<string>): ApplicationCompilation {\n return compileApplication(new Map(files.map(file => [file.path, file.source])), undefined, languages);\n}\n\n"],"mappings":"+uEAsEA,SAAgB,qBAAqB,EAA0C,EAAiC,EAA4B,GAG1I,CACE,OAAO,+BAA+BA,EAAWC,EAAWC,CAAyB,CAAC,CAAC,MAC3F,CAEA,SAAS,+BAA+B,EAA0C,EAAiC,EAA4B,GAAO,CAClJ,IAAMC,EAAaC,EAAwB,cAAcJ,EAAU,OAAO,GAAYK,EAAS,sBAAwB,EAAK,CAAC,CAAC,IAAI,IAAa,CAAE,MAAOC,EAAWD,EAAS,OAAQ,GAAOA,EAAS,IAAI,EAAG,UAAWA,EAAS,SAAU,EAAE,EAAGJ,CAAS,EACjPM,EAAWP,EAAU,IAAI,GAAYQ,EAAkBH,EAAS,OAAQA,EAAS,KAAMA,EAAS,sBAAwB,GAAQ,CAAC,EAAIA,EAAS,UAAW,GAAOF,EAAYF,CAAS,CAAC,EACtLQ,EAAuBF,EAAS,SAAS,EAAQ,KAAWG,EAAO,MAAM,cAAgB,CAAC,EAAA,CAAG,IAAI,IAAW,CAAE,SAAQ,kBAAmBV,EAAUW,EAAM,CAAC,sBAAwB,EAAM,EAAE,CAAC,EAC3LC,EAA0BZ,EAAU,MAAM,GAAYK,EAAS,sBAAwB,EAAK,GAAKE,EAAS,MAAM,GAAU,CAACM,EAA0B,iBAAiBH,EAAO,WAAW,CAAC,EACzLI,EAASP,EAAS,KAAK,EAAQ,IAAUP,EAAUW,EAAM,CAAC,sBAAwB,GAAQ,CAAE,GAAGD,EAAQ,MAAO,CAAE,GAAGA,EAAO,MAAO,aAAc,CAAC,CAAE,CAAE,EAAIA,CAAM,EAC9JK,EAASC,EAAeF,CAAM,EAC9BG,EAAU,IAAIC,EAAc,IAAIC,EAAW,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AAC4B,EAAS,IAAI,cAAcH,CAAU,CAAC,CAAC,CAAC,EAC/G,MAAO,CACH,OAAQ,CAAE,GAAG3B,EAAQ,QAAO,YAAa+B,EAAK,QAAS,CAACA,EAAI,KAAK,GAAcJ,EAAW,WAAa,OAAO,EAAG,uBAAsB,yBAAwB,EAC/J,OAAQ,IAAI,IAAI5B,EAAO,KAAK,EAAQ,IAAU,CAACd,EAAUW,EAAM,CAAC,KAAMD,EAAO,KAAK,CAAC,CAAC,CACxF,CACJ,CAEA,SAAS,cAAc,EAAgC,CACnD,OAAO,KAAK,UAAU,CAACgC,EAAW,KAAMA,EAAW,SAAS,KAAMA,EAAW,SAAS,KAAMA,EAAW,SAAS,MAAM,CAAC,CAC3H"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{unescapeString as t}from"../Text/StringLiteral.js";import{nativePattern as n}from"../Text/patterns.js";import{locationOf as r}from"./SourceLine.js";import{parseModeledMappingSource as i}from"./ExpressionParser.js";import{firstWord as a}from"./LineText.js";import{parseDescription as o}from"./DescriptionParser.js";import{parseCode as s,parseFile as c}from"./ImplementationParser.js";const l=n(`^policy\\s+([A-Za-z_]\\w*)$`);function parsePolicy(t,n){let i=t;t=t.valueContext;let u=l.exec(n.content)?.[1]??``;u===``&&t.error(e.InvalidPolicyDeclaration,`Invalid policy declaration '${n.content}' - expected 'policy <Name>'`,r(n));let d=null,f=null,p=null,m=!1,h=null;for(let l=t.peekChild(n.indent);l!==void 0;l=t.peekChild(n.indent))if(t.reader.takeSignificant(),a(l.content)===`description`)h=o(i,l,h,`Policy '${u}'`);else if(a(l.content)===`require`){let n=l.content.substring(7).trim();for(let e=t.peekChild(l.indent);e!==void 0;e=t.peekChild(l.indent))t.reader.takeSignificant(),n+=` ${e.content}`;let a=tokenizePolicyCondition(t,n);a.includes(`not`)&&(t=i);let o=parsePolicyCondition(t,a,r(l));m?t.error(e.RepeatedPolicyRequirement,`Policy '${u}' has more than one require line; combine the conditions with and/or in one require`,r(l)):d=o,m=!0}else if(a(l.content)===`file`){let n=c(t,l);f===null&&p===null?p=n:t.error(e.UnknownPolicyDirective,`Policy '${u}' must have only one implementation - a file reference or an inline code block, not both`,r(l))}else if(l.content.startsWith("```")||t.languages.has(l.content)){let n=s(t,l);f===null&&p===null?f=n:t.error(e.UnknownPolicyDirective,`Policy '${u}' must have only one implementation - a file reference or an inline code block, not both`,r(l))}else t.error(e.UnknownPolicyDirective,`Unexpected '${l.content}' in policy body - expected 'require ...', 'file <path>' or an inline code block`,r(l)),t.skipOpaqueBlock(l.indent);return d!==null&&(f!==null||p!==null)&&t.error(e.MixedPolicyImplementation,`Policy '${u}' cannot combine 'require' with a file or inline code block`,r(n)),d===null&&f===null&&p===null&&t.error(e.PolicyWithoutRequirement,`Policy '${u}' must declare a 'require' condition, a file reference or an inline code block`,r(n)),{kind:`PolicySyntax`,name:u,condition:d,code:f,file:p,description:h,location:r(n)}}function tokenizePolicyCondition(e,t){let r=e.sourceOptions.numericMode===`exact`?`-?[0-9]+(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?(?=$|[\\s()])|[\\w.$-]+|[^\\s]`:`[\\w.$]+`;return[...t.match(new RegExp(n(`"(?:[^"\\\\]|\\\\.)*"|\\(|\\)|${r}`).source,`gu`))??[]]}function parsePolicyCondition(n,r,a){let
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{unescapeString as t}from"../Text/StringLiteral.js";import{nativePattern as n}from"../Text/patterns.js";import{locationOf as r}from"./SourceLine.js";import{parseModeledMappingSource as i}from"./ExpressionParser.js";import{firstWord as a}from"./LineText.js";import{parseDescription as o}from"./DescriptionParser.js";import{parseCode as s,parseFile as c}from"./ImplementationParser.js";const l=n(`^policy\\s+([A-Za-z_]\\w*)$`);function parsePolicy(t,n){let i=t;t=t.valueContext;let u=l.exec(n.content)?.[1]??``;u===``&&t.error(e.InvalidPolicyDeclaration,`Invalid policy declaration '${n.content}' - expected 'policy <Name>'`,r(n));let d=null,f=null,p=null,m=!1,h=null;for(let l=t.peekChild(n.indent);l!==void 0;l=t.peekChild(n.indent))if(t.reader.takeSignificant(),a(l.content)===`description`)h=o(i,l,h,`Policy '${u}'`);else if(a(l.content)===`require`){let n=l.content.substring(7).trim();for(let e=t.peekChild(l.indent);e!==void 0;e=t.peekChild(l.indent))t.reader.takeSignificant(),n+=` ${e.content}`;let a=tokenizePolicyCondition(t,n);a.includes(`not`)&&(t=i);let o=parsePolicyCondition(t,a,r(l),i);m?t.error(e.RepeatedPolicyRequirement,`Policy '${u}' has more than one require line; combine the conditions with and/or in one require`,r(l)):d=o,m=!0}else if(a(l.content)===`file`){let n=c(t,l);f===null&&p===null?p=n:t.error(e.UnknownPolicyDirective,`Policy '${u}' must have only one implementation - a file reference or an inline code block, not both`,r(l))}else if(l.content.startsWith("```")||t.languages.has(l.content)){let n=s(t,l);f===null&&p===null?f=n:t.error(e.UnknownPolicyDirective,`Policy '${u}' must have only one implementation - a file reference or an inline code block, not both`,r(l))}else t.error(e.UnknownPolicyDirective,`Unexpected '${l.content}' in policy body - expected 'require ...', 'file <path>' or an inline code block`,r(l)),t.skipOpaqueBlock(l.indent);return d!==null&&(f!==null||p!==null)&&t.error(e.MixedPolicyImplementation,`Policy '${u}' cannot combine 'require' with a file or inline code block`,r(n)),d===null&&f===null&&p===null&&t.error(e.PolicyWithoutRequirement,`Policy '${u}' must declare a 'require' condition, a file reference or an inline code block`,r(n)),{kind:`PolicySyntax`,name:u,condition:d,code:f,file:p,description:h,location:r(n)}}function tokenizePolicyCondition(e,t){let r=e.sourceOptions.numericMode===`exact`?`-?[0-9]+(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?(?=$|[\\s()])|[\\w.$-]+|[^\\s]`:`[\\w.$]+`;return[...t.match(new RegExp(n(`"(?:[^"\\\\]|\\\\.)*"|\\(|\\)|${r}`).source,`gu`))??[]]}function parsePolicyCondition(n,r,a,o){let s=n.sourceOptions.numericMode===`exact`||r.includes(`not`),c=0,quoted=e=>e!==void 0&&e.startsWith(`"`)&&e.endsWith(`"`),unquote=e=>t(e.substring(1,e.length-1)),group=()=>{if(r[c]===`not`){c++;let e=group();return e===null?null:{kind:`NotPolicyConditionSyntax`,operand:e,location:a}}if(r[c]===`(`){c++;let t=or();return r[c]===`)`?c++:s&&n.error(e.UnclosedPolicyConditionGroup,`Expected ')' in policy condition`,a),t}let t=r[c++];if(t===`authenticated`)return{kind:`AuthenticatedConditionSyntax`,location:a};if(t!==`role`&&t!==`claim`)return n.error(t===void 0?e.ExpectedPolicyCondition:e.UnexpectedTokenInPolicyCondition,t===void 0?`Expected a policy condition`:`Unexpected '${t}' in policy condition`,a),null;let l=r[c++];if(!quoted(l))return n.error(t===`role`?e.ExpectedRoleName:e.ExpectedClaimName,`Expected a quoted ${t} name after '${t}'`,a),null;if(t===`role`)return{kind:`RoleConditionSyntax`,role:unquote(l),location:a};if(r[c++]!==`matches`)return n.error(e.ExpectedClaimMatches,`Expected 'matches' after the claim name`,a),null;let u=r[c++];return u===void 0?(n.error(e.ExpectedClaimMatchTarget,`Expected 'subject' or a value after 'matches'`,a),null):{kind:`ClaimConditionSyntax`,claim:unquote(l),matchesSubject:u===`subject`,matches:u===`subject`?null:i(u,a,o),location:a}},and=()=>{let e=group();for(;e!==null&&r[c]===`and`;){c++;let t=group();if(t===null)return null;e={kind:`LogicalPolicyConditionSyntax`,left:e,operator:`And`,right:t,location:a}}return e},or=()=>{let e=and();for(;e!==null&&r[c]===`or`;){c++;let t=and();if(t===null)return null;e={kind:`LogicalPolicyConditionSyntax`,left:e,operator:`Or`,right:t,location:a}}return e},l=or();return s&&l!==null&&c<r.length&&n.error(e.UnexpectedTokenInPolicyCondition,`Unexpected '${r[c]}' in policy condition`,a),l}export{parsePolicy};
|
|
2
2
|
//# sourceMappingURL=PolicyParser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolicyParser.js","names":["pattern","parseMappingSource","headerPattern","nativePattern","diagnosticContext","context","name","header","DiagnosticCodes","locationOf","condition","code","file","hasRequire","description","line","firstWord","parseDescription","text","continuation","tokens","parsed","parseFile","parseCode","numeric","reportDiagnostics","position","token","unescapeString","operand","result","location","target","parseModeledMappingSource","left","right"],"sources":["../../../../../../Compiler/Parsing/PolicyParser.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 { SourceLocation } from '../Diagnostics/SourceLocation';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { CodeBlockSyntax, FileReferenceSyntax } from '../Syntax/Implementations';\nimport { PolicyConditionSyntax, PolicySyntax } from '../Syntax/Policies';\nimport { stringBodyPattern, unescapeString } from '../Text/StringLiteral';\nimport { nativePattern as pattern } from '../Text/patterns';\nimport { parseModeledMappingSource as parseMappingSource } from './ExpressionParser';\nimport { parseCode, parseFile } from './ImplementationParser';\nimport { firstWord } from './LineText';\nimport { parseDescription } from './DescriptionParser';\nimport { ParserContext } from './ParserContext';\nimport { locationOf, SourceLine } from './SourceLine';\n\nconst headerPattern = pattern('^policy\\\\s+([A-Za-z_]\\\\w*)$');\n\nexport function parsePolicy(context: ParserContext, header: SourceLine): PolicySyntax {\n const diagnosticContext = context;\n context = context.valueContext;\n const name = headerPattern.exec(header.content)?.[1] ?? '';\n if (name === '') context.error(DiagnosticCodes.InvalidPolicyDeclaration, `Invalid policy declaration '${header.content}' - expected 'policy <Name>'`, locationOf(header));\n let condition: PolicyConditionSyntax | null = null;\n let code: CodeBlockSyntax | null = null;\n let file: FileReferenceSyntax | null = null;\n let hasRequire = false;\n let description: string | null = null;\n for (let line = context.peekChild(header.indent); line !== undefined; line = context.peekChild(header.indent)) {\n context.reader.takeSignificant();\n if (firstWord(line.content) === 'description') {\n description = parseDescription(diagnosticContext, line, description, `Policy '${name}'`);\n } else if (firstWord(line.content) === 'require') {\n let text = line.content.substring('require'.length).trim();\n for (let continuation = context.peekChild(line.indent); continuation !== undefined; continuation = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n text += ` ${continuation.content}`;\n }\n const tokens = tokenizePolicyCondition(context, text);\n // Negation is newly admitted syntax, not diagnostic-free enrichment of legacy fields.\n if (tokens.includes('not')) context = diagnosticContext;\n const parsed = parsePolicyCondition(context, tokens, locationOf(line));\n if (hasRequire) context.error(DiagnosticCodes.RepeatedPolicyRequirement, `Policy '${name}' has more than one require line; combine the conditions with and/or in one require`, locationOf(line));\n else condition = parsed;\n hasRequire = true;\n } else if (firstWord(line.content) === 'file') {\n const parsed = parseFile(context, line);\n if (code === null && file === null) file = parsed;\n else context.error(DiagnosticCodes.UnknownPolicyDirective, `Policy '${name}' must have only one implementation - a file reference or an inline code block, not both`, locationOf(line));\n } else if (line.content.startsWith('```') || context.languages.has(line.content)) {\n const parsed = parseCode(context, line);\n if (code === null && file === null) code = parsed;\n else context.error(DiagnosticCodes.UnknownPolicyDirective, `Policy '${name}' must have only one implementation - a file reference or an inline code block, not both`, locationOf(line));\n } else {\n context.error(DiagnosticCodes.UnknownPolicyDirective, `Unexpected '${line.content}' in policy body - expected 'require ...', 'file <path>' or an inline code block`, locationOf(line));\n context.skipOpaqueBlock(line.indent);\n }\n }\n if (condition !== null && (code !== null || file !== null)) context.error(DiagnosticCodes.MixedPolicyImplementation, `Policy '${name}' cannot combine 'require' with a file or inline code block`, locationOf(header));\n if (condition === null && code === null && file === null) context.error(DiagnosticCodes.PolicyWithoutRequirement, `Policy '${name}' must declare a 'require' condition, a file reference or an inline code block`, locationOf(header));\n return { kind: 'PolicySyntax', name, condition, code, file, description, location: locationOf(header) };\n}\n\nfunction tokenizePolicyCondition(context: ParserContext, text: string): string[] {\n const numeric = context.sourceOptions.numericMode === 'exact' ? '-?[0-9]+(?:\\\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?(?=$|[\\\\s()])|[\\\\w.$-]+|[^\\\\s]' : '[\\\\w.$]+';\n return [...(text.match(new RegExp(pattern(`\"${stringBodyPattern}\"|\\\\(|\\\\)|${numeric}`).source, 'gu')) ?? [])];\n}\n\nfunction parsePolicyCondition(context: ParserContext, tokens: string[], location: SourceLocation): PolicyConditionSyntax | null {\n const reportDiagnostics = context.sourceOptions.numericMode === 'exact' || tokens.includes('not');\n let position = 0;\n const quoted = (token: string | undefined): token is string => token !== undefined && token.startsWith('\"') && token.endsWith('\"');\n const unquote = (token: string): string => unescapeString(token.substring(1, token.length - 1));\n const group = (): PolicyConditionSyntax | null => {\n if (tokens[position] === 'not') {\n position++;\n const operand = group();\n return operand === null ? null : { kind: 'NotPolicyConditionSyntax', operand, location };\n }\n if (tokens[position] === '(') {\n position++;\n const result = or();\n if (tokens[position] === ')') position++;\n else if (reportDiagnostics) context.error(DiagnosticCodes.UnclosedPolicyConditionGroup, \"Expected ')' in policy condition\", location);\n return result;\n }\n const token = tokens[position++];\n if (token === 'authenticated') return { kind: 'AuthenticatedConditionSyntax', location };\n if (token !== 'role' && token !== 'claim') {\n context.error(token === undefined ? DiagnosticCodes.ExpectedPolicyCondition : DiagnosticCodes.UnexpectedTokenInPolicyCondition, token === undefined ? 'Expected a policy condition' : `Unexpected '${token}' in policy condition`, location);\n return null;\n }\n const name = tokens[position++];\n if (!quoted(name)) {\n context.error(token === 'role' ? DiagnosticCodes.ExpectedRoleName : DiagnosticCodes.ExpectedClaimName, `Expected a quoted ${token} name after '${token}'`, location);\n return null;\n }\n if (token === 'role') return { kind: 'RoleConditionSyntax', role: unquote(name), location };\n if (tokens[position++] !== 'matches') {\n context.error(DiagnosticCodes.ExpectedClaimMatches, \"Expected 'matches' after the claim name\", location);\n return null;\n }\n const target = tokens[position++];\n if (target === undefined) {\n context.error(DiagnosticCodes.ExpectedClaimMatchTarget, \"Expected 'subject' or a value after 'matches'\", location);\n return null;\n }\n return { kind: 'ClaimConditionSyntax', claim: unquote(name), matchesSubject: target === 'subject', matches: target === 'subject' ? null : parseMappingSource(target, location, context), location };\n };\n const and = (): PolicyConditionSyntax | null => {\n let left = group();\n while (left !== null && tokens[position] === 'and') { position++; const right = group(); if (right === null) return null; left = { kind: 'LogicalPolicyConditionSyntax', left, operator: 'And', right, location }; }\n return left;\n };\n const or = (): PolicyConditionSyntax | null => {\n let left = and();\n while (left !== null && tokens[position] === 'or') { position++; const right = and(); if (right === null) return null; left = { kind: 'LogicalPolicyConditionSyntax', left, operator: 'Or', right, location }; }\n return left;\n };\n const condition = or();\n if (reportDiagnostics) {\n if (condition !== null && position < tokens.length) context.error(DiagnosticCodes.UnexpectedTokenInPolicyCondition, `Unexpected '${tokens[position]}' in policy condition`, location);\n }\n return condition;\n}\n"],"mappings":"+fAgBA,MAAME,EAAgBF,EAAQ,6BAA6B,EAE3D,SAAgB,YAAY,EAAwB,EAAkC,CAClF,IAAMI,EAAoBC,EAC1B,EAAUA,EAAQ,aAClB,IAAMC,EAAOJ,EAAc,KAAKK,EAAO,OAAO,CAAC,GAAG,IAAM,GACpDD,IAAS,IAAID,EAAQ,MAAMG,EAAgB,yBAA0B,+BAA+BD,EAAO,QAAQ,8BAA+BE,EAAWF,CAAM,CAAC,EACxK,IAAIG,EAA0C,KAC1CC,EAA+B,KAC/BC,EAAmC,KACnCC,EAAa,GACbC,EAA6B,KACjC,IAAK,IAAIC,EAAOV,EAAQ,UAAUE,EAAO,MAAM,EAAGQ,IAAS,IAAA,GAAW,EAAOV,EAAQ,UAAUE,EAAO,MAAM,EAExG,GADAF,EAAQ,OAAO,gBAAgB,EAC3BW,EAAUD,EAAK,OAAO,IAAM,cAC5B,EAAcE,EAAiBb,EAAmBW,EAAMD,EAAa,WAAWR,EAAK,EAAE,OACpF,GAAIU,EAAUD,EAAK,OAAO,IAAM,UAAW,CAC9C,IAAIG,EAAOH,EAAK,QAAQ,UAAU,CAAgB,CAAC,CAAC,KAAK,EACzD,IAAK,IAAII,EAAed,EAAQ,UAAU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,"file":"PolicyParser.js","names":["pattern","parseMappingSource","headerPattern","nativePattern","diagnosticContext","context","name","header","DiagnosticCodes","locationOf","condition","code","file","hasRequire","description","line","firstWord","parseDescription","text","continuation","tokens","parsed","parseFile","parseCode","numeric","reportDiagnostics","position","token","unescapeString","operand","result","location","target","parseModeledMappingSource","expressionContext","left","right"],"sources":["../../../../../../Compiler/Parsing/PolicyParser.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 { SourceLocation } from '../Diagnostics/SourceLocation';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { CodeBlockSyntax, FileReferenceSyntax } from '../Syntax/Implementations';\nimport { PolicyConditionSyntax, PolicySyntax } from '../Syntax/Policies';\nimport { stringBodyPattern, unescapeString } from '../Text/StringLiteral';\nimport { nativePattern as pattern } from '../Text/patterns';\nimport { parseModeledMappingSource as parseMappingSource } from './ExpressionParser';\nimport { parseCode, parseFile } from './ImplementationParser';\nimport { firstWord } from './LineText';\nimport { parseDescription } from './DescriptionParser';\nimport { ParserContext } from './ParserContext';\nimport { locationOf, SourceLine } from './SourceLine';\n\nconst headerPattern = pattern('^policy\\\\s+([A-Za-z_]\\\\w*)$');\n\nexport function parsePolicy(context: ParserContext, header: SourceLine): PolicySyntax {\n const diagnosticContext = context;\n context = context.valueContext;\n const name = headerPattern.exec(header.content)?.[1] ?? '';\n if (name === '') context.error(DiagnosticCodes.InvalidPolicyDeclaration, `Invalid policy declaration '${header.content}' - expected 'policy <Name>'`, locationOf(header));\n let condition: PolicyConditionSyntax | null = null;\n let code: CodeBlockSyntax | null = null;\n let file: FileReferenceSyntax | null = null;\n let hasRequire = false;\n let description: string | null = null;\n for (let line = context.peekChild(header.indent); line !== undefined; line = context.peekChild(header.indent)) {\n context.reader.takeSignificant();\n if (firstWord(line.content) === 'description') {\n description = parseDescription(diagnosticContext, line, description, `Policy '${name}'`);\n } else if (firstWord(line.content) === 'require') {\n let text = line.content.substring('require'.length).trim();\n for (let continuation = context.peekChild(line.indent); continuation !== undefined; continuation = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n text += ` ${continuation.content}`;\n }\n const tokens = tokenizePolicyCondition(context, text);\n // Negation is newly admitted syntax, not diagnostic-free enrichment of legacy fields.\n if (tokens.includes('not')) context = diagnosticContext;\n const parsed = parsePolicyCondition(context, tokens, locationOf(line), diagnosticContext);\n if (hasRequire) context.error(DiagnosticCodes.RepeatedPolicyRequirement, `Policy '${name}' has more than one require line; combine the conditions with and/or in one require`, locationOf(line));\n else condition = parsed;\n hasRequire = true;\n } else if (firstWord(line.content) === 'file') {\n const parsed = parseFile(context, line);\n if (code === null && file === null) file = parsed;\n else context.error(DiagnosticCodes.UnknownPolicyDirective, `Policy '${name}' must have only one implementation - a file reference or an inline code block, not both`, locationOf(line));\n } else if (line.content.startsWith('```') || context.languages.has(line.content)) {\n const parsed = parseCode(context, line);\n if (code === null && file === null) code = parsed;\n else context.error(DiagnosticCodes.UnknownPolicyDirective, `Policy '${name}' must have only one implementation - a file reference or an inline code block, not both`, locationOf(line));\n } else {\n context.error(DiagnosticCodes.UnknownPolicyDirective, `Unexpected '${line.content}' in policy body - expected 'require ...', 'file <path>' or an inline code block`, locationOf(line));\n context.skipOpaqueBlock(line.indent);\n }\n }\n if (condition !== null && (code !== null || file !== null)) context.error(DiagnosticCodes.MixedPolicyImplementation, `Policy '${name}' cannot combine 'require' with a file or inline code block`, locationOf(header));\n if (condition === null && code === null && file === null) context.error(DiagnosticCodes.PolicyWithoutRequirement, `Policy '${name}' must declare a 'require' condition, a file reference or an inline code block`, locationOf(header));\n return { kind: 'PolicySyntax', name, condition, code, file, description, location: locationOf(header) };\n}\n\nfunction tokenizePolicyCondition(context: ParserContext, text: string): string[] {\n const numeric = context.sourceOptions.numericMode === 'exact' ? '-?[0-9]+(?:\\\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?(?=$|[\\\\s()])|[\\\\w.$-]+|[^\\\\s]' : '[\\\\w.$]+';\n return [...(text.match(new RegExp(pattern(`\"${stringBodyPattern}\"|\\\\(|\\\\)|${numeric}`).source, 'gu')) ?? [])];\n}\n\nfunction parsePolicyCondition(context: ParserContext, tokens: string[], location: SourceLocation, expressionContext: ParserContext): PolicyConditionSyntax | null {\n const reportDiagnostics = context.sourceOptions.numericMode === 'exact' || tokens.includes('not');\n let position = 0;\n const quoted = (token: string | undefined): token is string => token !== undefined && token.startsWith('\"') && token.endsWith('\"');\n const unquote = (token: string): string => unescapeString(token.substring(1, token.length - 1));\n const group = (): PolicyConditionSyntax | null => {\n if (tokens[position] === 'not') {\n position++;\n const operand = group();\n return operand === null ? null : { kind: 'NotPolicyConditionSyntax', operand, location };\n }\n if (tokens[position] === '(') {\n position++;\n const result = or();\n if (tokens[position] === ')') position++;\n else if (reportDiagnostics) context.error(DiagnosticCodes.UnclosedPolicyConditionGroup, \"Expected ')' in policy condition\", location);\n return result;\n }\n const token = tokens[position++];\n if (token === 'authenticated') return { kind: 'AuthenticatedConditionSyntax', location };\n if (token !== 'role' && token !== 'claim') {\n context.error(token === undefined ? DiagnosticCodes.ExpectedPolicyCondition : DiagnosticCodes.UnexpectedTokenInPolicyCondition, token === undefined ? 'Expected a policy condition' : `Unexpected '${token}' in policy condition`, location);\n return null;\n }\n const name = tokens[position++];\n if (!quoted(name)) {\n context.error(token === 'role' ? DiagnosticCodes.ExpectedRoleName : DiagnosticCodes.ExpectedClaimName, `Expected a quoted ${token} name after '${token}'`, location);\n return null;\n }\n if (token === 'role') return { kind: 'RoleConditionSyntax', role: unquote(name), location };\n if (tokens[position++] !== 'matches') {\n context.error(DiagnosticCodes.ExpectedClaimMatches, \"Expected 'matches' after the claim name\", location);\n return null;\n }\n const target = tokens[position++];\n if (target === undefined) {\n context.error(DiagnosticCodes.ExpectedClaimMatchTarget, \"Expected 'subject' or a value after 'matches'\", location);\n return null;\n }\n return { kind: 'ClaimConditionSyntax', claim: unquote(name), matchesSubject: target === 'subject', matches: target === 'subject' ? null : parseMappingSource(target, location, expressionContext), location };\n };\n const and = (): PolicyConditionSyntax | null => {\n let left = group();\n while (left !== null && tokens[position] === 'and') { position++; const right = group(); if (right === null) return null; left = { kind: 'LogicalPolicyConditionSyntax', left, operator: 'And', right, location }; }\n return left;\n };\n const or = (): PolicyConditionSyntax | null => {\n let left = and();\n while (left !== null && tokens[position] === 'or') { position++; const right = and(); if (right === null) return null; left = { kind: 'LogicalPolicyConditionSyntax', left, operator: 'Or', right, location }; }\n return left;\n };\n const condition = or();\n if (reportDiagnostics) {\n if (condition !== null && position < tokens.length) context.error(DiagnosticCodes.UnexpectedTokenInPolicyCondition, `Unexpected '${tokens[position]}' in policy condition`, location);\n }\n return condition;\n}\n"],"mappings":"+fAgBA,MAAME,EAAgBF,EAAQ,6BAA6B,EAE3D,SAAgB,YAAY,EAAwB,EAAkC,CAClF,IAAMI,EAAoBC,EAC1B,EAAUA,EAAQ,aAClB,IAAMC,EAAOJ,EAAc,KAAKK,EAAO,OAAO,CAAC,GAAG,IAAM,GACpDD,IAAS,IAAID,EAAQ,MAAMG,EAAgB,yBAA0B,+BAA+BD,EAAO,QAAQ,8BAA+BE,EAAWF,CAAM,CAAC,EACxK,IAAIG,EAA0C,KAC1CC,EAA+B,KAC/BC,EAAmC,KACnCC,EAAa,GACbC,EAA6B,KACjC,IAAK,IAAIC,EAAOV,EAAQ,UAAUE,EAAO,MAAM,EAAGQ,IAAS,IAAA,GAAW,EAAOV,EAAQ,UAAUE,EAAO,MAAM,EAExG,GADAF,EAAQ,OAAO,gBAAgB,EAC3BW,EAAUD,EAAK,OAAO,IAAM,cAC5B,EAAcE,EAAiBb,EAAmBW,EAAMD,EAAa,WAAWR,EAAK,EAAE,OACpF,GAAIU,EAAUD,EAAK,OAAO,IAAM,UAAW,CAC9C,IAAIG,EAAOH,EAAK,QAAQ,UAAU,CAAgB,CAAC,CAAC,KAAK,EACzD,IAAK,IAAII,EAAed,EAAQ,UAAUU,EAAK,MAA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1,2 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{eventDeclarations as t}from"../Syntax/EventDeclarations.js";import{dependencySources as n,dependencySourcesOf as r}from"../Syntax/DependencySources.js";import{synthesizePersonaCaller as i}from"../Syntax/PersonaCallers.js";import{specificationCaseOrigins as a}from"../Syntax/SpecificationCaseOrigin.js";import{substituteCase as o}from"./SpecificationCaseParser.js";function specificationExamples(n){let r=[],examples=(e,t)=>{for(let n of e??[])r.push({name:n.name,scope:t,example:n})},features=(e,n)=>{for(let i of e){let e=[...n,i.name];examples(i.examples,e);for(let e of i.slices){let a=[...n,i.name,e.name];examples(e.examples,a);for(let n of new Set(t(e).map(e=>e.name)))r.push({name:n,scope:a,kind:`event`});for(let t of e.commands)r.push({name:t.name,scope:a,kind:`command`});for(let t of e.readModels)r.push({name:t.name,scope:a,kind:`readmodel`})}features(i.features,e)}};examples(n.examples,[]);for(let e of n.concepts)r.push({name:e.name,scope:[],kind:`concept`});for(let e of n.types)r.push({name:e.name,scope:[],kind:`type`});for(let e of n.modules)examples(e.examples,[e.name]),features(e.features,[e.name]);let resolveCandidates=(e,t)=>{let candidates=e=>{let n=e.split(`.`),i=r.filter(e=>e.name===n.at(-1)),a=n.slice(0,-1);if(a.length)return i.filter(e=>a.length<=e.scope.length&&a.every((t,n)=>e.scope[e.scope.length-a.length+n]===t));for(let e=t.length;e>=0;e--){let n=i.filter(n=>e<=n.scope.length&&t.slice(0,e).every((e,t)=>n.scope[t]===e));if(n.length)return n}return[]},i=candidates(e),a=n.imports.filter(t=>t.qualifiedName.split(`.`).at(-1)===e);return!i.length&&a.length===1&&(i=candidates(a[0].qualifiedName)),i},resolve=(e,t)=>{let n=resolveCandidates(e,t);return n.length===1?n[0]:void 0},fixture=(e,t,n)=>{let r=resolve(e,n),i=r?.example;if(!i)return null;let a=resolve(i.type,r.scope);return a?.kind===t?{example:i,name:[...a.scope,a.name].join(`.`)}:null},merge=(e,t)=>[...e.filter(e=>!t.some(t=>t.property===e.property)),...t];return{validateTypes:(t,i)=>{for(let a of r){let r=a.example;if(r===void 0||r.type===``)continue;let o=resolveCandidates(r.type,a.scope),s=o.length===1?o[0]:void 0;if(s===void 0){let s=n.imports.filter(e=>e.qualifiedName===r.type||e.qualifiedName.split(`.`).at(-1)===r.type);if(i&&o.length===0&&s.length===1&&resolveCandidates(s[0].qualifiedName,a.scope).length===0)continue;t.error(e.UnresolvedSpecificationExampleType,`Example '${r.name}' type '${r.type}' is unknown or ambiguous; qualify a declared event, command, or read model.`,r.location)}else s.kind!==`event`&&s.kind!==`command`&&s.kind!==`readmodel`&&t.error(e.UnresolvedSpecificationExampleType,`Example '${r.name}' must name an event, command, or read model, not a ${s.kind??`example`}; example inheritance is not supported.`,r.location)}},resolvedExamples:r.filter(e=>e.example!==void 0).flatMap(e=>{let t=resolve(e.example.type,e.scope);return t?.kind===void 0?[]:[{example:e.example,kind:t.kind,name:[...t.scope,t.name].join(`.`),scope:t.scope}]}),eventStep:(e,t,n)=>{let r=fixture(e.eventType,`event`,n),i=r?.example??null,a=i?.stream??i?.noStream??null,o=e.stream??e.noStream??null,s=o??a,c=r===null?e:{...e,eventType:r.name,values:merge(i.values,e.values),for:e.for??i.for,stream:s?.kind===`SpecificationStreamSyntax`?s:null,noStream:s?.kind===`SpecificationNoStreamSyntax`?s:null},l=c.values.map(t=>{let n=i?.values.find(e=>e.property===t.property),r=e.values.includes(t);return{property:t.property,value:t.source,origin:r?n===void 0?`authored`:`override`:`example`,overriddenValue:r?n?.source??null:null}});return c.for!==null&&l.push({property:`for`,value:c.for,origin:e.for===null?`example`:i?.for==null?`authored`:`override`,overriddenValue:e.for===null?null:i?.for??null}),{role:t,authored:e,effective:c,example:i,values:l,route:s===null?null:{value:s,origin:o===null?`example`:a===null?`authored`:`override`,overriddenValue:o===null?null:a}}},command:(e,t)=>{if(!e)return e;let n=fixture(e.commandType,`command`,t);if(!n)return e;let{example:r,name:i}=n;return{...e,commandType:i,values:merge(r.values,e.values),generatedValues:merge(r.generatedValues,e.generatedValues??[]),for:e.for??r.for}},readModel:(e,t)=>{let n=fixture(e.name,`readmodel`,t);return n?{...e,name:n.name,properties:merge(n.example.values,e.properties)}:e}}}function validateSpecificationExampleTypes(e,t,n=!1){specificationExamples(e).validateTypes(t,n)}function specificationCommandExamples(e){return specificationExamples(e).command}function expandSpecificationExamples(e){return expandEffectiveSpecificationExamples(e).application}function expandEffectiveSpecificationExamples(e){let t=specificationExamples(e),s=[],features=(c,l)=>c.map(c=>{let u=[...l,c.name];return{...c,features:features(c.features,u),slices:c.slices.map(u=>{let d=[...l,c.name,u.name],f={...u,specifications:u.specifications.flatMap(n=>{let r=[],event=(e,n)=>{let i=t.eventStep(e,n,d);return r.push(i),i.effective},c=e.personas.find(e=>e.name===n.givenCallerPersona?.name),l=c===void 0?null:i(c,e),u=l?.caller==null?null:{...l.caller,location:n.givenCallerPersona.location};u!==null&&r.push({role:`given caller`,authored:n.givenCallerPersona,effective:u,example:null,route:null,values:l.contributions.map(e=>({property:e.type??e.kind,value:{kind:`LiteralExpressionSyntax`,value:e.kind===`authenticated`||e.value,location:e.location},origin:`persona`,overriddenValue:null,persona:c.name,policy:e.policy}))});let f={...n,...u===null?{}:{givenCaller:u,givenCallerPersona:void 0},given:n.given.map(e=>event(e,`given`)),givenReadModels:n.givenReadModels.map(e=>t.readModel(e,d)),when:t.command(n.when,d),whenAppended:n.whenAppended===null?null:event(n.whenAppended,`when append`),thenEvents:n.thenEvents.map(e=>event(e,`then`)),thenReadModels:n.thenReadModels.map(e=>t.readModel(e,d))};return(n.cases?.length??0)===0?(s.push({authored:n,effective:f,steps:r}),[f]):n.cases.map(e=>{let t=/* @__PURE__ */ new WeakMap,i={...o(f,e,t),name:`${n.name}_${e.name}`,parameters:[],cases:[]};return a.set(i,{table:n.name,case:e.name}),s.push({authored:n,effective:i,table:n.name,case:e.name,steps:r.map(n=>({...n,effective:o(n.effective,e,t),values:n.values.map(n=>n.value.kind===`CaseValueExpressionSyntax`?{...n,value:o(n.value,e,t),origin:`case`,caseParameter:n.value.parameter}:n),route:n.route===null?null:{...n.route,value:o(n.route.value,e,t)}}))}),i})})};return n.set(f,r(u)),f})}});return{application:{...e,modules:e.modules.map(e=>({...e,features:features(e.features,[e.name])}))},specifications:s}}export{expandEffectiveSpecificationExamples,expandSpecificationExamples,specificationCommandExamples,specificationExamples,validateSpecificationExampleTypes};
|
|
2
2
|
//# sourceMappingURL=SpecificationCommandExamples.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpecificationCommandExamples.js","names":["entries","example","nodes","feature","scope","parent","slice","name","eventDeclarations","event","command","model","application","node","module","parts","reference","named","entry","qualifiers","index","part","depth","visible","matches","imported","declaration","type","kind","inherited","authored","replacement","value","resolved","step","route","effective","values","prior","action","specifications","expanded","steps","pair","role","persona","specification","caller","synthesizePersonaCaller","synthesizedCaller","atom","result","copies","substituteCase","row","specificationCaseOrigins","dependencySources","dependencySourcesOf"],"sources":["../../../../../../Compiler/Parsing/SpecificationCommandExamples.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 { synthesizePersonaCaller } from '../Syntax/PersonaCallers';\nimport { specificationCaseOrigins } from '../Syntax/SpecificationCaseOrigin';\nimport { substituteCase } from './SpecificationCaseParser';\nimport { dependencySources, dependencySourcesOf } from '../Syntax/DependencySources';\nimport { eventDeclarations } from '../Syntax/EventDeclarations';\nimport { EffectiveSpecification, EffectiveSpecificationStep, EffectiveSpecificationValue, EffectiveSpecificationApplication } from '../Syntax/EffectiveSpecification';\nimport { PropertyMappingSyntax } from '../Syntax/Expressions';\nimport { SpecificationCommandSyntax, SpecificationEventSyntax, SpecificationReadModelSyntax } from '../Syntax/Specifications';\nimport { SpecificationExampleSyntax } from '../Syntax/SpecificationExampleSyntax';\nimport { ApplicationSyntax, FeatureSyntax } from '../Syntax/Structure';\n\n// Validators consume effective fixtures without changing the authored syntax.\n// Resolve the example at its use site, then its type at the declaration site.\nexport function specificationExamples(application: ApplicationSyntax) {\n const entries: { name: string; scope: readonly string[]; example?: SpecificationExampleSyntax; kind?: string }[] = [];\n const examples = (nodes: readonly SpecificationExampleSyntax[] | undefined, scope: readonly string[]) => {\n for (const example of nodes ?? []) entries.push({ name: example.name, scope, example });\n };\n const features = (nodes: readonly FeatureSyntax[], parent: readonly string[]) => {\n for (const feature of nodes) {\n const scope = [...parent, feature.name];\n examples(feature.examples, scope);\n for (const slice of feature.slices) {\n const scope = [...parent, feature.name, slice.name];\n examples(slice.examples, scope);\n for (const name of new Set(eventDeclarations(slice).map(event => event.name))) entries.push({ name, scope, kind: 'event' });\n for (const command of slice.commands) entries.push({ name: command.name, scope, kind: 'command' });\n for (const model of slice.readModels) entries.push({ name: model.name, scope, kind: 'readmodel' });\n }\n features(feature.features, scope);\n }\n };\n examples(application.examples, []);\n for (const node of [...application.concepts, ...application.types]) entries.push({ name: node.name, scope: [], kind: 'type' });\n for (const module of application.modules) { examples(module.examples, [module.name]); features(module.features, [module.name]); }\n const resolve = (reference: string, scope: readonly string[]) => {\n const candidates = (reference: string) => {\n const parts = reference.split('.');\n const named = entries.filter(entry => entry.name === parts.at(-1));\n const qualifiers = parts.slice(0, -1);\n if (qualifiers.length) return named.filter(entry => qualifiers.length <= entry.scope.length && qualifiers.every((part, index) => entry.scope[entry.scope.length - qualifiers.length + index] === part));\n for (let depth = scope.length; depth >= 0; depth--) {\n const visible = named.filter(entry => depth <= entry.scope.length && scope.slice(0, depth).every((part, index) => entry.scope[index] === part));\n if (visible.length) return visible;\n }\n return [];\n };\n let matches = candidates(reference);\n const imported = application.imports.filter(entry => entry.qualifiedName.split('.').at(-1) === reference);\n if (!matches.length && imported.length === 1) matches = candidates(imported[0].qualifiedName);\n return matches.length === 1 ? matches[0] : undefined;\n };\n const fixture = (reference: string, kind: string, scope: readonly string[]) => {\n const declaration = resolve(reference, scope);\n const example = declaration?.example;\n if (!example) return null;\n const type = resolve(example.type, declaration.scope);\n return type?.kind === kind ? { example, name: [...type.scope, type.name].join('.') } : null;\n };\n const merge = (inherited: readonly PropertyMappingSyntax[], authored: readonly PropertyMappingSyntax[]) => [...inherited.filter(value => !authored.some(replacement => replacement.property === value.property)), ...authored];\n return {\n resolvedExamples: entries.filter(entry => entry.example !== undefined).flatMap(entry => {\n const type = resolve(entry.example!.type, entry.scope);\n return type?.kind === undefined ? [] : [{ example: entry.example!, kind: type.kind, name: [...type.scope, type.name].join('.'), scope: type.scope }];\n }),\n eventStep: (step: SpecificationEventSyntax, role: string, scope: readonly string[]): EffectiveSpecificationStep => {\n const resolved = fixture(step.eventType, 'event', scope);\n const example = resolved?.example ?? null;\n const inherited = example?.stream ?? example?.noStream ?? null;\n const authored = step.stream ?? step.noStream ?? null;\n const route = authored ?? inherited;\n const effective = resolved === null ? step : { ...step, eventType: resolved.name, values: merge(example!.values, step.values), for: step.for ?? example!.for, stream: route?.kind === 'SpecificationStreamSyntax' ? route : null, noStream: route?.kind === 'SpecificationNoStreamSyntax' ? route : null };\n const values: EffectiveSpecificationValue[] = effective.values.map(value => {\n const prior = example?.values.find(prior => prior.property === value.property);\n const replacement = step.values.includes(value);\n return { property: value.property, value: value.source, origin: replacement ? prior === undefined ? 'authored' : 'override' : 'example', overriddenValue: replacement ? prior?.source ?? null : null };\n });\n if (effective.for !== null) values.push({ property: 'for', value: effective.for, origin: step.for === null ? 'example' : example?.for == null ? 'authored' : 'override', overriddenValue: step.for === null ? null : example?.for ?? null });\n return { role, authored: step, effective, example, values, route: route === null ? null : { value: route, origin: authored === null ? 'example' : inherited === null ? 'authored' : 'override', overriddenValue: authored === null ? null : inherited } };\n },\n command: (action: SpecificationCommandSyntax | null, scope: readonly string[]): SpecificationCommandSyntax | null => {\n if (!action) return action;\n const effective = fixture(action.commandType, 'command', scope);\n if (!effective) return action;\n const { example, name } = effective;\n return { ...action, commandType: name, values: merge(example.values, action.values), generatedValues: merge(example.generatedValues, action.generatedValues ?? []), for: action.for ?? example.for };\n },\n readModel: (step: SpecificationReadModelSyntax, scope: readonly string[]): SpecificationReadModelSyntax => {\n const effective = fixture(step.name, 'readmodel', scope);\n if (!effective) return step;\n return { ...step, name: effective.name, properties: merge(effective.example.values, step.properties) };\n },\n };\n}\n\nexport function specificationCommandExamples(application: ApplicationSyntax): (action: SpecificationCommandSyntax | null, scope: readonly string[]) => SpecificationCommandSyntax | null {\n return specificationExamples(application).command;\n}\n\nexport function expandSpecificationExamples(application: ApplicationSyntax): ApplicationSyntax {\n return expandEffectiveSpecificationExamples(application).application;\n}\n\nexport function expandEffectiveSpecificationExamples(application: ApplicationSyntax): EffectiveSpecificationApplication {\n const effective = specificationExamples(application);\n const specifications: EffectiveSpecification[] = [];\n const features = (nodes: readonly FeatureSyntax[], parent: readonly string[]): FeatureSyntax[] => nodes.map(feature => {\n const scope = [...parent, feature.name];\n return {\n ...feature,\n features: features(feature.features, scope),\n slices: feature.slices.map(slice => {\n const scope = [...parent, feature.name, slice.name];\n const expanded = { ...slice, specifications: slice.specifications.flatMap(specification => {\n const steps: EffectiveSpecificationStep[] = [];\n const event = (step: SpecificationEventSyntax, role: string): SpecificationEventSyntax => {\n const pair = effective.eventStep(step, role, scope);\n steps.push(pair);\n return pair.effective as SpecificationEventSyntax;\n };\n const persona = application.personas.find(persona => persona.name === specification.givenCallerPersona?.name);\n const caller = persona === undefined ? null : synthesizePersonaCaller(persona, application);\n const synthesizedCaller = caller?.caller == null ? null : { ...caller.caller, location: specification.givenCallerPersona!.location };\n if (synthesizedCaller !== null) {\n steps.push({ role: 'given caller', authored: specification.givenCallerPersona!, effective: synthesizedCaller, example: null, route: null,\n values: caller!.contributions.map(atom => ({ property: atom.type ?? atom.kind, value: { kind: 'LiteralExpressionSyntax', value: atom.kind === 'authenticated' ? true : atom.value, location: atom.location }, origin: 'persona', overriddenValue: null, persona: persona!.name, policy: atom.policy })) });\n }\n const result = {\n ...specification,\n ...(synthesizedCaller === null ? {} : { givenCaller: synthesizedCaller, givenCallerPersona: undefined }),\n given: specification.given.map(step => event(step, 'given')),\n givenReadModels: specification.givenReadModels.map(step => effective.readModel(step, scope)),\n when: effective.command(specification.when, scope),\n whenAppended: specification.whenAppended === null ? null : event(specification.whenAppended, 'when append'),\n thenEvents: specification.thenEvents.map(step => event(step, 'then')),\n thenReadModels: specification.thenReadModels.map(step => effective.readModel(step, scope)),\n };\n if ((specification.cases?.length ?? 0) === 0) {\n specifications.push({ authored: specification, effective: result, steps });\n return [result];\n }\n return specification.cases!.map(row => {\n const copies = new WeakMap<object, unknown>();\n const expanded = { ...substituteCase(result, row, copies), name: `${specification.name}_${row.name}`, parameters: [], cases: [] };\n specificationCaseOrigins.set(expanded, { table: specification.name, case: row.name });\n specifications.push({ authored: specification, effective: expanded, table: specification.name, case: row.name,\n steps: steps.map(step => ({ ...step, effective: substituteCase(step.effective, row, copies),\n values: step.values.map(value => value.value.kind === 'CaseValueExpressionSyntax'\n ? { ...value, value: substituteCase(value.value, row, copies), origin: 'case', caseParameter: value.value.parameter } : value),\n route: step.route === null ? null : { ...step.route, value: substituteCase(step.route.value, row, copies) } })) });\n return expanded;\n });\n }) };\n dependencySources.set(expanded, dependencySourcesOf(slice));\n return expanded;\n }),\n };\n });\n return { application: { ...application, modules: application.modules.map(module => ({ ...module, features: features(module.features, [module.name]) })) }, specifications };\n}\n"],"mappings":"waAgBA,SAAgB,sBAAsB,EAAgC,CAClE,IAAMA,EAA6G,CAAC,EAC9G,UAAY,EAA0D,IAA6B,CACrG,IAAK,IAAMC,KAAWC,GAAS,CAAC,EAAGF,EAAQ,KAAK,CAAE,KAAMC,EAAQ,KAAM,QAAO,SAAQ,CAAC,CAC1F,EACM,UAAY,EAAiC,IAA8B,CAC7E,IAAK,IAAME,KAAWD,EAAO,CACzB,IAAME,EAAQ,CAAC,GAAGC,EAAQF,EAAQ,I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AAE,GAAGE,EAAQ,SAAU,SAASA,EAAO,SAAU,CAACA,EAAO,IAAI,CAAC,CAAE,EAAE,CAAE,EAAG,gBAAe,CAC9K"}
|
|
1
|
+
{"version":3,"file":"SpecificationCommandExamples.js","names":["entries","example","nodes","feature","scope","parent","slice","name","eventDeclarations","event","command","model","application","node","module","parts","reference","named","entry","qualifiers","index","part","depth","visible","matches","imported","declaration","type","kind","inherited","authored","replacement","value","deferImportedTypes","context","DiagnosticCodes","resolved","step","route","effective","values","prior","action","specifications","expanded","steps","pair","role","persona","specification","caller","synthesizePersonaCaller","synthesizedCaller","atom","result","copies","substituteCase","row","specificationCaseOrigins","dependencySources","dependencySourcesOf"],"sources":["../../../../../../Compiler/Parsing/SpecificationCommandExamples.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 } from '../Diagnostics/DiagnosticCodes';\nimport { ParserContext } from './ParserContext';\nimport { synthesizePersonaCaller } from '../Syntax/PersonaCallers';\nimport { specificationCaseOrigins } from '../Syntax/SpecificationCaseOrigin';\nimport { substituteCase } from './SpecificationCaseParser';\nimport { dependencySources, dependencySourcesOf } from '../Syntax/DependencySources';\nimport { eventDeclarations } from '../Syntax/EventDeclarations';\nimport { EffectiveSpecification, EffectiveSpecificationStep, EffectiveSpecificationValue, EffectiveSpecificationApplication } from '../Syntax/EffectiveSpecification';\nimport { PropertyMappingSyntax } from '../Syntax/Expressions';\nimport { SpecificationCommandSyntax, SpecificationEventSyntax, SpecificationReadModelSyntax } from '../Syntax/Specifications';\nimport { SpecificationExampleSyntax } from '../Syntax/SpecificationExampleSyntax';\nimport { ApplicationSyntax, FeatureSyntax } from '../Syntax/Structure';\n\n// Validators consume effective fixtures without changing the authored syntax.\n// Resolve the example at its use site, then its type at the declaration site.\nexport function specificationExamples(application: ApplicationSyntax) {\n const entries: { name: string; scope: readonly string[]; example?: SpecificationExampleSyntax; kind?: string }[] = [];\n const examples = (nodes: readonly SpecificationExampleSyntax[] | undefined, scope: readonly string[]) => {\n for (const example of nodes ?? []) entries.push({ name: example.name, scope, example });\n };\n const features = (nodes: readonly FeatureSyntax[], parent: readonly string[]) => {\n for (const feature of nodes) {\n const scope = [...parent, feature.name];\n examples(feature.examples, scope);\n for (const slice of feature.slices) {\n const scope = [...parent, feature.name, slice.name];\n examples(slice.examples, scope);\n for (const name of new Set(eventDeclarations(slice).map(event => event.name))) entries.push({ name, scope, kind: 'event' });\n for (const command of slice.commands) entries.push({ name: command.name, scope, kind: 'command' });\n for (const model of slice.readModels) entries.push({ name: model.name, scope, kind: 'readmodel' });\n }\n features(feature.features, scope);\n }\n };\n examples(application.examples, []);\n for (const node of application.concepts) entries.push({ name: node.name, scope: [], kind: 'concept' });\n for (const node of application.types) entries.push({ name: node.name, scope: [], kind: 'type' });\n for (const module of application.modules) { examples(module.examples, [module.name]); features(module.features, [module.name]); }\n const resolveCandidates = (reference: string, scope: readonly string[]) => {\n const candidates = (reference: string) => {\n const parts = reference.split('.');\n const named = entries.filter(entry => entry.name === parts.at(-1));\n const qualifiers = parts.slice(0, -1);\n if (qualifiers.length) return named.filter(entry => qualifiers.length <= entry.scope.length && qualifiers.every((part, index) => entry.scope[entry.scope.length - qualifiers.length + index] === part));\n for (let depth = scope.length; depth >= 0; depth--) {\n const visible = named.filter(entry => depth <= entry.scope.length && scope.slice(0, depth).every((part, index) => entry.scope[index] === part));\n if (visible.length) return visible;\n }\n return [];\n };\n let matches = candidates(reference);\n const imported = application.imports.filter(entry => entry.qualifiedName.split('.').at(-1) === reference);\n if (!matches.length && imported.length === 1) matches = candidates(imported[0].qualifiedName);\n return matches;\n };\n const resolve = (reference: string, scope: readonly string[]) => {\n const matches = resolveCandidates(reference, scope);\n return matches.length === 1 ? matches[0] : undefined;\n };\n const fixture = (reference: string, kind: string, scope: readonly string[]) => {\n const declaration = resolve(reference, scope);\n const example = declaration?.example;\n if (!example) return null;\n const type = resolve(example.type, declaration.scope);\n return type?.kind === kind ? { example, name: [...type.scope, type.name].join('.') } : null;\n };\n const merge = (inherited: readonly PropertyMappingSyntax[], authored: readonly PropertyMappingSyntax[]) => [...inherited.filter(value => !authored.some(replacement => replacement.property === value.property)), ...authored];\n return {\n validateTypes: (context: ParserContext, deferImportedTypes: boolean) => {\n for (const entry of entries) {\n const example = entry.example;\n if (example === undefined || example.type === '') continue;\n const matches = resolveCandidates(example.type, entry.scope);\n const type = matches.length === 1 ? matches[0] : undefined;\n if (type === undefined) {\n const imported = application.imports.filter(imported => imported.qualifiedName === example.type || imported.qualifiedName.split('.').at(-1) === example.type);\n if (deferImportedTypes && matches.length === 0 && imported.length === 1 && resolveCandidates(imported[0].qualifiedName, entry.scope).length === 0) continue;\n context.error(DiagnosticCodes.UnresolvedSpecificationExampleType, `Example '${example.name}' type '${example.type}' is unknown or ambiguous; qualify a declared event, command, or read model.`, example.location);\n } else if (type.kind !== 'event' && type.kind !== 'command' && type.kind !== 'readmodel') {\n context.error(DiagnosticCodes.UnresolvedSpecificationExampleType, `Example '${example.name}' must name an event, command, or read model, not a ${type.kind ?? 'example'}; example inheritance is not supported.`, example.location);\n }\n }\n },\n resolvedExamples: entries.filter(entry => entry.example !== undefined).flatMap(entry => {\n const type = resolve(entry.example!.type, entry.scope);\n return type?.kind === undefined ? [] : [{ example: entry.example!, kind: type.kind, name: [...type.scope, type.name].join('.'), scope: type.scope }];\n }),\n eventStep: (step: SpecificationEventSyntax, role: string, scope: readonly string[]): EffectiveSpecificationStep => {\n const resolved = fixture(step.eventType, 'event', scope);\n const example = resolved?.example ?? null;\n const inherited = example?.stream ?? example?.noStream ?? null;\n const authored = step.stream ?? step.noStream ?? null;\n const route = authored ?? inherited;\n const effective = resolved === null ? step : { ...step, eventType: resolved.name, values: merge(example!.values, step.values), for: step.for ?? example!.for, stream: route?.kind === 'SpecificationStreamSyntax' ? route : null, noStream: route?.kind === 'SpecificationNoStreamSyntax' ? route : null };\n const values: EffectiveSpecificationValue[] = effective.values.map(value => {\n const prior = example?.values.find(prior => prior.property === value.property);\n const replacement = step.values.includes(value);\n return { property: value.property, value: value.source, origin: replacement ? prior === undefined ? 'authored' : 'override' : 'example', overriddenValue: replacement ? prior?.source ?? null : null };\n });\n if (effective.for !== null) values.push({ property: 'for', value: effective.for, origin: step.for === null ? 'example' : example?.for == null ? 'authored' : 'override', overriddenValue: step.for === null ? null : example?.for ?? null });\n return { role, authored: step, effective, example, values, route: route === null ? null : { value: route, origin: authored === null ? 'example' : inherited === null ? 'authored' : 'override', overriddenValue: authored === null ? null : inherited } };\n },\n command: (action: SpecificationCommandSyntax | null, scope: readonly string[]): SpecificationCommandSyntax | null => {\n if (!action) return action;\n const effective = fixture(action.commandType, 'command', scope);\n if (!effective) return action;\n const { example, name } = effective;\n return { ...action, commandType: name, values: merge(example.values, action.values), generatedValues: merge(example.generatedValues, action.generatedValues ?? []), for: action.for ?? example.for };\n },\n readModel: (step: SpecificationReadModelSyntax, scope: readonly string[]): SpecificationReadModelSyntax => {\n const effective = fixture(step.name, 'readmodel', scope);\n if (!effective) return step;\n return { ...step, name: effective.name, properties: merge(effective.example.values, step.properties) };\n },\n };\n}\n\nexport function validateSpecificationExampleTypes(application: ApplicationSyntax, context: ParserContext, deferImportedTypes = false): void {\n specificationExamples(application).validateTypes(context, deferImportedTypes);\n}\n\nexport function specificationCommandExamples(application: ApplicationSyntax): (action: SpecificationCommandSyntax | null, scope: readonly string[]) => SpecificationCommandSyntax | null {\n return specificationExamples(application).command;\n}\n\nexport function expandSpecificationExamples(application: ApplicationSyntax): ApplicationSyntax {\n return expandEffectiveSpecificationExamples(application).application;\n}\n\nexport function expandEffectiveSpecificationExamples(application: ApplicationSyntax): EffectiveSpecificationApplication {\n const effective = specificationExamples(application);\n const specifications: EffectiveSpecification[] = [];\n const features = (nodes: readonly FeatureSyntax[], parent: readonly string[]): FeatureSyntax[] => nodes.map(feature => {\n const scope = [...parent, feature.name];\n return {\n ...feature,\n features: features(feature.features, scope),\n slices: feature.slices.map(slice => {\n const scope = [...parent, feature.name, slice.name];\n const expanded = { ...slice, specifications: slice.specifications.flatMap(specification => {\n const steps: EffectiveSpecificationStep[] = [];\n const event = (step: SpecificationEventSyntax, role: string): SpecificationEventSyntax => {\n const pair = effective.eventStep(step, role, scope);\n steps.push(pair);\n return pair.effective as SpecificationEventSyntax;\n };\n const persona = application.personas.find(persona => persona.name === specification.givenCallerPersona?.name);\n const caller = persona === undefined ? null : synthesizePersonaCaller(persona, application);\n const synthesizedCaller = caller?.caller == null ? null : { ...caller.caller, location: specification.givenCallerPersona!.location };\n if (synthesizedCaller !== null) {\n steps.push({ role: 'given caller', authored: specification.givenCallerPersona!, effective: synthesizedCaller, example: null, route: null,\n values: caller!.contributions.map(atom => ({ property: atom.type ?? atom.kind, value: { kind: 'LiteralExpressionSyntax', value: atom.kind === 'authenticated' ? true : atom.value, location: atom.location }, origin: 'persona', overriddenValue: null, persona: persona!.name, policy: atom.policy })) });\n }\n const result = {\n ...specification,\n ...(synthesizedCaller === null ? {} : { givenCaller: synthesizedCaller, givenCallerPersona: undefined }),\n given: specification.given.map(step => event(step, 'given')),\n givenReadModels: specification.givenReadModels.map(step => effective.readModel(step, scope)),\n when: effective.command(specification.when, scope),\n whenAppended: specification.whenAppended === null ? null : event(specification.whenAppended, 'when append'),\n thenEvents: specification.thenEvents.map(step => event(step, 'then')),\n thenReadModels: specification.thenReadModels.map(step => effective.readModel(step, scope)),\n };\n if ((specification.cases?.length ?? 0) === 0) {\n specifications.push({ authored: specification, effective: result, steps });\n return [result];\n }\n return specification.cases!.map(row => {\n const copies = new WeakMap<object, unknown>();\n const expanded = { ...substituteCase(result, row, copies), name: `${specification.name}_${row.name}`, parameters: [], cases: [] };\n specificationCaseOrigins.set(expanded, { table: specification.name, case: row.name });\n specifications.push({ authored: specification, effective: expanded, table: specification.name, case: row.name,\n steps: steps.map(step => ({ ...step, effective: substituteCase(step.effective, row, copies),\n values: step.values.map(value => value.value.kind === 'CaseValueExpressionSyntax'\n ? { ...value, value: substituteCase(value.value, row, copies), origin: 'case', caseParameter: value.value.parameter } : value),\n route: step.route === null ? null : { ...step.route, value: substituteCase(step.route.value, row, copies) } })) });\n return expanded;\n });\n }) };\n dependencySources.set(expanded, dependencySourcesOf(slice));\n return expanded;\n }),\n };\n });\n return { application: { ...application, modules: application.modules.map(module => ({ ...module, features: features(module.features, [module.name]) })) }, specifications };\n}\n"],"mappings":"4eAkBA,SAAgB,sBAAsB,EAAgC,CAClE,IAAMA,EAA6G,CAAC,EAC9G,UAAY,EAA0D,IAA6B,CACrG,IAAK,IAAMC,KAAWC,GAAS,CAAC,EAAGF,EAAQ,KAAK,CAAE,KAAMC,EAAQ,KAAM,QAAO,SAAQ,CAAC,CAC1F,EACM,UAAY,EAAiC,IAA8B,CAC7E,IAAK,IAAME,KAAWD,EAAO,CACzB,IAAME,EAAQ,CAAC,GAAGC,EAAQF,EAAQ,IAAI,EACtC,SAASA,EAAQ,SAAUC,CAAK,EAChC,IAAK,IAAME,KAASH,EAAQ,OAAQ,CAChC,IAAMC,EAAQ,CAAC,GAAGC,EAAQF,EAAQ,KAAMG,EAAM,IAAI,EAClD,SAASA,EAAM,SAAUF,CAAK,EAC9B,IAAK,IAAMG,KAAQ,IAAI,IAAIC,EAAkBF,CAAK,CAAC,CAAC,IAAI,GAASG,EAAM,IAAI,CAAC,EAAGT,EAAQ,KAAK,CAAE,OAAM,QAAO,KAAM,OAAQ,CAAC,EAC1H,IAAK,IAAMU,KAAWJ,EAAM,SAAUN,EAAQ,KAAK,CAAE,KAAMU,EAAQ,KAAM,QAAO,KAAM,SAAU,CAAC,EACjG,IAAK,IAAMC,KAASL,EAAM,WAAYN,EAAQ,KAAK,CAAE,KAAMW,EAAM,KAAM,QAAO,KAAM,WAAY,CAAC,CACrG,CACA,SAASR,EAAQ,SAAUC,CAAK,CACpC,CACJ,EACA,SAASQ,EAAY,SAAU,CAAC,CAAC,EACjC,IAAK,IAAMC,KAAQD,EAAY,SAAUZ,E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4BAChD,CAAE,GAAGA,EAAO,MAAOwB,EAAexB,EAAM,MAAOyB,EAAKF,CAAM,EAAG,OAAQ,OAAQ,cAAevB,EAAM,MAAM,SAAU,EAAIA,CAAK,EACjI,MAAOK,EAAK,QAAU,KAAO,KAAO,CAAE,GAAGA,EAAK,MAAO,MAAOmB,EAAenB,EAAK,MAAM,MAAOoB,EAAKF,CAAM,CAAE,CAAE,EAAE,CAAE,CAAC,EAClHX,CACX,CAAC,CACL,CAAC,CAAE,EAEH,OADAe,EAAkB,IAAIf,EAAUgB,EAAoBtD,CAAK,CAAC,EACnDsC,CACX,CAAC,CACL,CACJ,CAAC,EACD,MAAO,CAAE,YAAa,CAAE,GAAGhC,EAAa,QAASA,EAAY,QAAQ,IAAI,IAAW,CAAE,GAAGE,EAAQ,SAAU,SAASA,EAAO,SAAU,CAACA,EAAO,IAAI,CAAC,CAAE,EAAE,CAAE,EAAG,gBAAe,CAC9K"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../_virtual/_virtual/_rolldown/runtime.js";import{splitLines as e}from"./Parsing/SourceLineSplitter.js";import{validateIdentity as t}from"./Parsing/IdentityValidator.js";import{expandSpecificationExamples as n}from"./Parsing/SpecificationCommandExamples.js";import{validateResponses as
|
|
1
|
+
import"../_virtual/_virtual/_rolldown/runtime.js";import{splitLines as e}from"./Parsing/SourceLineSplitter.js";import{validateIdentity as t}from"./Parsing/IdentityValidator.js";import{expandSpecificationExamples as n,validateSpecificationExampleTypes as r}from"./Parsing/SpecificationCommandExamples.js";import{validateResponses as i}from"./Parsing/ResponseValidator.js";import{validateSpecificationCases as a}from"./Parsing/SpecificationCaseValidator.js";import{productionDestinationDiagnostics as o}from"./Diagnostics/ProductionDestinationDiagnostics.js";import{validateConstraintProperties as s}from"./Parsing/ConstraintPropertyValidator.js";import{validateDependencyDeclarations as c}from"./Dependencies/DeclaredDependencyTargets.js";import{documentPlacement as l}from"./Files/PlayPlacement.js";import{interactionAncestry as u}from"./Parsing/InteractionAlternatives.js";import"./Parsing/SpecificationParser.js";import"./Parsing/SpecificationExampleParser.js";import"./Parsing/CaptureParser.js";import"./Parsing/ProjectionParser.js";import"./Parsing/ImportDiscovery.js";import{DeclaredDependencies as d}from"./Dependencies/DeclaredDependencies.js";import{validatePublicEventUsage as f}from"./Parsing/PublicEventUsageValidator.js";import{sourceContext as p}from"./Parsing/SourceOptionsParser.js";import{validateInlineEvents as m}from"./Parsing/InlineEventValidator.js";import{validateOperations as h}from"./Parsing/OperationValidator.js";import{parseApplication as g}from"./Parsing/ScreenplayParser.js";import{CommandStreamCandidates as _}from"./Parsing/CommandStreamCandidates.js";import{validateEventSources as v}from"./Parsing/EventSourceValidator.js";import{validateProjectionTargets as y}from"./Parsing/ProjectionTargetValidator.js";import{validateIdentifierCompliance as b}from"./Parsing/IdentifierComplianceValidator.js";import{validateEventSubjects as x}from"./Parsing/EventSubjectValidator.js";import{validateReadModelKeys as S}from"./Parsing/ReadModelKeyValidator.js";import{validateReactionRefusals as C}from"./Parsing/ReactionRefusalValidator.js";import{validateSpecificationRedelivery as w}from"./Parsing/SpecificationRedeliveryValidator.js";import{validateGuardedActions as T}from"./Parsing/GuardedActionValidator.js";import{validatePersonaCallers as E}from"./Parsing/PersonaCallerValidator.js";import{validatePurposes as D}from"./Parsing/PurposeValidator.js";import{timelineOrderDiagnostics as O}from"./Files/TimelineOrder.js";function parseForAuthoring(k,A,j=l,M=!0,N,P){let F=e(k,!1,A),I=p(F,A,P);I.scope=j,I.interactionAncestors=u(F),I.streamCandidates=N??_.capture([F],j,P);let L=g(I,F,j);if(M){t(L,I),D(L,I),m(L,I),s(L,I),h(L,I),f(L,I),a(L,I),r(L,I,!0);let e=n(L);i(e,I),v(L,I),y(L,I),b(e,I),x(L,I),S(L,I),C(L,I),w(L,I),T(L,I),E(L,I),L=c(L,I),d.validate(L,I);for(let e of o(L))I.information(e.code,e.message,e.location);for(let e of O(L))I.information(e.code,e.message,e.location)}return{value:L,diagnostics:I.diagnostics,triggerData:I.triggerData,inputUses:I.inputUses,guardedInteractions:I.guardedInteractions,success:!I.diagnostics.some(e=>e.severity===`error`)}}export{parseForAuthoring};
|
|
2
2
|
//# sourceMappingURL=ScreenplayCompiler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenplayCompiler.js","names":["documentPlacement","lines","splitLines","source","path","context","sourceContext","languages","placement","interactionAncestry","streamCandidates","CommandStreamCandidates","value","parseApplication","validateResponseContracts","validateIdentity","validatePurposes","validateInlineEvents","validateConstraintProperties","validateOperations","validatePublicEventUsage","validateSpecificationCases","effective","expandSpecificationExamples","validateResponses","validateEventSources","validateProjectionTargets","validateIdentifierCompliance","validateEventSubjects","validateReadModelKeys","validateReactionRefusals","validateSpecificationRedelivery","validateGuardedActions","validatePersonaCallers","validateDependencyDeclarations","DeclaredDependencies","diagnostic","productionDestinationDiagnostics","timelineOrderDiagnostics"],"sources":["../../../../../Compiler/ScreenplayCompiler.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 { validateIdentity } from './Parsing/IdentityValidator';\nimport { Diagnostic } from './Diagnostics/Diagnostic';\nimport { validateSpecificationCases } from './Parsing/SpecificationCaseValidator';\nimport { expandSpecificationExamples } from './Parsing/SpecificationCommandExamples';\nimport { productionDestinationDiagnostics } from './Diagnostics/ProductionDestinationDiagnostics';\nimport { validateConstraintProperties } from './Parsing/ConstraintPropertyValidator';\nimport { validateDependencyDeclarations } from './Dependencies/DeclaredDependencyTargets';\nimport { DeclaredDependencies } from './Dependencies/DeclaredDependencies';\nimport { documentPlacement, PlayPlacement } from './Files/PlayPlacement';\nimport { DiscoveredImport, discoverImports as discoverImportsIn } from './Parsing/ImportDiscovery';\nimport { InputUse } from './Parsing/InputUses';\nimport { GuardedInteractionBinding, interactionAncestry } from './Parsing/InteractionAlternatives';\nimport { validateResponses } from './Parsing/ResponseValidator';\nimport { validatePublicEventUsage } from './Parsing/PublicEventUsageValidator';\nimport { sourceContext } from './Parsing/SourceOptionsParser';\nimport { validateInlineEvents } from './Parsing/InlineEventValidator';\nimport { validateOperations } from './Parsing/OperationValidator';\nimport { CommandStreamCandidates } from './Parsing/CommandStreamCandidates';\nimport { validateEventSources } from './Parsing/EventSourceValidator';\nimport { validateProjectionTargets } from './Parsing/ProjectionTargetValidator';\nimport { validateIdentifierCompliance } from './Parsing/IdentifierComplianceValidator';\nimport { validateEventSubjects } from './Parsing/EventSubjectValidator';\nimport { validateReadModelKeys } from './Parsing/ReadModelKeyValidator';\nimport { validateReactionRefusals } from './Parsing/ReactionRefusalValidator';\nimport { validateSpecificationRedelivery } from './Parsing/SpecificationRedeliveryValidator';\nimport { validateGuardedActions } from './Parsing/GuardedActionValidator';\nimport { validatePersonaCallers } from './Parsing/PersonaCallerValidator';\nimport { validatePurposes } from './Parsing/PurposeValidator';\nimport { parseApplication } from './Parsing/ScreenplayParser';\nimport { splitLines } from './Parsing/SourceLineSplitter';\nimport { PropertySyntax } from './Syntax/Declarations';\nimport { ApplicationSyntax } from './Syntax/Structure';\nimport { ApplicationSyntaxVisitor } from './Syntax/Visitors';\nimport { ProjectionSyntax } from './Syntax/Projections';\nimport { CaptureSyntax } from './Syntax/Captures';\nimport { SpecificationExampleSyntax, SpecificationSyntax } from './Syntax/Specifications';\nimport { SyntaxNode } from './Syntax/SyntaxNode';\nimport { ParserContext } from './Parsing/ParserContext';\nimport { parseProjection } from './Parsing/ProjectionParser';\nimport { parseCapture } from './Parsing/CaptureParser';\nimport { parseSpecification } from './Parsing/SpecificationParser';\nimport { parseExample } from './Parsing/SpecificationExampleParser';\nimport { firstWord } from './Parsing/LineText';\nimport { SourceLine, locationOf } from './Parsing/SourceLine';\nimport { DiagnosticCodes } from './Diagnostics/DiagnosticCodes';\nimport { timelineOrderDiagnostics } from './Files/TimelineOrder';\n\n// What compiling produced: the syntax tree, and the diagnostics found on the way. A tree is always\n// produced, so a document with errors still shows everything that could be read.\nexport interface CompilationResult<T> {\n readonly value: T;\n readonly diagnostics: readonly Diagnostic[];\n readonly success: boolean;\n}\n\n// Parses one .play document - the TypeScript counterpart of the C# ScreenplayCompiler.Parse. The path, when\n// given, is carried on every source location so a folder of documents can be merged and still point back\n// at the file each node came from. A placement says the document's top level belongs to the module or\n// feature an import placed it in: that module and feature are in the tree, marked as placements, holding what\n// the document declares at its top level.\nexport function parse(source: string, path?: string, placement: PlayPlacement = documentPlacement): CompilationResult<ApplicationSyntax> {\n const { value, diagnostics, success } = parseForAuthoring(source, path, placement);\n return { value, diagnostics, success };\n}\n\n// Additive authoring view: do not widen TypeRefSyntax or the cross-compiler SyntaxJson projection.\nexport function parseForAuthoring(source: string, path?: string, placement: PlayPlacement = documentPlacement, validateResponseContracts = true, streamCandidates?: CommandStreamCandidates, languages?: ReadonlySet<string>): CompilationResult<ApplicationSyntax> & { readonly triggerData: readonly PropertySyntax[]; readonly inputUses: readonly InputUse[]; readonly guardedInteractions: readonly GuardedInteractionBinding[] } {\n const lines = splitLines(source, false, path);\n const context = sourceContext(lines, path, languages);\n context.scope = placement;\n context.interactionAncestors = interactionAncestry(lines);\n context.streamCandidates = streamCandidates ?? CommandStreamCandidates.capture([lines], placement, languages);\n let value = parseApplication(context, lines, placement);\n // Folder assembly validates declaration-dependent contracts once against the merged inventory.\n if (validateResponseContracts) {\n validateIdentity(value, context);\n validatePurposes(value, context);\n validateInlineEvents(value, context);\n validateConstraintProperties(value, context);\n validateOperations(value, context);\n validatePublicEventUsage(value, context);\n validateSpecificationCases(value, context);\n const effective = expandSpecificationExamples(value);\n validateResponses(effective, context);\n validateEventSources(value, context);\n validateProjectionTargets(value, context);\n validateIdentifierCompliance(effective, context);\n validateEventSubjects(value, context);\n validateReadModelKeys(value, context);\n validateReactionRefusals(value, context);\n validateSpecificationRedelivery(value, context);\n validateGuardedActions(value, context);\n validatePersonaCallers(value, context);\n value = validateDependencyDeclarations(value, context);\n DeclaredDependencies.validate(value, context);\n for (const diagnostic of productionDestinationDiagnostics(value)) context.information(diagnostic.code, diagnostic.message, diagnostic.location);\n for (const diagnostic of timelineOrderDiagnostics(value)) context.information(diagnostic.code, diagnostic.message, diagnostic.location);\n }\n return {\n value,\n diagnostics: context.diagnostics,\n triggerData: context.triggerData,\n inputUses: context.inputUses,\n guardedInteractions: context.guardedInteractions,\n success: !context.diagnostics.some(diagnostic => diagnostic.severity === 'error'),\n };\n}\n\n/** Checks public boundaries on programmatically authored or decoded assembled syntax. */\nexport function publicEventDiagnostics(application: ApplicationSyntax): readonly Diagnostic[] {\n const context = sourceContext([], application.location.path);\n validatePublicEventUsage(application, context);\n return context.diagnostics;\n}\n\n// Parses a document and hands its syntax tree to a visitor - the counterpart of the C#\n// ScreenplayCompiler.Compile<T>(source, visitor). The visitor runs even when there are errors, over\n// everything that could be read.\nexport function compile<T>(source: string, visitor: ApplicationSyntaxVisitor<T>, path?: string): CompilationResult<T> {\n const parsed = parse(source, path);\n return { value: visitor.visit(parsed.value), diagnostics: parsed.diagnostics, success: parsed.success };\n}\n\n// Finds the files a document imports and where in it each import is written - each import with the module\n// and feature names around it, outermost first. Diagnostics are not collected; parsing the document reports them.\nexport function discoverImports(source: string, path?: string, languages?: ReadonlySet<string>): DiscoveredImport[] {\n const lines = splitLines(source, false, path);\n return discoverImportsIn(sourceContext(lines, path, languages));\n}\n\n// Additive entry points preserve the caller's registry; none can select numeric mode externally.\nexport function parseWithLanguages(source: string, languages: ReadonlySet<string>, path?: string, placement: PlayPlacement = documentPlacement): CompilationResult<ApplicationSyntax> {\n const { value, diagnostics, success } = parseForAuthoring(source, path, placement, true, undefined, languages);\n return { value, diagnostics, success };\n}\n\nexport function parseProjectionSource(source: string, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly ProjectionSyntax[]> {\n return parseSourceFamily(source, 'projection', parseProjection, path, languages);\n}\n\nexport function parseCaptureSource(source: string, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly CaptureSyntax[]> {\n return parseSourceFamily(source, 'capture', parseCapture, path, languages);\n}\n\nexport function parseSpecificationSource(source: string, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly SpecificationSyntax[]> {\n return parseSourceFamily(source, 'specification', parseSpecification, path, languages);\n}\n\nfunction parseSourceFamily<T extends SyntaxNode>(source: string, keyword: string, read: (context: ParserContext, line: SourceLine) => T, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly T[]> {\n const context = sourceContext(splitLines(source, true, path), path, languages, true);\n const value: T[] = [];\n const examples: SpecificationExampleSyntax[] = [];\n for (let line = context.reader.peekSignificant(); line !== undefined; line = context.reader.peekSignificant()) {\n context.reader.takeSignificant();\n if (keyword === 'specification' && firstWord(line.content) === 'example') examples.push(parseExample(context, line));\n else if (line.content.startsWith(keyword)) value.push(read(context, line));\n else {\n context.error(DiagnosticCodes.UnknownTopLevelConstruct, `Expected '${keyword}', got '${line.content}'`, locationOf(line));\n context.skipOpaqueBlock(line.indent);\n }\n }\n if (context.sourceOptions.numericMode === 'exact' && value.length === 0 && context.diagnostics.length === 0) {\n const code = keyword === 'projection' ? DiagnosticCodes.ProjectionDocumentWithoutProjection : keyword === 'capture' ? DiagnosticCodes.CaptureDocumentWithoutCapture : DiagnosticCodes.SpecificationDocumentWithoutSpecification;\n context.error(code, `Document must contain at least one ${keyword}`, context.start);\n }\n const roots = keyword === 'specification' && examples.length > 0 ? value.map(node => ({ ...node, examples })) : value;\n if (keyword === 'specification') {\n const application = parseApplication(sourceContext([], path, languages), [], documentPlacement);\n validateSpecificationCases({ ...application, examples }, context, roots as unknown as SpecificationSyntax[]);\n }\n return { value: roots, diagnostics: context.diagnostics, success: !context.diagnostics.some(diagnostic => diagnostic.severity === 'error') };\n}\n"],"mappings":"q2EAqEA,SAAgB,kBAAkB,EAAgB,EAAe,EAA2BA,EAAmB,EAA4B,GAAM,EAA4C,EAA0O,CACna,IAAMC,EAAQC,EAAWC,EAAQ,GAAOC,CAAI,EACtCC,EAAUC,EAAcL,EAAOG,EAAMG,CAAS,E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ACJ"}
|
|
1
|
+
{"version":3,"file":"ScreenplayCompiler.js","names":["documentPlacement","lines","splitLines","source","path","context","sourceContext","languages","placement","interactionAncestry","streamCandidates","CommandStreamCandidates","value","parseApplication","validateResponseContracts","validateIdentity","validatePurposes","validateInlineEvents","validateConstraintProperties","validateOperations","validatePublicEventUsage","validateSpecificationCases","validateSpecificationExampleTypes","effective","expandSpecificationExamples","validateResponses","validateEventSources","validateProjectionTargets","validateIdentifierCompliance","validateEventSubjects","validateReadModelKeys","validateReactionRefusals","validateSpecificationRedelivery","validateGuardedActions","validatePersonaCallers","validateDependencyDeclarations","DeclaredDependencies","diagnostic","productionDestinationDiagnostics","timelineOrderDiagnostics"],"sources":["../../../../../Compiler/ScreenplayCompiler.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 { validateIdentity } from './Parsing/IdentityValidator';\nimport { Diagnostic } from './Diagnostics/Diagnostic';\nimport { validateSpecificationCases } from './Parsing/SpecificationCaseValidator';\nimport { expandSpecificationExamples, validateSpecificationExampleTypes } from './Parsing/SpecificationCommandExamples';\nimport { productionDestinationDiagnostics } from './Diagnostics/ProductionDestinationDiagnostics';\nimport { validateConstraintProperties } from './Parsing/ConstraintPropertyValidator';\nimport { validateDependencyDeclarations } from './Dependencies/DeclaredDependencyTargets';\nimport { DeclaredDependencies } from './Dependencies/DeclaredDependencies';\nimport { documentPlacement, PlayPlacement } from './Files/PlayPlacement';\nimport { DiscoveredImport, discoverImports as discoverImportsIn } from './Parsing/ImportDiscovery';\nimport { InputUse } from './Parsing/InputUses';\nimport { GuardedInteractionBinding, interactionAncestry } from './Parsing/InteractionAlternatives';\nimport { validateResponses } from './Parsing/ResponseValidator';\nimport { validatePublicEventUsage } from './Parsing/PublicEventUsageValidator';\nimport { sourceContext } from './Parsing/SourceOptionsParser';\nimport { validateInlineEvents } from './Parsing/InlineEventValidator';\nimport { validateOperations } from './Parsing/OperationValidator';\nimport { CommandStreamCandidates } from './Parsing/CommandStreamCandidates';\nimport { validateEventSources } from './Parsing/EventSourceValidator';\nimport { validateProjectionTargets } from './Parsing/ProjectionTargetValidator';\nimport { validateIdentifierCompliance } from './Parsing/IdentifierComplianceValidator';\nimport { validateEventSubjects } from './Parsing/EventSubjectValidator';\nimport { validateReadModelKeys } from './Parsing/ReadModelKeyValidator';\nimport { validateReactionRefusals } from './Parsing/ReactionRefusalValidator';\nimport { validateSpecificationRedelivery } from './Parsing/SpecificationRedeliveryValidator';\nimport { validateGuardedActions } from './Parsing/GuardedActionValidator';\nimport { validatePersonaCallers } from './Parsing/PersonaCallerValidator';\nimport { validatePurposes } from './Parsing/PurposeValidator';\nimport { parseApplication } from './Parsing/ScreenplayParser';\nimport { splitLines } from './Parsing/SourceLineSplitter';\nimport { PropertySyntax } from './Syntax/Declarations';\nimport { ApplicationSyntax } from './Syntax/Structure';\nimport { ApplicationSyntaxVisitor } from './Syntax/Visitors';\nimport { ProjectionSyntax } from './Syntax/Projections';\nimport { CaptureSyntax } from './Syntax/Captures';\nimport { SpecificationExampleSyntax, SpecificationSyntax } from './Syntax/Specifications';\nimport { SyntaxNode } from './Syntax/SyntaxNode';\nimport { ParserContext } from './Parsing/ParserContext';\nimport { parseProjection } from './Parsing/ProjectionParser';\nimport { parseCapture } from './Parsing/CaptureParser';\nimport { parseSpecification } from './Parsing/SpecificationParser';\nimport { parseExample } from './Parsing/SpecificationExampleParser';\nimport { firstWord } from './Parsing/LineText';\nimport { SourceLine, locationOf } from './Parsing/SourceLine';\nimport { DiagnosticCodes } from './Diagnostics/DiagnosticCodes';\nimport { timelineOrderDiagnostics } from './Files/TimelineOrder';\n\n// What compiling produced: the syntax tree, and the diagnostics found on the way. A tree is always\n// produced, so a document with errors still shows everything that could be read.\nexport interface CompilationResult<T> {\n readonly value: T;\n readonly diagnostics: readonly Diagnostic[];\n readonly success: boolean;\n}\n\n// Parses one .play document - the TypeScript counterpart of the C# ScreenplayCompiler.Parse. The path, when\n// given, is carried on every source location so a folder of documents can be merged and still point back\n// at the file each node came from. A placement says the document's top level belongs to the module or\n// feature an import placed it in: that module and feature are in the tree, marked as placements, holding what\n// the document declares at its top level.\nexport function parse(source: string, path?: string, placement: PlayPlacement = documentPlacement): CompilationResult<ApplicationSyntax> {\n const { value, diagnostics, success } = parseForAuthoring(source, path, placement);\n return { value, diagnostics, success };\n}\n\n// Additive authoring view: do not widen TypeRefSyntax or the cross-compiler SyntaxJson projection.\nexport function parseForAuthoring(source: string, path?: string, placement: PlayPlacement = documentPlacement, validateResponseContracts = true, streamCandidates?: CommandStreamCandidates, languages?: ReadonlySet<string>): CompilationResult<ApplicationSyntax> & { readonly triggerData: readonly PropertySyntax[]; readonly inputUses: readonly InputUse[]; readonly guardedInteractions: readonly GuardedInteractionBinding[] } {\n const lines = splitLines(source, false, path);\n const context = sourceContext(lines, path, languages);\n context.scope = placement;\n context.interactionAncestors = interactionAncestry(lines);\n context.streamCandidates = streamCandidates ?? CommandStreamCandidates.capture([lines], placement, languages);\n let value = parseApplication(context, lines, placement);\n // Folder assembly validates declaration-dependent contracts once against the merged inventory.\n if (validateResponseContracts) {\n validateIdentity(value, context);\n validatePurposes(value, context);\n validateInlineEvents(value, context);\n validateConstraintProperties(value, context);\n validateOperations(value, context);\n validatePublicEventUsage(value, context);\n validateSpecificationCases(value, context);\n validateSpecificationExampleTypes(value, context, true);\n const effective = expandSpecificationExamples(value);\n validateResponses(effective, context);\n validateEventSources(value, context);\n validateProjectionTargets(value, context);\n validateIdentifierCompliance(effective, context);\n validateEventSubjects(value, context);\n validateReadModelKeys(value, context);\n validateReactionRefusals(value, context);\n validateSpecificationRedelivery(value, context);\n validateGuardedActions(value, context);\n validatePersonaCallers(value, context);\n value = validateDependencyDeclarations(value, context);\n DeclaredDependencies.validate(value, context);\n for (const diagnostic of productionDestinationDiagnostics(value)) context.information(diagnostic.code, diagnostic.message, diagnostic.location);\n for (const diagnostic of timelineOrderDiagnostics(value)) context.information(diagnostic.code, diagnostic.message, diagnostic.location);\n }\n return {\n value,\n diagnostics: context.diagnostics,\n triggerData: context.triggerData,\n inputUses: context.inputUses,\n guardedInteractions: context.guardedInteractions,\n success: !context.diagnostics.some(diagnostic => diagnostic.severity === 'error'),\n };\n}\n\n/** Checks public boundaries on programmatically authored or decoded assembled syntax. */\nexport function publicEventDiagnostics(application: ApplicationSyntax): readonly Diagnostic[] {\n const context = sourceContext([], application.location.path);\n validatePublicEventUsage(application, context);\n return context.diagnostics;\n}\n\n// Parses a document and hands its syntax tree to a visitor - the counterpart of the C#\n// ScreenplayCompiler.Compile<T>(source, visitor). The visitor runs even when there are errors, over\n// everything that could be read.\nexport function compile<T>(source: string, visitor: ApplicationSyntaxVisitor<T>, path?: string): CompilationResult<T> {\n const parsed = parse(source, path);\n return { value: visitor.visit(parsed.value), diagnostics: parsed.diagnostics, success: parsed.success };\n}\n\n// Finds the files a document imports and where in it each import is written - each import with the module\n// and feature names around it, outermost first. Diagnostics are not collected; parsing the document reports them.\nexport function discoverImports(source: string, path?: string, languages?: ReadonlySet<string>): DiscoveredImport[] {\n const lines = splitLines(source, false, path);\n return discoverImportsIn(sourceContext(lines, path, languages));\n}\n\n// Additive entry points preserve the caller's registry; none can select numeric mode externally.\nexport function parseWithLanguages(source: string, languages: ReadonlySet<string>, path?: string, placement: PlayPlacement = documentPlacement): CompilationResult<ApplicationSyntax> {\n const { value, diagnostics, success } = parseForAuthoring(source, path, placement, true, undefined, languages);\n return { value, diagnostics, success };\n}\n\nexport function parseProjectionSource(source: string, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly ProjectionSyntax[]> {\n return parseSourceFamily(source, 'projection', parseProjection, path, languages);\n}\n\nexport function parseCaptureSource(source: string, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly CaptureSyntax[]> {\n return parseSourceFamily(source, 'capture', parseCapture, path, languages);\n}\n\nexport function parseSpecificationSource(source: string, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly SpecificationSyntax[]> {\n return parseSourceFamily(source, 'specification', parseSpecification, path, languages);\n}\n\nfunction parseSourceFamily<T extends SyntaxNode>(source: string, keyword: string, read: (context: ParserContext, line: SourceLine) => T, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly T[]> {\n const context = sourceContext(splitLines(source, true, path), path, languages, true);\n const value: T[] = [];\n const examples: SpecificationExampleSyntax[] = [];\n for (let line = context.reader.peekSignificant(); line !== undefined; line = context.reader.peekSignificant()) {\n context.reader.takeSignificant();\n if (keyword === 'specification' && firstWord(line.content) === 'example') examples.push(parseExample(context, line));\n else if (line.content.startsWith(keyword)) value.push(read(context, line));\n else {\n context.error(DiagnosticCodes.UnknownTopLevelConstruct, `Expected '${keyword}', got '${line.content}'`, locationOf(line));\n context.skipOpaqueBlock(line.indent);\n }\n }\n if (context.sourceOptions.numericMode === 'exact' && value.length === 0 && context.diagnostics.length === 0) {\n const code = keyword === 'projection' ? DiagnosticCodes.ProjectionDocumentWithoutProjection : keyword === 'capture' ? DiagnosticCodes.CaptureDocumentWithoutCapture : DiagnosticCodes.SpecificationDocumentWithoutSpecification;\n context.error(code, `Document must contain at least one ${keyword}`, context.start);\n }\n const roots = keyword === 'specification' && examples.length > 0 ? value.map(node => ({ ...node, examples })) : value;\n if (keyword === 'specification') {\n const application = parseApplication(sourceContext([], path, languages), [], documentPlacement);\n validateSpecificationCases({ ...application, examples }, context, roots as unknown as SpecificationSyntax[]);\n }\n return { value: roots, diagnostics: context.diagnostics, success: !context.diagnostics.some(diagnostic => diagnostic.severity === 'error') };\n}\n"],"mappings":"44EAqEA,SAAgB,kBAAkB,EAAgB,EAAe,EAA2BA,EAAmB,EAA4B,GAAM,EAA4C,EAA0O,CACna,IAAMC,EAAQC,EAAWC,EAAQ,GAAOC,CAAI,EACtCC,EAAUC,EAAcL,EAAOG,EAAMG,CAAS,EACpD,EAAQ,MAAQC,EAChB,EAAQ,qBAAuBC,EAAoBR,CAAK,EACxD,EAAQ,iBAAmBS,GAAoBC,EAAwB,QA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import{AuthoringProductionResol
|
|
|
2
2
|
`),locations:e.map((e,t)=>({line:t+1,column:0}))};let i=[],s=[],c=!1;e.forEach((e,t)=>{!n[t]&&o(e)===0&&/^\w/.test(e)&&(c=/^(?:concept|type|import|domain|system|eventsource|policy|persona|identity)\b/.test(e)),(c?i:s).push(t)});let l=r.includes(`feature`)?1:r.includes(`slice`)?2:3,u=t.slice(0,l);return{source:[...i.map(t=>e[t]),...u,...s.map(t=>` `.repeat(l*2)+e[t])].join(`
|
|
3
3
|
`),locations:[...i.map(e=>({line:e+1,column:0})),...u.map(()=>({line:0,column:0})),...s.map(e=>({line:e+1,column:l*2}))]}}function analyze(d,f,p,m=`current.play`,h=!0){let g=f.map((e,t)=>typeof e==`string`?{path:`other-${t}.play`,source:e}:e).filter(e=>e.path!==m),_=[{path:m,source:d.join(`
|
|
4
4
|
`),placement:p,isPlacementResolved:h},...g],v=new Set(_.flatMap(e=>[...e.source.matchAll(/\w+/g)].map(e=>e[0]).concat(e.placement??[]))),fresh=e=>{let t=e;for(let n=1;v.has(t);n++)t=`${e}${n}`;return v.add(t),t},y=fresh(`EditorAuthoring`),b=fresh(`FragmentFeature`),x=/* @__PURE__ */ new Set([y,b]),S=_.map((e,t)=>{let n=t===0?d:e.source.split(`
|
|
5
|
-
`),r=fresh(`Fragment${t}`);x.add(r);let i=e.placement?.length?{source:e.source,locations:n.map((e,t)=>({line:t+1,column:0}))}:authoringSource(n,[`module ${y}`,` feature ${b}`,` slice StateChange ${r}`]);return{...e,...i,placement:e.placement??[]}}),C=S[0],w=new Map(S.map(e=>[e.path,e.locations])),T=i([...S.slice(1),C]),E=/* @__PURE__ */ new Map,D=/* @__PURE__ */ new Map,O=/* @__PURE__ */ new WeakSet,walk=e=>{if(typeof e!=`object`||!e||O.has(e))return;if(O.add(e),Array.isArray(e)){e.forEach(walk);return}let t=e;if(typeof t.path==`string`&&typeof t.line==`number`&&typeof t.column==`number`){let e=w.get(t.path)?.[t.line-1];e&&(t.line=e.line,t.column=Math.max(1,t.column-e.column))}else{for(let e of Object.values(t))walk(e);t.location?.path===m&&(t.kind===`CommandSyntax`&&E.set(t.location.line-1,e),t.kind===`SpecificationSyntax`&&D.set(t.location.line-1,e))}};walk(T.value),walk(T.physicalEventSources);for(let e of T.diagnostics)walk(e.location);let k=T.diagnostics.some(e=>{if(![`PLAY0022`,`PLAY0024`,`PLAY0029`].includes(e.code))return!1;let t=S.find(t=>t.path===e.location.path),n=_.find(t=>t.path===e.location.path)?.source.split(`
|
|
5
|
+
`),r=fresh(`Fragment${t}`);x.add(r);let i=e.placement?.length?{source:e.source,locations:n.map((e,t)=>({line:t+1,column:0}))}:authoringSource(n,[`module ${y}`,` feature ${b}`,` slice StateChange ${r}`]);return{...e,...i,placement:e.placement??[]}}),C=S[0],w=new Map(S.map(e=>[e.path,e.locations])),T=i([...S.slice(1),C],void 0,!0),E=/* @__PURE__ */ new Map,D=/* @__PURE__ */ new Map,O=/* @__PURE__ */ new WeakSet,walk=e=>{if(typeof e!=`object`||!e||O.has(e))return;if(O.add(e),Array.isArray(e)){e.forEach(walk);return}let t=e;if(typeof t.path==`string`&&typeof t.line==`number`&&typeof t.column==`number`){let e=w.get(t.path)?.[t.line-1];e&&(t.line=e.line,t.column=Math.max(1,t.column-e.column))}else{for(let e of Object.values(t))walk(e);t.location?.path===m&&(t.kind===`CommandSyntax`&&E.set(t.location.line-1,e),t.kind===`SpecificationSyntax`&&D.set(t.location.line-1,e))}};walk(T.value),walk(T.physicalEventSources);for(let e of T.diagnostics)walk(e.location);let k=T.diagnostics.some(e=>{if(![`PLAY0022`,`PLAY0024`,`PLAY0029`].includes(e.code))return!1;let t=S.find(t=>t.path===e.location.path),n=_.find(t=>t.path===e.location.path)?.source.split(`
|
|
6
6
|
`)[e.location.line-1];return t?.locations.some(e=>e.line===0)&&n!==void 0&&o(n)===0}),A=T.diagnostics.filter(e=>e.location.path===m).flatMap(e=>(walk(e.location),e.location.line>0?[e]:[])),j=new e(T.value);for(let{slice:e}of j.slices)for(let n of t(e).reducers??[])walk(n);let M=new Set(j.slices.flatMap(({slice:e})=>[...e.commands.flatMap(e=>e.produces),...e.reactions.flatMap(e=>e.triggers).flatMap(e=>e.produces)].filter(t=>t.location.path===m&&!j.isEventProduction(t,e)).map(e=>e.location.line-1)));for(let e of A)e.code===`PLAY0499`&&M.add(e.location.line-1);let N=j.declarations.filter(e=>e.kind===`operation`).map(e=>({...e.node,scope:e.scope.filter(e=>!x.has(e))})),P=/* @__PURE__ */ new Map,F=a(d),range=e=>{let t=[],n=o(d[e]);for(let r=e;r<d.length&&!(r>e&&!F[r]&&s(d[r]).trim()&&o(d[r])<=n);r++)t.push(r);return t};for(let{slice:e,scope:t}of j.slices){if(e.location.path===m&&e.location.line>0)for(let n of range(e.location.line-1))P.set(n,{scope:t});for(let n of e.specifications.filter(e=>e.location.path===m&&e.location.line>0))for(let e of range(n.location.line-1))P.set(e,{scope:t});for(let n of e.commands.filter(e=>e.location.path===m&&e.location.line>0))for(let e of range(n.location.line-1))P.set(e,{scope:t,commandLine:n.location.line-1})}let I=new Map(j.declarations.map(e=>[e.node.location,e.scope]));for(let e of N.filter(e=>e.location.path===m)){let t=I.get(e.location);for(let n of range(e.location.line-1))P.set(n,{...P.get(n),scope:t,operation:e})}let L=new Map(N.map(e=>[e.location,e])),referenceLocation=(e,t)=>{let n=s(d[e.line-1]??``),r=n.slice(e.column-1).match(/^(?:given\s+operation|then\s+(?:operation|compensated))\s+/)?.[0];return r&&n.slice(e.column-1+r.length,e.column-1+r.length+t.length)===t?{...e,column:e.column+r.length}:e},R=[];for(let{slice:e}of j.slices){for(let t of e.commands)for(let n of t.produces){if(n.location.path!==m)continue;let t=j.resolve(n.event,e),r=t.declaration?L.get(t.declaration.node.location)??null:null,i={name:n.event,location:n.location,targetLocation:n.targetLocation??n.location,kind:t.kind,declaration:r,mappings:n.mappings};if(R.push(i),t.kind===`operation`)for(let e of range(n.location.line-1)){let t=P.get(e);t&&P.set(e,{...t,production:i})}}for(let t of e.specifications)for(let n of[...t.givenOperationFailures??[],...t.thenOperations??[],...t.thenCompensated??[]]){if(n.location.path!==m)continue;let t=j.resolve(n.operation,e);R.push({name:n.operation,location:n.location,targetLocation:referenceLocation(n.location,n.operation),kind:t.kind,declaration:t.declaration?L.get(t.declaration.node.location)??null:null,mappings:[]})}}let z={declarations:N,systems:T.value.systems??[],references:R,contexts:P,types:T.value.types,concepts:T.value.concepts,targets:e=>{let t=j.slices.find(t=>t.scope.length===e.length&&t.scope.every((t,n)=>t===e[n]))?.slice;return t?N.flatMap(e=>{let n=j.resolve(e.name,t).declaration?.node.location===e.location?e.name:[...e.scope,e.name].join(`.`);return j.resolve(n,t).kind===`operation`&&j.resolve(n,t).declaration?.node.location===e.location?[{name:n,declaration:e}]:[]}):[]}},B=T.physicalEventSources.map(e=>e.source),V=new r(T.physicalEventSources,T.sourceInventoryComplete&&!k),H=/* @__PURE__ */ new Map,resolve=(e,t)=>{let n=JSON.stringify([e,t]),r=H.get(n);return r||(r=V.resolve(e,t),H.set(n,r)),{...r,source:r.state===`unique`?r.sources[0]:void 0,stream:r.state===`unique`?r.streams[0]:void 0}},U=new Set(T.value.imports.map(e=>e.qualifiedName)),W=B.flatMap(e=>e.streams.filter(t=>resolve(e.name,t.name).state===`unique`&&!U.has(`${e.name}.${t.name}`)).map(t=>({name:`${e.name}.${t.name}`,source:e,stream:t}))),G=/* @__PURE__ */ new Map,K=[];for(let e of E.values()){for(let t of range(e.location.line-1))G.set(t,{command:e});for(let t of[...e.produces,...e.validations,...e.handler?[e.handler]:[]])for(let e of range(t.location.line-1))G.delete(e);if(e.stream){K.push(e.stream);for(let t of range(e.stream.location.line-1))G.set(t,{command:e,route:e.stream})}}let q=new Map(j.slices.flatMap(({slice:e})=>e.commands.map(t=>[t,e])));for(let e of E.values()){let t=q.get(e);if(t){for(let n of e.produces)if(j.isEventProduction(n,t)){for(let t of range(n.location.line-1))G.set(t,{command:e,production:!0});if(n.stream){K.push(n.stream);for(let t of range(n.stream.location.line-1))G.set(t,{command:e,production:!0,route:n.stream})}}}}for(let{slice:e}of j.slices)for(let n of[...e.reactions,...t(e).reducers??[]].filter(e=>e.location.path===m&&e.location.line>0))for(let e of range(n.location.line-1))G.set(e,{observer:n});let J=c(T.value,m,d,range,x,T.diagnostics),Y=[...[...D.values()].flatMap(e=>[...e.given.map(e=>({event:e,expectation:!1})),...e.whenAppended?[{event:e.whenAppended,expectation:!1}]:[],...e.thenEvents.map(e=>({event:e,expectation:!0})),...e.whenRedelivered?[{event:e.whenRedelivered,expectation:!0}]:[]]),...(J.eventExamples??[]).map(e=>({event:e,expectation:!0}))];for(let e of Y){let t=e.event;for(let n of range(t.location.line-1))G.set(n,e);if(t.stream){K.push(t.stream);for(let n of range(t.stream.location.line-1))G.set(n,{...e,route:t.stream})}}for(let e of B.filter(e=>e.location.path===m)){for(let t of range(e.location.line-1))G.set(t,{source:e});for(let t of e.streams)for(let n of range(t.location.line-1))G.set(n,{source:e,stream:t})}let X={declarations:B,routes:K,ambiguousCandidates:[...E.values()].flatMap(e=>e.streamCandidates??[]).filter(e=>e.propertyCandidate!==null),contexts:G,targets:W,resolve},Z;return{identityDetails:(T.value.identity?.details??[]).map(e=>({name:e.name,type:`${e.type.name}${e.type.isCollection?`[]`:``}${e.type.isOptional?` optional`:``}`,line:e.location.line-1})),commands:E,specifications:D,diagnostics:A,operationProductionLines:M,operations:z,eventSources:X,readModels:j.slices.flatMap(({slice:e,scope:t})=>(e.readModels??[]).map(e=>({model:e,scope:t.filter(e=>!x.has(e))}))),examples:J,personas:l(T.value,d),dependencies:{completions(e,t,r){if(Z===void 0){let e=n(C.source,m,C.placement,!1).value,remapDependencyHeaders=e=>{walk(e.location),e.features.forEach(remapDependencyHeaders)};e.modules.forEach(remapDependencyHeaders),Z=u(T.value,e,m,range,x)}return Z.completions(e,t,r)}}}}function responseAnalysis(e,t=[],n,r=`current.play`,i=!0){let a=JSON.stringify([e,t,n,r,i]),o=f.get(a);return o===void 0&&(o=analyze(e,t,n,r,i),f.size>=16&&f.delete(f.keys().next().value),f.set(a,o)),o}export{responseAnalysis,d as responseAvailability};
|
|
7
7
|
//# sourceMappingURL=response-analysis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-analysis.js","names":["responseAvailability","revisions","fences","fenceMap","lines","roots","index","indentOf","line","root","globals","body","global","depth","wrappers","headers","others","otherSources","document","path","documents","names","match","name","prefix","suffix","module","feature","syntheticScopes","preparedDocuments","sourceLines","fragment","prepared","locations","parsed","parsePlacedDocuments","commands","specifications","visited","value","node","original","child","diagnostic","unknownFragmentExtent","location","diagnostics","productions","AuthoringProductionResolver","reducer","dependencySourcesOf","slice","operationProductionLines","command","reaction","trigger","production","declarations","declaration","segment","contexts","result","indent","start","withoutComment","specification","declarationScopes","operation","scope","declarationsByLocation","source","references","resolved","reference","context","step","operations","entry","part","sourceDeclarations","sourceCatalog","EventSourceReadConfidence","resolutions","key","stream","importedTypeReferences","imported","targets","sourceContexts","routes","member","commandSlices","observer","examples","exampleAnalysis","routeOwners","event","eventSources","candidate","dependencyAnalysis","detail","personaAnalysis","localDependencies","parseForAuthoring","dependencyTargetAnalysis","qualifier","placement","isPlacementResolved","analysis"],"sources":["../../response-analysis.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { AuthoringProductionKind, AuthoringProductionResolver, CommandSyntax, dependencySourcesOf, Diagnostic, EventSourceReadConfidence, FeatureSyntax, OperationSyntax, parseForAuthoring, parsePlacedDocuments, SpecificationSyntax } from '@cratis/screenplay-compiler';\nimport { fenceMap, indentOf, withoutComment } from './document-context';\nimport { ResponseAnalysis } from './ResponseAnalysis';\nimport { ExampleAnalysis } from './ExampleAnalysis';\nimport { exampleAnalysis } from './example-analysis';\nimport { personaAnalysis } from './persona-analysis';\nimport { dependencyTargetAnalysis } from './dependency-target-analysis';\nimport { EventSourceAnalysis } from './EventSourceAnalysis';\nimport { AuthoredCommandRoute } from './AuthoredCommandRoute';\nimport { AuthoredReadModelKeys } from './AuthoredReadModelKeys';\nimport { AuthoringDocument } from './AuthoringDocument';\nimport { OperationAnalysis, OperationDeclaration, OperationReference } from './OperationAnalysis';\n\n// Public editor shapes are structural: packed declarations never expose the private compiler.\nexport type { AuthoringDocument } from './AuthoringDocument';\nexport type { AnalysisLocation } from './AnalysisLocation';\nexport type { AnalysisDiagnostic } from './AnalysisDiagnostic';\nexport type { AnalysisType } from './AnalysisType';\nexport type { AnalysisCommand } from './AnalysisCommand';\nexport type { AnalysisSpecification } from './AnalysisSpecification';\nexport type { CommandResponseSymbol } from './CommandResponseSymbol';\nexport type { ResponseFieldSymbol } from './ResponseFieldSymbol';\nexport type { ResponseSourceSymbol } from './ResponseSourceSymbol';\nexport type { ResponseAnalysis } from './ResponseAnalysis';\n\nexport const responseAvailability = 'Executable as ESM v7. Generated values require fixtures in reference execution; other unadmitted constructs still prevent binding.';\n\n// A bounded revision cache shared by symbols, validation, completion and hover. Index typed nodes\n// once, not by reparsing the document for each command or response field.\nconst revisions = new Map<string, ReturnType<typeof analyze>>();\n\nfunction authoringSource(lines: string[], headers: readonly string[]) {\n const fences = fenceMap(lines);\n const roots = lines.flatMap((line, index) => !fences[index] && indentOf(line) === 0 && /^\\w/.test(line) ? [line.split(/\\s+/)[0]] : []);\n if (roots.includes('module') || !roots.some(root => ['feature', 'slice', 'command', 'event', 'operation', 'reaction', 'specification'].includes(root))) {\n return { source: lines.join('\\n'), locations: lines.map((_, index) => ({ line: index + 1, column: 0 })) };\n }\n // Isolated slice/command fragments are a supported editor input. Global declarations stay global.\n const globals: number[] = [];\n const body: number[] = [];\n let global = false;\n lines.forEach((line, index) => {\n if (!fences[index] && indentOf(line) === 0 && /^\\w/.test(line)) global = /^(?:concept|type|import|domain|system|eventsource|policy|persona|identity)\\b/.test(line);\n (global ? globals : body).push(index);\n });\n const depth = roots.includes('feature') ? 1 : roots.includes('slice') ? 2 : 3;\n const wrappers = headers.slice(0, depth);\n const source = [...globals.map(index => lines[index]), ...wrappers, ...body.map(index => ' '.repeat(depth * 2) + lines[index])].join('\\n');\n const locations = [...globals.map(index => ({ line: index + 1, column: 0 })), ...wrappers.map(() => ({ line: 0, column: 0 })), ...body.map(index => ({ line: index + 1, column: depth * 2 }))];\n return { source, locations };\n}\n\nfunction analyze(lines: string[], otherSources: readonly (string | AuthoringDocument)[], placement?: readonly string[], path = 'current.play', isPlacementResolved = true): ResponseAnalysis & { readonly operations: OperationAnalysis; readonly eventSources: EventSourceAnalysis; readonly readModels: readonly AuthoredReadModelKeys[]; readonly examples: ExampleAnalysis; readonly personas: ReturnType<typeof personaAnalysis>; readonly dependencies: ReturnType<typeof dependencyTargetAnalysis> } {\n const others = otherSources.map((document, index) => typeof document === 'string' ? { path: `other-${index}.play`, source: document } : document).filter(document => document.path !== path);\n const documents: AuthoringDocument[] = [{ path, source: lines.join('\\n'), placement, isPlacementResolved }, ...others];\n // Modules/features merge, but slices are real declarations: equal slice names discard later\n // documents. Share only fresh synthetic module/feature names, with a distinct synthetic slice\n // per fragment. This retains all commands for normal (including ambiguous) scope resolution,\n // without combining source texts or renaming real declarations/explicit placements. Reserve\n // source/placement names once so even a real Editor.Authoring.Fragment cannot collide.\n const names = new Set(documents.flatMap(document => [...document.source.matchAll(/\\w+/g)].map(match => match[0]).concat(document.placement ?? [])));\n const fresh = (prefix: string): string => {\n let name = prefix;\n for (let suffix = 1; names.has(name); suffix++) name = `${prefix}${suffix}`;\n names.add(name);\n return name;\n };\n const module = fresh('EditorAuthoring');\n const feature = fresh('FragmentFeature');\n const syntheticScopes = new Set([module, feature]);\n const preparedDocuments = documents.map((document, index) => {\n const sourceLines = index === 0 ? lines : document.source.split('\\n');\n const fragment = fresh(`Fragment${index}`);\n syntheticScopes.add(fragment);\n const prepared = document.placement?.length ? { source: document.source, locations: sourceLines.map((_, line) => ({ line: line + 1, column: 0 })) }\n : authoringSource(sourceLines, [`module ${module}`, ` feature ${feature}`, ` slice StateChange ${fragment}`]);\n return { ...document, ...prepared, placement: document.placement ?? [] };\n });\n const prepared = preparedDocuments[0];\n const locations = new Map(preparedDocuments.map(document => [document.path, document.locations]));\n // Put the buffer after its supplied context so duplicate real declarations are reported at\n // the current source, not silently dropped from its source-local diagnostic view.\n const parsed = parsePlacedDocuments([...preparedDocuments.slice(1), prepared]);\n const commands = new Map<number, CommandSyntax>();\n const specifications = new Map<number, SpecificationSyntax>();\n const visited = new WeakSet<object>();\n const walk = (value: unknown): void => {\n if (value === null || typeof value !== 'object' || visited.has(value)) return;\n visited.add(value);\n if (Array.isArray(value)) { value.forEach(walk); return; }\n const node = value as Record<string, unknown>;\n // Source locations also occur as standalone members (usesLocation, targetLocation).\n // Mutate each original identity once: shared locations must not be shifted twice.\n if (typeof node.path === 'string' && typeof node.line === 'number' && typeof node.column === 'number') {\n const original = locations.get(node.path)?.[node.line - 1];\n if (original) { node.line = original.line; node.column = Math.max(1, node.column - original.column); }\n return;\n }\n for (const child of Object.values(node)) walk(child);\n if ((node.location as { path?: string; line: number } | undefined)?.path === path) {\n if (node.kind === 'CommandSyntax') commands.set((node.location as { line: number }).line - 1, value as CommandSyntax);\n if (node.kind === 'SpecificationSyntax') specifications.set((node.location as { line: number }).line - 1, value as SpecificationSyntax);\n }\n };\n walk(parsed.value);\n walk(parsed.physicalEventSources);\n // Fragment wrappers must not turn an unread original root into confidence evidence.\n // Retain the parser's unknown-owner diagnostic at its original physical root location.\n for (const diagnostic of parsed.diagnostics) walk(diagnostic.location);\n const unknownFragmentExtent = parsed.diagnostics.some(diagnostic => {\n if (!['PLAY0022', 'PLAY0024', 'PLAY0029'].includes(diagnostic.code)) return false;\n const document = preparedDocuments.find(document => document.path === diagnostic.location.path);\n const original = documents.find(document => document.path === diagnostic.location.path)?.source.split('\\n')[diagnostic.location.line - 1];\n return document?.locations.some(location => location.line === 0) && original !== undefined && indentOf(original) === 0;\n });\n const diagnostics: Diagnostic[] = parsed.diagnostics.filter(diagnostic => diagnostic.location.path === path).flatMap(diagnostic => {\n walk(diagnostic.location);\n return diagnostic.location.line > 0 ? [diagnostic] : [];\n });\n const productions = new AuthoringProductionResolver(parsed.value);\n for (const { slice } of productions.slices) for (const reducer of dependencySourcesOf(slice).reducers ?? []) walk(reducer);\n const operationProductionLines = new Set(productions.slices.flatMap(({ slice }) => [...slice.commands.flatMap(command => command.produces), ...slice.reactions.flatMap(reaction => reaction.triggers).flatMap(trigger => trigger.produces)]\n .filter(production => production.location.path === path && !productions.isEventProduction(production, slice))\n .map(production => production.location.line - 1)));\n // Rejected inline operation declarations have no syntax node, but the core parser still owns\n // the command-only kind fact. Retain it rather than suggesting an event declaration repair.\n for (const diagnostic of diagnostics) if (diagnostic.code === 'PLAY0499') operationProductionLines.add(diagnostic.location.line - 1);\n const declarations: OperationDeclaration[] = productions.declarations.filter(declaration => declaration.kind === AuthoringProductionKind.Operation)\n .map(declaration => ({ ...declaration.node as OperationSyntax, scope: declaration.scope.filter(segment => !syntheticScopes.has(segment)) }));\n const contexts = new Map<number, { scope: readonly string[]; commandLine?: number; operation?: OperationDeclaration; production?: OperationReference }>();\n // Index source ownership once per revision. Typed headers, not keyword-shaped properties,\n // define the ranges; greater-indented legacy properties remain leaves.\n const fences = fenceMap(lines);\n const range = (start: number): number[] => {\n const result: number[] = [];\n const indent = indentOf(lines[start]);\n for (let line = start; line < lines.length; line++) {\n if (line > start && !fences[line] && withoutComment(lines[line]).trim() && indentOf(lines[line]) <= indent) break;\n result.push(line);\n }\n return result;\n };\n for (const { slice, scope } of productions.slices) {\n if (slice.location.path === path && slice.location.line > 0) for (const line of range(slice.location.line - 1)) contexts.set(line, { scope });\n for (const specification of slice.specifications.filter(specification => specification.location.path === path && specification.location.line > 0)) {\n for (const line of range(specification.location.line - 1)) contexts.set(line, { scope });\n }\n for (const command of slice.commands.filter(command => command.location.path === path && command.location.line > 0)) {\n for (const line of range(command.location.line - 1)) contexts.set(line, { scope, commandLine: command.location.line - 1 });\n }\n }\n const declarationScopes = new Map(productions.declarations.map(declaration => [declaration.node.location, declaration.scope]));\n for (const operation of declarations.filter(operation => operation.location.path === path)) {\n const scope = declarationScopes.get(operation.location)!;\n for (const line of range(operation.location.line - 1)) contexts.set(line, { ...contexts.get(line), scope, operation });\n }\n const declarationsByLocation = new Map(declarations.map(declaration => [declaration.location, declaration]));\n const referenceLocation = (location: { path?: string; line: number; column: number }, name: string) => {\n const source = withoutComment(lines[location.line - 1] ?? '');\n const prefix = source.slice(location.column - 1).match(/^(?:given\\s+operation|then\\s+(?:operation|compensated))\\s+/)?.[0];\n return prefix && source.slice(location.column - 1 + prefix.length, location.column - 1 + prefix.length + name.length) === name\n ? { ...location, column: location.column + prefix.length } : location;\n };\n const references: OperationReference[] = [];\n for (const { slice } of productions.slices) {\n for (const command of slice.commands) for (const production of command.produces) {\n if (production.location.path !== path) continue;\n const resolved = productions.resolve(production.event, slice);\n const declaration = resolved.declaration ? declarationsByLocation.get(resolved.declaration.node.location) ?? null : null;\n const reference = { name: production.event, location: production.location, targetLocation: production.targetLocation ?? production.location, kind: resolved.kind, declaration, mappings: production.mappings };\n references.push(reference);\n if (resolved.kind === AuthoringProductionKind.Operation) {\n for (const line of range(production.location.line - 1)) {\n const context = contexts.get(line);\n if (context) contexts.set(line, { ...context, production: reference });\n }\n }\n }\n for (const specification of slice.specifications) {\n for (const step of [...specification.givenOperationFailures ?? [], ...specification.thenOperations ?? [], ...specification.thenCompensated ?? []]) {\n if (step.location.path !== path) continue;\n const resolved = productions.resolve(step.operation, slice);\n references.push({ name: step.operation, location: step.location, targetLocation: referenceLocation(step.location, step.operation), kind: resolved.kind,\n declaration: resolved.declaration ? declarationsByLocation.get(resolved.declaration.node.location) ?? null : null,\n mappings: [] });\n }\n }\n }\n const operations: OperationAnalysis = { declarations, systems: parsed.value.systems ?? [], references, contexts, types: parsed.value.types, concepts: parsed.value.concepts,\n targets: scope => {\n const slice = productions.slices.find(entry => entry.scope.length === scope.length && entry.scope.every((part, index) => part === scope[index]))?.slice;\n if (!slice) return [];\n return declarations.flatMap(declaration => {\n const name = productions.resolve(declaration.name, slice).declaration?.node.location === declaration.location\n ? declaration.name : [...declaration.scope, declaration.name].join('.');\n return productions.resolve(name, slice).kind === AuthoringProductionKind.Operation &&\n productions.resolve(name, slice).declaration?.node.location === declaration.location ? [{ name, declaration }] : [];\n });\n }\n };\n const sourceDeclarations = parsed.physicalEventSources.map(entry => entry.source);\n const sourceCatalog = new EventSourceReadConfidence(parsed.physicalEventSources, parsed.sourceInventoryComplete && !unknownFragmentExtent);\n const resolutions = new Map<string, ReturnType<EventSourceReadConfidence['resolve']>>();\n const resolve = (source: string, stream?: string) => {\n const key = JSON.stringify([source, stream]);\n let result = resolutions.get(key);\n if (!result) { result = sourceCatalog.resolve(source, stream); resolutions.set(key, result); }\n return { ...result, source: result.state === 'unique' ? result.sources[0] : undefined, stream: result.state === 'unique' ? result.streams[0] : undefined };\n };\n const importedTypeReferences = new Set(parsed.value.imports.map(imported => imported.qualifiedName));\n const targets = sourceDeclarations.flatMap(source => {\n return source.streams.filter(stream => resolve(source.name, stream.name).state === 'unique' && !importedTypeReferences.has(`${source.name}.${stream.name}`)).map(stream => ({ name: `${source.name}.${stream.name}`, source, stream }));\n });\n const sourceContexts = new Map<number, EventSourceAnalysis['contexts'] extends ReadonlyMap<number, infer Context> ? Context : never>();\n const routes: AuthoredCommandRoute[] = [];\n for (const command of commands.values()) {\n for (const line of range(command.location.line - 1)) sourceContexts.set(line, { command });\n for (const member of [...command.produces, ...command.validations, ...(command.handler ? [command.handler] : [])])\n for (const line of range(member.location.line - 1)) sourceContexts.delete(line);\n // Retained ambiguity candidates are not selected authored routes.\n if (command.stream) {\n routes.push(command.stream);\n for (const line of range(command.stream.location.line - 1)) sourceContexts.set(line, { command, route: command.stream });\n }\n }\n const commandSlices = new Map(productions.slices.flatMap(({ slice }) => slice.commands.map(command => [command, slice] as const)));\n for (const command of commands.values()) {\n const slice = commandSlices.get(command);\n if (!slice) continue;\n for (const production of command.produces) {\n if (!productions.isEventProduction(production, slice)) continue;\n for (const line of range(production.location.line - 1)) sourceContexts.set(line, { command, production: true });\n if (production.stream) {\n routes.push(production.stream);\n for (const line of range(production.stream.location.line - 1)) sourceContexts.set(line, { command, production: true, route: production.stream });\n }\n }\n }\n for (const { slice } of productions.slices) {\n for (const observer of [...slice.reactions, ...dependencySourcesOf(slice).reducers ?? []].filter(observer => observer.location.path === path && observer.location.line > 0)) {\n for (const line of range(observer.location.line - 1)) sourceContexts.set(line, { observer });\n }\n }\n const examples = exampleAnalysis(parsed.value, path, lines, range, syntheticScopes, parsed.diagnostics);\n const routeOwners = [\n ...[...specifications.values()].flatMap(specification => [\n ...specification.given.map(event => ({ event, expectation: false })),\n ...(specification.whenAppended ? [{ event: specification.whenAppended, expectation: false }] : []),\n ...specification.thenEvents.map(event => ({ event, expectation: true })),\n ...(specification.whenRedelivered ? [{ event: specification.whenRedelivered, expectation: true }] : [])\n ]),\n ...(examples.eventExamples ?? []).map(event => ({ event, expectation: true }))\n ];\n for (const context of routeOwners) {\n const event = context.event;\n for (const line of range(event.location.line - 1)) sourceContexts.set(line, context);\n if (event.stream) {\n routes.push(event.stream);\n for (const line of range(event.stream.location.line - 1)) sourceContexts.set(line, { ...context, route: event.stream });\n }\n }\n for (const source of sourceDeclarations.filter(source => source.location.path === path)) {\n for (const line of range(source.location.line - 1)) sourceContexts.set(line, { source });\n for (const stream of source.streams) for (const line of range(stream.location.line - 1)) sourceContexts.set(line, { source, stream });\n }\n const ambiguousCandidates = [...commands.values()].flatMap(command => command.streamCandidates ?? []).filter(candidate => candidate.propertyCandidate !== null);\n const eventSources: EventSourceAnalysis = { declarations: sourceDeclarations, routes, ambiguousCandidates, contexts: sourceContexts, targets, resolve };\n let dependencyAnalysis: ReturnType<typeof dependencyTargetAnalysis> | undefined;\n const dependencies: ReturnType<typeof dependencyTargetAnalysis> = {\n completions(line, qualifier, placement) {\n if (dependencyAnalysis === undefined) {\n // Merging restated headers retains the first header's location. Index physical typed\n // headers only when needed, so later fragments still own their incomplete lines.\n const localDependencies = parseForAuthoring(prepared.source, path, prepared.placement, false).value;\n const remapDependencyHeaders = (node: typeof localDependencies.modules[number] | FeatureSyntax): void => {\n walk(node.location);\n node.features.forEach(remapDependencyHeaders);\n };\n localDependencies.modules.forEach(remapDependencyHeaders);\n dependencyAnalysis = dependencyTargetAnalysis(parsed.value, localDependencies, path, range, syntheticScopes);\n }\n return dependencyAnalysis.completions(line, qualifier, placement);\n },\n };\n const identityDetails = (parsed.value.identity?.details ?? []).map(detail => ({ name: detail.name, type: `${detail.type.name}${detail.type.isCollection ? '[]' : ''}${detail.type.isOptional ? ' optional' : ''}`, line: detail.location.line - 1 }));\n return { identityDetails, commands, specifications, diagnostics, operationProductionLines, operations, eventSources, readModels: productions.slices.flatMap(({ slice, scope }) => (slice.readModels ?? []).map(model => ({ model, scope: scope.filter(segment => !syntheticScopes.has(segment)) }))), examples, personas: personaAnalysis(parsed.value, lines), dependencies };\n}\n\nexport function responseAnalysis(lines: string[], otherSources: readonly (string | AuthoringDocument)[] = [], placement?: readonly string[], path = 'current.play', isPlacementResolved = true): ResponseAnalysis & { readonly operations: OperationAnalysis; readonly eventSources: EventSourceAnalysis; readonly readModels: readonly AuthoredReadModelKeys[]; readonly examples: ExampleAnalysis; readonly personas: ReturnType<typeof personaAnalysis>; readonly dependencies: ReturnType<typeof dependencyTargetAnalysis> } {\n const key = JSON.stringify([lines, otherSources, placement, path, isPlacementResolved]);\n let analysis = revisions.get(key);\n if (analysis === undefined) {\n analysis = analyze(lines, otherSources, placement, path, isPlacementResolved);\n if (revisions.size >= 16) revisions.delete(revisions.keys().next().value!);\n revisions.set(key, analysis);\n }\n return analysis;\n}\n"],"mappings":"0vBA4BA,MAAaA,EAAuB,qIAI9BC,kBAAY,IAAI,IAEtB,SAAS,gBAAgB,EAAiB,EAA4B,CAClE,IAAMC,EAASC,EAASC,CAAK,EACvBC,EAAQD,EAAM,SAAS,EAAM,IAAU,CAACF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C,EAAkBvE,EAAS,OAAQb,EAAMa,EAAS,UAAW,EAAK,CAAC,CAAC,MACxF,uBAA0B,GAAyE,CACrG,KAAKQ,EAAK,QAAQ,EAClBA,EAAK,SAAS,QAAQ,sBAAsB,CAChD,EACA8D,EAAkB,QAAQ,QAAQ,sBAAsB,EACxD,EAAqBE,EAAyBtE,EAAO,MAAOoE,EAAmBnF,EAAM,MAAOS,CAAe,CAC/G,CACA,OAAOuE,EAAmB,YAAY3F,EAAMiG,EAAWC,CAAS,CACpE,CAGuW,CAAE,CACjX,CAEA,SAAgB,iBAAiB,EAAiB,EAAwD,CAAC,EAAG,EAA+B,EAAO,eAAgB,EAAsB,GAAuU,CAC7f,IAAMvB,EAAM,KAAK,UAAU,CAAC/E,EAAOa,EAAcyF,EAAWvF,EAAMwF,CAAmB,CAAC,EAClFC,EAAW3G,EAAU,IAAIkF,CAAG,EAMhC,OALIyB,IAAa,IAAA,KACb,EAAW,QAAQxG,EAAOa,EAAcyF,EAAWvF,EAAMwF,CAAmB,EACxE1G,EAAU,MAAQ,IAAIA,EAAU,OAAOA,EAAU,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAM,EACzEA,EAAU,IAAIkF,EAAKyB,CAAQ,GAExBA,CACX"}
|
|
1
|
+
{"version":3,"file":"response-analysis.js","names":["responseAvailability","revisions","fences","fenceMap","lines","roots","index","indentOf","line","root","globals","body","global","depth","wrappers","headers","others","otherSources","document","path","documents","names","match","name","prefix","suffix","module","feature","syntheticScopes","preparedDocuments","sourceLines","fragment","prepared","locations","parsed","parsePlacedDocuments","commands","specifications","visited","value","node","original","child","diagnostic","unknownFragmentExtent","location","diagnostics","productions","AuthoringProductionResolver","reducer","dependencySourcesOf","slice","operationProductionLines","command","reaction","trigger","production","declarations","declaration","segment","contexts","result","indent","start","withoutComment","specification","declarationScopes","operation","scope","declarationsByLocation","source","references","resolved","reference","context","step","operations","entry","part","sourceDeclarations","sourceCatalog","EventSourceReadConfidence","resolutions","key","stream","importedTypeReferences","imported","targets","sourceContexts","routes","member","commandSlices","observer","examples","exampleAnalysis","routeOwners","event","eventSources","candidate","dependencyAnalysis","detail","personaAnalysis","localDependencies","parseForAuthoring","dependencyTargetAnalysis","qualifier","placement","isPlacementResolved","analysis"],"sources":["../../response-analysis.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { AuthoringProductionKind, AuthoringProductionResolver, CommandSyntax, dependencySourcesOf, Diagnostic, EventSourceReadConfidence, FeatureSyntax, OperationSyntax, parseForAuthoring, parsePlacedDocuments, SpecificationSyntax } from '@cratis/screenplay-compiler';\nimport { fenceMap, indentOf, withoutComment } from './document-context';\nimport { ResponseAnalysis } from './ResponseAnalysis';\nimport { ExampleAnalysis } from './ExampleAnalysis';\nimport { exampleAnalysis } from './example-analysis';\nimport { personaAnalysis } from './persona-analysis';\nimport { dependencyTargetAnalysis } from './dependency-target-analysis';\nimport { EventSourceAnalysis } from './EventSourceAnalysis';\nimport { AuthoredCommandRoute } from './AuthoredCommandRoute';\nimport { AuthoredReadModelKeys } from './AuthoredReadModelKeys';\nimport { AuthoringDocument } from './AuthoringDocument';\nimport { OperationAnalysis, OperationDeclaration, OperationReference } from './OperationAnalysis';\n\n// Public editor shapes are structural: packed declarations never expose the private compiler.\nexport type { AuthoringDocument } from './AuthoringDocument';\nexport type { AnalysisLocation } from './AnalysisLocation';\nexport type { AnalysisDiagnostic } from './AnalysisDiagnostic';\nexport type { AnalysisType } from './AnalysisType';\nexport type { AnalysisCommand } from './AnalysisCommand';\nexport type { AnalysisSpecification } from './AnalysisSpecification';\nexport type { CommandResponseSymbol } from './CommandResponseSymbol';\nexport type { ResponseFieldSymbol } from './ResponseFieldSymbol';\nexport type { ResponseSourceSymbol } from './ResponseSourceSymbol';\nexport type { ResponseAnalysis } from './ResponseAnalysis';\n\nexport const responseAvailability = 'Executable as ESM v7. Generated values require fixtures in reference execution; other unadmitted constructs still prevent binding.';\n\n// A bounded revision cache shared by symbols, validation, completion and hover. Index typed nodes\n// once, not by reparsing the document for each command or response field.\nconst revisions = new Map<string, ReturnType<typeof analyze>>();\n\nfunction authoringSource(lines: string[], headers: readonly string[]) {\n const fences = fenceMap(lines);\n const roots = lines.flatMap((line, index) => !fences[index] && indentOf(line) === 0 && /^\\w/.test(line) ? [line.split(/\\s+/)[0]] : []);\n if (roots.includes('module') || !roots.some(root => ['feature', 'slice', 'command', 'event', 'operation', 'reaction', 'specification'].includes(root))) {\n return { source: lines.join('\\n'), locations: lines.map((_, index) => ({ line: index + 1, column: 0 })) };\n }\n // Isolated slice/command fragments are a supported editor input. Global declarations stay global.\n const globals: number[] = [];\n const body: number[] = [];\n let global = false;\n lines.forEach((line, index) => {\n if (!fences[index] && indentOf(line) === 0 && /^\\w/.test(line)) global = /^(?:concept|type|import|domain|system|eventsource|policy|persona|identity)\\b/.test(line);\n (global ? globals : body).push(index);\n });\n const depth = roots.includes('feature') ? 1 : roots.includes('slice') ? 2 : 3;\n const wrappers = headers.slice(0, depth);\n const source = [...globals.map(index => lines[index]), ...wrappers, ...body.map(index => ' '.repeat(depth * 2) + lines[index])].join('\\n');\n const locations = [...globals.map(index => ({ line: index + 1, column: 0 })), ...wrappers.map(() => ({ line: 0, column: 0 })), ...body.map(index => ({ line: index + 1, column: depth * 2 }))];\n return { source, locations };\n}\n\nfunction analyze(lines: string[], otherSources: readonly (string | AuthoringDocument)[], placement?: readonly string[], path = 'current.play', isPlacementResolved = true): ResponseAnalysis & { readonly operations: OperationAnalysis; readonly eventSources: EventSourceAnalysis; readonly readModels: readonly AuthoredReadModelKeys[]; readonly examples: ExampleAnalysis; readonly personas: ReturnType<typeof personaAnalysis>; readonly dependencies: ReturnType<typeof dependencyTargetAnalysis> } {\n const others = otherSources.map((document, index) => typeof document === 'string' ? { path: `other-${index}.play`, source: document } : document).filter(document => document.path !== path);\n const documents: AuthoringDocument[] = [{ path, source: lines.join('\\n'), placement, isPlacementResolved }, ...others];\n // Modules/features merge, but slices are real declarations: equal slice names discard later\n // documents. Share only fresh synthetic module/feature names, with a distinct synthetic slice\n // per fragment. This retains all commands for normal (including ambiguous) scope resolution,\n // without combining source texts or renaming real declarations/explicit placements. Reserve\n // source/placement names once so even a real Editor.Authoring.Fragment cannot collide.\n const names = new Set(documents.flatMap(document => [...document.source.matchAll(/\\w+/g)].map(match => match[0]).concat(document.placement ?? [])));\n const fresh = (prefix: string): string => {\n let name = prefix;\n for (let suffix = 1; names.has(name); suffix++) name = `${prefix}${suffix}`;\n names.add(name);\n return name;\n };\n const module = fresh('EditorAuthoring');\n const feature = fresh('FragmentFeature');\n const syntheticScopes = new Set([module, feature]);\n const preparedDocuments = documents.map((document, index) => {\n const sourceLines = index === 0 ? lines : document.source.split('\\n');\n const fragment = fresh(`Fragment${index}`);\n syntheticScopes.add(fragment);\n const prepared = document.placement?.length ? { source: document.source, locations: sourceLines.map((_, line) => ({ line: line + 1, column: 0 })) }\n : authoringSource(sourceLines, [`module ${module}`, ` feature ${feature}`, ` slice StateChange ${fragment}`]);\n return { ...document, ...prepared, placement: document.placement ?? [] };\n });\n const prepared = preparedDocuments[0];\n const locations = new Map(preparedDocuments.map(document => [document.path, document.locations]));\n // Put the buffer after its supplied context so duplicate real declarations are reported at\n // the current source, not silently dropped from its source-local diagnostic view.\n // Editor context can omit imported declarations. Defer only those missing types; imports whose\n // targets are present in the merged inventory still receive declaration-dependent validation.\n const parsed = parsePlacedDocuments([...preparedDocuments.slice(1), prepared], undefined, true);\n const commands = new Map<number, CommandSyntax>();\n const specifications = new Map<number, SpecificationSyntax>();\n const visited = new WeakSet<object>();\n const walk = (value: unknown): void => {\n if (value === null || typeof value !== 'object' || visited.has(value)) return;\n visited.add(value);\n if (Array.isArray(value)) { value.forEach(walk); return; }\n const node = value as Record<string, unknown>;\n // Source locations also occur as standalone members (usesLocation, targetLocation).\n // Mutate each original identity once: shared locations must not be shifted twice.\n if (typeof node.path === 'string' && typeof node.line === 'number' && typeof node.column === 'number') {\n const original = locations.get(node.path)?.[node.line - 1];\n if (original) { node.line = original.line; node.column = Math.max(1, node.column - original.column); }\n return;\n }\n for (const child of Object.values(node)) walk(child);\n if ((node.location as { path?: string; line: number } | undefined)?.path === path) {\n if (node.kind === 'CommandSyntax') commands.set((node.location as { line: number }).line - 1, value as CommandSyntax);\n if (node.kind === 'SpecificationSyntax') specifications.set((node.location as { line: number }).line - 1, value as SpecificationSyntax);\n }\n };\n walk(parsed.value);\n walk(parsed.physicalEventSources);\n // Fragment wrappers must not turn an unread original root into confidence evidence.\n // Retain the parser's unknown-owner diagnostic at its original physical root location.\n for (const diagnostic of parsed.diagnostics) walk(diagnostic.location);\n const unknownFragmentExtent = parsed.diagnostics.some(diagnostic => {\n if (!['PLAY0022', 'PLAY0024', 'PLAY0029'].includes(diagnostic.code)) return false;\n const document = preparedDocuments.find(document => document.path === diagnostic.location.path);\n const original = documents.find(document => document.path === diagnostic.location.path)?.source.split('\\n')[diagnostic.location.line - 1];\n return document?.locations.some(location => location.line === 0) && original !== undefined && indentOf(original) === 0;\n });\n const diagnostics: Diagnostic[] = parsed.diagnostics.filter(diagnostic => diagnostic.location.path === path).flatMap(diagnostic => {\n walk(diagnostic.location);\n return diagnostic.location.line > 0 ? [diagnostic] : [];\n });\n const productions = new AuthoringProductionResolver(parsed.value);\n for (const { slice } of productions.slices) for (const reducer of dependencySourcesOf(slice).reducers ?? []) walk(reducer);\n const operationProductionLines = new Set(productions.slices.flatMap(({ slice }) => [...slice.commands.flatMap(command => command.produces), ...slice.reactions.flatMap(reaction => reaction.triggers).flatMap(trigger => trigger.produces)]\n .filter(production => production.location.path === path && !productions.isEventProduction(production, slice))\n .map(production => production.location.line - 1)));\n // Rejected inline operation declarations have no syntax node, but the core parser still owns\n // the command-only kind fact. Retain it rather than suggesting an event declaration repair.\n for (const diagnostic of diagnostics) if (diagnostic.code === 'PLAY0499') operationProductionLines.add(diagnostic.location.line - 1);\n const declarations: OperationDeclaration[] = productions.declarations.filter(declaration => declaration.kind === AuthoringProductionKind.Operation)\n .map(declaration => ({ ...declaration.node as OperationSyntax, scope: declaration.scope.filter(segment => !syntheticScopes.has(segment)) }));\n const contexts = new Map<number, { scope: readonly string[]; commandLine?: number; operation?: OperationDeclaration; production?: OperationReference }>();\n // Index source ownership once per revision. Typed headers, not keyword-shaped properties,\n // define the ranges; greater-indented legacy properties remain leaves.\n const fences = fenceMap(lines);\n const range = (start: number): number[] => {\n const result: number[] = [];\n const indent = indentOf(lines[start]);\n for (let line = start; line < lines.length; line++) {\n if (line > start && !fences[line] && withoutComment(lines[line]).trim() && indentOf(lines[line]) <= indent) break;\n result.push(line);\n }\n return result;\n };\n for (const { slice, scope } of productions.slices) {\n if (slice.location.path === path && slice.location.line > 0) for (const line of range(slice.location.line - 1)) contexts.set(line, { scope });\n for (const specification of slice.specifications.filter(specification => specification.location.path === path && specification.location.line > 0)) {\n for (const line of range(specification.location.line - 1)) contexts.set(line, { scope });\n }\n for (const command of slice.commands.filter(command => command.location.path === path && command.location.line > 0)) {\n for (const line of range(command.location.line - 1)) contexts.set(line, { scope, commandLine: command.location.line - 1 });\n }\n }\n const declarationScopes = new Map(productions.declarations.map(declaration => [declaration.node.location, declaration.scope]));\n for (const operation of declarations.filter(operation => operation.location.path === path)) {\n const scope = declarationScopes.get(operation.location)!;\n for (const line of range(operation.location.line - 1)) contexts.set(line, { ...contexts.get(line), scope, operation });\n }\n const declarationsByLocation = new Map(declarations.map(declaration => [declaration.location, declaration]));\n const referenceLocation = (location: { path?: string; line: number; column: number }, name: string) => {\n const source = withoutComment(lines[location.line - 1] ?? '');\n const prefix = source.slice(location.column - 1).match(/^(?:given\\s+operation|then\\s+(?:operation|compensated))\\s+/)?.[0];\n return prefix && source.slice(location.column - 1 + prefix.length, location.column - 1 + prefix.length + name.length) === name\n ? { ...location, column: location.column + prefix.length } : location;\n };\n const references: OperationReference[] = [];\n for (const { slice } of productions.slices) {\n for (const command of slice.commands) for (const production of command.produces) {\n if (production.location.path !== path) continue;\n const resolved = productions.resolve(production.event, slice);\n const declaration = resolved.declaration ? declarationsByLocation.get(resolved.declaration.node.location) ?? null : null;\n const reference = { name: production.event, location: production.location, targetLocation: production.targetLocation ?? production.location, kind: resolved.kind, declaration, mappings: production.mappings };\n references.push(reference);\n if (resolved.kind === AuthoringProductionKind.Operation) {\n for (const line of range(production.location.line - 1)) {\n const context = contexts.get(line);\n if (context) contexts.set(line, { ...context, production: reference });\n }\n }\n }\n for (const specification of slice.specifications) {\n for (const step of [...specification.givenOperationFailures ?? [], ...specification.thenOperations ?? [], ...specification.thenCompensated ?? []]) {\n if (step.location.path !== path) continue;\n const resolved = productions.resolve(step.operation, slice);\n references.push({ name: step.operation, location: step.location, targetLocation: referenceLocation(step.location, step.operation), kind: resolved.kind,\n declaration: resolved.declaration ? declarationsByLocation.get(resolved.declaration.node.location) ?? null : null,\n mappings: [] });\n }\n }\n }\n const operations: OperationAnalysis = { declarations, systems: parsed.value.systems ?? [], references, contexts, types: parsed.value.types, concepts: parsed.value.concepts,\n targets: scope => {\n const slice = productions.slices.find(entry => entry.scope.length === scope.length && entry.scope.every((part, index) => part === scope[index]))?.slice;\n if (!slice) return [];\n return declarations.flatMap(declaration => {\n const name = productions.resolve(declaration.name, slice).declaration?.node.location === declaration.location\n ? declaration.name : [...declaration.scope, declaration.name].join('.');\n return productions.resolve(name, slice).kind === AuthoringProductionKind.Operation &&\n productions.resolve(name, slice).declaration?.node.location === declaration.location ? [{ name, declaration }] : [];\n });\n }\n };\n const sourceDeclarations = parsed.physicalEventSources.map(entry => entry.source);\n const sourceCatalog = new EventSourceReadConfidence(parsed.physicalEventSources, parsed.sourceInventoryComplete && !unknownFragmentExtent);\n const resolutions = new Map<string, ReturnType<EventSourceReadConfidence['resolve']>>();\n const resolve = (source: string, stream?: string) => {\n const key = JSON.stringify([source, stream]);\n let result = resolutions.get(key);\n if (!result) { result = sourceCatalog.resolve(source, stream); resolutions.set(key, result); }\n return { ...result, source: result.state === 'unique' ? result.sources[0] : undefined, stream: result.state === 'unique' ? result.streams[0] : undefined };\n };\n const importedTypeReferences = new Set(parsed.value.imports.map(imported => imported.qualifiedName));\n const targets = sourceDeclarations.flatMap(source => {\n return source.streams.filter(stream => resolve(source.name, stream.name).state === 'unique' && !importedTypeReferences.has(`${source.name}.${stream.name}`)).map(stream => ({ name: `${source.name}.${stream.name}`, source, stream }));\n });\n const sourceContexts = new Map<number, EventSourceAnalysis['contexts'] extends ReadonlyMap<number, infer Context> ? Context : never>();\n const routes: AuthoredCommandRoute[] = [];\n for (const command of commands.values()) {\n for (const line of range(command.location.line - 1)) sourceContexts.set(line, { command });\n for (const member of [...command.produces, ...command.validations, ...(command.handler ? [command.handler] : [])])\n for (const line of range(member.location.line - 1)) sourceContexts.delete(line);\n // Retained ambiguity candidates are not selected authored routes.\n if (command.stream) {\n routes.push(command.stream);\n for (const line of range(command.stream.location.line - 1)) sourceContexts.set(line, { command, route: command.stream });\n }\n }\n const commandSlices = new Map(productions.slices.flatMap(({ slice }) => slice.commands.map(command => [command, slice] as const)));\n for (const command of commands.values()) {\n const slice = commandSlices.get(command);\n if (!slice) continue;\n for (const production of command.produces) {\n if (!productions.isEventProduction(production, slice)) continue;\n for (const line of range(production.location.line - 1)) sourceContexts.set(line, { command, production: true });\n if (production.stream) {\n routes.push(production.stream);\n for (const line of range(production.stream.location.line - 1)) sourceContexts.set(line, { command, production: true, route: production.stream });\n }\n }\n }\n for (const { slice } of productions.slices) {\n for (const observer of [...slice.reactions, ...dependencySourcesOf(slice).reducers ?? []].filter(observer => observer.location.path === path && observer.location.line > 0)) {\n for (const line of range(observer.location.line - 1)) sourceContexts.set(line, { observer });\n }\n }\n const examples = exampleAnalysis(parsed.value, path, lines, range, syntheticScopes, parsed.diagnostics);\n const routeOwners = [\n ...[...specifications.values()].flatMap(specification => [\n ...specification.given.map(event => ({ event, expectation: false })),\n ...(specification.whenAppended ? [{ event: specification.whenAppended, expectation: false }] : []),\n ...specification.thenEvents.map(event => ({ event, expectation: true })),\n ...(specification.whenRedelivered ? [{ event: specification.whenRedelivered, expectation: true }] : [])\n ]),\n ...(examples.eventExamples ?? []).map(event => ({ event, expectation: true }))\n ];\n for (const context of routeOwners) {\n const event = context.event;\n for (const line of range(event.location.line - 1)) sourceContexts.set(line, context);\n if (event.stream) {\n routes.push(event.stream);\n for (const line of range(event.stream.location.line - 1)) sourceContexts.set(line, { ...context, route: event.stream });\n }\n }\n for (const source of sourceDeclarations.filter(source => source.location.path === path)) {\n for (const line of range(source.location.line - 1)) sourceContexts.set(line, { source });\n for (const stream of source.streams) for (const line of range(stream.location.line - 1)) sourceContexts.set(line, { source, stream });\n }\n const ambiguousCandidates = [...commands.values()].flatMap(command => command.streamCandidates ?? []).filter(candidate => candidate.propertyCandidate !== null);\n const eventSources: EventSourceAnalysis = { declarations: sourceDeclarations, routes, ambiguousCandidates, contexts: sourceContexts, targets, resolve };\n let dependencyAnalysis: ReturnType<typeof dependencyTargetAnalysis> | undefined;\n const dependencies: ReturnType<typeof dependencyTargetAnalysis> = {\n completions(line, qualifier, placement) {\n if (dependencyAnalysis === undefined) {\n // Merging restated headers retains the first header's location. Index physical typed\n // headers only when needed, so later fragments still own their incomplete lines.\n const localDependencies = parseForAuthoring(prepared.source, path, prepared.placement, false).value;\n const remapDependencyHeaders = (node: typeof localDependencies.modules[number] | FeatureSyntax): void => {\n walk(node.location);\n node.features.forEach(remapDependencyHeaders);\n };\n localDependencies.modules.forEach(remapDependencyHeaders);\n dependencyAnalysis = dependencyTargetAnalysis(parsed.value, localDependencies, path, range, syntheticScopes);\n }\n return dependencyAnalysis.completions(line, qualifier, placement);\n },\n };\n const identityDetails = (parsed.value.identity?.details ?? []).map(detail => ({ name: detail.name, type: `${detail.type.name}${detail.type.isCollection ? '[]' : ''}${detail.type.isOptional ? ' optional' : ''}`, line: detail.location.line - 1 }));\n return { identityDetails, commands, specifications, diagnostics, operationProductionLines, operations, eventSources, readModels: productions.slices.flatMap(({ slice, scope }) => (slice.readModels ?? []).map(model => ({ model, scope: scope.filter(segment => !syntheticScopes.has(segment)) }))), examples, personas: personaAnalysis(parsed.value, lines), dependencies };\n}\n\nexport function responseAnalysis(lines: string[], otherSources: readonly (string | AuthoringDocument)[] = [], placement?: readonly string[], path = 'current.play', isPlacementResolved = true): ResponseAnalysis & { readonly operations: OperationAnalysis; readonly eventSources: EventSourceAnalysis; readonly readModels: readonly AuthoredReadModelKeys[]; readonly examples: ExampleAnalysis; readonly personas: ReturnType<typeof personaAnalysis>; readonly dependencies: ReturnType<typeof dependencyTargetAnalysis> } {\n const key = JSON.stringify([lines, otherSources, placement, path, isPlacementResolved]);\n let analysis = revisions.get(key);\n if (analysis === undefined) {\n analysis = analyze(lines, otherSources, placement, path, isPlacementResolved);\n if (revisions.size >= 16) revisions.delete(revisions.keys().next().value!);\n revisions.set(key, analysis);\n }\n return analysis;\n}\n"],"mappings":"0vBA4BA,MAAaA,EAAuB,qIAI9BC,kBAAY,IAAI,IAEtB,SAAS,gBAAgB,EAAiB,EAA4B,CAClE,IAAMC,EAASC,EAASC,CAAK,EACvBC,EAAQD,EAAM,SAAS,EAAM,IAAU,CAACF,EAAOI,IAAUC,EAASC,CAAI,IAAM,GAAK,MAAM,KAAKA,CAAI,EAAI,CAACA,EAAK,MAAM,KAAK,CAAC,CAAC,EAAE,EAAI,CAAC,CAAC,EACrI,GAAIH,EAAM,SAAS,QAAQ,GAAK,CAACA,EAAM,KAAK,GAAQ,CAAC,UAAW,QAAS,UAAW,QAAS,YAAa,WAAY,eAAe,CAAC,CAAC,SAASI,CAAI,CAAC,EACjJ,MAAO,CAAE,OAAQL,EAAM,KAAK;CAAI,EAAG,UAAWA,EAAM,KAAK,EAAG,KAAW,CAAE,KAAME,EAAQ,EAAG,OAAQ,CAAE,EAAE,CAAE,EAG5G,IAAMI,EAAoB,CAAC,EACrBC,EAAiB,CAAC,EACpBC,EAAS,GACbR,EAAM,SAAS,EAAM,IAAU,CACvB,CAACF,EAAOI,IAAUC,EAASC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