/** * Interface to Apalache * * This functionality is enabled by managing and interacting with the Apalache * server. * * @author Shon Feder, Informal Systems, 2024 * @author Igor Konnov, konnov.phd, 2024 * * @module */ import { Either } from '@sweet-monads/either'; import { ErrorMessage } from './ErrorMessage'; import { ItfTrace } from './itf'; /** * A server endpoint for establishing a connection with the Apalache server. */ export interface ServerEndpoint { hostname: string; port: number; } /** * Parse an endpoint URL in the format hostname:port * @param input the string to parse * @returns either `left(error)`, or `right(ServerEndpoint)` */ export declare function parseServerEndpoint(input: string): Either; export declare function createConfig(loadedConfig: any, parsedSpec: string, args: any, inv?: string[], init?: string, next?: string): ApalacheConfig; /** * Convert an endpoint to a GRPC connection string. * @param endpoint an endpoint * @returns the connection string expected by the Apalache server API */ export declare function serverEndpointToConnectionString(endpoint: ServerEndpoint): string; export declare const DEFAULT_APALACHE_VERSION_TAG = "0.56.1"; type ApalacheError = { explanation: string; errors: ErrorMessage[]; traces?: ItfTrace[]; }; export type ApalacheResult = Either; export type ApalacheConfig = any; type Apalache = { check: (c: ApalacheConfig) => Promise>; tla: (c: ApalacheConfig) => Promise>; }; /** * Fetch the latest Apalache release pinned by `APALACHE_VERSION_TAG` from Github. * * @returns A promise resolving to: * - a `right` equal to the path the Apalache dist was unpacked to, * - a `left` indicating an error. */ export declare function fetchApalache(apalacheVersion: string, verbosityLevel: number): Promise>; /** * Connect to an already running Apalache server, or – if unsuccessful – fetch * Apalache, spawn it, and connect to it. * * If an Apalache server is spawned, the child process exits when the parent process (i.e., this process) terminates. * * @param serverEndpoint * a server endpoint * * @returns A promise resolving to: * - a `right` equal to the path the Apalache dist was unpacked to, * - a `left` indicating an error. */ export declare function connect(serverEndpoint: ServerEndpoint, apalacheVersion: string, verbosityLevel: number): Promise>; export {};