@cratis/screenplay-language 4.147.2 → 4.149.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/ContinuationResponseField.d.ts +7 -0
- package/dist/ContinuationResponseField.d.ts.map +1 -0
- package/dist/ResponseAnalysis.d.ts +2 -0
- package/dist/ResponseAnalysis.d.ts.map +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js +1 -1
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ContinuationValues.js +2 -0
- package/dist/bundles/compiler/Parsing/ContinuationValues.js.map +1 -0
- package/dist/bundles/compiler/Parsing/InputUses.js +1 -1
- package/dist/bundles/compiler/Parsing/InputUses.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ParserContext.js +1 -1
- package/dist/bundles/compiler/Parsing/ParserContext.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ResponseCommandResolver.js +2 -0
- package/dist/bundles/compiler/Parsing/ResponseCommandResolver.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ResponseValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/ResponseValidator.js.map +1 -1
- package/dist/bundles/compiler/ScreenplayCompiler.js +1 -1
- package/dist/bundles/compiler/ScreenplayCompiler.js.map +1 -1
- package/dist/bundles/compiler/index.js +1 -1
- package/dist/bundles/completion-planner.js +2 -2
- package/dist/bundles/completion-planner.js.map +1 -1
- package/dist/bundles/continuation-responses.js +2 -0
- package/dist/bundles/continuation-responses.js.map +1 -0
- package/dist/bundles/diagnostic-codes.js +1 -1
- package/dist/bundles/diagnostic-codes.js.map +1 -1
- package/dist/bundles/hover-content.js +5 -5
- package/dist/bundles/hover-content.js.map +1 -1
- package/dist/bundles/response-analysis.js +6 -6
- package/dist/bundles/response-analysis.js.map +1 -1
- package/dist/bundles/validation.js +1 -1
- package/dist/bundles/validation.js.map +1 -1
- package/dist/completion-planner.d.ts.map +1 -1
- package/dist/continuation-responses.d.ts +5 -0
- package/dist/continuation-responses.d.ts.map +1 -0
- package/dist/diagnostic-codes.d.ts +1 -0
- package/dist/diagnostic-codes.d.ts.map +1 -1
- package/dist/hover-content.d.ts.map +1 -1
- package/dist/response-analysis.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseValidator.js","names":["primitiveTypes","context","effectiveCommand","specificationCommandExamples","application","slices","scope","parent","feature","slice","child","module","commands","properties","responseFields","command","entries","imports","imported","name","resolved","key","from","segments","candidates","qualifiers","entry","index","value","depth","visible","concepts","conceptNames","concept","composites","type","readModels","model","commandProperties","property","declared","DiagnosticCodes","production","event","reaction","trigger","source","explicit","response","names","field","action","specification","input","identifiers","fixture","expectation","fields","asserted","contract","inputs","result","duplicates","item","items","member","primitive","exactIsIntegral","responseDateValue","uuidValuePattern","text"],"sources":["../../../../../../Compiler/Parsing/ResponseValidator.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 { exactIsIntegral } from '../Syntax/ExactMathFacts';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { CommandSyntax } from '../Syntax/Commands';\nimport { ConceptSyntax, PropertySyntax, TypeRefSyntax } from '../Syntax/Declarations';\nimport { ExpressionSyntax } from '../Syntax/Expressions';\nimport { PropertyResponseSourceSyntax, ResponseFieldSyntax } from '../Syntax/Responses';\nimport { SpecificationSyntax } from '../Syntax/Specifications';\nimport { ApplicationSyntax, FeatureSyntax, SliceSyntax } from '../Syntax/Structure';\nimport { InputUse } from './InputUses';\nimport { ParserContext } from './ParserContext';\nimport { responseDateValue } from './ResponseDateValues';\nimport { specificationCommandExamples } from './SpecificationCommandExamples';\n\nconst primitiveTypes = new Set(['Uuid', 'String', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime']);\ninterface ScopedCommand { command: CommandSyntax; scope: readonly string[] }\n\nexport function validateResponses(application: ApplicationSyntax, context: ParserContext, inputs: readonly InputUse[] = context.inputUses): void {\n const effectiveCommand = specificationCommandExamples(application);\n const slices: { slice: SliceSyntax; scope: readonly string[] }[] = [];\n const collect = (feature: FeatureSyntax, parent: readonly string[]): void => {\n const scope = [...parent, feature.name];\n feature.slices.forEach(slice => slices.push({ slice, scope: [...scope, slice.name] }));\n feature.features.forEach(child => collect(child, scope));\n };\n application.modules.forEach(module => module.features.forEach(feature => collect(feature, [module.name])));\n const commands = new Map<string, ScopedCommand[]>();\n const properties = new Map<CommandSyntax, Map<string, PropertySyntax>>();\n const responseFields = new Map<CommandSyntax, Map<string, ResponseFieldSyntax>>();\n for (const { slice, scope } of slices) {\n for (const command of slice.commands) {\n const entries = commands.get(command.name) ?? [];\n entries.push({ command, scope });\n commands.set(command.name, entries);\n properties.set(command, uniqueByName(command.properties));\n if (command.response?.kind === 'RecordCommandResponseSyntax') responseFields.set(command, uniqueByName(command.response.fields));\n }\n }\n const imports = new Map<string, string[]>();\n for (const imported of application.imports) {\n const name = imported.qualifiedName.split('.').at(-1)!;\n imports.set(name, [...(imports.get(name) ?? []), imported.qualifiedName]);\n }\n const resolved = new Map<string, CommandSyntax | null>();\n const resolve = (name: string, from: readonly string[]): CommandSyntax | null => {\n const key = `${from.join('.')}|${name}`;\n if (resolved.has(key)) return resolved.get(key)!;\n const imported = imports.get(name) ?? [];\n const local = commands.get(name.split('.').at(-1)!) ?? [];\n const reference = local.length === 0 && imported.length === 1 ? imported[0] : name;\n const segments = reference.split('.');\n let candidates = commands.get(segments.at(-1)!) ?? [];\n if (segments.length > 1) {\n const qualifiers = segments.slice(0, -1);\n candidates = candidates.filter(entry => qualifiers.length <= entry.scope.length && qualifiers.every((value, index) => entry.scope[entry.scope.length - qualifiers.length + index] === value));\n } else {\n for (let depth = from.length; depth >= 0; depth--) {\n const visible = candidates.filter(entry => depth <= entry.scope.length && from.slice(0, depth).every((value, index) => entry.scope[index] === value));\n if (visible.length > 0) { candidates = visible; break; }\n }\n }\n const command = candidates.length === 1 ? candidates[0].command : null;\n resolved.set(key, command);\n return command;\n };\n const concepts = uniqueByName(application.concepts);\n const conceptNames = new Set(application.concepts.map(concept => concept.name));\n const composites = new Map([...uniqueByName(application.types)].map(([name, type]) => [name, uniqueByName(type.properties)]));\n const readModels = new Set(slices.flatMap(entry => entry.slice.readModels.map(model => model.name)));\n const commandProperties = new Set([...properties.keys()].flatMap(command => [...command.properties]));\n const checkDeclarations = (declared: readonly PropertySyntax[]): void => {\n for (const property of declared) {\n if (property.isGenerated && !commandProperties.has(property)) context.error(DiagnosticCodes.GeneratedPropertyOutsideCommand, 'Generated properties can only be declared on commands.', property.location);\n }\n };\n // Only these typed declarations carry PropertySyntax. Do not pull the complete extensible walker\n // into every browser parser just to inspect their generated flags.\n const checkFeature = (feature: FeatureSyntax): void => {\n feature.features.forEach(checkFeature);\n for (const slice of feature.slices) {\n for (const command of slice.commands) {\n for (const production of command.produces) if (production.inlineEvent !== null) checkDeclarations(production.inlineEvent.properties);\n }\n slice.events.forEach(event => checkDeclarations(event.properties));\n slice.readModels.forEach(model => checkDeclarations(model.properties));\n for (const reaction of slice.reactions) {\n for (const trigger of reaction.triggers) {\n for (const production of trigger.produces) if (production.inlineEvent !== null) checkDeclarations(production.inlineEvent.properties);\n }\n }\n }\n };\n application.types.forEach(type => checkDeclarations(type.properties));\n application.modules.forEach(module => module.features.forEach(checkFeature));\n const validateSource = (source: PropertyResponseSourceSyntax, explicit: TypeRefSyntax | null, command: CommandSyntax): void => {\n const property = properties.get(command)!.get(source.property);\n if (property === undefined) {\n context.error(DiagnosticCodes.InvalidResponseSource, `Response source '${source.property}' must reference one direct command property.`, source.location);\n return;\n }\n const type = property.type;\n if (type.isCollection || readModels.has(type.name)) context.error(DiagnosticCodes.InvalidResponseShape, 'Collection and whole-read-model responses are not supported.', source.location);\n if (explicit !== null && (explicit.name !== type.name || explicit.isCollection !== type.isCollection || explicit.isOptional !== type.isOptional)) context.error(DiagnosticCodes.InvalidResponseShape, \"An explicit response field type must match its source's declared type, collection shape and optionality.\", explicit.location);\n };\n for (const command of properties.keys()) {\n for (const property of command.properties) {\n if (!property.isGenerated) continue;\n const concept = concepts.get(property.type.name);\n if (property.type.isOptional || property.type.isCollection || (concept === undefined ? primitiveTypes.has(property.type.name) || composites.has(property.type.name) || conceptNames.has(property.type.name) || readModels.has(property.type.name) : concept.type !== 'Uuid' && concept.generation == null)) context.error(DiagnosticCodes.InvalidGeneratedType, 'A generated property must be a required, noncollection generatable concept.', property.location);\n }\n const response = command.response;\n if (response?.kind === 'ScalarCommandResponseSyntax') validateSource(response.source, null, command);\n else if (response?.kind === 'RecordCommandResponseSyntax') {\n if (response.fields.length === 0) context.error(DiagnosticCodes.InvalidCommandResponse, 'A response block requires at least one field.', response.location);\n const names = new Set<string>();\n for (const field of response.fields) {\n if (names.has(field.name)) context.error(DiagnosticCodes.DuplicateResponseField, `Duplicate response field '${field.name}'.`, field.location);\n names.add(field.name);\n validateSource(field.source, field.type, command);\n }\n }\n }\n const validateSpecification = (specification: SpecificationSyntax, scope: readonly string[]): void => {\n const action = effectiveCommand(specification.when, scope);\n const command = action === null ? null : resolve(action.commandType, scope);\n if (action !== null && command !== null) {\n const declared = properties.get(command)!;\n for (const input of action.values) {\n if (declared.get(input.property.split('.')[0])?.isGenerated) context.error(DiagnosticCodes.GeneratedPropertySuppliedAsInput, `Generated property '${input.property}' cannot be supplied as request or form input.`, input.location);\n }\n const identifiers = [...declared.values()].filter(property => property.isIdentifier);\n if (action.for !== null && identifiers.length === 1 && identifiers[0].isGenerated) {\n const type = identifiers[0].type;\n const known = primitiveTypes.has(type.name) || concepts.has(type.name) || composites.has(type.name);\n if (known && (type.isOptional || type.isCollection || !['Uuid', 'String'].includes(concepts.get(type.name)?.type ?? '') || !compatibleValue(action.for, type, concepts, composites))) {\n context.error(DiagnosticCodes.InvalidGeneratedFixture, \"A generated identifier fixture must supply one compatible concrete UUID value through 'for'.\", action.for.location);\n }\n }\n const names = new Set<string>();\n for (const fixture of action.generatedValues ?? []) {\n const property = declared.get(fixture.property);\n if (names.has(fixture.property) || property === undefined || !property.isGenerated || property.isIdentifier || !compatibleValue(fixture.source, property.type, concepts, composites)) context.error(DiagnosticCodes.InvalidGeneratedFixture, 'A generated fixture must uniquely supply a compatible value for a nonidentifier generated command property.', fixture.location);\n names.add(fixture.property);\n }\n }\n const expectation = specification.thenReturns;\n if (expectation == null) return;\n if (action === null || specification.thenErrors.length > 0 || specification.thenDenied != null) context.error(DiagnosticCodes.InvalidReturnExpectation, 'A return expectation requires a command action and cannot accompany an error or denial.', expectation.location);\n if (command === null) return;\n const response = command.response;\n const declared = properties.get(command)!;\n if (expectation.kind === 'ScalarSpecificationReturnSyntax' && response?.kind === 'ScalarCommandResponseSyntax' && declared.has(response.source.property)) {\n if (!compatibleValue(expectation.value, declared.get(response.source.property)!.type, concepts, composites)) context.error(DiagnosticCodes.InvalidReturnExpectation, \"The expected return value must match the response source's type.\", expectation.location);\n } else if (expectation.kind === 'RecordSpecificationReturnSyntax' && response?.kind === 'RecordCommandResponseSyntax') {\n if (expectation.fields.length === 0) context.error(DiagnosticCodes.InvalidReturnExpectation, 'A record return expectation requires at least one field.', expectation.location);\n const fields = responseFields.get(command)!;\n const asserted = new Set<string>();\n for (const field of expectation.fields) {\n const contract = fields.get(field.property);\n const property = contract === undefined ? undefined : declared.get(contract.source.property);\n if (asserted.has(field.property) || property === undefined || !compatibleValue(field.source, property.type, concepts, composites)) context.error(DiagnosticCodes.InvalidReturnExpectation, 'A return assertion must uniquely name a response field and supply a compatible concrete value.', field.location);\n asserted.add(field.property);\n }\n } else {\n context.error(DiagnosticCodes.InvalidReturnExpectation, \"The return expectation must match the command's scalar or record response shape.\", expectation.location);\n }\n };\n for (const { slice, scope } of slices) slice.specifications.forEach(specification => validateSpecification(specification, scope));\n for (const input of inputs) {\n if (input.isParameter === true) continue;\n const command = resolve(input.command, input.scope);\n if (command !== null && properties.get(command)!.get(input.property.split('.')[0])?.isGenerated) context.error(DiagnosticCodes.GeneratedPropertySuppliedAsInput, `Generated property '${input.property}' cannot be supplied as request or form input.`, input.location);\n }\n}\n\nexport function uniqueByName<T extends { readonly name: string }>(items: readonly T[]): Map<string, T> {\n const result = new Map<string, T>();\n const duplicates = new Set<string>();\n for (const item of items) {\n if (result.has(item.name)) duplicates.add(item.name);\n result.set(item.name, item);\n }\n duplicates.forEach(name => result.delete(name));\n return result;\n}\n\nexport function compatibleValue(value: ExpressionSyntax, type: TypeRefSyntax, concepts: ReadonlyMap<string, ConceptSyntax>, composites: ReadonlyMap<string, ReadonlyMap<string, PropertySyntax>>): boolean {\n if (value.kind === 'LiteralExpressionSyntax' && value.value === null) return type.isOptional;\n if (type.isCollection) return value.kind === 'ListExpressionSyntax' && value.items.every(item => compatibleValue(item, { ...type, isCollection: false, isOptional: false }, concepts, composites));\n const properties = composites.get(type.name);\n if (properties !== undefined) return value.kind === 'ObjectExpressionSyntax' && value.members.every(member => {\n const property = properties.get(member.name);\n return property !== undefined && compatibleValue(member.value, property.type, concepts, composites);\n });\n const concept = concepts.get(type.name);\n const primitive = concept?.type ?? type.name;\n if (concept?.type === 'Enum') return value.kind === 'LiteralExpressionSyntax' && typeof value.value === 'string' && concept.values.includes(value.value);\n if (value.kind === 'LiteralExpressionSyntax') {\n switch (primitive) {\n case 'Uuid': return typeof value.value === 'string' && uuidValue(value.value);\n case 'String': return typeof value.value === 'string';\n case 'Bool': return typeof value.value === 'boolean';\n case 'Int': return typeof value.value === 'number' ? Number.isFinite(value.value) && Number.isInteger(value.value) : typeof value.value === 'object' && value.value !== null && exactIsIntegral(value.value);\n case 'Decimal': return typeof value.value === 'number' ? Number.isFinite(value.value) : typeof value.value === 'object' && value.value !== null && value.value.literalType === 'ExactNumber';\n case 'Date': return typeof value.value === 'string' && responseDateValue(value.value, false);\n case 'DateTime': return typeof value.value === 'string' && responseDateValue(value.value, true);\n default: return !primitiveTypes.has(primitive);\n }\n }\n return !primitiveTypes.has(primitive) && concept === undefined;\n}\n\n// Shared with ResponseValueTypes.cs: 32 hex digits (N), hyphenated UUIDs (D), or D wrapped in\n// braces (B) / parentheses (P). Hex is case-insensitive; whitespace and X initializer notation\n// are not admitted in response/fixture values. The lookahead requires the true end, even after a newline.\nconst uuidValuePattern = /^(?:[0-9a-f]{32}|[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}|\\{[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\\}|\\([0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\\))(?![\\s\\S])/i;\n\nfunction uuidValue(text: string): boolean {\n return uuidValuePattern.test(text);\n}\n"],"mappings":"oUAgBA,MAAMA,kBAAiB,IAAI,IAAI,CAAC,OAAQ,SAAU,MAAO,UAAW,OAAQ,OAAQ,UAAU,CAAC,EAG/F,SAAgB,kBAAkB,EAAgC,EAAwB,EAA8BC,EAAQ,UAAiB,CAC7I,IAAMC,EAAmBC,EAA6BC,CAAW,EAC3DC,EAA6D,CAAC,EAC9D,SAAW,EAAwB,IAAoC,CACzE,IAAMC,EAAQ,CAAC,GAAGC,EAAQC,EAAQ,IAAI,EACtCA,EAAQ,OAAO,QAAQ,GAASH,EAAO,KAAK,CAAE,QAAO,MAAO,CAAC,GAAGC,EAAOG,EAAM,IAAI,CAAE,CAAC,CAAC,EACrFD,EAAQ,SAAS,QAAQ,GAAS,QAAQE,EAAOJ,CAAK,CAAC,CAC3D,EACAF,EAAY,QAAQ,QAAQ,GAAUO,EAAO,SAAS,QAAQ,GAAW,QAAQH,EAAS,CAACG,EAAO,IAAI,CAAC,CAAC,CAAC,EACzG,IAAMC,kBAAW,IAAI,IACfC,kBAAa,IAAI,IACjBC,kBAAiB,IAAI,IAC3B,IAAK,GAAM,CAAE,QAAO,WAAWT,EAC3B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UAAY,UAAUA,EAAM,KAAK,EAC5E,IAAK,SAAU,OAAO,OAAOA,EAAM,OAAU,SAC7C,IAAK,OAAQ,OAAO,OAAOA,EAAM,OAAU,UAC3C,IAAK,MAAO,OAAO,OAAOA,EAAM,OAAU,SAAW,OAAO,SAASA,EAAM,KAAK,GAAK,OAAO,UAAUA,EAAM,KAAK,EAAI,OAAOA,EAAM,OAAU,UAAYA,EAAM,QAAU,MAAQuC,EAAgBvC,EAAM,KAAK,EAC3M,IAAK,UAAW,OAAO,OAAOA,EAAM,OAAU,SAAW,OAAO,SAASA,EAAM,KAAK,EAAI,OAAOA,EAAM,OAAU,UAAYA,EAAM,QAAU,MAAQA,EAAM,MAAM,cAAgB,cAC/K,IAAK,OAAQ,OAAO,OAAOA,EAAM,OAAU,UAAYwC,EAAkBxC,EAAM,MAAO,EAAK,EAC3F,IAAK,WAAY,OAAO,OAAOA,EAAM,OAAU,UAAYwC,EAAkBxC,EAAM,MAAO,EAAI,EAC9F,QAAS,MAAO,CAAC5B,EAAe,IAAIkE,CAAS,CACjD,CAEJ,MAAO,CAAClE,EAAe,IAAIkE,CAAS,GAAKjC,IAAY,IAAA,EACzD,CAKA,MAAMoC,EAAmB,2KAEzB,SAAS,UAAU,EAAuB,CACtC,OAAOA,EAAiB,KAAKC,CAAI,CACrC"}
|
|
1
|
+
{"version":3,"file":"ResponseValidator.js","names":["bareName","nativePattern","primitiveTypes","context","effectiveCommand","specificationCommandExamples","application","slices","scope","parent","feature","slice","child","module","commands","properties","responseFields","command","entries","resolve","responseCommandResolver","concepts","conceptNames","concept","composites","name","type","readModels","entry","model","commandProperties","property","declared","DiagnosticCodes","production","event","reaction","trigger","source","explicit","response","names","field","action","specification","input","identifiers","fixture","expectation","fields","asserted","contract","use","failed","inputs","result","duplicates","item","items","value","member","primitive","exactIsIntegral","responseDateValue","uuidValuePattern","text"],"sources":["../../../../../../Compiler/Parsing/ResponseValidator.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 { nativePattern } from '../Text/patterns';\nimport { exactIsIntegral } from '../Syntax/ExactMathFacts';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { CommandSyntax } from '../Syntax/Commands';\nimport { ConceptSyntax, PropertySyntax, TypeRefSyntax } from '../Syntax/Declarations';\nimport { ExpressionSyntax } from '../Syntax/Expressions';\nimport { PropertyResponseSourceSyntax, ResponseFieldSyntax } from '../Syntax/Responses';\nimport { SpecificationSyntax } from '../Syntax/Specifications';\nimport { ApplicationSyntax, FeatureSyntax, SliceSyntax } from '../Syntax/Structure';\nimport { InputUse } from './InputUses';\nimport { ParserContext } from './ParserContext';\nimport { responseCommandResolver } from './ResponseCommandResolver';\nimport { responseDateValue } from './ResponseDateValues';\nimport { specificationCommandExamples } from './SpecificationCommandExamples';\n\nconst bareName = nativePattern(/^[A-Za-z_]\\w*$/.source);\nconst primitiveTypes = new Set(['Uuid', 'String', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime']);\ninterface ScopedCommand { command: CommandSyntax; scope: readonly string[] }\n\nexport function validateResponses(application: ApplicationSyntax, context: ParserContext, inputs: readonly InputUse[] = context.inputUses): void {\n const effectiveCommand = specificationCommandExamples(application);\n const slices: { slice: SliceSyntax; scope: readonly string[] }[] = [];\n const collect = (feature: FeatureSyntax, parent: readonly string[]): void => {\n const scope = [...parent, feature.name];\n feature.slices.forEach(slice => slices.push({ slice, scope: [...scope, slice.name] }));\n feature.features.forEach(child => collect(child, scope));\n };\n application.modules.forEach(module => module.features.forEach(feature => collect(feature, [module.name])));\n const commands = new Map<string, ScopedCommand[]>();\n const properties = new Map<CommandSyntax, Map<string, PropertySyntax>>();\n const responseFields = new Map<CommandSyntax, Map<string, ResponseFieldSyntax>>();\n for (const { slice, scope } of slices) {\n for (const command of slice.commands) {\n const entries = commands.get(command.name) ?? [];\n entries.push({ command, scope });\n commands.set(command.name, entries);\n properties.set(command, uniqueByName(command.properties));\n if (command.response?.kind === 'RecordCommandResponseSyntax') responseFields.set(command, uniqueByName(command.response.fields));\n }\n }\n const resolve = responseCommandResolver([...commands.values()].flat(), application.imports);\n const concepts = uniqueByName(application.concepts);\n const conceptNames = new Set(application.concepts.map(concept => concept.name));\n const composites = new Map([...uniqueByName(application.types)].map(([name, type]) => [name, uniqueByName(type.properties)]));\n const readModels = new Set(slices.flatMap(entry => entry.slice.readModels.map(model => model.name)));\n const commandProperties = new Set([...properties.keys()].flatMap(command => [...command.properties]));\n const checkDeclarations = (declared: readonly PropertySyntax[]): void => {\n for (const property of declared) {\n if (property.isGenerated && !commandProperties.has(property)) context.error(DiagnosticCodes.GeneratedPropertyOutsideCommand, 'Generated properties can only be declared on commands.', property.location);\n }\n };\n // Only these typed declarations carry PropertySyntax. Do not pull the complete extensible walker\n // into every browser parser just to inspect their generated flags.\n const checkFeature = (feature: FeatureSyntax): void => {\n feature.features.forEach(checkFeature);\n for (const slice of feature.slices) {\n for (const command of slice.commands) {\n for (const production of command.produces) if (production.inlineEvent !== null) checkDeclarations(production.inlineEvent.properties);\n }\n slice.events.forEach(event => checkDeclarations(event.properties));\n slice.readModels.forEach(model => checkDeclarations(model.properties));\n for (const reaction of slice.reactions) {\n for (const trigger of reaction.triggers) {\n for (const production of trigger.produces) if (production.inlineEvent !== null) checkDeclarations(production.inlineEvent.properties);\n }\n }\n }\n };\n application.types.forEach(type => checkDeclarations(type.properties));\n application.modules.forEach(module => module.features.forEach(checkFeature));\n const validateSource = (source: PropertyResponseSourceSyntax, explicit: TypeRefSyntax | null, command: CommandSyntax): void => {\n const property = properties.get(command)!.get(source.property);\n if (property === undefined) {\n context.error(DiagnosticCodes.InvalidResponseSource, `Response source '${source.property}' must reference one direct command property.`, source.location);\n return;\n }\n const type = property.type;\n if (type.isCollection || readModels.has(type.name)) context.error(DiagnosticCodes.InvalidResponseShape, 'Collection and whole-read-model responses are not supported.', source.location);\n if (explicit !== null && (explicit.name !== type.name || explicit.isCollection !== type.isCollection || explicit.isOptional !== type.isOptional)) context.error(DiagnosticCodes.InvalidResponseShape, \"An explicit response field type must match its source's declared type, collection shape and optionality.\", explicit.location);\n };\n for (const command of properties.keys()) {\n for (const property of command.properties) {\n if (!property.isGenerated) continue;\n const concept = concepts.get(property.type.name);\n if (property.type.isOptional || property.type.isCollection || (concept === undefined ? primitiveTypes.has(property.type.name) || composites.has(property.type.name) || conceptNames.has(property.type.name) || readModels.has(property.type.name) : concept.type !== 'Uuid' && concept.generation == null)) context.error(DiagnosticCodes.InvalidGeneratedType, 'A generated property must be a required, noncollection generatable concept.', property.location);\n }\n const response = command.response;\n if (response?.kind === 'ScalarCommandResponseSyntax') validateSource(response.source, null, command);\n else if (response?.kind === 'RecordCommandResponseSyntax') {\n if (response.fields.length === 0) context.error(DiagnosticCodes.InvalidCommandResponse, 'A response block requires at least one field.', response.location);\n const names = new Set<string>();\n for (const field of response.fields) {\n if (names.has(field.name)) context.error(DiagnosticCodes.DuplicateResponseField, `Duplicate response field '${field.name}'.`, field.location);\n names.add(field.name);\n validateSource(field.source, field.type, command);\n }\n }\n }\n const validateSpecification = (specification: SpecificationSyntax, scope: readonly string[]): void => {\n const action = effectiveCommand(specification.when, scope);\n const command = action === null ? null : resolve(action.commandType, scope);\n if (action !== null && command !== null) {\n const declared = properties.get(command)!;\n for (const input of action.values) {\n if (declared.get(input.property.split('.')[0])?.isGenerated) context.error(DiagnosticCodes.GeneratedPropertySuppliedAsInput, `Generated property '${input.property}' cannot be supplied as request or form input.`, input.location);\n }\n const identifiers = [...declared.values()].filter(property => property.isIdentifier);\n if (action.for !== null && identifiers.length === 1 && identifiers[0].isGenerated) {\n const type = identifiers[0].type;\n const known = primitiveTypes.has(type.name) || concepts.has(type.name) || composites.has(type.name);\n if (known && (type.isOptional || type.isCollection || !['Uuid', 'String'].includes(concepts.get(type.name)?.type ?? '') || !compatibleValue(action.for, type, concepts, composites))) {\n context.error(DiagnosticCodes.InvalidGeneratedFixture, \"A generated identifier fixture must supply one compatible concrete UUID value through 'for'.\", action.for.location);\n }\n }\n const names = new Set<string>();\n for (const fixture of action.generatedValues ?? []) {\n const property = declared.get(fixture.property);\n if (names.has(fixture.property) || property === undefined || !property.isGenerated || property.isIdentifier || !compatibleValue(fixture.source, property.type, concepts, composites)) context.error(DiagnosticCodes.InvalidGeneratedFixture, 'A generated fixture must uniquely supply a compatible value for a nonidentifier generated command property.', fixture.location);\n names.add(fixture.property);\n }\n }\n const expectation = specification.thenReturns;\n if (expectation == null) return;\n if (action === null || specification.thenErrors.length > 0 || specification.thenDenied != null) context.error(DiagnosticCodes.InvalidReturnExpectation, 'A return expectation requires a command action and cannot accompany an error or denial.', expectation.location);\n if (command === null) return;\n const response = command.response;\n const declared = properties.get(command)!;\n if (expectation.kind === 'ScalarSpecificationReturnSyntax' && response?.kind === 'ScalarCommandResponseSyntax' && declared.has(response.source.property)) {\n if (!compatibleValue(expectation.value, declared.get(response.source.property)!.type, concepts, composites)) context.error(DiagnosticCodes.InvalidReturnExpectation, \"The expected return value must match the response source's type.\", expectation.location);\n } else if (expectation.kind === 'RecordSpecificationReturnSyntax' && response?.kind === 'RecordCommandResponseSyntax') {\n if (expectation.fields.length === 0) context.error(DiagnosticCodes.InvalidReturnExpectation, 'A record return expectation requires at least one field.', expectation.location);\n const fields = responseFields.get(command)!;\n const asserted = new Set<string>();\n for (const field of expectation.fields) {\n const contract = fields.get(field.property);\n const property = contract === undefined ? undefined : declared.get(contract.source.property);\n if (asserted.has(field.property) || property === undefined || !compatibleValue(field.source, property.type, concepts, composites)) context.error(DiagnosticCodes.InvalidReturnExpectation, 'A return assertion must uniquely name a response field and supply a compatible concrete value.', field.location);\n asserted.add(field.property);\n }\n } else {\n context.error(DiagnosticCodes.InvalidReturnExpectation, \"The return expectation must match the command's scalar or record response shape.\", expectation.location);\n }\n };\n for (const { slice, scope } of slices) slice.specifications.forEach(specification => validateSpecification(specification, scope));\n const returned = (command: CommandSyntax, name: string): boolean => command.response?.kind === 'ScalarCommandResponseSyntax'\n ? command.response.source.property === name : responseFields.get(command)?.has(name) === true;\n for (const use of context.continuationValues) {\n if (!bareName.test(use.text) || use.locals.includes(use.text)) continue;\n const scopedCommands = (names: readonly string[]): CommandSyntax[] => names.filter(name => !use.parameters.includes(name)).flatMap(name => {\n const command = resolve(name, use.scope);\n return command === null ? [] : [command];\n });\n if (scopedCommands(use.success).some(command => returned(command, use.text))) continue;\n const failed = scopedCommands(use.failure).reverse().find(command => returned(command, use.text));\n if (failed) context.error(DiagnosticCodes.ResponseNameUsedOnFailure, `'${use.text}' is returned by '${failed.name}' only on success`, use.location);\n }\n for (const input of inputs) {\n if (input.isParameter === true) continue;\n const command = resolve(input.command, input.scope);\n if (command !== null && properties.get(command)!.get(input.property.split('.')[0])?.isGenerated) context.error(DiagnosticCodes.GeneratedPropertySuppliedAsInput, `Generated property '${input.property}' cannot be supplied as request or form input.`, input.location);\n }\n}\n\nexport function uniqueByName<T extends { readonly name: string }>(items: readonly T[]): Map<string, T> {\n const result = new Map<string, T>();\n const duplicates = new Set<string>();\n for (const item of items) {\n if (result.has(item.name)) duplicates.add(item.name);\n result.set(item.name, item);\n }\n duplicates.forEach(name => result.delete(name));\n return result;\n}\n\nexport function compatibleValue(value: ExpressionSyntax, type: TypeRefSyntax, concepts: ReadonlyMap<string, ConceptSyntax>, composites: ReadonlyMap<string, ReadonlyMap<string, PropertySyntax>>): boolean {\n if (value.kind === 'LiteralExpressionSyntax' && value.value === null) return type.isOptional;\n if (type.isCollection) return value.kind === 'ListExpressionSyntax' && value.items.every(item => compatibleValue(item, { ...type, isCollection: false, isOptional: false }, concepts, composites));\n const properties = composites.get(type.name);\n if (properties !== undefined) return value.kind === 'ObjectExpressionSyntax' && value.members.every(member => {\n const property = properties.get(member.name);\n return property !== undefined && compatibleValue(member.value, property.type, concepts, composites);\n });\n const concept = concepts.get(type.name);\n const primitive = concept?.type ?? type.name;\n if (concept?.type === 'Enum') return value.kind === 'LiteralExpressionSyntax' && typeof value.value === 'string' && concept.values.includes(value.value);\n if (value.kind === 'LiteralExpressionSyntax') {\n switch (primitive) {\n case 'Uuid': return typeof value.value === 'string' && uuidValue(value.value);\n case 'String': return typeof value.value === 'string';\n case 'Bool': return typeof value.value === 'boolean';\n case 'Int': return typeof value.value === 'number' ? Number.isFinite(value.value) && Number.isInteger(value.value) : typeof value.value === 'object' && value.value !== null && exactIsIntegral(value.value);\n case 'Decimal': return typeof value.value === 'number' ? Number.isFinite(value.value) : typeof value.value === 'object' && value.value !== null && value.value.literalType === 'ExactNumber';\n case 'Date': return typeof value.value === 'string' && responseDateValue(value.value, false);\n case 'DateTime': return typeof value.value === 'string' && responseDateValue(value.value, true);\n default: return !primitiveTypes.has(primitive);\n }\n }\n return !primitiveTypes.has(primitive) && concept === undefined;\n}\n\n// Shared with ResponseValueTypes.cs: 32 hex digits (N), hyphenated UUIDs (D), or D wrapped in\n// braces (B) / parentheses (P). Hex is case-insensitive; whitespace and X initializer notation\n// are not admitted in response/fixture values. The lookahead requires the true end, even after a newline.\nconst uuidValuePattern = /^(?:[0-9a-f]{32}|[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}|\\{[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\\}|\\([0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\\))(?![\\s\\S])/i;\n\nfunction uuidValue(text: string): boolean {\n return uuidValuePattern.test(text);\n}\n"],"mappings":"+bAkBA,MAAMA,EAAWC,EAAc,iBAAuB,EAChDC,kBAAiB,IAAI,IAAI,CAAC,OAAQ,SAAU,MAAO,UAAW,OAAQ,OAAQ,UAAU,CAAC,EAG/F,SAAgB,kBAAkB,EAAgC,EAAwB,EAA8BC,EAAQ,UAAiB,CAC7I,IAAMC,EAAmBC,EAA6BC,CAAW,EAC3DC,EAA6D,CAAC,EAC9D,SAAW,EAAwB,IAAoC,CACzE,IAAMC,EAAQ,CAAC,GAAGC,EAAQC,EAAQ,IAAI,E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AUA,EAAM,KAAK,EAC5E,IAAK,SAAU,OAAO,OAAOA,EAAM,OAAU,SAC7C,IAAK,OAAQ,OAAO,OAAOA,EAAM,OAAU,UAC3C,IAAK,MAAO,OAAO,OAAOA,EAAM,OAAU,SAAW,OAAO,SAASA,EAAM,KAAK,GAAK,OAAO,UAAUA,EAAM,KAAK,EAAI,OAAOA,EAAM,OAAU,UAAYA,EAAM,QAAU,MAAQG,EAAgBH,EAAM,KAAK,EAC3M,IAAK,UAAW,OAAO,OAAOA,EAAM,OAAU,SAAW,OAAO,SAASA,EAAM,KAAK,EAAI,OAAOA,EAAM,OAAU,UAAYA,EAAM,QAAU,MAAQA,EAAM,MAAM,cAAgB,cAC/K,IAAK,OAAQ,OAAO,OAAOA,EAAM,OAAU,UAAYI,EAAkBJ,EAAM,MAAO,EAAK,EAC3F,IAAK,WAAY,OAAO,OAAOA,EAAM,OAAU,UAAYI,EAAkBJ,EAAM,MAAO,EAAI,EAC9F,QAAS,MAAO,CAACzD,EAAe,IAAI2D,CAAS,CACjD,CAEJ,MAAO,CAAC3D,EAAe,IAAI2D,CAAS,GAAKtC,IAAY,IAAA,EACzD,CAKA,MAAMyC,EAAmB,2KAEzB,SAAS,UAAU,EAAuB,CACtC,OAAOA,EAAiB,KAAKC,CAAI,CACrC"}
|
|
@@ -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,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};
|
|
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,continuationValues:I.continuationValues,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","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,QAAQ,CAACV,CAAK,EAAGO,EAAWD,CAAS,EAC5G,IAAIK,EAAQC,EAAiBR,EAASJ,EAAOO,CAAS,EAEtD,GAAIM,EAA2B,CAC3BC,EAAiBH,EAAOP,CAAO,EAC/BW,EAAiBJ,EAAOP,CAAO,EAC/BY,EAAqBL,EAAOP,CAAO,EACnCa,EAA6BN,EAAOP,CAAO,EAC3Cc,EAAmBP,EAAOP,CAAO,EACjCe,EAAyBR,EAAOP,CAAO,EACvCgB,EAA2BT,EAAOP,CAAO,EACzCiB,EAAkCV,EAAOP,EAAS,EAAI,EACtD,IAAMkB,EAAYC,EAA4BZ,CAAK,EACnDa,EAAkBF,EAAWlB,CAAO,EACpCqB,EAAqBd,EAAOP,CAAO,EACnCsB,EAA0Bf,EAAOP,CAAO,EACxCuB,EAA6BL,EAAWlB,CAAO,EAC/CwB,EAAsBjB,EAAOP,CAAO,EACpCyB,EAAsBlB,EAAOP,CAAO,EACpC0B,EAAyBnB,EAAOP,CAAO,EACvC2B,EAAgCpB,EAAOP,CAAO,EAC9C4B,EAAuBrB,EAAOP,CAAO,EACrC6B,EAAuBtB,EAAOP,CAAO,EACrC,EAAQ8B,EAA+BvB,EAAOP,CAAO,EACrD+B,EAAqB,SAASxB,EAAOP,CAAO,EAC5C,IAAK,IAAMgC,KAAcC,EAAiC1B,CAAK,EAAGP,EAAQ,YAAYgC,EAAW,KAAMA,EAAW,QAASA,EAAW,QAAQ,EAC9I,IAAK,IAAMA,KAAcE,EAAyB3B,CAAK,EAAGP,EAAQ,YAAYgC,EAAW,KAAMA,EAAW,QAASA,EAAW,QAAQ,CAC1I,CACA,MAAO,CACH,QACA,YAAahC,EAAQ,YACrB,YAAaA,EAAQ,YACrB,UAAWA,EAAQ,UACnB,oBAAqBA,EAAQ,oBAC7B,QAAS,CAACA,EAAQ,YAAY,KAAK,GAAcgC,EAAW,WAAa,OAAO,CACpF,CACJ"}
|
|
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 { ContinuationValueUse } from './Parsing/ContinuationValueUse';\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 continuationValues: readonly ContinuationValueUse[]; 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 continuationValues: context.continuationValues,\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":"44EAsEA,SAAgB,kBAAkB,EAAgB,EAAe,EAA2BA,EAAmB,EAA4B,GAAM,EAA4C,EAAwS,CACje,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,QAAQ,CAACV,CAAK,EAAGO,EAAWD,CAAS,EAC5G,IAAIK,EAAQC,EAAiBR,EAASJ,EAAOO,CAAS,EAEtD,GAAIM,EAA2B,CAC3BC,EAAiBH,EAAOP,CAAO,EAC/BW,EAAiBJ,EAAOP,CAAO,EAC/BY,EAAqBL,EAAOP,CAAO,EACnCa,EAA6BN,EAAOP,CAAO,EAC3Cc,EAAmBP,EAAOP,CAAO,EACjCe,EAAyBR,EAAOP,CAAO,EACvCgB,EAA2BT,EAAOP,CAAO,EACzCiB,EAAkCV,EAAOP,EAAS,EAAI,EACtD,IAAMkB,EAAYC,EAA4BZ,CAAK,EACnDa,EAAkBF,EAAWlB,CAAO,EACpCqB,EAAqBd,EAAOP,CAAO,EACnCsB,EAA0Bf,EAAOP,CAAO,EACxCuB,EAA6BL,EAAWlB,CAAO,EAC/CwB,EAAsBjB,EAAOP,CAAO,EACpCyB,EAAsBlB,EAAOP,CAAO,EACpC0B,EAAyBnB,EAAOP,CAAO,EACvC2B,EAAgCpB,EAAOP,CAAO,EAC9C4B,EAAuBrB,EAAOP,CAAO,EACrC6B,EAAuBtB,EAAOP,CAAO,EACrC,EAAQ8B,EAA+BvB,EAAOP,CAAO,EACrD+B,EAAqB,SAASxB,EAAOP,CAAO,EAC5C,IAAK,IAAMgC,KAAcC,EAAiC1B,CAAK,EAAGP,EAAQ,YAAYgC,EAAW,KAAMA,EAAW,QAASA,EAAW,QAAQ,EAC9I,IAAK,IAAMA,KAAcE,EAAyB3B,CAAK,EAAGP,EAAQ,YAAYgC,EAAW,KAAMA,EAAW,QAASA,EAAW,QAAQ,CAC1I,CACA,MAAO,CACH,QACA,YAAahC,EAAQ,YACrB,YAAaA,EAAQ,YACrB,UAAWA,EAAQ,UACnB,mBAAoBA,EAAQ,mBAC5B,oBAAqBA,EAAQ,oBAC7B,QAAS,CAACA,EAAQ,YAAY,KAAK,GAAcgC,EAAW,WAAa,OAAO,CACpF,CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DiagnosticCodes as e}from"./Diagnostics/DiagnosticCodes.js";import{unescapeString as t}from"./Text/StringLiteral.js";import"./Text/patterns.js";import{sourceLocation as
|
|
1
|
+
import{DiagnosticCodes as e}from"./Diagnostics/DiagnosticCodes.js";import{unescapeString as t}from"./Text/StringLiteral.js";import{pattern as n}from"./Text/patterns.js";import{sourceLocation as r}from"./Diagnostics/SourceLocation.js";import{eventDeclarations as i}from"./Syntax/EventDeclarations.js";import{operationDeclarations as a}from"./Syntax/Operations.js";import{AuthoringProductionResolver as o}from"./Syntax/AuthoringProductionResolver.js";import{dependencySourcesOf as s}from"./Syntax/DependencySources.js";import{ScreenplaySyntaxWalker as c}from"./Syntax/ScreenplaySyntaxWalker.js";import{isExactNumberToken as l,parseExactNumber as u}from"./Syntax/ExactNumber.js";import{EventSourceCatalog as d}from"./Syntax/EventSourceCatalog.js";import{implicitDestination as f,requiresExplicitDestinations as p}from"./Syntax/ProductionDestinations.js";import{InvalidExactNumber as m,canonicalExactText as h,exactIsIntegral as g}from"./Syntax/ExactMathFacts.js";import{responseCommandResolver as _}from"./Parsing/ResponseCommandResolver.js";import{synthesizePersonaCaller as v}from"./Syntax/PersonaCallers.js";import"./Syntax/SpecificationCaseOrigin.js";import"./Parsing/SpecificationCommandExamples.js";import{DeclaredDependencyTargets as y}from"./Dependencies/DeclaredDependencyTargets.js";import{describePlacement as b,documentPlacement as x,isDocumentPlacement as S}from"./Files/PlayPlacement.js";import"./Syntax/InvalidSyntaxJson.js";import"./Syntax/SourceOptions.js";import{isSourceStreamName as C,isSourceStreamTypeName as w,sourceStreamPattern as T}from"./Text/SourceStreamNames.js";import{sliceTypes as E}from"./Syntax/Structure.js";import{consumedEvents as D,eventsSourceKind as O,fromSetting as k,isEventsSource as A}from"./Syntax/CaptureEventsSource.js";import{eventBodyReservedWords as j}from"./Text/ReservedWords.js";import"./Files/AuthoredOrder.js";import{dependencyKinds as M}from"./Dependencies/DependencyKind.js";import{InvalidDependencyQuery as N}from"./Dependencies/InvalidDependencyQuery.js";import{SliceReferenceCollector as P,buildingReadModelReferences as F,referenceClassifications as I,sliceReferences as L}from"./Dependencies/SliceReferences.js";import{stronglyConnectedGroups as R}from"./Dependencies/StronglyConnectedGroups.js";import{DependencyGraph as z}from"./Dependencies/DependencyGraph.js";import{streamIdFailureMessage as B,tryFormatInteger as V,tryFormatText as H,tryFormatUuidText as U}from"./Syntax/StreamIdFormatter.js";import{parseForAuthoring as W}from"./ScreenplayCompiler.js";import{applyQuickFixEdits as G,isQuickFixDiagnostic as K,legacyOptionalTypeLength as q,prepareQuickFixes as J}from"./Authoring/QuickFixes.js";import"./Dependencies/index.js";import{EventSourceReadConfidence as Y}from"./Syntax/EventSourceReadConfidence.js";import"./Syntax/SyntaxJson.js";import"./Syntax/index.js";import"./Files/OrderingRoot.js";import{mergeDocuments as X}from"./Files/PlayFolderMerge.js";import"./Files/PlayImports.js";import{parsePlacedDocuments as Z}from"./Files/PlayApplicationAssembly.js";export{o as AuthoringProductionResolver,y as DeclaredDependencyTargets,z as DependencyGraph,e as DiagnosticCodes,d as EventSourceCatalog,Y as EventSourceReadConfidence,N as InvalidDependencyQuery,m as InvalidExactNumber,c as ScreenplaySyntaxWalker,P as SliceReferenceCollector,G as applyQuickFixEdits,F as buildingReadModelReferences,h as canonicalExactText,D as consumedEvents,M as dependencyKinds,s as dependencySourcesOf,b as describePlacement,x as documentPlacement,j as eventBodyReservedWords,i as eventDeclarations,O as eventsSourceKind,g as exactIsIntegral,k as fromSetting,f as implicitDestination,S as isDocumentPlacement,A as isEventsSource,l as isExactNumberToken,K as isQuickFixDiagnostic,C as isSourceStreamName,w as isSourceStreamTypeName,q as legacyOptionalTypeLength,X as mergeDocuments,a as operationDeclarations,u as parseExactNumber,W as parseForAuthoring,Z as parsePlacedDocuments,n as pattern,J as prepareQuickFixes,I as referenceClassifications,p as requiresExplicitDestinations,_ as responseCommandResolver,L as sliceReferences,E as sliceTypes,r as sourceLocation,T as sourceStreamPattern,B as streamIdFailureMessage,R as stronglyConnectedGroups,v as synthesizePersonaCaller,V as tryFormatInteger,H as tryFormatText,U as tryFormatUuidText,t as unescapeString};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import"./_virtual/_virtual/_rolldown/runtime.js";import{enclosingChain as e,enclosingHeaders as t,fenceMap as n,indentOf as r,nearestEnclosingLine as i,withoutComment as a}from"./document-context.js";import{purposeItems as o}from"./purpose-items.js";import{authenticationItems as s,behaviorItems as c,contributeItems as l,featureScopeItems as u,formItems as d,layoutItems as f,moduleScopeItems as p,outcomeItems as m,personaItems as h,readModelItems as g,reducerItems as _,seedItems as v,templateItems as y,themeItems as b,uiProfileItems as x}from"./scope-items.js";import{actionArgumentItems as
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{enclosingChain as e,enclosingHeaders as t,fenceMap as n,indentOf as r,nearestEnclosingLine as i,withoutComment as a}from"./document-context.js";import{purposeItems as o}from"./purpose-items.js";import{authenticationItems as s,behaviorItems as c,contributeItems as l,featureScopeItems as u,formItems as d,layoutItems as f,moduleScopeItems as p,outcomeItems as m,personaItems as h,readModelItems as g,reducerItems as _,seedItems as v,templateItems as y,themeItems as b,uiProfileItems as x}from"./scope-items.js";import{actionArgumentItems as S,actionItems as C,commandItems as w,commandRuleItems as ee,conceptItems as T,constraintItems as E,eventItems as D,guardedActionItems as O,handlerItems as k,identityItems as A,implementationItems as j,inlineEventItems as M,interactionActionItems as N,interactionChoiceItems as te,invocationItems as P,namedRuleImplementationItems as F,operationImplementationItems as I,operationItems as L,operationPhaseItems as R,optionalTypeItems as z,performerItems as B,policyItems as V,producesItems as H,queryItems as U,reactionItems as W,reactionTriggerItems as G,refusalItems as K,ruleItems as q,screenItems as J,sliceItemsFor as Y,specificationItems as X,specificationStepItems as Z,tableItems as ne,topLevelItems as re,triggerItems as ie,typeItems as ae,validateItems as oe}from"./completion-items.js";import{scanDocument as Q}from"./symbols.js";import{responseCompletions as se}from"./response-completions.js";import{exampleCompletions as ce}from"./example-authoring.js";import{refusalContext as le}from"./refusal-context.js";import{generationCompletions as ue}from"./generation-completions.js";import{namedRuleContext as de}from"./named-rule-context.js";import{continuationResponseCompletions as fe}from"./continuation-responses.js";import{dependencyTargetCompletions as pe}from"./dependency-completions.js";import{structureCompletion as me}from"./structure-completions.js";import{getSubLanguage as he}from"./sub-language-registry.js";import{readModelKeyCompletions as ge}from"./read-model-key-completions.js";const $={label:`stream`,insertText:"stream ${1:Source.Stream}",documentation:`Replace the whole command route for this event production. ESM v10.`},_e=/(?:^|\s)rule\s+[A-Za-z_]\w*(?:\s+severity\s+(?:information|warning|error))?(?:\s+message\s+.*)?$/,declaredIn=(e,t)=>e.some(e=>RegExp(`^${t}\\b`).test(e));function topLevelEntries(e){return re.filter(t=>!(t.label===`domain`&&declaredIn(e,`domain`))&&!(t.label===`authentication`&&declaredIn(e,`authentication`))&&!(t.label===`identity`&&declaredIn(e,`identity`)))}const isTemplate=e=>/^(?:screen|dialog)\s+template\b/.test(e??``);function expansionEntry(e,t){let n=e.split(`
|
|
2
2
|
`).map((e,n)=>n===0?e:e.slice(Math.min(t,r(e)))).join(`
|
|
3
3
|
`);return{label:e.split(`
|
|
4
|
-
`)[0].trim(),insertText:n.replace(/[$}\\]/g,`\\$&`),documentation:`Expands the whole block from what the command and its events declare.`}}function completionEntriesFor(e,t={headers:[],document:[]}){let n=e[0];if(n===void 0||n===`domain`)return topLevelEntries(t.document);let r=
|
|
4
|
+
`)[0].trim(),insertText:n.replace(/[$}\\]/g,`\\$&`),documentation:`Expands the whole block from what the command and its events declare.`}}function completionEntriesFor(e,t={headers:[],document:[]}){let n=e[0];if(n===void 0||n===`domain`)return topLevelEntries(t.document);let r=he(n);if(r)return r.completions??[];let i=t.headers[0];switch(n){case`purpose`:return o;case`module`:return p;case`feature`:return u;case`slice`:return Y(i?.split(/\s+/)[1]);case`concept`:return/:\s*Enum\b/.test(i??``)?[...T,{label:`enum member (numbered)`,insertText:"${1:value} = ${2:0}",documentation:`Every member must declare a unique int32 number. Keep published numbers unchanged; specifications name members, not numbers.`}]:T;case`type`:return ae;case`command`:return w;case`public`:case`event`:return D;case`readmodel`:return g;case`reducer`:return _;case`form`:return d;case`contribute`:return l;case`behavior`:return c;case`persona`:return h;case`identity`:return A;case`authentication`:return s;case`seed`:return v;case`theme`:return b;case`ui`:return x;case`on`:case`success`:case`failure`:case`confirm`:return m;case`layout`:return f;case`system`:return L.filter(e=>e.label===`description`);case`operation`:return L;case`execute`:case`compensate`:return R;case`produces`:return e.includes(`command`)?[...H,$]:H;case`handler`:return k;case`implementation`:return e[1]===`handler`?j:[`execute`,`compensate`].includes(e[1])?I:[];case`reads`:return[{label:`by parts`,insertText:"by\n ${1:part} = ${2:source}\n ${3:part} = ${4:source}",documentation:`Supply every composite read-model key part by name.`}];case`query`:return U;case`performer`:return B;case`constraint`:return E;case`reaction`:return W;case`invokes`:return e.includes(`reaction`)?P:[];case`trigger`:return ie;case`when`:case`every`:case`at`:return e.includes(`reaction`)?G:[];case`specification`:return X;case`policy`:return V;case`validate`:return oe;case`action`:return C;case`table`:case`summary`:return ne;case`screen`:return isTemplate(i)?y:J;case`dialog`:return y;default:return isTemplate(t.headers.find(e=>isTemplate(e)))?y:e.includes(`screen`)||n===`section`?J:e.includes(`produces`)?e.includes(`command`)?[...H,$]:H:[]}}function planCompletions(o,s,c,l=Q(o)){let u=n(o);if(u[s]||a(c).length<c.length)return{kind:`none`};if(/^\s*concept\s+[\p{L}\p{Mn}\p{Nd}\p{Pc}]+\s*:\s*\w+\s+(?:(?:pii|personal|secret)\s+)*\w*$/u.test(c))return{kind:`entries`,entries:[`pii`,`secret`].filter(e=>!RegExp(`\\b${e}\\b`).test(c)).map(e=>({label:e,insertText:e,documentation:e===`pii`?`personal data (GDPR Art. 4(1)); renders Chronicle [PII]`:`Operational secret; renders [Encrypted] + [NotAudited].`}))};let d=e(o,u,s,r(c))[0]===`concept`,f=d?ue(o,s,c):null;if(f!==null)return{kind:`entries`,entries:f};if(d&&/^\s*(?:secret|sensitive|@sensitive)\s+scope\s+\w*$/.test(c))return{kind:`entries`,entries:[`subject`,`namespace`,`global`].map(e=>({label:e,insertText:e,documentation:`Explicit secret encryption scope.`}))};if(d&&/^\s*(?:pii|personal|@pii)\s+special\s+\w*$/.test(c))return{kind:`entries`,entries:[`racialOrEthnicOrigin`,`politicalOpinions`,`religiousOrPhilosophicalBeliefs`,`tradeUnionMembership`,`genetic`,`biometric`,`health`,`sexLifeOrSexualOrientation`].map(e=>({label:e,insertText:e,documentation:`GDPR Art. 9(1) special category.`}))};let p=fe(o,s,c,l);if(p!==null)return{kind:`entries`,entries:p};let m=ce(o,s,c)??se(o,s,c,Q(o));if(m!==null)return{kind:`entries`,entries:m};let h=ge(o,s,c,l);if(h!==null)return{kind:`entries`,entries:h};let g=pe(o,s,c,l);if(g!==null)return{kind:`entries`,entries:g};let _=c.match(/^\s*import\s+"([^"]*)$/);if(_)return{kind:`playFiles`,replaceLength:_[1].length};if(/["/]$/.test(c))return{kind:`none`};let v=le(o,s,r(o[s]??c));if(/\$refusal\.\w*$/.test(c))return{kind:`entries`,entries:v===void 0?[]:[`reason`,`message`,.../^on\s+refused\s+by\s+constraint(?:\s|$)/.test(v)?[`constraint`]:[]].map(e=>({label:e,insertText:e,documentation:`String refusal value; syntax-only, not yet executable (PLAY0268).`}))};let y=c.match(/\$[\w.]*$/);if(y)return{kind:`contextVariables`,replaceLength:y[0].length};let b=o[s]??``,x=c.trim().length===0?c.length:r(b),C=e(o,u,s,x);if(C.includes(`screen`)){let e=x,t=!1;for(let n=s-1;n>=0;n--){if(u[n])continue;let i=a(o[n]);if(!(i.trim().length===0||r(i)>=e)){if(e=r(i),/^\s*action\s+(?:"|\$strings\.)/.test(i)){t=!0;break}if(/^\s*screen\b/.test(i))break}}if(t){if(/^\s*(?:when\b.*|otherwise)\s+execute\s+[\w.]*$/.test(c))return{kind:`commands`};if(C[0]===`action`)return{kind:`entries`,entries:O};if([`when`,`otherwise`].includes(C[0])){let e=i(o,u,s,x)??``;return{kind:`entries`,entries:/\bexecute\s+[\w.]+$/.test(e)?S:[]}}}}if([`on`,`when`,`otherwise`].includes(C[0])){let e=x;for(let t=s-1;t>=0;t--){if(u[t])continue;let n=a(o[t]);if(!(n.trim().length===0||r(n)>=e)){if(e=r(n),/^\s*on\s+(?:click|double click|select)\s*$/.test(n))return{kind:`entries`,entries:C[0]===`on`?te:N};if(/^\s*(?:screen|behavior|specification|reaction)\b/.test(n))break}}}if(C[0]===`on`&&v!==void 0)return{kind:`entries`,entries:K};let w=de(o,s,x);if(w===`implementation`)return{kind:`entries`,entries:F};if(w===`rule`)return{kind:`entries`,entries:ee};let T=[`public`,`event`,`command`,`type`,`readmodel`,`trigger`,`when`,`every`,`at`].includes(C[0])||C[0]===`produces`&&/^produces\s+event\b/.test(i(o,u,s,x)??``),E=c.trimStart().split(/\s+/)[0],D=C[0]===`command`&&[`reads`,`authorize`,`produces`].includes(E)||C[0]===`event`&&E===`tag`||[`trigger`,`when`,`every`,`at`].includes(C[0])&&[`description`,`file`,`reads`,`produces`,`invokes`].includes(E),optionalPrefix=e=>e!==null&&`optional`.startsWith(e[1]),k=T&&!D&&optionalPrefix(c.match(/^\s*@?[a-z_]\w*\s+[\w.]+(?:\[\])?\s+(\w*)$/)),A=C[0]===`query`&&optionalPrefix(c.match(/^\s*(?:by|filter)\s+[a-z_]\w*\s+[\w.]+(?:\[\])?\s+(\w*)$/))||optionalPrefix(c.match(/^\s*query\s+[A-Za-z_]\w*\s*=>\s*(?:observable\s+)?[\w.]+(?:\[\])?\s+(\w*)$/)),j=(C[0]===`event`||C[0]===`produces`&&/^produces\s+event\b/.test(i(o,u,s,x)??``))&&!D?c.match(/^\s*@?[a-z_]\w*\s+([\w.]+)\s+(\w*)$/):null,P=l.concepts.find(e=>e.name===j?.[1]),I=P?.primitive??j?.[1],R=(I===`String`||I===`Uuid`||I===`Int`&&P!==void 0)&&!P?.attributes.some(e=>[`pii`,`personal`,`secret`,`sensitive`].includes(e.replace(/^@/,``))),B=j!==null&&R&&`subject`.startsWith(j[2]),V=C[0]===`readmodel`?c.match(/^\s*@?[a-z_]\w*\s+[\w.]+\s+(\w*)$/):null,H=[...V&&`key`.startsWith(V[1])?[{label:`key`,insertText:`key`,documentation:`Declares a required read-model key part. Explicit keys replace inference. Composite keys are authoring-only (#599).`}]:[],...(k||A)&&!/=>\s*observable\s+$/.test(c)?z:[],...B?[{label:`subject`,insertText:`subject`,documentation:`One required scalar event data-subject identity; not pii or secret. Report-only lineage metadata (PLAY0270), no ESM or provider output yet.`}]:[]];if(H.length>0)return{kind:`entries`,entries:H};if(/\bauthorize\s+[\w\s]*$/.test(c)||C[0]===`authorize`)return{kind:`policies`};if(/\bwhen\s+\w*$/.test(c)&&C.includes(`reaction`))return{kind:`triggers`};if(/\bon\s+\w*$/.test(c)&&C.includes(`constraint`))return{kind:`events`};if(/\binvokes\s+\w*$/.test(c)&&C.includes(`reaction`))return{kind:`commands`};if(/\b(?:on|unique\s+event)\s+\w*$/.test(c)&&C[0]===`constraint`)return{kind:`events`};if(/\bproduces\s+\w*$/.test(c))return{kind:`producesTargets`};if(/\bnavigate\s+to\s+\w*$/.test(c))return{kind:`screens`};if(C[0]===`specification`){if(/^\s*when\s+query\s+[\w.]*$/.test(c))return{kind:`queries`};let e=c.match(/^\s*(given|when|then)\s+\w*$/);if(e)return{kind:`entries`,entries:Z[e[1]]}}if(/\b(?:via|then)\s+query\s+[\w.]*$/.test(c))return{kind:`queries`};if((C[0]===`event`||C[0]===`command`||C[0]===`type`)&&/^\s+[a-z_]\w*\s+[\w[\]?]*$/.test(c)||C[0]===`query`&&/^\s+(?:by|filter)\s+[a-z_]\w*\s+[\w[\]?]*$/.test(c))return{kind:`types`};let U=i(o,u,s,x);if(U&&/^produces\s+operation\b/.test(U))return{kind:`entries`,entries:L};if(U&&/^produces\s+event\b/.test(U))return/^\s+@?[a-z_]\w*\s+[\w[\]?]*$/.test(c)?{kind:`types`}:{kind:`entries`,entries:C.includes(`command`)?[...M,$]:M};if(U&&_e.test(U))return{kind:`entries`,entries:q};let W=t(o,u,s,x);if(C[0]===`for`&&C.includes(`seed`))return{kind:`events`};let G=completionEntriesFor(C,{headers:W,document:o}),J=C[0]===`command`?me(o,s,` `.repeat(x),``,l):null;return{kind:`entries`,entries:J?[expansionEntry(J.text,x),...G]:G}}export{completionEntriesFor,planCompletions};
|
|
5
5
|
//# sourceMappingURL=completion-planner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completion-planner.js","names":["items.moduleItems","items.featureItems","items.sliceItemsFor","items.conceptItems","items.typeItems","items.commandItems","items.eventItems","scope.readModelItems","scope.reducerItems","scope.formItems","scope.contributeItems","scope.behaviorItems","scope.personaItems","items.identityItems","scope.authenticationItems","scope.seedItems","scope.themeItems","scope.uiProfileItems","scope.outcomeItems","scope.layoutItems","items.operationItems","items.operationPhaseItems","items.producesItems","items.handlerItems","items.implementationItems","items.operationImplementationItems","items.queryItems","items.performerItems","items.constraintItems","items.reactionItems","items.invocationItems","items.triggerItems","items.reactionTriggerItems","items.specificationItems","items.policyItems","items.validateItems","items.actionItems","items.tableItems","scope.templateItems","items.screenItems","items.guardedActionItems","items.actionArgumentItems","items.interactionChoiceItems","items.interactionActionItems","items.refusalItems","items.namedRuleImplementationItems","items.commandRuleItems","items.optionalTypeItems","items.specificationStepItems","items.inlineEventItems","items.ruleItems","productionRouteItem","RULE_LINE_PATTERN","document","keyword","line","topLevelItems","item","header","relative","text","index","indent","indentOf","construct","chain","where","subLanguage","getSubLanguage","purposeItems","moduleScopeItems","featureScopeItems","sliceItemsFor","conceptItems","typeItems","commandItems","eventItems","readModelItems","reducerItems","formItems","contributeItems","behaviorItems","personaItems","identityItems","authenticationItems","seedItems","themeItems","uiProfileItems","outcomeItems","layoutItems","operationItems","operationPhaseItems","producesItems","handlerItems","implementationItems","operationImplementationItems","queryItems","performerItems","constraintItems","reactionItems","invocationItems","triggerItems","reactionTriggerItems","specificationItems","policyItems","validateItems","actionItems","tableItems","templateItems","screenItems","candidate","scanDocument","lines","fences","fenceMap","lineIndex","withoutComment","textBefore","marker","inConcept","enclosingChain","generationEntries","generationCompletions","scope","category","responseEntries","exampleCompletions","responseCompletions","keyEntries","readModelKeyCompletions","symbols","dependencyEntries","dependencyTargetCompletions","importPath","refusal","refusalContext","member","contextVariableMatch","currentLine","effectiveIndent","parentIndent","guarded","parent","guardedActionItems","nearestEnclosingLine","actionArgumentItems","interactionChoiceItems","interactionActionItems","refusalItems","ruleContext","namedRuleContext","namedRuleImplementationItems","commandRuleItems","propertyOwner","propertyName","reservedProperty","match","afterPropertyType","afterQueryType","subjectModifier","subjectConcept","concept","subjectType","subjectTarget","attribute","afterSubjectType","keyModifier","modifierEntries","optionalTypeItems","step","specificationStepItems","enclosingLine","inlineEventItems","ruleItems","headers","enclosingHeaders","entries","expansion","structureCompletion"],"sources":["../../completion-planner.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 { enclosingChain, enclosingHeaders, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { refusalContext } from './refusal-context';\nimport { generationCompletions } from './generation-completions';\nimport { namedRuleContext } from './named-rule-context';\nimport { responseCompletions } from './response-completions';\nimport { dependencyTargetCompletions } from './dependency-completions';\nimport { exampleCompletions } from './example-authoring';\nimport { DocumentSymbols, scanDocument } from './symbols';\nimport { structureCompletion } from './structure-completions';\nimport { getSubLanguage } from './sub-language-registry';\nimport * as items from './completion-items';\nimport * as scope from './scope-items';\nimport { CompletionEntry } from './completion-items';\nimport { purposeItems } from './purpose-items';\nimport { readModelKeyCompletions } from './read-model-key-completions';\n\n// Matches a validation rule line ending in \"rule <Name>\" (optionally followed by a\n// message clause) - both the command form (\"<property> rule <Name>\") and the\n// concept implied-subject form (\"rule <Name>\"). Its first word is the property\n// name, not \"rule\", so it can't be recognized through the chain[0] keyword switch\n// the way \"on <EventType>\" or \"handler\" are - hence the dedicated regex check.\nconst productionRouteItem = { label: 'stream', insertText: 'stream ${1:Source.Stream}', documentation: 'Replace the whole command route for this event production. ESM v10.' };\n\nconst RULE_LINE_PATTERN = /(?:^|\\s)rule\\s+[A-Za-z_]\\w*(?:\\s+severity\\s+(?:information|warning|error))?(?:\\s+message\\s+.*)?$/;\n\nexport type CompletionPlan =\n | { kind: 'none' }\n | { kind: 'entries'; entries: CompletionEntry[] }\n | { kind: 'contextVariables'; replaceLength: number }\n | { kind: 'playFiles'; replaceLength: number }\n | { kind: 'policies' }\n | { kind: 'events' }\n | { kind: 'triggers' }\n | { kind: 'commands' }\n | { kind: 'producesTargets' }\n | { kind: 'screens' }\n | { kind: 'queries' }\n | { kind: 'types' };\n\n// What the position sits inside, beyond the keyword chain: the whole header of each enclosing block, so a\n// slice's type and a template's kind are known, and the document's own lines, so a declaration that may\n// appear once is not offered again.\nexport interface CompletionScope {\n headers: readonly string[];\n document: readonly string[];\n}\n\nconst declaredIn = (document: readonly string[], keyword: string) => document.some(line => new RegExp(`^${keyword}\\\\b`).test(line));\n\nfunction topLevelEntries(document: readonly string[]): CompletionEntry[] {\n return items.topLevelItems.filter(item => !(item.label === 'domain' && declaredIn(document, 'domain')) && !(item.label === 'authentication' && declaredIn(document, 'authentication')) && !(item.label === 'identity' && declaredIn(document, 'identity')));\n}\n\nconst isTemplate = (header: string | undefined) => /^(?:screen|dialog)\\s+template\\b/.test(header ?? '');\n\n// A whole block as one completion entry. Continuation lines are indented relative to the line it is inserted on,\n// which is how the editors indent a multi-line snippet.\nfunction expansionEntry(text: string, indent: number): CompletionEntry {\n const relative = text.split('\\n').map((line, index) => (index === 0 ? line : line.slice(Math.min(indent, indentOf(line))))).join('\\n');\n const label = text.split('\\n')[0].trim();\n return { label, insertText: relative.replace(/[$}\\\\]/g, '\\\\$&'), documentation: 'Expands the whole block from what the command and its events declare.' };\n}\n\nexport function completionEntriesFor(chain: string[], where: CompletionScope = { headers: [], document: [] }): CompletionEntry[] {\n const construct = chain[0];\n if (construct === undefined || construct === 'domain') return topLevelEntries(where.document);\n const subLanguage = getSubLanguage(construct);\n if (subLanguage) return subLanguage.completions ?? [];\n const header = where.headers[0];\n switch (construct) {\n case 'purpose':\n return purposeItems;\n case 'module':\n return items.moduleItems;\n case 'feature':\n return items.featureItems;\n case 'slice':\n return items.sliceItemsFor(header?.split(/\\s+/)[1]);\n case 'concept':\n return /:\\s*Enum\\b/.test(header ?? '') ? [...items.conceptItems, { label: 'enum member (numbered)', insertText: '${1:value} = ${2:0}', documentation: 'Every member must declare a unique int32 number. Keep published numbers unchanged; specifications name members, not numbers.' }] : items.conceptItems;\n case 'type':\n return items.typeItems;\n case 'command':\n return items.commandItems;\n case 'public':\n case 'event':\n return items.eventItems;\n case 'readmodel':\n return scope.readModelItems;\n case 'reducer':\n return scope.reducerItems;\n case 'form':\n return scope.formItems;\n case 'contribute':\n return scope.contributeItems;\n case 'behavior':\n return scope.behaviorItems;\n case 'persona':\n return scope.personaItems;\n case 'identity':\n return items.identityItems;\n case 'authentication':\n return scope.authenticationItems;\n case 'seed':\n return scope.seedItems;\n case 'theme':\n return scope.themeItems;\n case 'ui':\n return scope.uiProfileItems;\n case 'on':\n case 'success':\n case 'failure':\n case 'confirm':\n return scope.outcomeItems;\n case 'layout':\n return scope.layoutItems;\n case 'system':\n return items.operationItems.filter(item => item.label === 'description');\n case 'operation':\n return items.operationItems;\n case 'execute':\n case 'compensate':\n return items.operationPhaseItems;\n case 'produces':\n return chain.includes('command') ? [...items.producesItems, productionRouteItem] : items.producesItems;\n case 'handler':\n return items.handlerItems;\n case 'implementation':\n return chain[1] === 'handler' ? items.implementationItems : ['execute', 'compensate'].includes(chain[1]) ? items.operationImplementationItems : [];\n case 'reads':\n return [{ label: 'by parts', insertText: 'by\\n ${1:part} = ${2:source}\\n ${3:part} = ${4:source}', documentation: 'Supply every composite read-model key part by name.' }];\n case 'query':\n return items.queryItems;\n case 'performer':\n return items.performerItems;\n case 'constraint':\n return items.constraintItems;\n case 'reaction':\n return items.reactionItems;\n case 'invokes':\n return chain.includes('reaction') ? items.invocationItems : [];\n case 'trigger':\n return items.triggerItems;\n case 'when':\n case 'every':\n case 'at':\n return chain.includes('reaction') ? items.reactionTriggerItems : [];\n case 'specification':\n return items.specificationItems;\n case 'policy':\n return items.policyItems;\n case 'validate':\n return items.validateItems;\n case 'action':\n return items.actionItems;\n case 'table':\n case 'summary':\n return items.tableItems;\n case 'screen':\n return isTemplate(header) ? scope.templateItems : items.screenItems;\n case 'dialog':\n return scope.templateItems;\n default:\n if (isTemplate(where.headers.find(candidate => isTemplate(candidate)))) return scope.templateItems;\n // Sections inside a screen expose the screen vocabulary.\n if (chain.includes('screen') || construct === 'section') return items.screenItems;\n if (chain.includes('produces')) return chain.includes('command') ? [...items.producesItems, productionRouteItem] : items.producesItems;\n return [];\n }\n}\n\n// Decides what to complete at a position, without any editor dependency — the\n// Monaco service and the VSCode extension both materialize the plan into items.\nexport function planCompletions(\n lines: string[],\n lineIndex: number,\n textBefore: string,\n symbols: DocumentSymbols = scanDocument(lines),\n): CompletionPlan {\n const fences = fenceMap(lines);\n if (fences[lineIndex] || withoutComment(textBefore).length < textBefore.length) return { kind: 'none' };\n if (/^\\s*concept\\s+[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}]+\\s*:\\s*\\w+\\s+(?:(?:pii|personal|secret)\\s+)*\\w*$/u.test(textBefore)) {\n return { kind: 'entries', entries: ['pii', 'secret'].filter(marker => !new RegExp(`\\\\b${marker}\\\\b`).test(textBefore)).map(marker => ({ label: marker, insertText: marker, documentation: marker === 'pii' ? 'personal data (GDPR Art. 4(1)); renders Chronicle [PII]' : 'Operational secret; renders [Encrypted] + [NotAudited].' })) };\n }\n const inConcept = enclosingChain(lines, fences, lineIndex, indentOf(textBefore))[0] === 'concept';\n const generationEntries = inConcept ? generationCompletions(lines, lineIndex, textBefore) : null;\n if (generationEntries !== null) return { kind: 'entries', entries: generationEntries };\n if (inConcept && /^\\s*(?:secret|sensitive|@sensitive)\\s+scope\\s+\\w*$/.test(textBefore)) {\n return { kind: 'entries', entries: ['subject', 'namespace', 'global'].map(scope => ({ label: scope, insertText: scope, documentation: 'Explicit secret encryption scope.' })) };\n }\n if (inConcept && /^\\s*(?:pii|personal|@pii)\\s+special\\s+\\w*$/.test(textBefore)) {\n return { kind: 'entries', entries: ['racialOrEthnicOrigin', 'politicalOpinions', 'religiousOrPhilosophicalBeliefs', 'tradeUnionMembership', 'genetic', 'biometric', 'health', 'sexLifeOrSexualOrientation'].map(category => ({ label: category, insertText: category, documentation: 'GDPR Art. 9(1) special category.' })) };\n }\n const responseEntries = exampleCompletions(lines, lineIndex, textBefore) ?? responseCompletions(lines, lineIndex, textBefore, scanDocument(lines));\n if (responseEntries !== null) return { kind: 'entries', entries: responseEntries };\n const keyEntries = readModelKeyCompletions(lines, lineIndex, textBefore, symbols);\n if (keyEntries !== null) return { kind: 'entries', entries: keyEntries };\n const dependencyEntries = dependencyTargetCompletions(lines, lineIndex, textBefore, symbols);\n if (dependencyEntries !== null) return { kind: 'entries', entries: dependencyEntries };\n\n // Inside the quotes of a file import, what is wanted is a path - replacing what has been typed so far.\n const importPath = textBefore.match(/^\\s*import\\s+\"([^\"]*)$/);\n if (importPath) {\n return { kind: 'playFiles', replaceLength: importPath[1].length };\n }\n\n // A quote or a slash only asks for a completion inside an import path.\n if (/[\"/]$/.test(textBefore)) return { kind: 'none' };\n\n const refusal = refusalContext(lines, lineIndex, indentOf(lines[lineIndex] ?? textBefore));\n if (/\\$refusal\\.\\w*$/.test(textBefore)) {\n return { kind: 'entries', entries: refusal === undefined ? [] : ['reason', 'message', ...(/^on\\s+refused\\s+by\\s+constraint(?:\\s|$)/.test(refusal) ? ['constraint'] : [])].map(member => ({ label: member, insertText: member, documentation: 'String refusal value; syntax-only, not yet executable (PLAY0268).' })) };\n }\n const contextVariableMatch = textBefore.match(/\\$[\\w.]*$/);\n if (contextVariableMatch) {\n return { kind: 'contextVariables', replaceLength: contextVariableMatch[0].length };\n }\n\n const currentLine = lines[lineIndex] ?? '';\n const effectiveIndent =\n textBefore.trim().length === 0 ? textBefore.length : indentOf(currentLine);\n const chain = enclosingChain(lines, fences, lineIndex, effectiveIndent);\n if (chain.includes('screen')) {\n let parentIndent = effectiveIndent;\n let guarded = false;\n for (let index = lineIndex - 1; index >= 0; index--) {\n if (fences[index]) continue;\n const parent = withoutComment(lines[index]);\n if (parent.trim().length === 0 || indentOf(parent) >= parentIndent) continue;\n parentIndent = indentOf(parent);\n if (/^\\s*action\\s+(?:\"|\\$strings\\.)/.test(parent)) { guarded = true; break; }\n if (/^\\s*screen\\b/.test(parent)) break;\n }\n if (guarded) {\n if (/^\\s*(?:when\\b.*|otherwise)\\s+execute\\s+[\\w.]*$/.test(textBefore)) return { kind: 'commands' };\n if (chain[0] === 'action') return { kind: 'entries', entries: items.guardedActionItems };\n if (['when', 'otherwise'].includes(chain[0])) {\n const parent = nearestEnclosingLine(lines, fences, lineIndex, effectiveIndent) ?? '';\n return { kind: 'entries', entries: /\\bexecute\\s+[\\w.]+$/.test(parent) ? items.actionArgumentItems : [] };\n }\n }\n }\n if (['on', 'when', 'otherwise'].includes(chain[0])) {\n let parentIndent = effectiveIndent;\n for (let index = lineIndex - 1; index >= 0; index--) {\n if (fences[index]) continue;\n const parent = withoutComment(lines[index]);\n if (parent.trim().length === 0 || indentOf(parent) >= parentIndent) continue;\n parentIndent = indentOf(parent);\n if (/^\\s*on\\s+(?:click|double click|select)\\s*$/.test(parent)) {\n return { kind: 'entries', entries: chain[0] === 'on' ? items.interactionChoiceItems : items.interactionActionItems };\n }\n if (/^\\s*(?:screen|behavior|specification|reaction)\\b/.test(parent)) break;\n }\n }\n if (chain[0] === 'on' && refusal !== undefined) return { kind: 'entries', entries: items.refusalItems };\n const ruleContext = namedRuleContext(lines, lineIndex, effectiveIndent);\n if (ruleContext === 'implementation') return { kind: 'entries', entries: items.namedRuleImplementationItems };\n if (ruleContext === 'rule') return { kind: 'entries', entries: items.commandRuleItems };\n\n const propertyOwner = ['public', 'event', 'command', 'type', 'readmodel', 'trigger', 'when', 'every', 'at'].includes(chain[0]) ||\n (chain[0] === 'produces' && /^produces\\s+event\\b/.test(nearestEnclosingLine(lines, fences, lineIndex, effectiveIndent) ?? ''));\n const propertyName = textBefore.trimStart().split(/\\s+/)[0];\n const reservedProperty = (chain[0] === 'command' && ['reads', 'authorize', 'produces'].includes(propertyName)) ||\n (chain[0] === 'event' && propertyName === 'tag') ||\n (['trigger', 'when', 'every', 'at'].includes(chain[0]) && ['description', 'file', 'reads', 'produces', 'invokes'].includes(propertyName));\n const optionalPrefix = (match: RegExpMatchArray | null) => match !== null && 'optional'.startsWith(match[1]);\n const afterPropertyType = propertyOwner && !reservedProperty && optionalPrefix(textBefore.match(/^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+(\\w*)$/));\n const afterQueryType = (chain[0] === 'query' && optionalPrefix(textBefore.match(/^\\s*(?:by|filter)\\s+[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+(\\w*)$/))) ||\n optionalPrefix(textBefore.match(/^\\s*query\\s+[A-Za-z_]\\w*\\s*=>\\s*(?:observable\\s+)?[\\w.]+(?:\\[\\])?\\s+(\\w*)$/));\n const eventPropertyOwner = chain[0] === 'event' || (chain[0] === 'produces' && /^produces\\s+event\\b/.test(nearestEnclosingLine(lines, fences, lineIndex, effectiveIndent) ?? ''));\n const subjectModifier = eventPropertyOwner && !reservedProperty ? textBefore.match(/^\\s*@?[a-z_]\\w*\\s+([\\w.]+)\\s+(\\w*)$/) : null;\n const subjectConcept = symbols.concepts.find(concept => concept.name === subjectModifier?.[1]);\n const subjectType = subjectConcept?.primitive ?? subjectModifier?.[1];\n const subjectTarget = (subjectType === 'String' || subjectType === 'Uuid' || (subjectType === 'Int' && subjectConcept !== undefined)) &&\n !subjectConcept?.attributes.some(attribute => ['pii', 'personal', 'secret', 'sensitive'].includes(attribute.replace(/^@/, '')));\n const afterSubjectType = subjectModifier !== null && subjectTarget && 'subject'.startsWith(subjectModifier[2]);\n const keyModifier = chain[0] === 'readmodel' ? textBefore.match(/^\\s*@?[a-z_]\\w*\\s+[\\w.]+\\s+(\\w*)$/) : null;\n const modifierEntries = [\n ...(keyModifier && 'key'.startsWith(keyModifier[1]) ? [{ label: 'key', insertText: 'key', documentation: 'Declares a required read-model key part. Explicit keys replace inference. Composite keys are authoring-only (#599).' }] : []),\n ...((afterPropertyType || afterQueryType) && !/=>\\s*observable\\s+$/.test(textBefore) ? items.optionalTypeItems : []),\n ...(afterSubjectType ? [{ label: 'subject', insertText: 'subject', documentation: 'One required scalar event data-subject identity; not pii or secret. Report-only lineage metadata (PLAY0270), no ESM or provider output yet.' }] : []),\n ];\n if (modifierEntries.length > 0) return { kind: 'entries', entries: modifierEntries };\n\n if (/\\bauthorize\\s+[\\w\\s]*$/.test(textBefore) || chain[0] === 'authorize') {\n return { kind: 'policies' };\n }\n if (/\\bwhen\\s+\\w*$/.test(textBefore) && chain.includes('reaction')) {\n return { kind: 'triggers' };\n }\n if (/\\bon\\s+\\w*$/.test(textBefore) && chain.includes('constraint')) {\n return { kind: 'events' };\n }\n if (/\\binvokes\\s+\\w*$/.test(textBefore) && chain.includes('reaction')) {\n return { kind: 'commands' };\n }\n if (/\\b(?:on|unique\\s+event)\\s+\\w*$/.test(textBefore) && chain[0] === 'constraint') {\n return { kind: 'events' };\n }\n if (/\\bproduces\\s+\\w*$/.test(textBefore)) {\n return { kind: 'producesTargets' };\n }\n if (/\\bnavigate\\s+to\\s+\\w*$/.test(textBefore)) {\n return { kind: 'screens' };\n }\n if (chain[0] === 'specification') {\n if (/^\\s*when\\s+query\\s+[\\w.]*$/.test(textBefore)) return { kind: 'queries' };\n const step = textBefore.match(/^\\s*(given|when|then)\\s+\\w*$/);\n if (step) return { kind: 'entries', entries: items.specificationStepItems[step[1] as 'given' | 'when' | 'then'] };\n }\n if (/\\b(?:via|then)\\s+query\\s+[\\w.]*$/.test(textBefore)) {\n return { kind: 'queries' };\n }\n if (\n (chain[0] === 'event' || chain[0] === 'command' || chain[0] === 'type') &&\n /^\\s+[a-z_]\\w*\\s+[\\w[\\]?]*$/.test(textBefore)\n ) {\n return { kind: 'types' };\n }\n if (chain[0] === 'query' && /^\\s+(?:by|filter)\\s+[a-z_]\\w*\\s+[\\w[\\]?]*$/.test(textBefore)) {\n return { kind: 'types' };\n }\n\n const enclosingLine = nearestEnclosingLine(lines, fences, lineIndex, effectiveIndent);\n if (enclosingLine && /^produces\\s+operation\\b/.test(enclosingLine)) return { kind: 'entries', entries: items.operationItems };\n if (enclosingLine && /^produces\\s+event\\b/.test(enclosingLine)) {\n if (/^\\s+@?[a-z_]\\w*\\s+[\\w[\\]?]*$/.test(textBefore)) return { kind: 'types' };\n return { kind: 'entries', entries: chain.includes('command') ? [...items.inlineEventItems, productionRouteItem] : items.inlineEventItems };\n }\n if (enclosingLine && RULE_LINE_PATTERN.test(enclosingLine)) {\n return { kind: 'entries', entries: items.ruleItems };\n }\n\n const headers = enclosingHeaders(lines, fences, lineIndex, effectiveIndent);\n if (chain[0] === 'for' && chain.includes('seed')) return { kind: 'events' };\n const entries = completionEntriesFor(chain, { headers, document: lines });\n const expansion = chain[0] === 'command' ? structureCompletion(lines, lineIndex, ' '.repeat(effectiveIndent), '', symbols) : null;\n return { kind: 'entries', entries: expansion ? [expansionEntry(expansion.text, effectiveIndent), ...entries] : entries };\n}\n"],"mappings":"s+DAwBA,MAAMmD,EAAsB,CAAE,MAAO,SAAU,WAAY,4BAA6B,cAAe,qEAAsE,EAEvKC,GAAoB,mGAwBpB,YAAc,EAA6B,IAAoBC,EAAS,KAAK,GAAY,OAAO,IAAIC,EAAQ,IAAI,CAAC,CAAC,KAAKC,CAAI,CAAC,EAElI,SAAS,gBAAgB,EAAgD,CACrE,OAAAC,GAA2B,OAAO,GAAQ,EAAEC,EAAK,QAAU,UAAY,WAAWJ,EAAU,QAAQ,IAAM,EAAEI,EAAK,QAAU,kBAAoB,WAAWJ,EAAU,gBAAgB,IAAM,EAAEI,EAAK,QAAU,YAAc,WAAWJ,EAAU,UAAU,EAAE,CAC9P,CAEA,MAAM,WAAc,GAA+B,kCAAkC,KAAKK,GAAU,EAAE,EAItG,SAAS,eAAe,EAAc,EAAiC,CACnE,IAAMC,EAAWC,EAAK,MAAM;CAAI,CAAC,CAAC,KAAK,EAAM,IAAWC,IAAU,EAAIN,EAAOA,EAAK,MAAM,KAAK,IAAIO,EAAQC,EAASR,CAAI,CAAC,CAAC,CAAE,CAAC,CAAC,KAAK;CAAI,EAErI,MAAO,CAAE,MADKK,EAAK,MAAM;CAAI,CAAC,CAAC,EAAE,CAAC,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C,CAAe,EAAG,GAAGqC,CAAO,EAAIA,CAAQ,CAC3H"}
|
|
1
|
+
{"version":3,"file":"completion-planner.js","names":["items.moduleItems","items.featureItems","items.sliceItemsFor","items.conceptItems","items.typeItems","items.commandItems","items.eventItems","scope.readModelItems","scope.reducerItems","scope.formItems","scope.contributeItems","scope.behaviorItems","scope.personaItems","items.identityItems","scope.authenticationItems","scope.seedItems","scope.themeItems","scope.uiProfileItems","scope.outcomeItems","scope.layoutItems","items.operationItems","items.operationPhaseItems","items.producesItems","items.handlerItems","items.implementationItems","items.operationImplementationItems","items.queryItems","items.performerItems","items.constraintItems","items.reactionItems","items.invocationItems","items.triggerItems","items.reactionTriggerItems","items.specificationItems","items.policyItems","items.validateItems","items.actionItems","items.tableItems","scope.templateItems","items.screenItems","items.guardedActionItems","items.actionArgumentItems","items.interactionChoiceItems","items.interactionActionItems","items.refusalItems","items.namedRuleImplementationItems","items.commandRuleItems","items.optionalTypeItems","items.specificationStepItems","items.inlineEventItems","items.ruleItems","productionRouteItem","RULE_LINE_PATTERN","document","keyword","line","topLevelItems","item","header","relative","text","index","indent","indentOf","construct","chain","where","subLanguage","getSubLanguage","purposeItems","moduleScopeItems","featureScopeItems","sliceItemsFor","conceptItems","typeItems","commandItems","eventItems","readModelItems","reducerItems","formItems","contributeItems","behaviorItems","personaItems","identityItems","authenticationItems","seedItems","themeItems","uiProfileItems","outcomeItems","layoutItems","operationItems","operationPhaseItems","producesItems","handlerItems","implementationItems","operationImplementationItems","queryItems","performerItems","constraintItems","reactionItems","invocationItems","triggerItems","reactionTriggerItems","specificationItems","policyItems","validateItems","actionItems","tableItems","templateItems","screenItems","candidate","scanDocument","lines","fences","fenceMap","lineIndex","withoutComment","textBefore","marker","inConcept","enclosingChain","generationEntries","generationCompletions","scope","category","continuationEntries","continuationResponseCompletions","symbols","responseEntries","exampleCompletions","responseCompletions","keyEntries","readModelKeyCompletions","dependencyEntries","dependencyTargetCompletions","importPath","refusal","refusalContext","member","contextVariableMatch","currentLine","effectiveIndent","parentIndent","guarded","parent","guardedActionItems","nearestEnclosingLine","actionArgumentItems","interactionChoiceItems","interactionActionItems","refusalItems","ruleContext","namedRuleContext","namedRuleImplementationItems","commandRuleItems","propertyOwner","propertyName","reservedProperty","match","afterPropertyType","afterQueryType","subjectModifier","subjectConcept","concept","subjectType","subjectTarget","attribute","afterSubjectType","keyModifier","modifierEntries","optionalTypeItems","step","specificationStepItems","enclosingLine","inlineEventItems","ruleItems","headers","enclosingHeaders","entries","expansion","structureCompletion"],"sources":["../../completion-planner.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 { enclosingChain, enclosingHeaders, fenceMap, indentOf, nearestEnclosingLine, withoutComment } from './document-context';\nimport { refusalContext } from './refusal-context';\nimport { generationCompletions } from './generation-completions';\nimport { namedRuleContext } from './named-rule-context';\nimport { continuationResponseCompletions } from './continuation-responses';\nimport { responseCompletions } from './response-completions';\nimport { dependencyTargetCompletions } from './dependency-completions';\nimport { exampleCompletions } from './example-authoring';\nimport { DocumentSymbols, scanDocument } from './symbols';\nimport { structureCompletion } from './structure-completions';\nimport { getSubLanguage } from './sub-language-registry';\nimport * as items from './completion-items';\nimport * as scope from './scope-items';\nimport { CompletionEntry } from './completion-items';\nimport { purposeItems } from './purpose-items';\nimport { readModelKeyCompletions } from './read-model-key-completions';\n\n// Matches a validation rule line ending in \"rule <Name>\" (optionally followed by a\n// message clause) - both the command form (\"<property> rule <Name>\") and the\n// concept implied-subject form (\"rule <Name>\"). Its first word is the property\n// name, not \"rule\", so it can't be recognized through the chain[0] keyword switch\n// the way \"on <EventType>\" or \"handler\" are - hence the dedicated regex check.\nconst productionRouteItem = { label: 'stream', insertText: 'stream ${1:Source.Stream}', documentation: 'Replace the whole command route for this event production. ESM v10.' };\n\nconst RULE_LINE_PATTERN = /(?:^|\\s)rule\\s+[A-Za-z_]\\w*(?:\\s+severity\\s+(?:information|warning|error))?(?:\\s+message\\s+.*)?$/;\n\nexport type CompletionPlan =\n | { kind: 'none' }\n | { kind: 'entries'; entries: CompletionEntry[] }\n | { kind: 'contextVariables'; replaceLength: number }\n | { kind: 'playFiles'; replaceLength: number }\n | { kind: 'policies' }\n | { kind: 'events' }\n | { kind: 'triggers' }\n | { kind: 'commands' }\n | { kind: 'producesTargets' }\n | { kind: 'screens' }\n | { kind: 'queries' }\n | { kind: 'types' };\n\n// What the position sits inside, beyond the keyword chain: the whole header of each enclosing block, so a\n// slice's type and a template's kind are known, and the document's own lines, so a declaration that may\n// appear once is not offered again.\nexport interface CompletionScope {\n headers: readonly string[];\n document: readonly string[];\n}\n\nconst declaredIn = (document: readonly string[], keyword: string) => document.some(line => new RegExp(`^${keyword}\\\\b`).test(line));\n\nfunction topLevelEntries(document: readonly string[]): CompletionEntry[] {\n return items.topLevelItems.filter(item => !(item.label === 'domain' && declaredIn(document, 'domain')) && !(item.label === 'authentication' && declaredIn(document, 'authentication')) && !(item.label === 'identity' && declaredIn(document, 'identity')));\n}\n\nconst isTemplate = (header: string | undefined) => /^(?:screen|dialog)\\s+template\\b/.test(header ?? '');\n\n// A whole block as one completion entry. Continuation lines are indented relative to the line it is inserted on,\n// which is how the editors indent a multi-line snippet.\nfunction expansionEntry(text: string, indent: number): CompletionEntry {\n const relative = text.split('\\n').map((line, index) => (index === 0 ? line : line.slice(Math.min(indent, indentOf(line))))).join('\\n');\n const label = text.split('\\n')[0].trim();\n return { label, insertText: relative.replace(/[$}\\\\]/g, '\\\\$&'), documentation: 'Expands the whole block from what the command and its events declare.' };\n}\n\nexport function completionEntriesFor(chain: string[], where: CompletionScope = { headers: [], document: [] }): CompletionEntry[] {\n const construct = chain[0];\n if (construct === undefined || construct === 'domain') return topLevelEntries(where.document);\n const subLanguage = getSubLanguage(construct);\n if (subLanguage) return subLanguage.completions ?? [];\n const header = where.headers[0];\n switch (construct) {\n case 'purpose':\n return purposeItems;\n case 'module':\n return items.moduleItems;\n case 'feature':\n return items.featureItems;\n case 'slice':\n return items.sliceItemsFor(header?.split(/\\s+/)[1]);\n case 'concept':\n return /:\\s*Enum\\b/.test(header ?? '') ? [...items.conceptItems, { label: 'enum member (numbered)', insertText: '${1:value} = ${2:0}', documentation: 'Every member must declare a unique int32 number. Keep published numbers unchanged; specifications name members, not numbers.' }] : items.conceptItems;\n case 'type':\n return items.typeItems;\n case 'command':\n return items.commandItems;\n case 'public':\n case 'event':\n return items.eventItems;\n case 'readmodel':\n return scope.readModelItems;\n case 'reducer':\n return scope.reducerItems;\n case 'form':\n return scope.formItems;\n case 'contribute':\n return scope.contributeItems;\n case 'behavior':\n return scope.behaviorItems;\n case 'persona':\n return scope.personaItems;\n case 'identity':\n return items.identityItems;\n case 'authentication':\n return scope.authenticationItems;\n case 'seed':\n return scope.seedItems;\n case 'theme':\n return scope.themeItems;\n case 'ui':\n return scope.uiProfileItems;\n case 'on':\n case 'success':\n case 'failure':\n case 'confirm':\n return scope.outcomeItems;\n case 'layout':\n return scope.layoutItems;\n case 'system':\n return items.operationItems.filter(item => item.label === 'description');\n case 'operation':\n return items.operationItems;\n case 'execute':\n case 'compensate':\n return items.operationPhaseItems;\n case 'produces':\n return chain.includes('command') ? [...items.producesItems, productionRouteItem] : items.producesItems;\n case 'handler':\n return items.handlerItems;\n case 'implementation':\n return chain[1] === 'handler' ? items.implementationItems : ['execute', 'compensate'].includes(chain[1]) ? items.operationImplementationItems : [];\n case 'reads':\n return [{ label: 'by parts', insertText: 'by\\n ${1:part} = ${2:source}\\n ${3:part} = ${4:source}', documentation: 'Supply every composite read-model key part by name.' }];\n case 'query':\n return items.queryItems;\n case 'performer':\n return items.performerItems;\n case 'constraint':\n return items.constraintItems;\n case 'reaction':\n return items.reactionItems;\n case 'invokes':\n return chain.includes('reaction') ? items.invocationItems : [];\n case 'trigger':\n return items.triggerItems;\n case 'when':\n case 'every':\n case 'at':\n return chain.includes('reaction') ? items.reactionTriggerItems : [];\n case 'specification':\n return items.specificationItems;\n case 'policy':\n return items.policyItems;\n case 'validate':\n return items.validateItems;\n case 'action':\n return items.actionItems;\n case 'table':\n case 'summary':\n return items.tableItems;\n case 'screen':\n return isTemplate(header) ? scope.templateItems : items.screenItems;\n case 'dialog':\n return scope.templateItems;\n default:\n if (isTemplate(where.headers.find(candidate => isTemplate(candidate)))) return scope.templateItems;\n // Sections inside a screen expose the screen vocabulary.\n if (chain.includes('screen') || construct === 'section') return items.screenItems;\n if (chain.includes('produces')) return chain.includes('command') ? [...items.producesItems, productionRouteItem] : items.producesItems;\n return [];\n }\n}\n\n// Decides what to complete at a position, without any editor dependency — the\n// Monaco service and the VSCode extension both materialize the plan into items.\nexport function planCompletions(\n lines: string[],\n lineIndex: number,\n textBefore: string,\n symbols: DocumentSymbols = scanDocument(lines),\n): CompletionPlan {\n const fences = fenceMap(lines);\n if (fences[lineIndex] || withoutComment(textBefore).length < textBefore.length) return { kind: 'none' };\n if (/^\\s*concept\\s+[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}]+\\s*:\\s*\\w+\\s+(?:(?:pii|personal|secret)\\s+)*\\w*$/u.test(textBefore)) {\n return { kind: 'entries', entries: ['pii', 'secret'].filter(marker => !new RegExp(`\\\\b${marker}\\\\b`).test(textBefore)).map(marker => ({ label: marker, insertText: marker, documentation: marker === 'pii' ? 'personal data (GDPR Art. 4(1)); renders Chronicle [PII]' : 'Operational secret; renders [Encrypted] + [NotAudited].' })) };\n }\n const inConcept = enclosingChain(lines, fences, lineIndex, indentOf(textBefore))[0] === 'concept';\n const generationEntries = inConcept ? generationCompletions(lines, lineIndex, textBefore) : null;\n if (generationEntries !== null) return { kind: 'entries', entries: generationEntries };\n if (inConcept && /^\\s*(?:secret|sensitive|@sensitive)\\s+scope\\s+\\w*$/.test(textBefore)) {\n return { kind: 'entries', entries: ['subject', 'namespace', 'global'].map(scope => ({ label: scope, insertText: scope, documentation: 'Explicit secret encryption scope.' })) };\n }\n if (inConcept && /^\\s*(?:pii|personal|@pii)\\s+special\\s+\\w*$/.test(textBefore)) {\n return { kind: 'entries', entries: ['racialOrEthnicOrigin', 'politicalOpinions', 'religiousOrPhilosophicalBeliefs', 'tradeUnionMembership', 'genetic', 'biometric', 'health', 'sexLifeOrSexualOrientation'].map(category => ({ label: category, insertText: category, documentation: 'GDPR Art. 9(1) special category.' })) };\n }\n const continuationEntries = continuationResponseCompletions(lines, lineIndex, textBefore, symbols);\n if (continuationEntries !== null) return { kind: 'entries', entries: continuationEntries };\n const responseEntries = exampleCompletions(lines, lineIndex, textBefore) ?? responseCompletions(lines, lineIndex, textBefore, scanDocument(lines));\n if (responseEntries !== null) return { kind: 'entries', entries: responseEntries };\n const keyEntries = readModelKeyCompletions(lines, lineIndex, textBefore, symbols);\n if (keyEntries !== null) return { kind: 'entries', entries: keyEntries };\n const dependencyEntries = dependencyTargetCompletions(lines, lineIndex, textBefore, symbols);\n if (dependencyEntries !== null) return { kind: 'entries', entries: dependencyEntries };\n\n // Inside the quotes of a file import, what is wanted is a path - replacing what has been typed so far.\n const importPath = textBefore.match(/^\\s*import\\s+\"([^\"]*)$/);\n if (importPath) {\n return { kind: 'playFiles', replaceLength: importPath[1].length };\n }\n\n // A quote or a slash only asks for a completion inside an import path.\n if (/[\"/]$/.test(textBefore)) return { kind: 'none' };\n\n const refusal = refusalContext(lines, lineIndex, indentOf(lines[lineIndex] ?? textBefore));\n if (/\\$refusal\\.\\w*$/.test(textBefore)) {\n return { kind: 'entries', entries: refusal === undefined ? [] : ['reason', 'message', ...(/^on\\s+refused\\s+by\\s+constraint(?:\\s|$)/.test(refusal) ? ['constraint'] : [])].map(member => ({ label: member, insertText: member, documentation: 'String refusal value; syntax-only, not yet executable (PLAY0268).' })) };\n }\n const contextVariableMatch = textBefore.match(/\\$[\\w.]*$/);\n if (contextVariableMatch) {\n return { kind: 'contextVariables', replaceLength: contextVariableMatch[0].length };\n }\n\n const currentLine = lines[lineIndex] ?? '';\n const effectiveIndent =\n textBefore.trim().length === 0 ? textBefore.length : indentOf(currentLine);\n const chain = enclosingChain(lines, fences, lineIndex, effectiveIndent);\n if (chain.includes('screen')) {\n let parentIndent = effectiveIndent;\n let guarded = false;\n for (let index = lineIndex - 1; index >= 0; index--) {\n if (fences[index]) continue;\n const parent = withoutComment(lines[index]);\n if (parent.trim().length === 0 || indentOf(parent) >= parentIndent) continue;\n parentIndent = indentOf(parent);\n if (/^\\s*action\\s+(?:\"|\\$strings\\.)/.test(parent)) { guarded = true; break; }\n if (/^\\s*screen\\b/.test(parent)) break;\n }\n if (guarded) {\n if (/^\\s*(?:when\\b.*|otherwise)\\s+execute\\s+[\\w.]*$/.test(textBefore)) return { kind: 'commands' };\n if (chain[0] === 'action') return { kind: 'entries', entries: items.guardedActionItems };\n if (['when', 'otherwise'].includes(chain[0])) {\n const parent = nearestEnclosingLine(lines, fences, lineIndex, effectiveIndent) ?? '';\n return { kind: 'entries', entries: /\\bexecute\\s+[\\w.]+$/.test(parent) ? items.actionArgumentItems : [] };\n }\n }\n }\n if (['on', 'when', 'otherwise'].includes(chain[0])) {\n let parentIndent = effectiveIndent;\n for (let index = lineIndex - 1; index >= 0; index--) {\n if (fences[index]) continue;\n const parent = withoutComment(lines[index]);\n if (parent.trim().length === 0 || indentOf(parent) >= parentIndent) continue;\n parentIndent = indentOf(parent);\n if (/^\\s*on\\s+(?:click|double click|select)\\s*$/.test(parent)) {\n return { kind: 'entries', entries: chain[0] === 'on' ? items.interactionChoiceItems : items.interactionActionItems };\n }\n if (/^\\s*(?:screen|behavior|specification|reaction)\\b/.test(parent)) break;\n }\n }\n if (chain[0] === 'on' && refusal !== undefined) return { kind: 'entries', entries: items.refusalItems };\n const ruleContext = namedRuleContext(lines, lineIndex, effectiveIndent);\n if (ruleContext === 'implementation') return { kind: 'entries', entries: items.namedRuleImplementationItems };\n if (ruleContext === 'rule') return { kind: 'entries', entries: items.commandRuleItems };\n\n const propertyOwner = ['public', 'event', 'command', 'type', 'readmodel', 'trigger', 'when', 'every', 'at'].includes(chain[0]) ||\n (chain[0] === 'produces' && /^produces\\s+event\\b/.test(nearestEnclosingLine(lines, fences, lineIndex, effectiveIndent) ?? ''));\n const propertyName = textBefore.trimStart().split(/\\s+/)[0];\n const reservedProperty = (chain[0] === 'command' && ['reads', 'authorize', 'produces'].includes(propertyName)) ||\n (chain[0] === 'event' && propertyName === 'tag') ||\n (['trigger', 'when', 'every', 'at'].includes(chain[0]) && ['description', 'file', 'reads', 'produces', 'invokes'].includes(propertyName));\n const optionalPrefix = (match: RegExpMatchArray | null) => match !== null && 'optional'.startsWith(match[1]);\n const afterPropertyType = propertyOwner && !reservedProperty && optionalPrefix(textBefore.match(/^\\s*@?[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+(\\w*)$/));\n const afterQueryType = (chain[0] === 'query' && optionalPrefix(textBefore.match(/^\\s*(?:by|filter)\\s+[a-z_]\\w*\\s+[\\w.]+(?:\\[\\])?\\s+(\\w*)$/))) ||\n optionalPrefix(textBefore.match(/^\\s*query\\s+[A-Za-z_]\\w*\\s*=>\\s*(?:observable\\s+)?[\\w.]+(?:\\[\\])?\\s+(\\w*)$/));\n const eventPropertyOwner = chain[0] === 'event' || (chain[0] === 'produces' && /^produces\\s+event\\b/.test(nearestEnclosingLine(lines, fences, lineIndex, effectiveIndent) ?? ''));\n const subjectModifier = eventPropertyOwner && !reservedProperty ? textBefore.match(/^\\s*@?[a-z_]\\w*\\s+([\\w.]+)\\s+(\\w*)$/) : null;\n const subjectConcept = symbols.concepts.find(concept => concept.name === subjectModifier?.[1]);\n const subjectType = subjectConcept?.primitive ?? subjectModifier?.[1];\n const subjectTarget = (subjectType === 'String' || subjectType === 'Uuid' || (subjectType === 'Int' && subjectConcept !== undefined)) &&\n !subjectConcept?.attributes.some(attribute => ['pii', 'personal', 'secret', 'sensitive'].includes(attribute.replace(/^@/, '')));\n const afterSubjectType = subjectModifier !== null && subjectTarget && 'subject'.startsWith(subjectModifier[2]);\n const keyModifier = chain[0] === 'readmodel' ? textBefore.match(/^\\s*@?[a-z_]\\w*\\s+[\\w.]+\\s+(\\w*)$/) : null;\n const modifierEntries = [\n ...(keyModifier && 'key'.startsWith(keyModifier[1]) ? [{ label: 'key', insertText: 'key', documentation: 'Declares a required read-model key part. Explicit keys replace inference. Composite keys are authoring-only (#599).' }] : []),\n ...((afterPropertyType || afterQueryType) && !/=>\\s*observable\\s+$/.test(textBefore) ? items.optionalTypeItems : []),\n ...(afterSubjectType ? [{ label: 'subject', insertText: 'subject', documentation: 'One required scalar event data-subject identity; not pii or secret. Report-only lineage metadata (PLAY0270), no ESM or provider output yet.' }] : []),\n ];\n if (modifierEntries.length > 0) return { kind: 'entries', entries: modifierEntries };\n\n if (/\\bauthorize\\s+[\\w\\s]*$/.test(textBefore) || chain[0] === 'authorize') {\n return { kind: 'policies' };\n }\n if (/\\bwhen\\s+\\w*$/.test(textBefore) && chain.includes('reaction')) {\n return { kind: 'triggers' };\n }\n if (/\\bon\\s+\\w*$/.test(textBefore) && chain.includes('constraint')) {\n return { kind: 'events' };\n }\n if (/\\binvokes\\s+\\w*$/.test(textBefore) && chain.includes('reaction')) {\n return { kind: 'commands' };\n }\n if (/\\b(?:on|unique\\s+event)\\s+\\w*$/.test(textBefore) && chain[0] === 'constraint') {\n return { kind: 'events' };\n }\n if (/\\bproduces\\s+\\w*$/.test(textBefore)) {\n return { kind: 'producesTargets' };\n }\n if (/\\bnavigate\\s+to\\s+\\w*$/.test(textBefore)) {\n return { kind: 'screens' };\n }\n if (chain[0] === 'specification') {\n if (/^\\s*when\\s+query\\s+[\\w.]*$/.test(textBefore)) return { kind: 'queries' };\n const step = textBefore.match(/^\\s*(given|when|then)\\s+\\w*$/);\n if (step) return { kind: 'entries', entries: items.specificationStepItems[step[1] as 'given' | 'when' | 'then'] };\n }\n if (/\\b(?:via|then)\\s+query\\s+[\\w.]*$/.test(textBefore)) {\n return { kind: 'queries' };\n }\n if (\n (chain[0] === 'event' || chain[0] === 'command' || chain[0] === 'type') &&\n /^\\s+[a-z_]\\w*\\s+[\\w[\\]?]*$/.test(textBefore)\n ) {\n return { kind: 'types' };\n }\n if (chain[0] === 'query' && /^\\s+(?:by|filter)\\s+[a-z_]\\w*\\s+[\\w[\\]?]*$/.test(textBefore)) {\n return { kind: 'types' };\n }\n\n const enclosingLine = nearestEnclosingLine(lines, fences, lineIndex, effectiveIndent);\n if (enclosingLine && /^produces\\s+operation\\b/.test(enclosingLine)) return { kind: 'entries', entries: items.operationItems };\n if (enclosingLine && /^produces\\s+event\\b/.test(enclosingLine)) {\n if (/^\\s+@?[a-z_]\\w*\\s+[\\w[\\]?]*$/.test(textBefore)) return { kind: 'types' };\n return { kind: 'entries', entries: chain.includes('command') ? [...items.inlineEventItems, productionRouteItem] : items.inlineEventItems };\n }\n if (enclosingLine && RULE_LINE_PATTERN.test(enclosingLine)) {\n return { kind: 'entries', entries: items.ruleItems };\n }\n\n const headers = enclosingHeaders(lines, fences, lineIndex, effectiveIndent);\n if (chain[0] === 'for' && chain.includes('seed')) return { kind: 'events' };\n const entries = completionEntriesFor(chain, { headers, document: lines });\n const expansion = chain[0] === 'command' ? structureCompletion(lines, lineIndex, ' '.repeat(effectiveIndent), '', symbols) : null;\n return { kind: 'entries', entries: expansion ? [expansionEntry(expansion.text, effectiveIndent), ...entries] : entries };\n}\n"],"mappings":"qjEAyBA,MAAMmD,EAAsB,CAAE,MAAO,SAAU,WAAY,4BAA6B,cAAe,qEAAsE,EAEvKC,GAAoB,mGAwBpB,YAAc,EAA6B,IAAoBC,EAAS,KAAK,GAAY,OAAO,IAAIC,EAAQ,IAAI,CAAC,CAAC,KAAKC,CAAI,CAAC,EAElI,SAAS,gBAAgB,EAAgD,CACrE,OAAAC,GAA2B,OAAO,GAAQ,EAAEC,EAAK,QAAU,UAAY,WAAWJ,EAAU,QAAQ,IAAM,EAAEI,EAAK,QAAU,kBAAoB,WAAWJ,EAAU,gBAAgB,IAAM,EAAEI,EAAK,QAAU,YAAc,WAAWJ,EAAU,UAAU,EAAE,CAC9P,CAEA,MAAM,W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Aa,EACrD,MAAO,CAAE,KAAM,UAAW,QAAS3H,CAAgB,EAGvD,IAAM8H,EAAUC,EAAiBjE,EAAOC,EAAQE,EAAW0B,CAAe,EAC1E,GAAI5E,EAAM,KAAO,OAASA,EAAM,SAAS,MAAM,EAAG,MAAO,CAAE,KAAM,QAAS,EAC1E,IAAMiH,EAAU,qBAAqBjH,EAAO,CAAE,UAAS,SAAU+C,CAAM,CAAC,EAClEmE,EAAYlH,EAAM,KAAO,UAAYmH,GAAoBpE,EAAOG,EAAW,IAAI,OAAO0B,CAAe,EAAG,GAAId,CAAO,EAAI,KAC7H,MAAO,CAAE,KAAM,UAAW,QAASoD,EAAY,CAAC,eAAeA,EAAU,KAAMtC,CAAe,EAAG,GAAGqC,CAAO,EAAIA,CAAQ,CAC3H"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{typeReferenceText as e}from"./TypeReferenceSymbol.js";import{pattern as t}from"./compiler/Text/patterns.js";import"./compiler/index.js";import{responseAnalysis as n}from"./response-analysis.js";function fieldsAt(e,t,r){return n(e,r?.authoringDocuments??r?.authoringSources,r?.authoringPlacement,r?.authoringPath,r?.authoringPlacementResolved).continuationResponses?.get(t)??[]}function continuationResponseCompletions(n,r,i,a){if(!t(`^\\s*(?:with\\s+\\w+\\s+from\\s+|on\\s+submit\\s+navigate\\s+to\\s+[\\w.]+\\s+by\\s+)\\w*$`).test(i))return null;let o=fieldsAt(n,r,a);return o.length===0?null:o.map(t=>({label:t.name,insertText:t.name,detail:e(t.type),sortText:`0_${t.name}`,documentation:`Returned by ${t.command} on success`}))}function continuationResponseHover(n,r,i,a,o,s){let c=n[r]??``,l=t(`^(\\s*(?:with\\s+\\w+\\s+from\\s+|on\\s+submit\\s+navigate\\s+to\\s+[\\w.]+\\s+by\\s+|set\\s+[\\w.$]+\\s+to\\s+|notify\\s+(?:info|warning|error)\\s+|confirm\\s+))([A-Za-z_]\\w*)\\s*(?:\\/\\/.*)?$`).exec(c);if(!l||l[2]!==i||a!==l[1].length+1||o!==a+i.length)return null;let u=fieldsAt(n,r,s).find(e=>e.name===i);return u?`**${u.name}** — ${e(u.type)}. Returned by ${u.command} on success.`:null}export{continuationResponseCompletions,continuationResponseHover};
|
|
2
|
+
//# sourceMappingURL=continuation-responses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuation-responses.js","names":["responseAnalysis","lines","symbols","line","pattern","before","fields","field","typeReferenceText","content","operand","word","startColumn","endColumn"],"sources":["../../continuation-responses.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 { pattern } from '@cratis/screenplay-compiler';\nimport { responseAnalysis } from './response-analysis';\nimport { DocumentSymbols } from './symbols';\nimport { CompletionEntry } from './completion-items';\nimport { typeReferenceText } from './TypeReferenceSymbol';\n\nfunction fieldsAt(lines: string[], line: number, symbols?: DocumentSymbols) {\n return responseAnalysis(lines, symbols?.authoringDocuments ?? symbols?.authoringSources, symbols?.authoringPlacement, symbols?.authoringPath, symbols?.authoringPlacementResolved).continuationResponses?.get(line) ?? [];\n}\n\nexport function continuationResponseCompletions(lines: string[], line: number, before: string, symbols: DocumentSymbols): CompletionEntry[] | null {\n if (!pattern(/^\\s*(?:with\\s+\\w+\\s+from\\s+|on\\s+submit\\s+navigate\\s+to\\s+[\\w.]+\\s+by\\s+)\\w*$/.source).test(before)) return null;\n const fields = fieldsAt(lines, line, symbols);\n return fields.length === 0 ? null : fields.map(field => ({ label: field.name, insertText: field.name, detail: typeReferenceText(field.type), sortText: `0_${field.name}`, documentation: `Returned by ${field.command} on success` }));\n}\n\nexport function continuationResponseHover(lines: string[], line: number, word: string, startColumn: number, endColumn: number, symbols?: DocumentSymbols): string | null {\n const content = lines[line] ?? '';\n const operand = pattern(/^(\\s*(?:with\\s+\\w+\\s+from\\s+|on\\s+submit\\s+navigate\\s+to\\s+[\\w.]+\\s+by\\s+|set\\s+[\\w.$]+\\s+to\\s+|notify\\s+(?:info|warning|error)\\s+|confirm\\s+))([A-Za-z_]\\w*)\\s*(?:\\/\\/.*)?$/.source).exec(content);\n if (!operand || operand[2] !== word || startColumn !== operand[1].length + 1 || endColumn !== startColumn + word.length) return null;\n const field = fieldsAt(lines, line, symbols).find(field => field.name === word);\n return field ? `**${field.name}** — ${typeReferenceText(field.type)}. Returned by ${field.command} on success.` : null;\n}\n"],"mappings":"0PASA,SAAS,SAAS,EAAiB,EAAc,EAA2B,CACxE,OAAOA,EAAiBC,EAAOC,GAAS,oBAAsBA,GAAS,iBAAkBA,GAAS,mBAAoBA,GAAS,cAAeA,GAAS,0BAA0B,CAAC,CAAC,uBAAuB,IAAIC,CAAI,GAAK,CAAC,CAC5N,CAEA,SAAgB,gCAAgC,EAAiB,EAAc,EAAgB,EAAoD,CAC/I,GAAI,CAACC,EAAQ,4FAAsF,CAAC,CAAC,KAAKC,CAAM,EAAG,OAAO,KAC1H,IAAMC,EAAS,SAASL,EAAOE,EAAMD,CAAO,EAC5C,OAAOI,EAAO,SAAW,EAAI,KAAOA,EAAO,IAAI,IAAU,CAAE,MAAOC,EAAM,KAAM,WAAYA,EAAM,KAAM,OAAQC,EAAkBD,EAAM,IAAI,EAAG,SAAU,KAAKA,EAAM,OAAQ,cAAe,eAAeA,EAAM,QAAQ,YAAa,EAAE,CACzO,CAEA,SAAgB,0BAA0B,EAAiB,EAAc,EAAc,EAAqB,EAAmB,EAA0C,CACrK,IAAME,EAAUR,EAAME,IAAS,GACzBO,EAAUN,EAAQ,qMAAqL,CAAC,CAAC,KAAKK,CAAO,EAC3N,GAAI,CAACC,GAAWA,EAAQ,KAAOC,GAAQC,IAAgBF,EAAQ,EAAE,CAAC,OAAS,GAAKG,IAAcD,EAAcD,EAAK,OAAQ,OAAO,KAChI,IAAMJ,EAAQ,SAASN,EAAOE,EAAMD,CAAO,CAAC,CAAC,KAAK,GAASK,EAAM,OAASI,CAAI,EAC9E,OAAOJ,EAAQ,KAAKA,EAAM,KAAK,OAAOC,EAAkBD,EAAM,IAAI,EAAE,gBAAgBA,EAAM,QAAQ,cAAgB,IACtH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e={repeatedSingularDeclarationAcrossFiles:`PLAY0172`,invalidExposureDeclaration:`PLAY0621`,unknownExposureOwner:`PLAY0622`,reExposureCycle:`PLAY0623`,reExposureBroken:`PLAY0624`,invalidInstanceContribution:`PLAY0625`,unknownContributionInstance:`PLAY0626`,contributionNotExposed:`PLAY0627`,contributionTypeMismatch:`PLAY0628`,unknownTemplateContentSlot:`PLAY0629`,unknownNavigationOutlet:`PLAY0630`,templateScopeMismatch:`PLAY0631`,incompatibleComponentPackage:`PLAY0632`,unknownNavigationDestination:`PLAY0654`,unknownScreenContributionPoint:`PLAY0655`,templateNestingCycle:`PLAY0656`,mixedEnumerationNumbering:`PLAY0667`,duplicateEnumerationNumber:`PLAY0668`,enumerationNumberOutsideInt32:`PLAY0669`,malformedEnumerationNumber:`PLAY0670`,unpinnedStoredEnumeration:`PLAY0671`,invalidIdentityDeclaration:`PLAY0633`,duplicateIdentity:`PLAY0634`,invalidIdentityDetail:`PLAY0635`,unknownIdentitySource:`PLAY0636`,identityDetailWithoutSource:`PLAY0637`,identitySourceWithBody:`PLAY0638`,duplicateIdentityDetail:`PLAY0639`,builtInIdentityDetail:`PLAY0640`,unknownIdentityQuery:`PLAY0641`,invalidIdentityQuery:`PLAY0642`,identityQueryWithoutKey:`PLAY0643`,invalidIdentityQueryKey:`PLAY0644`,identityQueryAuthorizationDependency:`PLAY0645`,identityQueryTypeMismatch:`PLAY0646`,invalidReactionIdentity:`PLAY0647`,gatedInvocationWithoutIdentity:`PLAY0648`,unusedReactionIdentity:`PLAY0649`,unusedReactionRole:`PLAY0650`,unsatisfiedReactionIdentity:`PLAY0651`,reactionPrivilegeEscalation:`PLAY0652`,commandProducesPublicEvent:`PLAY0607`,publicEventRequiresOutboundTranslation:`PLAY0608`,outboundPublicEventCount:`PLAY0609`,foreignPublicEventConsumer:`PLAY0610`,outboundTranslationInput:`PLAY0611`,inboundTranslationOutput:`PLAY0612`,foreignPublicEventProduced:`PLAY0613`,publicTranslationRequiresDirection:`PLAY0614`,translationConstructDirection:`PLAY0615`,inboundTranslationInput:`PLAY0616`,outboundTranslationOutput:`PLAY0617`,eventTargetOutsideOutboundTranslation:`PLAY0618`,eventsSourceOutsideInboundTranslation:`PLAY0619`,invalidCaptureEventsSource:`PLAY0620`,invalidReadModelKey:`PLAY0660`,incompleteReadModelKey:`PLAY0661`,invalidReadModelKeyLookup:`PLAY0662`,productionRouteOutsideCommand:`PLAY0663`,redundantProductionRoute:`PLAY0664`,invalidObserverFilter:`PLAY0665`,observerFilterExcludesEveryProducer:`PLAY0666`,invalidDescription:`PLAY0145`,emptyDescription:`PLAY0146`,duplicateDescription:`PLAY0147`,unknownConceptDirective:`PLAY0010`,attributeReasonWithoutAttribute:`PLAY0012`,duplicateAttributeReason:`PLAY0013`,duplicateComplianceMarker:`PLAY0653`,legacyComplianceMarker:`PLAY0565`,unknownComplianceMarker:`PLAY0566`,invalidSecretScope:`PLAY0567`,duplicateSecretScope:`PLAY0568`,secretScopeIgnoredForPii:`PLAY0569`,invalidPersonalDataQualifier:`PLAY0570`,duplicateSpecialCategory:`PLAY0571`,invalidPurposeDeclaration:`PLAY0596`,invalidPurposeVocabulary:`PLAY0597`,duplicatePurposeField:`PLAY0598`,duplicatePurposeDeclaration:`PLAY0599`,unknownPurpose:`PLAY0600`,purposeInterestMismatch:`PLAY0601`,personalDataWithoutPurpose:`PLAY0602`,specialDataWithoutCondition:`PLAY0603`,criminalDataWithoutAuthorization:`PLAY0604`,purposeWithoutBasis:`PLAY0605`,unusedPurpose:`PLAY0606`,duplicateEventSubject:`PLAY0590`,invalidSubjectType:`PLAY0591`,protectedSubjectType:`PLAY0592`,invalidSubjectOwner:`PLAY0593`,readModelSubjectNotSupported:`PLAY0594`,invalidSubjectModifierOrder:`PLAY0595`,conflictingScreenDataBinding:`PLAY0530`,screenDataQueryMismatch:`PLAY0531`,actionWithoutInputSurface:`PLAY0532`,commandWithoutInputSurface:`PLAY0533`,readModelFieldWithoutOrigin:`PLAY0534`,queryParameterNotHeldByView:`PLAY0535`,unconsumedEvent:`PLAY0536`,unreachableScreen:`PLAY0537`,invalidSpecificationCallerPersona:`PLAY0572`,unsynthesizablePersonaCaller:`PLAY0573`,personaWithoutGate:`PLAY0574`,gateWithoutPersona:`PLAY0575`,ambiguousPersonaCaller:`PLAY0576`,invalidSpecificationParameter:`PLAY0577`,invalidSpecificationCase:`PLAY0578`,duplicateSpecificationParameter:`PLAY0579`,duplicateSpecificationCase:`PLAY0580`,incompleteSpecificationTable:`PLAY0581`,invalidSpecificationCaseAssignment:`PLAY0582`,invalidSpecificationCaseValue:`PLAY0583`,invalidSpecificationCaseReference:`PLAY0584`,optionalSpecificationParameterTarget:`PLAY0585`,specificationCaseNameCollision:`PLAY0586`,incompatibleSpecificationParameterType:`PLAY0587`,unusedSpecificationParameter:`PLAY0588`,singularSpecificationTableExpansion:`PLAY0589`,invalidActionAlternative:`PLAY0341`,guardedActionWithoutAlternatives:`PLAY0342`,misplacedActionOtherwise:`PLAY0343`,unsupportedActionConditionOperand:`PLAY0344`,unknownActionSubjectField:`PLAY0345`,unresolvedActionSubject:`PLAY0346`,unreachableActionAlternative:`PLAY0347`,unknownActionArgumentProperty:`PLAY0348`,invalidRefusalBranch:`PLAY0538`,invalidRefusalBranchBody:`PLAY0539`,unreachableRefusalBranch:`PLAY0540`,invalidRefusalValue:`PLAY0541`,unknownRefusalConstraint:`PLAY0542`,unmatchedRedeliveredOccurrence:`PLAY0543`,unknownRedeliveryReaction:`PLAY0544`,invalidNoEventsExpectation:`PLAY0545`,indeterminateNegatedClaimTarget:`PLAY0546`,invalidAbsentReadModelStep:`PLAY0453`,unknownConstraintProperty:`PLAY0391`,invalidSpecificationExample:`PLAY0518`,duplicateSpecificationAssignment:`PLAY0519`,unknownReadModelProperty:`PLAY0514`,piiNotSupportedOnIdentifier:`PLAY0515`,invalidEventSourceDeclaration:`PLAY0503`,invalidCommandStream:`PLAY0504`,invalidSpecificationStream:`PLAY0547`,specificationStreamOnCommand:`PLAY0548`,invalidSpecificationStreamRoute:`PLAY0549`,invalidSpecificationStreamEventSource:`PLAY0550`,specificationStreamContradictsCommand:`PLAY0551`,ambiguousCommandStream:`PLAY0505`,unsupportedStreamIdType:`PLAY0506`,redundantSourceStreamId:`PLAY0507`,eventFromLaterSlice:`PLAY0516`,timelineCycleGroup:`PLAY0517`,invalidSpecificationExampleBody:`PLAY0526`,undeclaredDependency:`PLAY0552`,unusedDependencyDeclaration:`PLAY0553`,invalidDependencyTarget:`PLAY0554`,repeatedDependencyDeclaration:`PLAY0555`,mutualDependencyDeclarations:`PLAY0556`,authorizationRefusalWithoutIdentity:`PLAY0557`,invalidDocumentation:`PLAY0558`,conflictingDocumentationAcrossFiles:`PLAY0559`,unsupportedInteractionAlternatives:`PLAY0560`,mixedInteractionAlternatives:`PLAY0561`,interactionAlternativeWithoutActions:`PLAY0562`,inlineInteractionAlternative:`PLAY0563`,legacyInteractionWhere:`PLAY0564`,ambiguousReference:`PLAY0198`,invalidImplementationBlock:`PLAY0492`,invalidImplementationHint:`PLAY0493`,conflictingImplementationSources:`PLAY0494`,eventSourceIdInPayload:`PLAY0469`,explicitProducesTargetsRequired:`PLAY0470`,redundantEventId:`PLAY0471`,invalidEventId:`PLAY0472`,inlineEventCollision:`PLAY0473`,inlineEventOutsideCommand:`PLAY0474`,inlineEventGeneration:`PLAY0475`,reservedProductionMetadata:`PLAY0476`,invalidEventDocumentation:`PLAY0477`,tabIndentation:`PLAY0006`,unknownPrimitiveType:`PLAY0008`,unknownSliceType:`PLAY0028`,duplicateCommandIdentifier:`PLAY0036`,unknownContextPath:`PLAY0153`,unknownContextCausedByProperty:`PLAY0154`,unknownContextIdentityProperty:`PLAY0155`,unclosedCodeBlock:`PLAY0164`,unknownType:`PLAY0165`,unknownEvent:`PLAY0166`,unknownPolicy:`PLAY0167`,duplicateDeclaration:`PLAY0168`,unknownEventContextMember:`PLAY0295`,unknownEventContextPath:`PLAY0296`,eventContextPathBelowCollection:`PLAY0297`,missingEventContextPath:`PLAY0298`,unresolvedDynamicKeySource:`PLAY0299`,invalidFileImport:`PLAY0454`,omittedProductionDestination:`PLAY0478`,legacyOptionalSuffix:`PLAY0479`,invalidOptionalModifierOrder:`PLAY0480`,optionalReadsNotSupported:`PLAY0481`,unavailableResponseExecution:`PLAY0268`,generatedPropertyOutsideCommand:`PLAY0482`,invalidGeneratedType:`PLAY0483`,invalidGeneratedModifierOrder:`PLAY0484`,generatedPropertyInput:`PLAY0485`,invalidCommandResponse:`PLAY0486`,invalidResponseSource:`PLAY0487`,duplicateResponseField:`PLAY0488`,invalidResponseShape:`PLAY0489`,invalidGeneratedFixture:`PLAY0490`,invalidReturnExpectation:`PLAY0491`,unknownGenerationStrategy:`PLAY0672`,invalidGenerationArgument:`PLAY0673`,invalidGenerationModifier:`PLAY0674`,duplicateGenerationModifier:`PLAY0675`,duplicateGeneration:`PLAY0676`,invalidGenerationPrimitive:`PLAY0677`,invalidGenerationPrefix:`PLAY0678`,invalidGenerationAlphabet:`PLAY0679`,invalidTypeIdPrefix:`PLAY0680`,generationSizeOutsideRange:`PLAY0681`,reservedSequenceGeneration:`PLAY0682`,lowGenerationEntropy:`PLAY0683`,lowGeneratedIdentifierEntropy:`PLAY0684`};export{e as diagnosticCodes};
|
|
1
|
+
const e={repeatedSingularDeclarationAcrossFiles:`PLAY0172`,invalidExposureDeclaration:`PLAY0621`,unknownExposureOwner:`PLAY0622`,reExposureCycle:`PLAY0623`,reExposureBroken:`PLAY0624`,invalidInstanceContribution:`PLAY0625`,unknownContributionInstance:`PLAY0626`,contributionNotExposed:`PLAY0627`,contributionTypeMismatch:`PLAY0628`,unknownTemplateContentSlot:`PLAY0629`,unknownNavigationOutlet:`PLAY0630`,templateScopeMismatch:`PLAY0631`,incompatibleComponentPackage:`PLAY0632`,unknownNavigationDestination:`PLAY0654`,unknownScreenContributionPoint:`PLAY0655`,templateNestingCycle:`PLAY0656`,mixedEnumerationNumbering:`PLAY0667`,duplicateEnumerationNumber:`PLAY0668`,enumerationNumberOutsideInt32:`PLAY0669`,malformedEnumerationNumber:`PLAY0670`,unpinnedStoredEnumeration:`PLAY0671`,invalidIdentityDeclaration:`PLAY0633`,duplicateIdentity:`PLAY0634`,invalidIdentityDetail:`PLAY0635`,unknownIdentitySource:`PLAY0636`,identityDetailWithoutSource:`PLAY0637`,identitySourceWithBody:`PLAY0638`,duplicateIdentityDetail:`PLAY0639`,builtInIdentityDetail:`PLAY0640`,unknownIdentityQuery:`PLAY0641`,invalidIdentityQuery:`PLAY0642`,identityQueryWithoutKey:`PLAY0643`,invalidIdentityQueryKey:`PLAY0644`,identityQueryAuthorizationDependency:`PLAY0645`,identityQueryTypeMismatch:`PLAY0646`,invalidReactionIdentity:`PLAY0647`,gatedInvocationWithoutIdentity:`PLAY0648`,unusedReactionIdentity:`PLAY0649`,unusedReactionRole:`PLAY0650`,unsatisfiedReactionIdentity:`PLAY0651`,reactionPrivilegeEscalation:`PLAY0652`,commandProducesPublicEvent:`PLAY0607`,publicEventRequiresOutboundTranslation:`PLAY0608`,outboundPublicEventCount:`PLAY0609`,foreignPublicEventConsumer:`PLAY0610`,outboundTranslationInput:`PLAY0611`,inboundTranslationOutput:`PLAY0612`,foreignPublicEventProduced:`PLAY0613`,publicTranslationRequiresDirection:`PLAY0614`,translationConstructDirection:`PLAY0615`,inboundTranslationInput:`PLAY0616`,outboundTranslationOutput:`PLAY0617`,eventTargetOutsideOutboundTranslation:`PLAY0618`,eventsSourceOutsideInboundTranslation:`PLAY0619`,invalidCaptureEventsSource:`PLAY0620`,invalidReadModelKey:`PLAY0660`,incompleteReadModelKey:`PLAY0661`,invalidReadModelKeyLookup:`PLAY0662`,productionRouteOutsideCommand:`PLAY0663`,redundantProductionRoute:`PLAY0664`,invalidObserverFilter:`PLAY0665`,observerFilterExcludesEveryProducer:`PLAY0666`,invalidDescription:`PLAY0145`,emptyDescription:`PLAY0146`,duplicateDescription:`PLAY0147`,unknownConceptDirective:`PLAY0010`,attributeReasonWithoutAttribute:`PLAY0012`,duplicateAttributeReason:`PLAY0013`,duplicateComplianceMarker:`PLAY0653`,legacyComplianceMarker:`PLAY0565`,unknownComplianceMarker:`PLAY0566`,invalidSecretScope:`PLAY0567`,duplicateSecretScope:`PLAY0568`,secretScopeIgnoredForPii:`PLAY0569`,invalidPersonalDataQualifier:`PLAY0570`,duplicateSpecialCategory:`PLAY0571`,invalidPurposeDeclaration:`PLAY0596`,invalidPurposeVocabulary:`PLAY0597`,duplicatePurposeField:`PLAY0598`,duplicatePurposeDeclaration:`PLAY0599`,unknownPurpose:`PLAY0600`,purposeInterestMismatch:`PLAY0601`,personalDataWithoutPurpose:`PLAY0602`,specialDataWithoutCondition:`PLAY0603`,criminalDataWithoutAuthorization:`PLAY0604`,purposeWithoutBasis:`PLAY0605`,unusedPurpose:`PLAY0606`,duplicateEventSubject:`PLAY0590`,invalidSubjectType:`PLAY0591`,protectedSubjectType:`PLAY0592`,invalidSubjectOwner:`PLAY0593`,readModelSubjectNotSupported:`PLAY0594`,invalidSubjectModifierOrder:`PLAY0595`,conflictingScreenDataBinding:`PLAY0530`,screenDataQueryMismatch:`PLAY0531`,actionWithoutInputSurface:`PLAY0532`,commandWithoutInputSurface:`PLAY0533`,readModelFieldWithoutOrigin:`PLAY0534`,queryParameterNotHeldByView:`PLAY0535`,unconsumedEvent:`PLAY0536`,unreachableScreen:`PLAY0537`,invalidSpecificationCallerPersona:`PLAY0572`,unsynthesizablePersonaCaller:`PLAY0573`,personaWithoutGate:`PLAY0574`,gateWithoutPersona:`PLAY0575`,ambiguousPersonaCaller:`PLAY0576`,invalidSpecificationParameter:`PLAY0577`,invalidSpecificationCase:`PLAY0578`,duplicateSpecificationParameter:`PLAY0579`,duplicateSpecificationCase:`PLAY0580`,incompleteSpecificationTable:`PLAY0581`,invalidSpecificationCaseAssignment:`PLAY0582`,invalidSpecificationCaseValue:`PLAY0583`,invalidSpecificationCaseReference:`PLAY0584`,optionalSpecificationParameterTarget:`PLAY0585`,specificationCaseNameCollision:`PLAY0586`,incompatibleSpecificationParameterType:`PLAY0587`,unusedSpecificationParameter:`PLAY0588`,singularSpecificationTableExpansion:`PLAY0589`,invalidActionAlternative:`PLAY0341`,guardedActionWithoutAlternatives:`PLAY0342`,misplacedActionOtherwise:`PLAY0343`,unsupportedActionConditionOperand:`PLAY0344`,unknownActionSubjectField:`PLAY0345`,unresolvedActionSubject:`PLAY0346`,unreachableActionAlternative:`PLAY0347`,unknownActionArgumentProperty:`PLAY0348`,invalidRefusalBranch:`PLAY0538`,invalidRefusalBranchBody:`PLAY0539`,unreachableRefusalBranch:`PLAY0540`,invalidRefusalValue:`PLAY0541`,unknownRefusalConstraint:`PLAY0542`,unmatchedRedeliveredOccurrence:`PLAY0543`,unknownRedeliveryReaction:`PLAY0544`,invalidNoEventsExpectation:`PLAY0545`,indeterminateNegatedClaimTarget:`PLAY0546`,invalidAbsentReadModelStep:`PLAY0453`,unknownConstraintProperty:`PLAY0391`,invalidSpecificationExample:`PLAY0518`,duplicateSpecificationAssignment:`PLAY0519`,unknownReadModelProperty:`PLAY0514`,piiNotSupportedOnIdentifier:`PLAY0515`,invalidEventSourceDeclaration:`PLAY0503`,invalidCommandStream:`PLAY0504`,invalidSpecificationStream:`PLAY0547`,specificationStreamOnCommand:`PLAY0548`,invalidSpecificationStreamRoute:`PLAY0549`,invalidSpecificationStreamEventSource:`PLAY0550`,specificationStreamContradictsCommand:`PLAY0551`,ambiguousCommandStream:`PLAY0505`,unsupportedStreamIdType:`PLAY0506`,redundantSourceStreamId:`PLAY0507`,eventFromLaterSlice:`PLAY0516`,timelineCycleGroup:`PLAY0517`,invalidSpecificationExampleBody:`PLAY0526`,undeclaredDependency:`PLAY0552`,unusedDependencyDeclaration:`PLAY0553`,invalidDependencyTarget:`PLAY0554`,repeatedDependencyDeclaration:`PLAY0555`,mutualDependencyDeclarations:`PLAY0556`,authorizationRefusalWithoutIdentity:`PLAY0557`,invalidDocumentation:`PLAY0558`,conflictingDocumentationAcrossFiles:`PLAY0559`,unsupportedInteractionAlternatives:`PLAY0560`,mixedInteractionAlternatives:`PLAY0561`,interactionAlternativeWithoutActions:`PLAY0562`,inlineInteractionAlternative:`PLAY0563`,legacyInteractionWhere:`PLAY0564`,ambiguousReference:`PLAY0198`,invalidImplementationBlock:`PLAY0492`,invalidImplementationHint:`PLAY0493`,conflictingImplementationSources:`PLAY0494`,eventSourceIdInPayload:`PLAY0469`,explicitProducesTargetsRequired:`PLAY0470`,redundantEventId:`PLAY0471`,invalidEventId:`PLAY0472`,inlineEventCollision:`PLAY0473`,inlineEventOutsideCommand:`PLAY0474`,inlineEventGeneration:`PLAY0475`,reservedProductionMetadata:`PLAY0476`,invalidEventDocumentation:`PLAY0477`,tabIndentation:`PLAY0006`,unknownPrimitiveType:`PLAY0008`,unknownSliceType:`PLAY0028`,duplicateCommandIdentifier:`PLAY0036`,unknownContextPath:`PLAY0153`,unknownContextCausedByProperty:`PLAY0154`,unknownContextIdentityProperty:`PLAY0155`,unclosedCodeBlock:`PLAY0164`,unknownType:`PLAY0165`,unknownEvent:`PLAY0166`,unknownPolicy:`PLAY0167`,duplicateDeclaration:`PLAY0168`,unknownEventContextMember:`PLAY0295`,unknownEventContextPath:`PLAY0296`,eventContextPathBelowCollection:`PLAY0297`,missingEventContextPath:`PLAY0298`,unresolvedDynamicKeySource:`PLAY0299`,invalidFileImport:`PLAY0454`,omittedProductionDestination:`PLAY0478`,legacyOptionalSuffix:`PLAY0479`,invalidOptionalModifierOrder:`PLAY0480`,optionalReadsNotSupported:`PLAY0481`,unavailableResponseExecution:`PLAY0268`,generatedPropertyOutsideCommand:`PLAY0482`,invalidGeneratedType:`PLAY0483`,invalidGeneratedModifierOrder:`PLAY0484`,generatedPropertyInput:`PLAY0485`,invalidCommandResponse:`PLAY0486`,invalidResponseSource:`PLAY0487`,duplicateResponseField:`PLAY0488`,invalidResponseShape:`PLAY0489`,invalidGeneratedFixture:`PLAY0490`,invalidReturnExpectation:`PLAY0491`,unknownGenerationStrategy:`PLAY0672`,invalidGenerationArgument:`PLAY0673`,invalidGenerationModifier:`PLAY0674`,duplicateGenerationModifier:`PLAY0675`,duplicateGeneration:`PLAY0676`,invalidGenerationPrimitive:`PLAY0677`,invalidGenerationPrefix:`PLAY0678`,invalidGenerationAlphabet:`PLAY0679`,invalidTypeIdPrefix:`PLAY0680`,generationSizeOutsideRange:`PLAY0681`,reservedSequenceGeneration:`PLAY0682`,lowGenerationEntropy:`PLAY0683`,lowGeneratedIdentifierEntropy:`PLAY0684`,responseNameUsedOnFailure:`PLAY0685`};export{e as diagnosticCodes};
|
|
2
2
|
//# sourceMappingURL=diagnostic-codes.js.map
|