agentlang
Version:
The easiest way to build the most reliable AI agents - enterprise-grade teams of AI agents that collaborate with each other and humans
201 lines • 7.82 kB
TypeScript
export declare class BasePattern {
alias: string | undefined;
aliases: string[] | undefined;
handlers: Map<string, BasePattern> | undefined;
setAlias(alias: string): this;
unsetAlias(): this;
addAlias(alias: string): void;
setAliases(aliases: string[]): void;
addHandler(k: 'not_found' | 'error', handler: BasePattern): void;
private aliasesAsString;
private handlersAsString;
hintsAsString(): string;
toString(): string;
}
export declare const EmptyBasePattern: BasePattern;
export declare enum LiteralPatternType {
ID = 0,
NUMBER = 1,
BOOLEAN = 2,
STRING = 3,
REFERENCE = 4,
MAP = 5,
ARRAY = 6
}
export type MapKey = {
str?: string;
num?: number;
bool?: boolean;
};
export declare class LiteralPattern extends BasePattern {
type: LiteralPatternType;
value: any;
static EmptyArray: LiteralPattern;
constructor(type: LiteralPatternType, value: any);
static Id(value: string): LiteralPattern;
static Number(value: number): LiteralPattern;
static Boolean(value: boolean): LiteralPattern;
static String(value: string): LiteralPattern;
static Reference(value: string): LiteralPattern;
static Map(value: Map<MapKey, BasePattern>): LiteralPattern;
static Array(value: Array<BasePattern>): LiteralPattern;
toString(): string;
}
export declare function isLiteralPattern(p: BasePattern): boolean;
export declare function isReferenceLiteral(p: LiteralPattern): boolean;
export declare function referenceParts(p: LiteralPattern): string[] | undefined;
export declare function isStringLiteral(p: LiteralPattern): boolean;
export declare function isNumberLiteral(p: LiteralPattern): boolean;
export declare function isBooleanLiteral(p: LiteralPattern): boolean;
export declare function isIdentifierLiteral(p: LiteralPattern): boolean;
export declare function isArrayLiteral(p: LiteralPattern): boolean;
export declare function isMapLiteral(p: LiteralPattern): boolean;
export declare class FunctionCallPattern extends BasePattern {
fnName: string;
arguments: BasePattern[];
isAsync: boolean;
constructor(fnName: string, args: BasePattern[]);
asAsync(): FunctionCallPattern;
toString(): string;
}
export declare function isFunctionCallPattern(p: BasePattern): boolean;
export declare class ExpressionPattern extends BasePattern {
expression: any;
private static services;
private static doParse;
private static parse;
constructor(expression: any);
static Validated(exprString: string): Promise<ExpressionPattern>;
toString(): string;
}
export declare function isExpressionPattern(p: BasePattern): boolean;
export declare class GroupExpressionPattern extends BasePattern {
expression: ExpressionPattern;
constructor(expr: ExpressionPattern);
toString(): string;
}
export declare function isGroupExpressionPattern(p: BasePattern): boolean;
export declare class NegExpressionPattern extends BasePattern {
expression: ExpressionPattern;
constructor(expr: ExpressionPattern);
toString(): string;
}
export declare class NotExpressionPattern extends BasePattern {
expression: ExpressionPattern;
constructor(expr: ExpressionPattern);
toString(): string;
}
export declare function isNegExpressionPattern(p: BasePattern): boolean;
export declare function isNotExpressionPattern(p: BasePattern): boolean;
export declare class ReferencePattern extends BasePattern {
record: string;
member: string;
constructor(record: string, member: string);
toString(): string;
}
export declare function isReferencePattern(p: BasePattern): boolean;
export type AttributePattern = {
name: string;
op: string | undefined;
value: BasePattern;
};
export declare class CrudPattern extends BasePattern {
recordName: string;
attributes: Array<AttributePattern>;
relationships: Map<string, CrudPattern[] | CrudPattern> | undefined;
into: Map<string, string> | undefined;
isQuery: boolean;
isQueryUpdate: boolean;
isCreate: boolean;
constructor(recordName: string);
addAttribute(n: string, p: BasePattern, op?: string): CrudPattern;
removeAttribute(n: string): CrudPattern;
addInto(alias: string, attr: string): CrudPattern;
removeInto(alias: string): CrudPattern;
resetInto(into?: Map<string, string>): CrudPattern;
hasInto(): boolean;
private flagType;
addRelationship(n: string, p: CrudPattern[] | CrudPattern): this;
removeRelationship(n: string): this;
private attributesAsString;
private relationshipsAsString;
getNormalizedRecordName(): string;
private intoAsString;
toString(): string;
}
export declare function isCrudPattern(p: BasePattern): boolean;
export declare function isCreatePattern(p: BasePattern): boolean;
export declare function isQueryPattern(p: BasePattern): boolean;
export declare function isQueryUpdatePattern(p: BasePattern): boolean;
export declare class ForEachPattern extends BasePattern {
variable: string;
source: BasePattern;
body: BasePattern[];
constructor(variable?: string, source?: BasePattern);
addPattern(p: BasePattern): ForEachPattern;
removePattern(index: number): ForEachPattern;
setPatternAt(p: BasePattern, index: number): ForEachPattern;
removePatternAt(index: number): ForEachPattern;
getPatternAt(index: number): BasePattern;
setVariable(s: string): ForEachPattern;
setSourcePattern(p: BasePattern): ForEachPattern;
toString(): string;
}
export declare function isForEachPattern(p: BasePattern): boolean;
export declare class IfPattern extends BasePattern {
condition: BasePattern;
body: BasePattern[];
elseBody: BasePattern[] | undefined;
private static True;
constructor(condition?: BasePattern);
isEmpty(): boolean;
addPattern(p: BasePattern): IfPattern;
removePattern(index: number): IfPattern;
setPatternAt(p: BasePattern, index: number): IfPattern;
removePatternAt(index: number): IfPattern;
getPatternAt(index: number): BasePattern;
setConditionPattern(p: BasePattern): IfPattern;
setElse(elseBody?: BasePattern[]): IfPattern;
removeElse(): IfPattern;
toString(): string;
}
export declare function isIfPattern(p: BasePattern): boolean;
export declare class CasePattern extends BasePattern {
condition: BasePattern;
body: BasePattern;
constructor(condition: BasePattern, body: BasePattern);
static FromString(s: string): Promise<CasePattern>;
toString(): string;
}
export declare function isCasePattern(p: BasePattern): boolean;
export declare function newCreatePattern(recName: string): CrudPattern;
export declare function newQueryPattern(recName: string, forQueryUpdate?: boolean): CrudPattern;
export declare function newQueryUpdatePattern(recName: string): CrudPattern;
export declare class DeletePattern extends BasePattern {
pattern: BasePattern;
constructor(pattern: BasePattern);
toString(): string;
}
export declare class ReturnPattern extends BasePattern {
pattern: BasePattern;
constructor(pattern: BasePattern);
toString(): string;
}
export declare class FullTextSearchPattern extends BasePattern {
name: string;
query: BasePattern;
options: BasePattern | undefined;
constructor(name: string, query: BasePattern, options?: BasePattern);
toString(): string;
}
export declare function isDeletePattern(p: BasePattern): boolean;
export declare function newDeletePattern(recName: string): DeletePattern;
export declare class FlowStepPattern extends BasePattern {
first: string;
next: string;
condition?: string;
constructor(first: string, next: string, condition?: string);
static Parse(s: string): FlowStepPattern;
toString(): string;
}
//# sourceMappingURL=syntax.d.ts.map