UNPKG

mlld

Version:

mlld: llm scripting language

1 lines 73.4 kB
{"version":3,"sources":["../core/types/guards.ts","../core/types/security.ts","../core/types/errors.ts","../core/types/show.ts","../core/types/exe.ts","../core/types/path.ts","../core/types/run.ts","../core/types/output.ts","../core/types/when.ts","../core/types/var.ts","../core/types/for.ts","../core/types/variables.ts","../core/types/executable.ts","../core/types/index.ts"],"names":["ParseErrorCode","VariableValueType"],"mappings":";;;AAwDO,SAAS,2BAA2B,KAA8C,EAAA;AACvF,EAAO,OAAA,KAAA,CAAM,OAAQ,CAAA,KAAK,CAClB,KAAA,KAAA,CAAM,MAAW,KAAA,CAAA,IAChB,KAAM,CAAA,CAAC,CAAK,IAAA,OAAO,KAAM,CAAA,CAAC,CAAM,KAAA,QAAA,IAAa,MAAU,IAAA,KAAA,CAAM,CAAC,CAAA,KAC7D,KAAM,CAAA,CAAC,CAAE,CAAA,IAAA,KAAS,MAAU,IAAA,KAAA,CAAM,CAAC,CAAA,CAAE,IAAS,KAAA,mBAAA,CAAA,CAAA;AAC1D;AALgB,MAAA,CAAA,0BAAA,EAAA,4BAAA,CAAA;AAWT,SAAS,WAAW,IAAkC,EAAA;AAC3D,EAAA,OAAO,KAAK,IAAS,KAAA,MAAA;AACvB;AAFgB,MAAA,CAAA,UAAA,EAAA,YAAA,CAAA;AAIT,SAAS,gBAAgB,IAAuC,EAAA;AACrE,EAAA,OAAO,KAAK,IAAS,KAAA,WAAA;AACvB;AAFgB,MAAA,CAAA,eAAA,EAAA,iBAAA,CAAA;AAIT,SAAS,gBAAgB,IAAuC,EAAA;AACrE,EAAA,OAAO,KAAK,IAAS,KAAA,WAAA;AACvB;AAFgB,MAAA,CAAA,eAAA,EAAA,iBAAA,CAAA;AAIT,SAAS,cAAc,IAAqC,EAAA;AACjE,EAAA,OAAO,KAAK,IAAS,KAAA,SAAA;AACvB;AAFgB,MAAA,CAAA,aAAA,EAAA,eAAA,CAAA;AAIT,SAAS,wBAAwB,IAA+C,EAAA;AACrF,EAA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,OAAO,QAAS,CAAA,IAAA,KAAS,QAAY,IAAA,OAAO,SAAS,MAAW,KAAA,QAAA;AACzE;AAFgB,MAAA,CAAA,iBAAA,EAAA,mBAAA,CAAA","file":"chunk-SON743RN.mjs","sourcesContent":["/**\n * Type guards for Mlld AST nodes using discriminated unions\n */\n\n// Import node types for type guards\nimport type {\n TextNode,\n DirectiveNode,\n CodeFenceNode,\n CommentNode,\n VariableReferenceNode,\n LiteralNode,\n DotSeparatorNode,\n PathSeparatorNode,\n ExecInvocation,\n NegationNode,\n FileReferenceNode,\n BinaryExpression,\n TernaryExpression,\n UnaryExpression,\n FieldAccessNode,\n ArraySliceNode,\n ArrayFilterNode,\n TimeDurationNode\n} from './primitives';\n\n// Import the union type\nimport type { MlldNode } from './index';\n\n// Import existing directive types\nimport { ImportDirectiveNode, ImportAllDirectiveNode, ImportSelectedDirectiveNode } from './import';\nimport {\n DataValue,\n DataObjectValue,\n DataArrayValue,\n isDirectiveValue,\n isTemplateValue as isContentNodeArray,\n isDataObjectValue,\n isDataArrayValue,\n isEmbedDirectiveValue,\n isRunDirectiveValue,\n isNestedDirective,\n isNestedEmbedDirective,\n isNestedRunDirective\n} from './var';\nimport { ImportWildcardNode } from './values';\nimport { WithClause } from './run';\nimport type { CapabilityContext, CapabilityKind } from './security';\n\n// Define InterpolatableValue for the guard function\nexport type InterpolatableValue = Array<TextNode | VariableReferenceNode>;\n\n/**\n * Type guard to check if a value is an InterpolatableValue array.\n * Checks if it's an array and if the first element (if any) looks like a TextNode or VariableReferenceNode.\n */\nexport function isInterpolatableValueArray(value: unknown): value is InterpolatableValue {\n return Array.isArray(value) && \n (value.length === 0 || \n (value[0] && typeof value[0] === 'object' && ('type' in value[0]) && \n (value[0].type === 'Text' || value[0].type === 'VariableReference')));\n}\n\n/**\n * Base node type guards using discriminated unions\n */\n\nexport function isTextNode(node: MlldNode): node is TextNode {\n return node.type === 'Text';\n}\n\nexport function isDirectiveNode(node: MlldNode): node is DirectiveNode {\n return node.type === 'Directive';\n}\n\nexport function isCodeFenceNode(node: MlldNode): node is CodeFenceNode {\n return node.type === 'CodeFence';\n}\n\nexport function isCommentNode(node: MlldNode): node is CommentNode {\n return node.type === 'Comment';\n}\n\nexport function isVariableReferenceNode(node: MlldNode): node is VariableReferenceNode {\n return node.type === 'VariableReference';\n}\n\nexport function isLiteralNode(node: MlldNode): node is LiteralNode {\n return node.type === 'Literal';\n}\n\nexport function isDotSeparatorNode(node: MlldNode): node is DotSeparatorNode {\n return node.type === 'DotSeparator';\n}\n\nexport function isPathSeparatorNode(node: MlldNode): node is PathSeparatorNode {\n return node.type === 'PathSeparator';\n}\n\nexport function isFileReferenceNode(node: MlldNode): node is FileReferenceNode {\n return node.type === 'FileReference';\n}\n\n/**\n * Import directive type guards\n */\n\nexport function isImportDirective(node: DirectiveNode): node is ImportDirectiveNode {\n return node.kind === 'import';\n}\n\nexport function isImportAllDirective(node: DirectiveNode): node is ImportAllDirectiveNode {\n return node.kind === 'import' && node.subtype === 'importAll';\n}\n\nexport function isImportSelectedDirective(node: DirectiveNode): node is ImportSelectedDirectiveNode {\n return node.kind === 'import' && node.subtype === 'importSelected';\n}\n\nexport function isWildcardImport(node: VariableReferenceNode): node is ImportWildcardNode {\n return node.valueType === 'import' && node.identifier === '*';\n}\n\n/**\n * ExecInvocation type guards\n */\n\nexport function isExecInvocation(node: any): node is ExecInvocation {\n return node?.type === 'ExecInvocation';\n}\n\nexport function hasWithClause(directive: any): directive is { values: { withClause: WithClause } } {\n return directive?.values?.withClause !== undefined;\n}\n\n/**\n * Negation type guard\n */\nexport function isNegationNode(node: any): node is NegationNode {\n return node?.type === 'Negation';\n}\n\n/**\n * Expression type guards for logical operators\n */\nexport function isBinaryExpression(node: any): node is BinaryExpression {\n return node?.type === 'BinaryExpression';\n}\n\nexport function isTernaryExpression(node: any): node is TernaryExpression {\n return node?.type === 'TernaryExpression';\n}\n\nexport function isUnaryExpression(node: any): node is UnaryExpression {\n return node?.type === 'UnaryExpression';\n}\n\n/**\n * Array operation type guards\n */\nexport function isArraySliceNode(node: FieldAccessNode): node is ArraySliceNode {\n return node.type === 'arraySlice';\n}\n\nexport function isArrayFilterNode(node: FieldAccessNode): node is ArrayFilterNode {\n return node.type === 'arrayFilter';\n}\n\nexport function isTimeDurationNode(node: any): node is TimeDurationNode {\n return node?.type === 'TimeDuration';\n}\n\n// ---------------------------------------------------------------------------\n// CAPABILITY GUARD TYPES\n// ---------------------------------------------------------------------------\n\nexport type GuardEvent =\n | { kind: Extract<CapabilityKind, 'import'>; context: CapabilityContext & { directive: DirectiveNode } }\n | { kind: Extract<CapabilityKind, 'command'>; context: CapabilityContext & { command: string } }\n | { kind: Extract<CapabilityKind, 'output'>; context: CapabilityContext & { target: string } };\n\nexport type GuardDecision =\n | { action: 'allow' }\n | { action: 'deny'; reason: string };\n\nexport type GuardThunk<E = unknown> = (\n event: GuardEvent,\n env: E\n) => GuardDecision | Promise<GuardDecision>;\n\n","import type { DirectiveKind } from './primitives';\n\nexport type ImportType = 'module' | 'static' | 'live' | 'cached' | 'local';\n\n// Placeholder label set; concrete definitions arrive in later phases.\nexport type SecurityLabel =\n | 'secret'\n | 'pii'\n | 'untrusted'\n | 'public'\n | 'trusted'\n | 'audited'\n | 'destructive'\n | 'network';\n\nexport type CapabilityKind = DirectiveKind | 'pipeline' | 'effect';\n\nexport type TaintLevel =\n | 'unknown'\n | 'literal'\n | 'module'\n | 'staticEmbed'\n | 'localFile'\n | 'commandOutput'\n | 'userInput'\n | 'resolver'\n | 'networkCached'\n | 'networkLive'\n | 'llmOutput';\n\nexport interface CapabilitySource {\n path?: string;\n locator?: string;\n description?: string;\n}\n\nexport interface SecurityDescriptor {\n readonly labels: ReadonlySet<SecurityLabel>;\n readonly taint: TaintLevel;\n readonly source?: CapabilitySource;\n readonly inference?: 'explicit' | 'inferred' | 'default';\n}\n\nexport interface CapabilityContext {\n readonly kind: CapabilityKind;\n readonly importType?: ImportType;\n readonly security: SecurityDescriptor;\n readonly metadata?: Record<string, unknown>;\n}\n\nexport function makeSecurityDescriptor(options?: {\n labels?: Iterable<SecurityLabel>;\n taint?: TaintLevel;\n source?: CapabilitySource;\n inference?: SecurityDescriptor['inference'];\n}): SecurityDescriptor {\n const labels = new Set(options?.labels ?? []);\n return {\n labels,\n taint: options?.taint ?? 'unknown',\n source: options?.source,\n inference: options?.inference ?? 'explicit'\n };\n}\n\nexport function mergeDescriptors(\n ...descriptors: Array<SecurityDescriptor | undefined>\n): SecurityDescriptor {\n const labels = new Set<SecurityLabel>();\n let taint: TaintLevel = 'unknown';\n\n for (const descriptor of descriptors) {\n if (!descriptor) continue;\n descriptor.labels.forEach(label => labels.add(label));\n taint = compareTaintLevels(taint, descriptor.taint);\n }\n\n return {\n labels,\n taint,\n inference: descriptors.every(d => d?.inference === 'explicit') ? 'explicit' : 'inferred'\n };\n}\n\nexport function hasLabel(\n descriptor: SecurityDescriptor | undefined,\n label: SecurityLabel\n): boolean {\n if (!descriptor) return false;\n return descriptor.labels.has(label);\n}\n\nexport function compareTaintLevels(a: TaintLevel, b: TaintLevel): TaintLevel {\n const order: TaintLevel[] = [\n 'llmOutput',\n 'networkLive',\n 'networkCached',\n 'resolver',\n 'userInput',\n 'commandOutput',\n 'localFile',\n 'staticEmbed',\n 'module',\n 'literal',\n 'unknown'\n ];\n\n if (a === b) return a;\n const indexA = order.indexOf(a);\n const indexB = order.indexOf(b);\n if (indexA === -1) return b;\n if (indexB === -1) return a;\n return indexA <= indexB ? a : b;\n}\n","/**\n * Error types for AST parsing\n */\n\nimport type { MlldNode } from './nodes';\n\n/**\n * Error codes for parsing failures\n */\nexport enum ParseErrorCode {\n INVALID_SYNTAX = 'INVALID_SYNTAX',\n INVALID_NODE = 'INVALID_NODE',\n UNEXPECTED_TOKEN = 'UNEXPECTED_TOKEN',\n MISSING_REQUIRED_FIELD = 'MISSING_REQUIRED_FIELD',\n INVALID_DIRECTIVE = 'INVALID_DIRECTIVE'\n}\n\n/**\n * AST parsing error\n */\nexport class MlldAstError extends Error {\n constructor(\n message: string,\n public code: ParseErrorCode,\n public location?: { start: { line: number; column: number }; end: { line: number; column: number } }\n ) {\n super(message);\n this.name = 'MlldAstError';\n }\n}\n\n/**\n * Peggy parser error interface\n */\nexport interface PeggyError {\n message: string;\n location?: {\n start: { line: number; column: number; offset: number };\n end: { line: number; column: number; offset: number };\n };\n expected?: Array<{ type: string; description?: string }>;\n found?: string;\n}\n\n/**\n * Parser options\n */\nexport interface ParserOptions {\n failFast?: boolean;\n trackLocations?: boolean;\n validateNodes?: boolean;\n preserveCodeFences?: boolean;\n onError?: (error: Error) => void;\n}\n\n/**\n * Parse result\n */\nexport interface ParseResult {\n success: boolean;\n nodes?: MlldNode[];\n errors?: Error[];\n}","import { \n DirectiveNode, \n NodeType, \n PathNode, \n PathNodeArray, \n TextNode, \n TextNodeArray, \n TypedDirectiveNode, \n VariableNode, \n VariableNodeArray \n} from './base';\n\n// ====================\n// Raw Value Interfaces\n// ====================\n\nexport interface ShowRaw {\n path?: string;\n section?: string;\n headerLevel?: string;\n underHeader?: string;\n content?: string;\n variable?: string;\n names?: string[];\n sectionTitle?: string;\n newTitle?: string;\n}\n\nexport interface ShowPathRaw extends ShowRaw {\n path: string;\n section?: string;\n headerLevel?: string;\n underHeader?: string;\n}\n\nexport interface ShowTemplateRaw extends ShowRaw {\n content: string;\n headerLevel?: string;\n underHeader?: string;\n}\n\nexport interface ShowVariableRaw extends ShowRaw {\n variable: string;\n headerLevel?: string;\n underHeader?: string;\n}\n\nexport interface ShowPathSectionRaw extends ShowRaw {\n sectionTitle: string;\n path: string;\n newTitle?: string;\n}\n\n\n// ====================\n// Value Interfaces\n// ====================\n\nexport interface ShowValues {\n path?: PathNodeArray;\n section?: TextNodeArray;\n headerLevel?: number;\n underHeader?: TextNodeArray;\n content?: TextNodeArray;\n variable?: VariableNodeArray;\n names?: VariableNodeArray;\n sectionTitle?: TextNodeArray;\n newTitle?: TextNodeArray;\n}\n\nexport interface ShowPathValues extends ShowValues {\n path: PathNodeArray;\n section?: TextNodeArray;\n headerLevel?: number;\n underHeader?: TextNodeArray;\n}\n\nexport interface ShowTemplateValues extends ShowValues {\n content: TextNodeArray;\n headerLevel?: number;\n underHeader?: TextNodeArray;\n}\n\nexport interface ShowVariableValues extends ShowValues {\n variable: VariableNodeArray;\n headerLevel?: number;\n underHeader?: TextNodeArray;\n}\n\nexport interface ShowPathSectionValues extends ShowValues {\n sectionTitle: TextNodeArray;\n path: PathNodeArray;\n newTitle?: TextNodeArray;\n}\n\n\n// ====================\n// Metadata Interfaces\n// ====================\n\nexport interface ShowMeta {\n path?: {\n hasVariables: boolean;\n };\n isTemplateContent?: boolean;\n}\n\nexport interface ShowPathMeta extends ShowMeta {\n path: {\n hasVariables: boolean;\n };\n}\n\nexport interface ShowTemplateMeta extends ShowMeta {\n isTemplateContent: boolean;\n hasVariables: boolean;\n wrapperType: string;\n}\n\nexport interface ShowPathSectionMeta extends ShowMeta {\n path: {\n hasVariables: boolean;\n };\n}\n\n// ====================\n// Node Interfaces\n// ====================\n\nexport interface ShowDirectiveNode extends TypedDirectiveNode<'show', \n 'showPath' | 'showTemplate' | 'showVariable' | 'showPathSection'> {\n values: ShowValues;\n raw: ShowRaw;\n meta: ShowMeta;\n}\n\nexport interface ShowPathDirectiveNode extends ShowDirectiveNode {\n subtype: 'showPath';\n values: ShowPathValues;\n raw: ShowPathRaw;\n meta: ShowPathMeta;\n}\n\nexport interface ShowTemplateDirectiveNode extends ShowDirectiveNode {\n subtype: 'showTemplate';\n values: ShowTemplateValues;\n raw: ShowTemplateRaw;\n meta: ShowTemplateMeta;\n}\n\nexport interface ShowVariableDirectiveNode extends ShowDirectiveNode {\n subtype: 'showVariable';\n values: ShowVariableValues;\n raw: ShowVariableRaw;\n meta: ShowMeta;\n}\n\nexport interface ShowPathSectionDirectiveNode extends ShowDirectiveNode {\n subtype: 'showPathSection';\n values: ShowPathSectionValues;\n raw: ShowPathSectionRaw;\n meta: ShowPathSectionMeta;\n}\n\n\n// ====================\n// Type Guards\n// ====================\n\nexport function isShowDirectiveNode(node: DirectiveNode): node is ShowDirectiveNode {\n return node.kind === 'show';\n}\n\nexport function isShowPathDirectiveNode(node: DirectiveNode): node is ShowPathDirectiveNode {\n return isShowDirectiveNode(node) && node.subtype === 'showPath';\n}\n\nexport function isShowTemplateDirectiveNode(node: DirectiveNode): node is ShowTemplateDirectiveNode {\n return isShowDirectiveNode(node) && node.subtype === 'showTemplate';\n}\n\nexport function isShowVariableDirectiveNode(node: DirectiveNode): node is ShowVariableDirectiveNode {\n return isShowDirectiveNode(node) && node.subtype === 'showVariable';\n}\n\nexport function isShowPathSectionDirectiveNode(node: DirectiveNode): node is ShowPathSectionDirectiveNode {\n return isShowDirectiveNode(node) && node.subtype === 'showPathSection';\n}\n\n","/**\n * Exe directive type definitions\n */\nimport { DirectiveNode, TypedDirectiveNode } from './base';\nimport { ContentNodeArray, TextNodeArray, VariableNodeArray } from './values';\nimport { WithClause } from './run';\nimport { ParameterNode } from './primitives';\n\n/**\n * Exe directive raw values\n */\nexport interface ExeRaw {\n identifier: string;\n params: string[];\n metadata?: string;\n command?: string;\n lang?: string;\n code?: string;\n withClause?: WithClause;\n}\n\n/**\n * Exe directive metadata\n */\nexport interface ExeMeta {\n parameterCount: number;\n argumentCount?: number;\n hasVariables?: boolean;\n language?: string;\n isMultiLine?: boolean;\n metadata?: {\n type?: string;\n [key: string]: unknown;\n };\n withClause?: WithClause;\n}\n\n/**\n * Base Exe directive node\n */\nexport interface ExeDirectiveNode extends TypedDirectiveNode<'exe', ExeSubtype> {\n values: ExeValues;\n raw: ExeRaw;\n meta: ExeMeta;\n}\n\n/**\n * Exe subtypes\n */\nexport type ExeSubtype = 'exeCommand' | 'exeCode';\n\n/**\n * Exe directive values - different structures based on subtype\n */\nexport interface ExeValues {\n identifier: TextNodeArray;\n params: ParameterNode[];\n metadata?: TextNodeArray;\n command?: ContentNodeArray;\n lang?: TextNodeArray;\n code?: ContentNodeArray;\n withClause?: WithClause;\n}\n\n/**\n * Exe Command directive - /exe commandName (params) = /run [command]\n */\nexport interface ExeCommandDirectiveNode extends ExeDirectiveNode {\n subtype: 'exeCommand';\n values: {\n identifier: TextNodeArray;\n params: ParameterNode[];\n metadata?: TextNodeArray;\n command: ContentNodeArray;\n };\n raw: {\n identifier: string;\n params: string[];\n metadata?: string;\n command: string;\n };\n meta: ExeMeta;\n}\n\n/**\n * Exe Code directive - /exe commandName (params) = /run language [code]\n */\nexport interface ExeCodeDirectiveNode extends ExeDirectiveNode {\n subtype: 'exeCode';\n values: {\n identifier: TextNodeArray;\n params: ParameterNode[];\n metadata?: TextNodeArray;\n lang: TextNodeArray;\n code: ContentNodeArray;\n };\n raw: {\n identifier: string;\n params: string[];\n metadata?: string;\n lang: string;\n code: string;\n };\n meta: ExeMeta;\n}\n\n/**\n * Type guards to check the type of an exe directive\n */\nexport function isExeDirectiveNode(node: DirectiveNode): node is ExeDirectiveNode {\n return node.kind === 'exe';\n}\n\nexport function isExeCommandDirective(node: ExeDirectiveNode): node is ExeCommandDirectiveNode {\n return node.subtype === 'exeCommand';\n}\n\nexport function isExeCodeDirective(node: ExeDirectiveNode): node is ExeCodeDirectiveNode {\n return node.subtype === 'exeCode';\n}","/**\n * Path directive type definitions\n */\nimport { DirectiveNode, TypedDirectiveNode } from './base';\nimport { VariableNodeArray, PathNodeArray } from './values';\nimport { PathRaw } from './raw';\nimport { PathDirectiveMeta } from './meta';\nimport { TTLValue } from './primitives';\nimport { WithClause } from './run';\n\n/**\n * Path directive values structure\n */\nexport interface PathValues {\n // Common to all path directive subtypes\n identifier: VariableNodeArray;\n path: PathNodeArray;\n ttl?: TTLValue;\n withClause?: WithClause;\n}\n\n/**\n * Base Path directive node\n */\nexport interface PathDirectiveNode extends TypedDirectiveNode<'path', 'pathAssignment'> {\n values: PathValues;\n raw: PathRaw;\n meta: PathDirectiveMeta;\n}\n\n/**\n * Path Assignment directive - @path var = \"$PROJECTPATH/value\"\n */\nexport interface PathAssignmentDirectiveNode extends PathDirectiveNode {\n subtype: 'pathAssignment';\n values: {\n identifier: VariableNodeArray;\n path: PathNodeArray;\n ttl?: TTLValue;\n withClause?: WithClause;\n };\n raw: {\n identifier: string;\n path: string;\n };\n}\n\n/**\n * Type guard to check if node is a path directive\n */\nexport function isPathDirective(node: DirectiveNode): node is PathDirectiveNode {\n return node.kind === 'path';\n}\n\n/**\n * Type guard to check if node is a path assignment directive\n */\nexport function isPathAssignmentDirective(node: DirectiveNode): node is PathAssignmentDirectiveNode {\n return isPathDirective(node) && node.subtype === 'pathAssignment';\n}\n\n/**\n * Type guard to check if node has a special variable path\n */\nexport function hasSpecialVariablePath(node: PathAssignmentDirectiveNode): boolean {\n // Check if the path contains a special variable reference (HOMEPATH, PROJECTPATH, etc.)\n if (node.values.path.length > 0) {\n const firstComponent = node.values.path[0];\n if (firstComponent.type === 'string' && \n (firstComponent.value.startsWith('$HOMEPATH') || \n firstComponent.value.startsWith('$~') ||\n firstComponent.value.startsWith('$PROJECTPATH') ||\n firstComponent.value.startsWith('$.'))) {\n return true;\n }\n \n // For interpolated strings, check components\n if (firstComponent.type === 'interpolated' && \n firstComponent.components && \n firstComponent.components.length > 0 &&\n firstComponent.components[0].type === 'specialVariable') {\n return true;\n }\n }\n \n return false;\n}","/**\n * Run directive type definitions\n */\nimport { DirectiveNode, TypedDirectiveNode } from './base';\nimport type { Expression } from './primitives';\nimport { ContentNodeArray, TextNodeArray, VariableNodeArray } from './values';\n\n/**\n * With clause for pipeline and dependency management\n */\nexport type PipelineStage = PipelineCommand | PipelineCommand[];\n\nexport interface WithClause {\n pipeline?: PipelineStage[];\n needs?: DependencyMap;\n trust?: TrustLevel;\n parallel?: number;\n delayMs?: number;\n stdin?: Expression;\n [key: string]: any; // For other with clause properties\n}\n\n/**\n * A pipeline command reference\n */\nexport interface PipelineCommand {\n identifier: VariableNodeArray;\n args: VariableNodeArray[];\n fields?: any[]; // Field access array\n rawIdentifier: string;\n rawArgs: string[];\n // Optional inline effects attached to this functional stage.\n // These are pipeline builtin \"effect\" commands (e.g., @log) that should\n // execute after this stage succeeds, and do not count as stages themselves.\n effects?: PipelineCommand[];\n}\n\n/**\n * Dependency map by language\n */\nexport interface DependencyMap {\n [language: string]: {\n [packageName: string]: string; // version constraint\n };\n}\n\n/**\n * Run directive raw values\n */\nexport interface RunRaw {\n command?: string;\n lang?: string;\n args?: string[];\n code?: string;\n identifier?: string;\n withClause?: WithClause;\n}\n\n/**\n * Run directive metadata\n */\nexport interface RunMeta {\n isMultiLine?: boolean;\n argumentCount?: number;\n language?: string;\n hasVariables?: boolean;\n withClause?: WithClause;\n}\n\n/**\n * Base Run directive node\n */\nexport interface RunDirectiveNode extends TypedDirectiveNode<'run', RunSubtype> {\n values: RunValues;\n raw: RunRaw;\n meta: RunMeta;\n}\n\n/**\n * Run subtypes\n */\nexport type RunSubtype = 'runCommand' | 'runCode' | 'runExec';\n\n/**\n * Run directive values - different structures based on subtype\n */\nexport interface RunValues {\n command?: ContentNodeArray;\n lang?: TextNodeArray;\n args?: VariableNodeArray;\n code?: ContentNodeArray;\n identifier?: VariableNodeArray;\n withClause?: WithClause;\n}\n\n/**\n * Run Command directive - @run [command]\n */\nexport interface RunCommandDirectiveNode extends RunDirectiveNode {\n subtype: 'runCommand';\n values: {\n command: ContentNodeArray;\n };\n raw: {\n command: string;\n };\n meta: {\n isMultiLine: boolean;\n hasVariables: boolean;\n };\n}\n\n/**\n * Run Code directive - @run language [code]\n */\nexport interface RunCodeDirectiveNode extends RunDirectiveNode {\n subtype: 'runCode';\n values: {\n lang: TextNodeArray;\n args: VariableNodeArray;\n code: ContentNodeArray;\n };\n raw: {\n lang: string;\n args: string[];\n code: string;\n };\n meta: {\n isMultiLine: boolean;\n language: string;\n };\n}\n\n/**\n * Run Exec directive - @run $commandName (arg1, arg2)\n */\nexport interface RunExecDirectiveNode extends RunDirectiveNode {\n subtype: 'runExec';\n values: {\n identifier: VariableNodeArray;\n args: VariableNodeArray;\n };\n raw: {\n identifier: string;\n args: string[];\n };\n meta: {\n argumentCount: number;\n };\n}\n\n/**\n * Type guards to check the type of a run directive\n */\nexport function isRunCommandDirective(node: RunDirectiveNode): node is RunCommandDirectiveNode {\n return node.subtype === 'runCommand';\n}\n\nexport function isRunCodeDirective(node: RunDirectiveNode): node is RunCodeDirectiveNode {\n return node.subtype === 'runCode';\n}\n\nexport function isRunExecDirective(node: RunDirectiveNode): node is RunExecDirectiveNode {\n return node.subtype === 'runExec';\n}\n","/**\n * Type definitions for the output directive\n */\nimport { \n TypedDirectiveNode,\n BaseMlldNode,\n TextNode,\n VariableReferenceNode\n} from './base';\nimport type { FieldAccessNode } from './primitives';\n\n// Output directive subtypes\nexport type OutputSubtype = \n | 'outputDocument'\n | 'outputFile'\n | 'outputStream'\n | 'outputEnv'\n | 'outputResolver'\n | 'outputVariable'\n | 'outputInvocation'\n | 'outputExecInvocation'\n | 'outputCommand'\n | 'outputLiteral';\n\n// Output target types\nexport interface OutputTargetFile {\n type: 'file';\n path: BaseMlldNode[];\n raw: string;\n meta: {\n quoted?: boolean;\n bracketed?: boolean;\n unquoted?: boolean;\n };\n}\n\nexport interface OutputTargetStream {\n type: 'stream';\n stream: 'stdout' | 'stderr';\n raw: string;\n}\n\nexport interface OutputTargetEnv {\n type: 'env';\n varname: string | null; // null means use default MLLD_VARIABLE pattern\n raw: string;\n}\n\nexport interface OutputTargetResolver {\n type: 'resolver';\n resolver: string;\n path: TextNode[];\n raw: string;\n}\n\nexport type OutputTarget = \n | OutputTargetFile\n | OutputTargetStream\n | OutputTargetEnv\n | OutputTargetResolver;\n\n// Output source types\nexport interface OutputSourceVariable {\n type: 'variable';\n subtype: 'outputVariable' | 'outputInvocation';\n values: {\n identifier: VariableReferenceNode[];\n fields?: FieldAccessNode[]; // Field access\n args?: BaseMlldNode[]; // For invocations\n };\n raw: {\n identifier: string;\n fields?: string[];\n args?: string[];\n };\n}\n\nexport interface OutputSourceExec {\n type: 'exec';\n subtype: 'outputExecInvocation';\n values: BaseMlldNode[]; // Exec invocation with tail modifiers\n raw: {\n commandName: string;\n };\n}\n\nexport interface OutputSourceCommand {\n type: 'command';\n subtype: 'outputCommand';\n values: {\n identifier: VariableReferenceNode[];\n args: BaseMlldNode[];\n };\n raw: {\n identifier: string;\n args: string[];\n };\n}\n\nexport interface OutputSourceLiteral {\n type: 'literal';\n subtype: 'outputLiteral';\n values: TextNode[];\n raw: string;\n}\n\nexport type OutputSource = \n | OutputSourceVariable\n | OutputSourceExec\n | OutputSourceCommand\n | OutputSourceLiteral;\n\n// Base output directive interface\nexport interface OutputDirectiveBase extends TypedDirectiveNode<'output', OutputSubtype> {\n kind: 'output';\n values: {\n source?: OutputSource['values'];\n target: OutputTarget;\n };\n raw: {\n source?: OutputSource['raw'];\n target: string;\n };\n meta: {\n sourceType?: OutputSource['type'];\n targetType: OutputTarget['type'];\n hasSource: boolean;\n format?: string;\n explicitFormat?: boolean;\n legacy?: boolean; // For backward compatibility with [path] syntax\n };\n}\n\n// Specific output directive types\nexport interface OutputDocumentDirective extends OutputDirectiveBase {\n subtype: 'outputDocument';\n meta: OutputDirectiveBase['meta'] & { hasSource: false };\n}\n\nexport interface OutputFileDirective extends OutputDirectiveBase {\n subtype: 'outputFile';\n}\n\nexport interface OutputStreamDirective extends OutputDirectiveBase {\n subtype: 'outputStream';\n}\n\nexport interface OutputEnvDirective extends OutputDirectiveBase {\n subtype: 'outputEnv';\n}\n\nexport interface OutputResolverDirective extends OutputDirectiveBase {\n subtype: 'outputResolver';\n}\n\n// Union of all output directive types\nexport type OutputDirective = \n | OutputDocumentDirective\n | OutputFileDirective\n | OutputStreamDirective\n | OutputEnvDirective\n | OutputResolverDirective;\n\n// Type guards\nexport function isOutputDirective(node: BaseMlldNode): node is OutputDirective {\n return node.type === 'Directive' && (node as any).kind === 'output';\n}\n\nexport function isOutputDocumentDirective(node: BaseMlldNode): node is OutputDocumentDirective {\n return isOutputDirective(node) && node.subtype === 'outputDocument';\n}\n\nexport function isOutputFileDirective(node: BaseMlldNode): node is OutputFileDirective {\n return isOutputDirective(node) && node.subtype === 'outputFile';\n}\n\nexport function isOutputStreamDirective(node: BaseMlldNode): node is OutputStreamDirective {\n return isOutputDirective(node) && node.subtype === 'outputStream';\n}\n\nexport function isOutputEnvDirective(node: BaseMlldNode): node is OutputEnvDirective {\n return isOutputDirective(node) && node.subtype === 'outputEnv';\n}\n\nexport function isOutputResolverDirective(node: BaseMlldNode): node is OutputResolverDirective {\n return isOutputDirective(node) && node.subtype === 'outputResolver';\n}\n\n// Utility function to check if target is a file\nexport function isFileTarget(target: OutputTarget): target is OutputTargetFile {\n return target.type === 'file';\n}\n\n// Utility function to check if target is a stream\nexport function isStreamTarget(target: OutputTarget): target is OutputTargetStream {\n return target.type === 'stream';\n}\n\n// Utility function to check if target is env\nexport function isEnvTarget(target: OutputTarget): target is OutputTargetEnv {\n return target.type === 'env';\n}\n\n// Utility function to check if target is resolver\nexport function isResolverTarget(target: OutputTarget): target is OutputTargetResolver {\n return target.type === 'resolver';\n}","/**\n * Type definitions for the @when conditional directive\n */\n\nimport type { DirectiveNode, BaseMlldNode } from './nodes';\n\n/**\n * Modifiers for when block form that control evaluation behavior\n */\nexport type WhenModifier = 'first' | 'all' | 'any';\n\n/**\n * Represents a condition-action pair in when block form\n */\nexport interface WhenConditionPair {\n condition: BaseMlldNode[];\n action?: BaseMlldNode[];\n}\n\n/**\n * Simple form of @when directive: @when <condition> => <action>\n */\nexport interface WhenSimpleNode extends DirectiveNode {\n kind: 'when';\n subtype: 'whenSimple';\n values: {\n condition: BaseMlldNode[];\n action: BaseMlldNode[];\n };\n}\n\n/**\n * Block form of @when directive: @when <var> <modifier>: [...]\n */\nexport interface WhenBlockNode extends DirectiveNode {\n kind: 'when';\n subtype: 'whenBlock';\n values: {\n variable?: BaseMlldNode[];\n modifier: BaseMlldNode[]; // Text node containing modifier value\n conditions: WhenConditionPair[];\n action?: BaseMlldNode[]; // Optional block-level action\n };\n meta: {\n modifier: WhenModifier;\n conditionCount: number;\n hasVariable?: boolean;\n };\n}\n\n/**\n * Match form of @when directive: @when <expression>: [value => action, ...]\n * Evaluates expression and executes actions for all matching conditions\n */\nexport interface WhenMatchNode extends DirectiveNode {\n kind: 'when';\n subtype: 'whenMatch';\n values: {\n expression: BaseMlldNode[]; // Expression to evaluate\n conditions: WhenConditionPair[]; // value => action pairs\n };\n meta: {\n conditionCount: number;\n };\n}\n\n/**\n * Union type for all when directive nodes\n */\nexport type WhenNode = WhenSimpleNode | WhenBlockNode | WhenMatchNode;\n\n/**\n * Type guard for when simple form\n */\nexport function isWhenSimpleNode(node: DirectiveNode): node is WhenSimpleNode {\n return node.kind === 'when' && node.subtype === 'whenSimple';\n}\n\n/**\n * Type guard for when block form\n */\nexport function isWhenBlockNode(node: DirectiveNode): node is WhenBlockNode {\n return node.kind === 'when' && node.subtype === 'whenBlock';\n}\n\n/**\n * Type guard for when match form\n */\nexport function isWhenMatchNode(node: DirectiveNode): node is WhenMatchNode {\n return node.kind === 'when' && node.subtype === 'whenMatch';\n}\n\n/**\n * Type guard for any when directive\n */\nexport function isWhenNode(node: DirectiveNode): node is WhenNode {\n return node.kind === 'when';\n}\n\n/**\n * Tail modifiers that can be applied to when expression results\n */\nexport interface TailModifiers {\n pipes?: BaseMlldNode[];\n}\n\n/**\n * When expression for value-returning contexts\n * Used in /var and /exe RHS: when: [condition => value, ...]\n */\nexport interface WhenExpressionNode extends BaseMlldNode {\n type: 'WhenExpression';\n conditions: WhenConditionPair[];\n withClause?: TailModifiers;\n meta: {\n conditionCount: number;\n isValueReturning: true;\n evaluationType: 'expression';\n hasTailModifiers: boolean;\n };\n}\n\n/**\n * Type guard for when expressions\n */\nexport function isWhenExpression(node: BaseMlldNode): node is WhenExpressionNode {\n return node.type === 'WhenExpression';\n}","/**\n * Var directive AST node type definitions\n * \n * This file defines the AST node types for the new @var directive.\n * These types represent the parsed structure from the grammar.\n */\n\nimport { TypedDirectiveNode } from './base';\nimport { ContentNodeArray, VariableNodeArray } from './values';\nimport { DirectiveNode, ExecInvocation } from './nodes';\nimport type { PipelineStage } from './run';\n\n/**\n * Data object value structure for var directive\n */\nexport interface DataObjectValue {\n type: 'object';\n properties: Record<string, DataValue>;\n}\n\n/**\n * Data array value structure for var directive\n */\nexport interface DataArrayValue {\n type: 'array';\n items: DataValue[];\n}\n\n/**\n * Foreach command expression structure\n */\nexport interface ForeachCommandExpression {\n type: 'foreach-command';\n value: {\n type: 'foreach';\n execInvocation: ExecInvocation;\n arrays: (ContentNodeArray | DirectiveNode)[];\n with?: ForeachWithOptions;\n batchPipeline?: ForeachBatchPipeline | null;\n [key: string]: unknown;\n };\n rawText: string;\n batchPipeline?: ForeachBatchPipeline | null;\n [key: string]: unknown;\n}\n\n/**\n * Batch pipeline metadata for foreach expressions\n */\nexport type ForeachBatchPipeline = \n | PipelineStage[]\n | {\n pipeline: PipelineStage[];\n isBatchPipeline?: boolean;\n [key: string]: unknown;\n };\n\n/**\n * Foreach with-clause options\n */\nexport interface ForeachWithOptions {\n separator?: unknown;\n template?: unknown;\n batchPipeline?: ForeachBatchPipeline | null;\n isBatchPipeline?: boolean;\n [key: string]: unknown;\n}\n\n/**\n * Foreach section expression structure\n */\nexport interface ForeachSectionExpression {\n type: 'foreachSection';\n template: ContentNodeArray;\n arrays: (ContentNodeArray | Directi