export type TokenType = 'NUMBER' | 'STRING' | 'IDENTIFIER' | 'LET' | 'CONST' | 'FN' | 'IF' | 'ELSE' | 'WHILE' | 'FOR' | 'IN' | 'RETURN' | 'BREAK' | 'CONTINUE' | 'TRY' | 'CATCH' | 'FINALLY' | 'TRUE' | 'FALSE' | 'NULL' | 'SHOW' | 'PROMPT' | 'MAKE' | 'MODEL' | 'IMAGE' | 'STRUCTURED_OUTPUT' | 'TOOL_CALL' | 'MEMORY' | 'IMPORT' | 'FROM' | 'EXPORT' | 'TO' | 'CONVERT' | 'ASYNC' | 'AWAIT' | 'ALLOW' | 'AS' | 'WITH' | 'PLUS' | 'MINUS' | 'STAR' | 'SLASH' | 'PERCENT' | 'EQUAL' | 'EQUAL_EQUAL' | 'BANG' | 'BANG_EQUAL' | 'LESS' | 'LESS_EQUAL' | 'GREATER' | 'GREATER_EQUAL' | 'AMPERSAND_AMPERSAND' | 'PIPE_PIPE' | 'PIPE' | 'DOT' | 'COMMA' | 'SEMICOLON' | 'COLON' | 'ARROW' | 'QUESTION' | 'LEFT_PAREN' | 'RIGHT_PAREN' | 'LEFT_BRACE' | 'RIGHT_BRACE' | 'LEFT_BRACKET' | 'RIGHT_BRACKET' | 'LESS_GREATER' | 'EOF' | 'NEWLINE' | 'COMMENT'; export interface Token { type: TokenType; lexeme: string; literal: string | number | boolean | null; line: number; column: number; } export type ASTNode = Program | Statement | Expression; export interface Program { type: 'Program'; statements: Statement[]; } export type Statement = LetStatement | FunctionStatement | ExpressionStatement | BlockStatement | IfStatement | WhileStatement | ForStatement | ReturnStatement | BreakStatement | ContinueStatement | TryStatement | ImportStatement | AllowStatement | ExportStatement | MemoryStatement; export interface LetStatement { type: 'LetStatement'; name: string; typeAnnotation?: TypeAnnotation; value?: Expression; line: number; leadingComments?: string[]; } export interface FunctionStatement { type: 'FunctionStatement'; name: string; parameters: Parameter[]; returnType?: TypeAnnotation; body: BlockStatement; line: number; isAsync?: boolean; leadingComments?: string[]; } export interface Parameter { name: string; type?: TypeAnnotation; defaultValue?: Expression; } export interface ExpressionStatement { type: 'ExpressionStatement'; expression: Expression; line: number; } export interface BlockStatement { type: 'BlockStatement'; statements: Statement[]; line: number; } export interface IfStatement { type: 'IfStatement'; condition: Expression; thenBranch: BlockStatement; elseBranch?: Statement; line: number; } export interface WhileStatement { type: 'WhileStatement'; condition: Expression; body: BlockStatement; line: number; } export interface ForStatement { type: 'ForStatement'; variable: string; iterable?: Expression; start?: Expression; end?: Expression; body: BlockStatement; line: number; } export interface ReturnStatement { type: 'ReturnStatement'; value?: Expression; line: number; } export interface BreakStatement { type: 'BreakStatement'; line: number; } export interface ContinueStatement { type: 'ContinueStatement'; line: number; } export interface TryStatement { type: 'TryStatement'; tryBlock: BlockStatement; catchParameter: string; catchBlock: BlockStatement; finallyBlock?: BlockStatement; line: number; } export interface ImportStatement { type: 'ImportStatement'; names: string[]; source: string; line: number; } export interface AllowStatement { type: 'AllowStatement'; source: string; binding: string | string[]; line: number; } export interface ExportStatement { type: 'ExportStatement'; statement: FunctionStatement | LetStatement; line: number; leadingComments?: string[]; } export interface MemoryStatement { type: 'MemoryStatement'; name: string; initialValue?: Expression; line: number; } export type Expression = Literal | Identifier | BinaryOp | UnaryOp | LogicalOp | Assignment | CallExpression | MemberExpression | IndexExpression | ArrayLiteral | ObjectLiteral | PromptExpression | ModelCallExpression | ImageCallExpression | VideoCallExpression | StructuredOutputExpression | ToolCallExpression | ConditionalExpression | ConvertExpression | AwaitExpression; export interface Literal { type: 'Literal'; value: string | number | boolean | null; rawType: 'number' | 'string' | 'bool' | 'null'; line: number; } export interface Identifier { type: 'Identifier'; name: string; line: number; } export interface BinaryOp { type: 'BinaryOp'; left: Expression; operator: string; right: Expression; line: number; } export interface UnaryOp { type: 'UnaryOp'; operator: string; operand: Expression; line: number; } export interface LogicalOp { type: 'LogicalOp'; left: Expression; operator: '&&' | '||'; right: Expression; line: number; } export interface Assignment { type: 'Assignment'; left: Expression; right: Expression; line: number; } export interface CallExpression { type: 'CallExpression'; callee: Expression; arguments: Expression[]; line: number; } export interface MemberExpression { type: 'MemberExpression'; object: Expression; property: string; line: number; } export interface IndexExpression { type: 'IndexExpression'; object: Expression; index: Expression; line: number; } export interface ArrayLiteral { type: 'ArrayLiteral'; elements: Expression[]; line: number; } export interface ObjectLiteral { type: 'ObjectLiteral'; properties: Array<{ key: string; value: Expression; }>; line: number; } export interface PromptExpression { type: 'PromptExpression'; name: string; content: Expression[]; line: number; } export interface ModelCallExpression { type: 'ModelCallExpression'; modelName: Expression; config?: Record; prompt: Expression; images?: Expression; line: number; } export interface ImageCallExpression { type: 'ImageCallExpression'; modelName: Expression; config?: Record; prompt: Expression; images?: Expression; line: number; } export interface VideoCallExpression { type: 'VideoCallExpression'; modelName: Expression; config?: Record; prompt: Expression; images?: Expression; line: number; } export interface StructuredOutputExpression { type: 'StructuredOutputExpression'; schema: Record; modelCall: Expression; line: number; } export interface ToolCallExpression { type: 'ToolCallExpression'; functionName: string; arguments: Expression[]; line: number; } export interface ConditionalExpression { type: 'ConditionalExpression'; condition: Expression; thenExpr: Expression; elseExpr: Expression; line: number; } export interface ConvertExpression { type: 'ConvertExpression'; conversionType: string; config?: Record; file: Expression; line: number; } export interface AwaitExpression { type: 'AwaitExpression'; expression: Expression; line: number; } export type TypeAnnotation = PrimitiveType | ArrayType | ObjectType | UnionType | OptionalType; export interface PrimitiveType { type: 'PrimitiveType'; name: 'number' | 'string' | 'bool' | 'null' | 'any'; } export interface ArrayType { type: 'ArrayType'; elementType: TypeAnnotation; } export interface ObjectType { type: 'ObjectType'; valueType: TypeAnnotation; } export interface UnionType { type: 'UnionType'; types: TypeAnnotation[]; } export interface OptionalType { type: 'OptionalType'; baseType: TypeAnnotation; } export type RuntimeValue = number | string | boolean | null | RuntimeArray | RuntimeObject | RuntimeFunction | RuntimeModule | RuntimePromise | RuntimeLazy; export interface RuntimeArray extends Array { } export interface RuntimeObject { [key: string]: RuntimeValue; } export interface RuntimeFunction { type: 'function'; name: string; params: Parameter[]; body: BlockStatement; closure: Environment; isBuiltin?: boolean; isAsync?: boolean; builtin?: (...args: RuntimeValue[]) => RuntimeValue | Promise; } export interface RuntimeModule { type: 'module'; exports: Map; } export interface RuntimePromise { type: 'promise'; promise: Promise; } export interface RuntimeLazy { type: 'lazy'; name: string; forced: boolean; value?: RuntimeValue; thunk: () => Promise; } export declare class Environment { private vars; private parent; constructor(parent?: Environment | null); getValues(): Map; getParent(): Environment | null; define(name: string, value: RuntimeValue): void; get(name: string): RuntimeValue; set(name: string, value: RuntimeValue): void; exists(name: string): boolean; } export interface AIRequest { model: string; prompt: string; temperature?: number; maxTokens?: number; topK?: number; topP?: number; ratio?: string; size?: string; tools?: any[]; images?: string[]; audio?: { data: string; mimeType: string; }; systemPrompt?: string; thinkingLevel?: { thinking?: string; level?: string; } | string; cache?: boolean; search?: boolean; stream?: boolean | ((chunk: string) => void | Promise); } export interface AIResponse { text: string; finishReason?: string; cached?: boolean; usage?: { inputTokens: number; outputTokens: number; thinkingTokens?: number; }; } export interface StructuredOutput { [key: string]: RuntimeValue; } export declare class ReturnValue extends Error { value: RuntimeValue; constructor(value: RuntimeValue); } export declare class BreakException extends Error { constructor(); } export declare class ContinueException extends Error { constructor(); } export declare class SesiRuntimeError extends Error { errorType: string; data: RuntimeValue; line?: number; column?: number; output?: string; stackTrace: string[]; constructor(errorType: string, message: string, data?: RuntimeValue, line?: number, column?: number, output?: string, stackTrace?: string[]); toRuntimeObject(): RuntimeObject; } export type InterpreterError = { message: string; line?: number; column?: number; }; //# sourceMappingURL=types.d.ts.map