import { Spinner } from 'yocto-spinner';

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */
/** Defines a contract for models that can hold additional data besides the described properties. */
interface AdditionalDataHolder {
    /**
     * Gets the additional data for this object that did not belong to the properties.
     * @returns The additional data for this object.
     */
    additionalData?: Record<string, unknown>;
}

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */
/**
 * Defines a serializable model object.
 */
interface Parsable {
}

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */
type Guid = string;

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */
/**
 * Represents a date only. ISO 8601.
 */
declare class DateOnly implements DateOnlyInterface {
    /**
     * Creates a new DateOnly from the given string.
     * @param root0 The year, month, and day
     * @param root0.year The year
     * @param root0.month The month
     * @param root0.day The day
     * @returns The new DateOnly
     * @throws An error if the year is invalid
     * @throws An error if the month is invalid
     * @throws An error if the day is invalid
     */
    constructor({ year, month, day }: Partial<DateOnlyInterface>);
    year: number;
    month: number;
    day: number;
    /**
     * Creates a new DateOnly from the given date.
     * @param date The date
     * @returns The new DateOnly
     * @throws An error if the date is invalid
     */
    static fromDate(date: Date): DateOnly;
    /**
     * Parses a string into a DateOnly. The string can be of the ISO 8601 time only format or a number representing the ticks of a Date.
     * @param value The value to parse
     * @returns The parsed DateOnly.
     * @throws An error if the value is invalid
     */
    static parse(value: string | undefined): DateOnly | undefined;
    /**
     *  Returns a string representation of the date in the format YYYY-MM-DD
     * @returns The date in the format YYYY-MM-DD ISO 8601
     */
    toString(): string;
}
interface DateOnlyInterface {
    /**
     * The year
     * @default 0
     */
    year: number;
    /**
     * The month
     * @default 1
     */
    month: number;
    /**
     * The day
     * @default 1
     */
    day: number;
}

/**
 * Represents a duration value. ISO 8601.
 */
declare class Duration implements DurationInterface {
    /**
     * Creates a new Duration value from the given parameters.
     * @param root0 The years, months, weeks, days, hours, minutes, seconds, and negative flag
     * @param root0.years The years
     * @param root0.months The months
     * @param root0.weeks The weeks
     * @param root0.days The days
     * @param root0.hours The hours
     * @param root0.minutes The minutes
     * @param root0.seconds The seconds
     * @param root0.negative The negative flag
     * @returns The new Duration
     * @throws An error if years is invalid
     * @throws An error if months is invalid
     * @throws An error if weeks is invalid
     * @throws An error if days is invalid
     * @throws An error if hours is invalid
     * @throws An error if minutes is invalid
     * @throws An error if seconds is invalid
     * @throws An error if weeks is used in combination with years or months
     */
    constructor({ years, months, weeks, days, hours, minutes, seconds, negative }: Partial<DurationInterface>);
    years: number;
    months: number;
    weeks: number;
    days: number;
    hours: number;
    minutes: number;
    seconds: number;
    negative: boolean;
    /**
     * Parses a string into a Duration. The string can be of the ISO 8601 duration format.
     * @param value The value to parse
     * @returns The parsed Duration.
     * @throws An error if the value is invalid
     */
    static parse(value: string | undefined): Duration | undefined;
    /**
     * Serializes the duration to a string in the ISO 8601 duration format.
     * @returns The serialized duration.
     */
    toString(): string;
}
interface DurationInterface {
    /**
     * Years of the duration
     * @default 0
     */
    years: number;
    /**
     * Months of the duration
     * @default 0
     */
    months: number;
    /**
     * Weeks of the duration, can't be used together with years or months
     * @default 0
     */
    weeks: number;
    /**
     * Days of the duration
     * @default 0
     */
    days: number;
    /**
     * Hours of the duration
     * @default 0
     */
    hours: number;
    /**
     * Minutes of the duration
     * @default 0
     */
    minutes: number;
    /**
     * Seconds of the duration
     * @default 0
     */
    seconds: number;
    /**
     * Whether the duration is negative
     * @default false
     */
    negative: boolean;
}

declare class TimeOnly implements TimeOnlyInterface {
    /**
     * Creates a new TimeOnly from the given parameters.
     * @param root0 The hours, minutes, seconds, and milliseconds
     * @param root0.hours The hours
     * @param root0.minutes The minutes
     * @param root0.seconds The seconds
     * @param root0.picoseconds The milliseconds
     * @returns The new TimeOnly
     * @throws An error if the milliseconds are invalid
     * @throws An error if the seconds are invalid
     * @throws An error if the minutes are invalid
     * @throws An error if the hours are invalid
     * @throws An error if the milliseconds are invalid
     */
    constructor({ hours, minutes, seconds, picoseconds }: Partial<TimeOnlyInterface>);
    hours: number;
    minutes: number;
    seconds: number;
    picoseconds: number;
    /**
     * Creates a new TimeOnly from the given date.
     * @param date The date
     * @returns The new TimeOnly
     * @throws An error if the date is invalid
     */
    static fromDate(date: Date): TimeOnly;
    /**
     * Parses a string into a TimeOnly. The string can be of the ISO 8601 time only format or a number representing the ticks of a Date.
     * @param value The value to parse
     * @returns The parsed TimeOnly.
     * @throws An error if the value is invalid
     */
    static parse(value: string | undefined): TimeOnly | undefined;
    /**
     * Returns a string representation of the time in the format HH:MM:SS.SSSSSSS
     * @returns The time in the format HH:MM:SS.SSSSSSS
     * @throws An error if the time is invalid
     */
    toString(): string;
}
interface TimeOnlyInterface {
    /**
     * The hours
     * @default 0
     */
    hours: number;
    /**
     * The minutes
     * @default 0
     */
    minutes: number;
    /**
     * The seconds
     * @default 0
     */
    seconds: number;
    /**
     * The milliseconds
     * @default 0
     */
    picoseconds: number;
}

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */

/**
 * Interface for a deserialization node in a parse tree. This interface provides an abstraction layer over serialization formats, libraries and implementations.
 */
interface ParseNode {
    /**
     * Gets the string value of the node.
     * @returns the string value of the node.
     */
    getStringValue(): string | undefined;
    /**
     * Gets a new parse node for the given identifier.
     * @param identifier the identifier of the current node property.
     * @returns a new parse node for the given identifier.
     */
    getChildNode(identifier: string): ParseNode | undefined;
    /**
     * Gets the boolean value of the node.
     * @returns the boolean value of the node.
     */
    getBooleanValue(): boolean | undefined;
    /**
     * Gets the Number value of the node.
     * @returns the Number value of the node.
     */
    getNumberValue(): number | undefined;
    /**
     * Gets the Guid value of the node.
     * @returns the Guid value of the node.
     */
    getGuidValue(): Guid | undefined;
    /**
     * Gets the Date value of the node.
     * @returns the Date value of the node.
     */
    getDateValue(): Date | undefined;
    /**
     * Gets the Duration value of the node.
     * @returns the Duration value of the node.
     */
    getDurationValue(): Duration | undefined;
    /**
     * Gets the DateOnly value of the node.
     * @returns the DateOnly value of the node.
     */
    getDateOnlyValue(): DateOnly | undefined;
    /**
     * Gets the TimeOnly value of the node.
     * @returns the TimeOnly value of the node.
     */
    getTimeOnlyValue(): TimeOnly | undefined;
    /**
     * Gets the collection of primitive values of the node.
     * @returns the collection of primitive values of the node.
     */
    getCollectionOfPrimitiveValues<T>(): T[] | undefined;
    /**
     * Gets the collection of object values of the node.
     * @returns the collection of object values of the node.
     */
    getCollectionOfObjectValues<T extends Parsable>(parsableFactory: ParsableFactory<T>): T[] | undefined;
    /**
     * Gets the model object value of the node.
     * @returns the model object value of the node.
     */
    getObjectValue<T extends Parsable>(parsableFactory: ParsableFactory<T>): T;
    /**
     * Gets the Enum values of the node.
     * @returns the Enum values of the node.
     */
    getCollectionOfEnumValues<T>(type: any): T[];
    /**
     * Gets the Enum value of the node.
     * @returns the Enum value of the node.
     */
    getEnumValue<T>(type: any): T | undefined;
    /**
     * Gets the callback called before the node is deserialized.
     * @returns the callback called before the node is deserialized.
     */
    onBeforeAssignFieldValues: ((value: Parsable) => void) | undefined;
    /**
     * Gets the callback called after the node is deserialized.
     * @returns the callback called after the node is deserialized.
     */
    onAfterAssignFieldValues: ((value: Parsable) => void) | undefined;
    /**
     * Gets the byte array value of the node.
     * @returns the byte array value of the node.
     */
    getByteArrayValue(): ArrayBuffer | undefined;
}

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */

/** Defines an interface for serialization of objects to a stream. */
interface SerializationWriter {
    /**
     * Writes the specified byte array value to the stream with an optional given key.
     * @param key the key to write the value with.
     * @param value the value to write to the stream.
     */
    writeByteArrayValue(key?: string, value?: ArrayBuffer): void;
    /**
     * Writes the specified string value to the stream with an optional given key.
     * @param key the key to write the value with.
     * @param value the value to write to the stream.
     */
    writeStringValue(key?: string, value?: string | null): void;
    /**
     * Writes the specified boolean value to the stream with an optional given key.
     * @param key the key to write the value with.
     * @param value the value to write to the stream.
     */
    writeBooleanValue(key?: string, value?: boolean | null): void;
    /**
     * Writes the specified number value to the stream with an optional given key.
     * @param key the key to write the value with.
     * @param value the value to write to the stream.
     */
    writeNumberValue(key?: string, value?: number | null): void;
    /**
     * Writes the specified Guid value to the stream with an optional given key.
     * @param key the key to write the value with.
     * @param value the value to write to the stream.
     */
    writeGuidValue(key?: string, value?: Guid | null): void;
    /**
     * Writes the specified Date value to the stream with an optional given key.
     * @param key the key to write the value with.
     * @param value the value to write to the stream.
     */
    writeDateValue(key?: string, value?: Date | null): void;
    /**
     * Writes the specified Duration value to the stream with an optional given key.
     * @param key the key to write the value with.
     * @param value the value to write to the stream.
     */
    writeDurationValue(key?: string, value?: Duration | null): void;
    /**
     * Writes the specified TimeOnly value to the stream with an optional given key.
     * @param key the key to write the value with.
     * @param value the value to write to the stream.
     */
    writeTimeOnlyValue(key?: string, value?: TimeOnly | null): void;
    /**
     * Writes the specified DateOnly value to the stream with an optional given key.
     * @param key the key to write the value with.
     * @param value the value to write to the stream.
     */
    writeDateOnlyValue(key?: string, value?: DateOnly | null): void;
    /**
     * Writes the specified collection of primitive values to the stream with an optional given key.
     * @param key the key to write the value with.
     * @param values the value to write to the stream.
     */
    writeCollectionOfPrimitiveValues<T>(key?: string, values?: T[] | null): void;
    /**
     * Writes the specified collection of object values to the stream with an optional given key.
     * @param key the key to write the value with.
     * @param values the value to write to the stream.
     */
    writeCollectionOfObjectValues<T extends Parsable>(key?: string, values?: T[] | null, serializerMethod?: ModelSerializerFunction<T>): void;
    /**
     * Writes the specified model object value to the stream with an optional given key.
     * @param key the key to write the value with.
     * @param value the value to write to the stream.
     */
    writeObjectValue<T extends Parsable>(key?: string, value?: T | null, serializerMethod?: ModelSerializerFunction<T>): void;
    /**
     * Writes the specified enum value to the stream with an optional given key.
     * @param key the key to write the value with.
     * @param values the value to write to the stream.
     */
    writeEnumValue<T>(key?: string, ...values: (T | null | undefined)[]): void;
    /**
     * Writes a null value for the specified key.
     * @param key the key to write the value with.
     */
    writeNullValue(key?: string): void;
    /**
     * Gets the value of the serialized content.
     * @returns the value of the serialized content.
     */
    getSerializedContent(): ArrayBuffer;
    /**
     * Writes the specified additional data values to the stream with an optional given key.
     * @param value the values to write to the stream.
     */
    writeAdditionalData(value: Record<string, unknown> | undefined): void;
    /**
     * Gets the callback called before the object gets serialized.
     * @returns the callback called before the object gets serialized.
     */
    onBeforeObjectSerialization: ((value: Parsable) => void) | undefined;
    /**
     * Gets the callback called after the object gets serialized.
     * @returns the callback called after the object gets serialized.
     */
    onAfterObjectSerialization: ((value: Parsable) => void) | undefined;
    /**
     * Gets the callback called right after the serialization process starts.
     * @returns the callback called right after the serialization process starts.
     */
    onStartObjectSerialization: ((value: Parsable, writer: SerializationWriter) => void) | undefined;
}

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */

type ModelSerializerFunction<T extends Parsable> = (writer: SerializationWriter, value?: Partial<T> | null) => void;
type DeserializeIntoModelFunction<T extends Parsable> = (value?: Partial<T>) => Record<string, (node: ParseNode) => void>;

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */

/**
 * Defines the factory to get the deserializers constructing the parsable models.
 * @param parseNode The node to parse use to get the discriminator value from the payload.
 * @returns The parsable object.
 */
type ParsableFactory<T extends Parsable> = (parseNode: ParseNode | undefined) => DeserializeIntoModelFunction<T>;

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */

/** Defines the contract for a factory that creates SerializationWriter instances. */
interface SerializationWriterFactory {
    /**
     * Gets the content type this factory creates serialization writers for.
     * @returns the content type this factory creates serialization writers for.
     */
    getValidContentType(): string;
    /**
     * Creates a new SerializationWriter instance for the given content type.
     * @param contentType the content type to create a serialization writer for.
     * @returns a new SerializationWriter instance for the given content type.
     */
    getSerializationWriter(contentType: string): SerializationWriter;
}

/**
 * A collection class for HTTP headers. The keys are case-insensitive.
 * @example
 * ```typescript
 * const headers = new Headers();
 * headers.add("header1", "value1");
 * ```
 */
declare class Headers extends Map<string, Set<string>> {
    private headers;
    private readonly singleValueHeaders;
    /**
     * Creates a new Headers object.
     * @param entries An iterable object that contains key-value pairs. Each key-value pair must be an array with two elements: the key of the header, and the value of the header.
     * @example
     * ```typescript
     *  const entries: [string, Set<string>][] = [
     *    ['header1', new Set(['value1'])],
     *    ['header2', new Set(['value2', 'value3'])]
     *  ];
     *  const headers = new Headers(entries);
     * ```
     */
    constructor(entries?: readonly (readonly [string, Set<string>])[] | null);
    /**
     * Sets a header with the specified name and value. If a header with the same name already exists, its value is appended with the specified value.
     * @param headerName the name of the header to set
     * @param headerValue the value of the header to set
     * @returns Headers object
     */
    set(headerName: string, headerValue: Set<string>): this;
    /**
     * Gets the values for the header with the specified name.
     * @param headerName The name of the header to get the values for.
     * @returns The values for the header with the specified name.
     * @throws Error if headerName is null or empty
     */
    get(headerName: string): Set<string> | undefined;
    /**
     * Checks if a header exists.
     * @param key The name of the header to check for.
     * @returns whether or not a header with the given name/key exists.
     */
    has(key: string): boolean;
    /**
     * Delete the header with the specified name.
     * @param headerName The name of the header to delete.
     * @returns Whether or not the header existed and was deleted.
     * @throws Error if headerName is null or empty
     */
    delete(headerName: string): boolean;
    /**
     * clear the headers collection
     */
    clear(): void;
    /**
     * execute a provided function once per each header
     * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each header in the dictionary.
     * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
     */
    forEach(callbackfn: (value: Set<string>, key: string, map: Map<string, Set<string>>) => void, thisArg?: any): void;
    /**
     * Adds values to the header with the specified name.
     * @param headerName The name of the header to add values to.
     * @param headerValues The values to add to the header.
     * @returns Whether or not the values were added to the header.
     */
    add(headerName: string, ...headerValues: string[]): boolean;
    /**
     * Adds values to the header with the specified name if it's not already present
     * @param headerName The name of the header to add values to.
     * @param headerValue The values to add to the header.
     * @returns If the headerValue have been added to the Dictionary.
     */
    tryAdd(headerName: string, headerValue: string): boolean;
    /**
     * Removes the specified value from the header with the specified name.
     * @param headerName The name of the header to remove the value from.
     * @param headerValue The value to remove from the header.
     * @returns Whether or not the header existed and was removed.
     * @throws Error if headerName is null or empty
     * @throws Error if headerValue is null
     */
    remove(headerName: string, headerValue: string): boolean;
    /**
     * Adds all the headers values from the specified headers collection.
     * @param headers The headers to update the current headers with.
     * @throws Error if headers is null
     */
    addAll(headers: Headers): void;
    /**
     * Adds all headers from the request configuration value to the current headers collection.
     * Replaces any existing headers with the same key.
     * @param headers The headers to update the current headers with.
     * @throws Error if headers is null
     */
    addAllRaw(headers: Record<string, string | string[]>): void;
    /**
     * Gets the values for the header with the specified name.
     * @param key The name of the header to get the values for.
     * @returns The values for the header with the specified name.
     * @throws Error if key is null or empty
     */
    tryGetValue(key: string): string[] | null;
    /**
     * Override toString method for the headers collection
     * @returns a string representation of the headers collection
     */
    toString(): string;
    /**
     * check if the headers collection is empty
     * @returns a boolean indicating if the headers collection is empty
     */
    isEmpty(): boolean;
    /**
     * get keys of the headers collection
     * @returns an iterator of keys
     */
    keys(): IterableIterator<string>;
    /**
     * get entries
     * @returns an iterator of entries
     */
    entries(): IterableIterator<[string, Set<string>]>;
}

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */
/**
 * Represents the HTTP method used by a request.
 */
declare enum HttpMethod {
    /** The HTTP GET method */
    GET = "GET",
    /** The HTTP POST method */
    POST = "POST",
    /** The HTTP PATCH method */
    PATCH = "PATCH",
    /** The HTTP DELETE method */
    DELETE = "DELETE",
    /** The HTTP OPTIONS method */
    OPTIONS = "OPTIONS",
    /** The HTTP CONNECT method */
    CONNECT = "CONNECT",
    /** The HTTP TRACE method */
    TRACE = "TRACE",
    /** The HTTP HEAD method */
    HEAD = "HEAD",
    /** The HTTP PUT method */
    PUT = "PUT"
}

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */
/** Represents a request option. */
interface RequestOption {
    /** Gets the option key for when adding it to a request. Must be unique. */
    getKey(): string;
}

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */

/**
 * Request configuration
 * @template T Query parameters type
 */
interface RequestConfiguration<T extends object> {
    /**
     * Request headers
     */
    headers?: Record<string, string | string[]>;
    /**
     * Request options
     */
    options?: RequestOption[];
    /**
     * Request query parameters
     */
    queryParameters?: T;
}

/** This class represents an abstract HTTP request. */
declare class RequestInformation implements RequestInformationSetContent {
    /**
     * Initializes a request information instance with the provided values.
     * @param httpMethod The HTTP method for the request.
     * @param urlTemplate The URL template for the request.
     * @param pathParameters The path parameters for the request.
     */
    constructor(httpMethod?: HttpMethod, urlTemplate?: string, pathParameters?: Record<string, unknown>);
    /** The URI of the request. */
    private uri?;
    /** The path parameters for the request. */
    pathParameters: Record<string, unknown>;
    /** The URL template for the request */
    urlTemplate?: string;
    /**
     * Gets the URL of the request
     * @returns the url string
     */
    get URL(): string;
    /** Sets the URL of the request */
    set URL(url: string);
    static readonly raw_url_key = "request-raw-url";
    /** The HTTP method for the request */
    httpMethod?: HttpMethod;
    /** The Request Body. */
    content?: ArrayBuffer;
    /** The Query Parameters of the request. */
    queryParameters: Record<string, string | number | boolean | string[] | number[] | undefined>;
    /** The Request Headers. */
    headers: Headers;
    private _requestOptions;
    /**
     * Gets the request options for the request.
     * @returns the request options.
     */
    getRequestOptions(): Record<string, RequestOption>;
    /**
     * Adds the headers for the request.
     * @param source The source collection to add the headers to
     */
    addRequestHeaders(source: Record<string, string | string[]> | undefined): void;
    /**
     * Adds the request options for the request.
     * @param options the options to add.
     */
    addRequestOptions(options: RequestOption[] | undefined): void;
    /**
     * Removes the request options for the request.
     * @param options the options to remove.
     */
    removeRequestOptions(...options: RequestOption[]): void;
    private static readonly binaryContentType;
    private static readonly contentTypeHeader;
    private static readonly tracerKey;
    private static readonly requestTypeKey;
    /**
     * Sets the request body from a model with the specified content type.
     * @param requestAdapter The adapter service to get the serialization writer from.
     * @param contentType the content type.
     * @param value the models.
     * @param modelSerializerFunction the serialization function for the model type.
     */
    setContentFromParsable: <T extends Parsable>(requestAdapter?: RequestAdapter, contentType?: string, value?: T[] | T, modelSerializerFunction?: ModelSerializerFunction<T>) => void;
    private readonly setContentAndContentType;
    private readonly getSerializationWriter;
    /**
     * Sets the request body from a model with the specified content type.
     * @param requestAdapter The adapter service to get the serialization writer from.
     * @param contentType the content type.
     * @param value the scalar values to serialize.
     */
    setContentFromScalar: <T extends PrimitiveTypesForDeserializationType>(requestAdapter: RequestAdapter | undefined, contentType: string | undefined, value: T[] | T) => void;
    /**
     * Sets the request body to be a binary stream.
     * @param value the binary stream
     * @param contentType the content type.
     */
    setStreamContent: (value: ArrayBuffer, contentType?: string) => void;
    private normalizeValue;
    /**
     * Sets the query string parameters from a raw object.
     * @param q parameters the parameters.
     * @param p the mapping from code symbol to URI template parameter name.
     */
    setQueryStringParametersFromRawObject<T extends object>(q?: T, p?: Record<string, string>): void;
    /**
     * Configure the current request with headers, query parameters and options.
     * @param config the configuration object to use.
     * @param queryParametersMapper mapping between code symbols and URI template parameter names.
     */
    configure<T extends object>(config?: RequestConfiguration<T>, queryParametersMapper?: Record<string, string>): void;
}
/**
 * Describes the contract of request adapter set content methods so it can be used in request metadata.
 */
interface RequestInformationSetContent {
    setStreamContent(value: ArrayBuffer, contentType?: string): void;
    setContentFromScalar<T extends PrimitiveTypesForDeserializationType>(requestAdapter: RequestAdapter | undefined, contentType: string | undefined, value: T[] | T): void;
    setContentFromParsable<T extends Parsable>(requestAdapter?: RequestAdapter, contentType?: string, value?: T[] | T, modelSerializerFunction?: ModelSerializerFunction<T>): void;
}

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */
/**
 * Stores model information in a different location than the object properties. Implementations can provide dirty tracking capabilities, caching capabilities or integration with 3rd party stores.
 */
interface BackingStore {
    /**
     * Gets a value from the backing store based on its key. Returns null if the value hasn't changed and "ReturnOnlyChangedValues" is true.
     * @returns The value from the backing store.
     * @param key The key to lookup the backing store with.
     */
    get<T>(key: string): T | undefined;
    /**
     * Sets or updates the stored value for the given key.
     * Will trigger subscriptions callbacks.
     * @param key The key to store and retrieve the information.
     * @param value The value to be stored.
     */
    set<T>(key: string, value: T): void;
    /**
     * Enumerates all the values stored in the backing store. Values will be filtered if "ReturnOnlyChangedValues" is true.
     * @returns The values available in the backing store.
     */
    enumerate(): {
        key: string;
        value: unknown;
    }[];
    /**
     * Enumerates the keys for all values that changed to null.
     * @returns The keys for the values that changed to null.
     */
    enumerateKeysForValuesChangedToNull(): string[];
    /**
     * Creates a subscription to any data change happening.
     * @param callback Callback to be invoked on data changes where the first parameter is the data key, the second the previous value and the third the new value.
     * @param subscriptionId The subscription Id to use.
     * @returns The subscription Id to use when removing the subscription
     */
    subscribe(callback: () => {
        key: string;
        previousValue: unknown;
        newValue: unknown;
    }, subscriptionId?: string): string;
    /**
     * Removes a subscription from the store based on its subscription id.
     * @param subscriptionId The Id of the subscription to remove.
     */
    unsubscribe(subscriptionId: string): void;
    /**
     * Clears the data stored in the backing store. Doesn't trigger any subscription.
     */
    clear(): void;
    /**
     * Whether the initialization of the object and/or the initial deserialization has been completed to track whether objects have changed.
     */
    initializationCompleted: boolean;
    /**
     * Whether to return only values that have changed since the initialization of the object when calling the Get and Enumerate methods.
     */
    returnOnlyChangedValues: boolean;
}

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */

/** Defines the contract for a factory that creates backing stores. */
interface BackingStoreFactory {
    /**
     * Creates a new instance of the backing store.
     * @returns a new instance of the backing store.
     */
    createBackingStore(): BackingStore;
}

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */

/** Service responsible for translating abstract Request Info into concrete native HTTP requests. */
interface RequestAdapter {
    /**
     * Gets the serialization writer factory currently in use for the HTTP core service.
     * @returns the serialization writer factory currently in use for the HTTP core service.
     */
    getSerializationWriterFactory(): SerializationWriterFactory;
    /**
     * Executes the HTTP request specified by the given RequestInformation and returns the deserialized response model.
     * @param requestInfo the request info to execute.
     * @param type the class of the response model to deserialize the response into.
     * @param errorMappings the error factories mapping to use in case of a failed request.
     * @returns a {@link Promise} with the deserialized response model.
     */
    send<ModelType extends Parsable>(requestInfo: RequestInformation, type: ParsableFactory<ModelType>, errorMappings: ErrorMappings | undefined): Promise<ModelType | undefined>;
    /**
     * Executes the HTTP request specified by the given RequestInformation and returns the deserialized response model collection.
     * @param requestInfo the request info to execute.
     * @param type the class of the response model to deserialize the response into.
     * @param errorMappings the error factories mapping to use in case of a failed request.
     * @returns a {@link Promise} with the deserialized response model collection.
     */
    sendCollection<ModelType extends Parsable>(requestInfo: RequestInformation, type: ParsableFactory<ModelType>, errorMappings: ErrorMappings | undefined): Promise<ModelType[] | undefined>;
    /**
     * Executes the HTTP request specified by the given RequestInformation and returns the deserialized response model collection.
     * @param requestInfo the request info to execute.
     * @param responseType the class of the response model to deserialize the response into.
     * @param errorMappings the error factories mapping to use in case of a failed request.
     * @returns a {@link Promise} with the deserialized response model collection.
     */
    sendCollectionOfPrimitive<ResponseType extends Exclude<PrimitiveTypesForDeserializationType, ArrayBuffer>>(requestInfo: RequestInformation, responseType: Exclude<PrimitiveTypesForDeserialization, "ArrayBuffer">, errorMappings: ErrorMappings | undefined): Promise<ResponseType[] | undefined>;
    /**
     * Executes the HTTP request specified by the given RequestInformation and returns the deserialized primitive response model.
     * @param requestInfo the request info to execute.
     * @param responseType the class of the response model to deserialize the response into.
     * @param errorMappings the error factories mapping to use in case of a failed request.
     * @returns a {@link Promise} with the deserialized primitive response model.
     */
    sendPrimitive<ResponseType extends PrimitiveTypesForDeserializationType>(requestInfo: RequestInformation, responseType: PrimitiveTypesForDeserialization, errorMappings: ErrorMappings | undefined): Promise<ResponseType | undefined>;
    /**
     * Executes the HTTP request specified by the given RequestInformation and returns the deserialized primitive response model.
     * @param requestInfo the request info to execute.
     * @param errorMappings the error factories mapping to use in case of a failed request.
     * @returns a {@link Promise} of void.
     */
    sendNoResponseContent(requestInfo: RequestInformation, errorMappings: ErrorMappings | undefined): Promise<void>;
    /**
     * Executes the HTTP request specified by the given RequestInformation and returns the deserialized enum response model.
     * @template EnumObject - The type of the enum object. Must extend Record<string, unknown>.
     * @param requestInfo - The request info to execute.
     * @param enumObject - The Enum object expected in the response.
     * @param errorMappings - the error factories mapping to use in case of a failed request.
     * @returns A promise that resolves to the response of the request, or undefined if an error occurred.
     */
    sendEnum<EnumObject extends Record<string, unknown>>(requestInfo: RequestInformation, enumObject: EnumObject, errorMappings: ErrorMappings | undefined): Promise<EnumObject[keyof EnumObject] | undefined>;
    /**
     * Executes the HTTP request specified by the given RequestInformation and returns the deserialized response model collection.
     * @template EnumObject - The type of the enum objects. Must extend Record<string, unknown>.
     * @param requestInfo - The request info to execute.
     * @param enumObject - The Enum object expected in the response.
     * @param errorMappings - the error factories mapping to use in case of a failed request.
     * @returns a promise with the deserialized response model collection.
     */
    sendCollectionOfEnum<EnumObject extends Record<string, unknown>>(requestInfo: RequestInformation, enumObject: EnumObject, errorMappings: ErrorMappings | undefined): Promise<EnumObject[keyof EnumObject][] | undefined>;
    /**
     * Enables the backing store proxies for the SerializationWriters and ParseNodes in use.
     * @param backingStoreFactory the backing store factory to use.
     */
    enableBackingStore(backingStoreFactory?: BackingStoreFactory): void;
    /** The base url for every request. */
    baseUrl: string;
    /**
     * Converts the given RequestInformation into a native HTTP request used by the implementing adapter.
     * @param requestInfo the request info to convert.
     * @returns a {@link Promise} with the native request.
     */
    convertToNativeRequest<T>(requestInfo: RequestInformation): Promise<T>;
}
interface ErrorMappings {
    _4XX?: ParsableFactory<Parsable>;
    _5XX?: ParsableFactory<Parsable>;
    XXX?: ParsableFactory<Parsable>;
    [key: number]: ParsableFactory<Parsable>;
}
type PrimitiveTypesForDeserializationType = string | number | boolean | Date | DateOnly | TimeOnly | Duration | ArrayBuffer;
type PrimitiveTypesForDeserialization = "string" | "number" | "boolean" | "Date" | "DateOnly" | "TimeOnly" | "Duration" | "ArrayBuffer";

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */
/** Parent interface for errors thrown by the client when receiving failed responses to its requests. */
interface ApiError extends Error {
    /** The status code for the error. */
    responseStatusCode: number | undefined;
    /** The Response Headers. */
    responseHeaders: Record<string, string[]> | undefined;
}

/**
 * -------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.
 * See License in the project root for license information.
 * -------------------------------------------------------------------------------------------
 */
interface BaseRequestBuilder<T> {
    withUrl(rawUrl: string): T;
}

interface AgentDescription extends AdditionalDataHolder, Parsable {
    /**
     * Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
     */
    additionalData?: Record<string, unknown>;
    /**
     * The name of the agent
     */
    agentName?: string | null;
    /**
     * A list of agent parameters that you can extract from the user's prompt.
     */
    agentParameterNames?: string[] | null;
    /**
     * The description of this agent, its purpose and capabilities.
     */
    description?: string | null;
    /**
     * This agent ONLY generates if user mentioned one of these topics
     */
    topics?: string[] | null;
}
/**
 * This schema represents a generated plan to execute agents to fulfill the user's request. The chat message should be non-technical - do NOT mention agents.
 */
interface AgentExecutionPlanSchema extends AdditionalDataHolder, Parsable {
    /**
     * Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
     */
    additionalData?: Record<string, unknown>;
    /**
     * The chat response to the user's message - a friendly non-technical message. Do NOT mention agents.
     */
    chatMessage?: string | null;
    /**
     * The ordered list of agents that you recommend should be used to handle the user's prompt. Only the most relevant agents should be recommended.
     */
    recommendedAgents?: RecommendedAgent[] | null;
}
type BlackboardFormat = (typeof BlackboardFormatObject)[keyof typeof BlackboardFormatObject];
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {AgentDescription}
 */
declare function createAgentDescriptionFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {AgentExecutionPlanSchema}
 */
declare function createAgentExecutionPlanSchemaFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {FunctionAgentDefinitionMinimal_agent_parameters}
 */
declare function createFunctionAgentDefinitionMinimal_agent_parametersFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {FunctionAgentDefinitionMinimal}
 */
declare function createFunctionAgentDefinitionMinimalFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {FunctionCallBlackboardInput}
 */
declare function createFunctionCallBlackboardInputFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {FunctionCallBlackboardOutput}
 */
declare function createFunctionCallBlackboardOutputFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {FunctionCallGenerateRequest}
 */
declare function createFunctionCallGenerateRequestFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {FunctionCallSchema_parameters}
 */
declare function createFunctionCallSchema_parametersFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {FunctionCallSchema}
 */
declare function createFunctionCallSchemaFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {FunctionSpecSchema}
 */
declare function createFunctionSpecSchemaFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {GeneratePlanRequest}
 */
declare function createGeneratePlanRequestFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {HTTPValidationError}
 */
declare function createHTTPValidationErrorFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {Message}
 */
declare function createMessageFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {ParameterSpec}
 */
declare function createParameterSpecFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {RecommendedAgent_agent_parameters}
 */
declare function createRecommendedAgent_agent_parametersFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {RecommendedAgent}
 */
declare function createRecommendedAgentFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns {ValidationError}
 */
declare function createValidationErrorFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoAgentDescription(agentDescription?: Partial<AgentDescription> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoAgentExecutionPlanSchema(agentExecutionPlanSchema?: Partial<AgentExecutionPlanSchema> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoFunctionAgentDefinitionMinimal(functionAgentDefinitionMinimal?: Partial<FunctionAgentDefinitionMinimal> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoFunctionAgentDefinitionMinimal_agent_parameters(functionAgentDefinitionMinimal_agent_parameters?: Partial<FunctionAgentDefinitionMinimal_agent_parameters> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoFunctionCallBlackboardInput(functionCallBlackboardInput?: Partial<FunctionCallBlackboardInput> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoFunctionCallBlackboardOutput(functionCallBlackboardOutput?: Partial<FunctionCallBlackboardOutput> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoFunctionCallGenerateRequest(functionCallGenerateRequest?: Partial<FunctionCallGenerateRequest> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoFunctionCallSchema(functionCallSchema?: Partial<FunctionCallSchema> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoFunctionCallSchema_parameters(functionCallSchema_parameters?: Partial<FunctionCallSchema_parameters> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoFunctionSpecSchema(functionSpecSchema?: Partial<FunctionSpecSchema> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoGeneratePlanRequest(generatePlanRequest?: Partial<GeneratePlanRequest> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoHTTPValidationError(hTTPValidationError?: Partial<HTTPValidationError> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoMessage(message?: Partial<Message> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoParameterSpec(parameterSpec?: Partial<ParameterSpec> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoRecommendedAgent(recommendedAgent?: Partial<RecommendedAgent> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoRecommendedAgent_agent_parameters(recommendedAgent_agent_parameters?: Partial<RecommendedAgent_agent_parameters> | undefined): Record<string, (node: ParseNode) => void>;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
declare function deserializeIntoValidationError(validationError?: Partial<ValidationError> | undefined): Record<string, (node: ParseNode) => void>;
interface FunctionAgentDefinitionMinimal extends Parsable {
    /**
     * The set of 'input' function calls that this agent understands. Each agent should understand its own output, but can also understand a subset of the output of other agents. This allows the agents to collaborate.
     */
    acceptedFunctions?: FunctionSpecSchema[] | null;
    /**
     * The name of the agent
     */
    agentName?: string | null;
    /**
     * A list of agent parameters to extract from the user prompt
     */
    agentParameters?: FunctionAgentDefinitionMinimal_agent_parameters | null;
    /**
     * The description of this agent, its purpose and capabilities.
     */
    description?: string | null;
    /**
     * The set of 'output' function calls that this agent generates.
     */
    functionsAllowedToGenerate?: FunctionSpecSchema[] | null;
    /**
     * This agent ONLY generates if user mentioned one of these topics
     */
    topics?: string[] | null;
}
/**
 * A list of agent parameters to extract from the user prompt
 */
interface FunctionAgentDefinitionMinimal_agent_parameters extends AdditionalDataHolder, Parsable {
    /**
     * Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
     */
    additionalData?: Record<string, unknown>;
}
interface FunctionCallBlackboardInput extends Parsable {
    /**
     * The format property
     */
    format?: BlackboardFormat | null;
    /**
     * The internal_newly_generated_functions property
     */
    internalNewlyGeneratedFunctions?: FunctionCallSchema[] | null;
    /**
     * The internal_newly_generated_messages property
     */
    internalNewlyGeneratedMessages?: Message[] | null;
    /**
     * All previously generated functions: either from client (representing its data) or from agents in this generation
     */
    internalPreviouslyGeneratedFunctions?: FunctionCallSchema[] | null;
    /**
     * The internal_previous_messages property
     */
    internalPreviousMessages?: Message[] | null;
}
interface FunctionCallBlackboardOutput extends Parsable {
    /**
     * The format property
     */
    format?: BlackboardFormat | null;
    /**
     * The internal_newly_generated_functions property
     */
    internalNewlyGeneratedFunctions?: FunctionCallSchema[] | null;
    /**
     * The internal_newly_generated_messages property
     */
    internalNewlyGeneratedMessages?: Message[] | null;
    /**
     * All previously generated functions: either from client (representing its data) or from agents in this generation
     */
    internalPreviouslyGeneratedFunctions?: FunctionCallSchema[] | null;
    /**
     * The internal_previous_messages property
     */
    internalPreviousMessages?: Message[] | null;
}
interface FunctionCallGenerateRequest extends Parsable {
    /**
     * The defintions of the Agents to execute, in order.
     */
    agentDefinitions?: FunctionAgentDefinitionMinimal[] | null;
    /**
     * Optionally include the previous Blackboard state, to have a conversation (avoids stateless server). This contains previous state and new data (which the user has updated either by executing its implementation of Function Calls).
     */
    blackboard?: FunctionCallBlackboardInput | null;
    /**
     * Describe the purpose and domain of this chat system.
     */
    chatAgentDescription?: string | null;
    /**
     * Optionally also include a previously generated plan, to reduce latency. If no plan is included, OR there is a user prompt, then generate will also internally call generate_plan.
     */
    executionPlan?: AgentExecutionPlanSchema | null;
    /**
     * The input from the user
     */
    userPrompt?: string | null;
}
/**
 * This schema represents a function call that was already generated.
 */
interface FunctionCallSchema extends AdditionalDataHolder, Parsable {
    /**
     * Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
     */
    additionalData?: Record<string, unknown>;
    /**
     * The name of the agent that generated the function call
     */
    agentName?: string | null;
    /**
     * The name of the function
     */
    functionName?: string | null;
    /**
     * The named parameters and their values
     */
    parameters?: FunctionCallSchema_parameters | null;
}
/**
 * The named parameters and their values
 */
interface FunctionCallSchema_parameters extends AdditionalDataHolder, Parsable {
    /**
     * Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
     */
    additionalData?: Record<string, unknown>;
}
/**
 * This schema represents the definition of a function call that can be generated.
 */
interface FunctionSpecSchema extends AdditionalDataHolder, Parsable {
    /**
     * Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
     */
    additionalData?: Record<string, unknown>;
    /**
     * Describes what the function does
     */
    description?: string | null;
    /**
     * The name of the function
     */
    functionName?: string | null;
    /**
     * Named parameters of the function
     */
    parameters?: ParameterSpec[] | null;
}
interface GeneratePlanRequest extends Parsable {
    /**
     * The descriptions of the available Agents. The response will contain the most suitable agents to execute in order.
     */
    agentDescriptions?: AgentDescription[] | null;
    /**
     * Describes the 'fallback' chat agent: if no suitable agents are recommended, this chat agent will be recommended, if the user's prompt is supported. The description should include the purpose and domain of this chat system.
     */
    chatAgentDescription?: string | null;
    /**
     * The chat message history, in case user is referring to previous messages. AI must take account of the previous messages, but prioritize the user_prompt.
     */
    messages?: Message[] | null;
    /**
     * Optionally also send a previously generated plan, so the AI can generate a new plan taking into account the user's feedback (in user_prompt).
     */
    previousPlan?: AgentExecutionPlanSchema | null;
    /**
     * The input from the user
     */
    userPrompt?: string | null;
}
interface HTTPValidationError extends AdditionalDataHolder, ApiError, Parsable {
    /**
     * Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
     */
    additionalData?: Record<string, unknown>;
    /**
     * The detail property
     */
    detail?: ValidationError[] | null;
}
interface Message extends AdditionalDataHolder, Parsable {
    /**
     * Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
     */
    additionalData?: Record<string, unknown>;
    /**
     * The message property
     */
    message?: string | null;
    /**
     * The role property
     */
    role?: MessageRole | null;
}
type MessageRole = (typeof MessageRoleObject)[keyof typeof MessageRoleObject];
/**
 * Defines one parameter of a function, including its name, type and allowed values. If allowed values are empty, then values must match the 'type'.
 */
interface ParameterSpec extends AdditionalDataHolder, Parsable {
    /**
     * Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
     */
    additionalData?: Record<string, unknown>;
    /**
     * The allowed_values property
     */
    allowedValues?: string[] | null;
    /**
     * The name property
     */
    name?: string | null;
    /**
     * Defines the type of a parameter.
     */
    type?: ParameterType | null;
}
type ParameterType = (typeof ParameterTypeObject)[keyof typeof ParameterTypeObject];
/**
 * This schema represents one agent that you recommend be used to handle the user's prompt.The recommendation includes the name of the agent, and a version of the user's prompt that has been rewritten to suit that agent.
 */
interface RecommendedAgent extends AdditionalDataHolder, Parsable {
    /**
     * Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
     */
    additionalData?: Record<string, unknown>;
    /**
     * The name of the agent
     */
    agentName?: string | null;
    /**
     * Agent Parameters that you extracted from the user's prompt
     */
    agentParameters?: RecommendedAgent_agent_parameters | null;
    /**
     * The user's prompt, rewritten to suit this agent
     */
    rewrittenUserPrompt?: string | null;
}
/**
 * Agent Parameters that you extracted from the user's prompt
 */
interface RecommendedAgent_agent_parameters extends AdditionalDataHolder, Parsable {
    /**
     * Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
     */
    additionalData?: Record<string, unknown>;
}
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeAgentDescription(writer: SerializationWriter, agentDescription?: Partial<AgentDescription> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeAgentExecutionPlanSchema(writer: SerializationWriter, agentExecutionPlanSchema?: Partial<AgentExecutionPlanSchema> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeFunctionAgentDefinitionMinimal(writer: SerializationWriter, functionAgentDefinitionMinimal?: Partial<FunctionAgentDefinitionMinimal> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeFunctionAgentDefinitionMinimal_agent_parameters(writer: SerializationWriter, functionAgentDefinitionMinimal_agent_parameters?: Partial<FunctionAgentDefinitionMinimal_agent_parameters> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeFunctionCallBlackboardInput(writer: SerializationWriter, functionCallBlackboardInput?: Partial<FunctionCallBlackboardInput> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeFunctionCallBlackboardOutput(writer: SerializationWriter, functionCallBlackboardOutput?: Partial<FunctionCallBlackboardOutput> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeFunctionCallGenerateRequest(writer: SerializationWriter, functionCallGenerateRequest?: Partial<FunctionCallGenerateRequest> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeFunctionCallSchema(writer: SerializationWriter, functionCallSchema?: Partial<FunctionCallSchema> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeFunctionCallSchema_parameters(writer: SerializationWriter, functionCallSchema_parameters?: Partial<FunctionCallSchema_parameters> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeFunctionSpecSchema(writer: SerializationWriter, functionSpecSchema?: Partial<FunctionSpecSchema> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeGeneratePlanRequest(writer: SerializationWriter, generatePlanRequest?: Partial<GeneratePlanRequest> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeHTTPValidationError(writer: SerializationWriter, hTTPValidationError?: Partial<HTTPValidationError> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeMessage(writer: SerializationWriter, message?: Partial<Message> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeParameterSpec(writer: SerializationWriter, parameterSpec?: Partial<ParameterSpec> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeRecommendedAgent(writer: SerializationWriter, recommendedAgent?: Partial<RecommendedAgent> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeRecommendedAgent_agent_parameters(writer: SerializationWriter, recommendedAgent_agent_parameters?: Partial<RecommendedAgent_agent_parameters> | undefined | null): void;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
declare function serializeValidationError(writer: SerializationWriter, validationError?: Partial<ValidationError> | undefined | null): void;
interface ValidationError extends AdditionalDataHolder, Parsable {
    /**
     * Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
     */
    additionalData?: Record<string, unknown>;
    /**
     * The loc property
     */
    loc?: string[] | null;
    /**
     * The msg property
     */
    msg?: string | null;
    /**
     * The type property
     */
    type?: string | null;
}
declare const BlackboardFormatObject: {
    readonly Function_call: "function_call";
    readonly Graphql: "graphql";
};
declare const MessageRoleObject: {
    readonly User: "user";
    readonly Assistant: "assistant";
};
/**
 * Defines the type of a parameter.
 */
declare const ParameterTypeObject: {
    readonly Int: "int";
    readonly Float: "float";
    readonly String: "string";
    readonly Datetime: "datetime";
};

declare enum TypeScriptBlackboardFormat {
    function_call = "function_call"
}
declare class FunctionCallBlackboardAccessor {
    readonly format: TypeScriptBlackboardFormat;
    private blackboard;
    constructor(blackboard: FunctionCallBlackboardOutput);
    get_new_functions(): FunctionCallSchema[];
    get_new_messages(): Message[];
    get_previous_messages(): Message[];
    get_previously_generated_functions(): FunctionCallSchema[];
    private _reset;
    set_user_data(user_data: FunctionCallSchema[]): void;
    get_internal_blackboard(): FunctionCallBlackboardOutput;
    _reset_all(): void;
}

/**
 * Builds and executes requests for operations under /generate_function_calls
 */
interface Generate_function_callsRequestBuilder extends BaseRequestBuilder<Generate_function_callsRequestBuilder> {
    /**
     * Generate Function Calls
     * @param body The request body
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @returns {Promise<FunctionCallBlackboardOutput>}
     * @throws {HTTPValidationError} error when the service returns a 422 status code
     */
    post(body: FunctionCallGenerateRequest, requestConfiguration?: RequestConfiguration<object> | undefined): Promise<FunctionCallBlackboardOutput | undefined>;
    /**
     * Generate Function Calls
     * @param body The request body
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @returns {RequestInformation}
     */
    toPostRequestInformation(body: FunctionCallGenerateRequest, requestConfiguration?: RequestConfiguration<object> | undefined): RequestInformation;
}

/**
 * Builds and executes requests for operations under /generate_plan
 */
interface Generate_planRequestBuilder extends BaseRequestBuilder<Generate_planRequestBuilder> {
    /**
     * Generate Plan
     * @param body The request body
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @returns {Promise<AgentExecutionPlanSchema>}
     * @throws {HTTPValidationError} error when the service returns a 422 status code
     */
    post(body: GeneratePlanRequest, requestConfiguration?: RequestConfiguration<object> | undefined): Promise<AgentExecutionPlanSchema | undefined>;
    /**
     * Generate Plan
     * @param body The request body
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @returns {RequestInformation}
     */
    toPostRequestInformation(body: GeneratePlanRequest, requestConfiguration?: RequestConfiguration<object> | undefined): RequestInformation;
}

/**
 * The main entry point of the SDK, exposes the configuration and the fluent API.
 */
interface PostsClient extends BaseRequestBuilder<PostsClient> {
    /**
     * The generate_function_calls property
     */
    get generate_function_calls(): Generate_function_callsRequestBuilder;
    /**
     * The generate_plan property
     */
    get generate_plan(): Generate_planRequestBuilder;
}

declare const generate_mutations_from_function_calls: (client: PostsClient, userPrompt: string, agentDefinitions: FunctionAgentDefinitionMinimal[], chatAgentDescription: string, existing_plan?: AgentExecutionPlanSchema | undefined, user_data?: FunctionCallSchema[] | null) => Promise<FunctionCallBlackboardAccessor | null>;
declare const EMPTY_USER_PROMPT_TO_ENABLE_PLAN = "";
declare const generate_mutations_with_existing_plan: (client: PostsClient, agentDefinitions: FunctionAgentDefinitionMinimal[], chatAgentDescription: string, existing_plan: AgentExecutionPlanSchema, blackboardAccessor?: FunctionCallBlackboardAccessor | null) => Promise<FunctionCallBlackboardAccessor | null>;
declare const generate_mutations: (client: PostsClient, userPrompt: string, agentDefinitions: FunctionAgentDefinitionMinimal[], chatAgentDescription: string, existing_plan?: AgentExecutionPlanSchema | undefined, blackboardAccessor?: FunctionCallBlackboardAccessor | null) => Promise<FunctionCallBlackboardAccessor | null>;

declare const generate_plan: (client: PostsClient, userPrompt: string, agentDefinitions: FunctionAgentDefinitionMinimal[], chatAgentDescription: string, previousPlan?: AgentExecutionPlanSchema | undefined, messages?: Message[] | null) => Promise<AgentExecutionPlanSchema | undefined>;

declare const createClient: (baseurl?: string | null) => PostsClient;

interface IFunctionCallHandler {
    name(): string;
    HandleFunctionCall(functionCall: FunctionCallSchema): void;
}
declare class FunctionRegistry {
    private defaultHandler;
    private functionNameToHandler;
    private categoryToFunction;
    registerDefaultHandler(handler: IFunctionCallHandler): void;
    registerHandler(fun: FunctionSpecSchema, category: string, handler: IFunctionCallHandler): void;
    getFunctionsForCategory(category: string): FunctionSpecSchema[];
    getHandler(functionName: string): IFunctionCallHandler;
}

/**
 * Client-side definition of an Agent, which is serializable and specifies its Inputs and Outputs in terms of Categories.
 * - this is to allow for 'dynamic' or Custom agents, which are not hard-coded but are read from some 'Agent Store', and could even be editted or created at run-time.
 *
 * - categories are used rather than function names, to have a looser coupling with which functions are actually available on the client.
 *   - this makes it easier to share agents between clients (for example via an Agent Store).
 */
interface SerializableAgentWithCategories {
    agentName: string;
    description: string;
    acceptedFunctionCategories: string[];
    functionCategoriesAllowedToGenerate: string[];
    topics: string[];
    agentParameters: string[];
}
/**
 * Interfaces do not exist at runtime (JavaScript is duck-typed)
 */
declare function instanceOfSerializableAgentWithCategories(object: any): object is SerializableAgentWithCategories;
/**
 * Takes a Serializable Agent (that was read from some Agent Store) and converts to to a 'contract' Agent, suitable for use with the REST API.
 * - the Serializable Agent is very loosely coupled to Functions, by means of categories.
 * - when converting, we use the FunctionRegistry to resolve the Category to relevant function(s).
 */
declare const convertSerializableAgentToContractAgent: (serializableAgent: SerializableAgentWithCategories, functionRegistry: FunctionRegistry) => FunctionAgentDefinitionMinimal;
interface IAgentStore {
    loadAgents(): SerializableAgentWithCategories[];
}

declare const getAgentStores: () => IAgentStore[];
declare const loadCustomAgents: () => SerializableAgentWithCategories[];

interface IDictionary<T> {
    [Key: string]: T;
}

declare type Callback = (functionCall: FunctionCallSchema) => void;
/**
 * Base class for Function Handlers: each Handler can handle FunctionCalls for an 'area'.
 * - the Handler is used to actually execute the action specified by the REST API.
 */
declare abstract class AreaHandlerBase implements IFunctionCallHandler {
    protected readonly registry: FunctionRegistry;
    protected readonly functionCallNameToCallback: IDictionary<Callback>;
    protected constructor(registry: FunctionRegistry);
    /**
     * Register a handler to handler the given Function Call.
     *
     * warning: do NOT use 'this' in your function (consider 'self').
     */
    protected registerFunctionHandler(fun: FunctionSpecSchema, category: string, functionHandler: Callback): void;
    HandleFunctionCall(functionCall: FunctionCallSchema): void;
    name(): string;
    protected abstract nameImplementation(): string;
}
/**
 * A Default 'catch other functions' Area Handler which can call one registered callback.
 * - the intention is to allow development without having to implement individual handlers for every function.
 */
declare class DefaultAreaHandler extends AreaHandlerBase {
    private defaultFunctionHandler;
    constructor(registry: FunctionRegistry, action: Callback);
    HandleFunctionCall(functionCall: FunctionCallSchema): void;
    protected nameImplementation(): string;
}

interface ExecutionError {
    functionCallName: string;
    error: string;
}
interface ExecuteStartResult {
    isOkToContinue: boolean;
    alsoExecutePreviousFunctions: boolean;
}
/**
 *
 * @param registry - The function call registry, which maps function calls to handlers.
 * @param blackboardAccessor - The accessor for the blackboard, to allow client decide how to update, after execution.
 * @param onExecuteStart - Called at the start of execution, allowing client to prepare. If this returns with isOkToContinue=false, then the execution is cancelled.
 * @param onExecuteEnd - Called at the end of execution, allowing client to do any final operations or clean up.
 *                       errors: Any errors that occured during execution.
 *                       blackboardAccessor: Normally, the client has applied all new mutations, and want to continue from that state:
 *                       -> The client needs to update the blackboard, marking all new functions as 'previous':
 *                          const new_user_data = blackboardAccessor.get_new_functions();
 *                          blackboardAccessor.set_user_data(new_user_data);
 *                       -> BUT for clients where execution is always on a 'fresh copy', then they would NOT want to mark new functions as 'previous' (so they can iterate over them again).
 * @returns
 */
declare const execute: (registry: FunctionRegistry, blackboardAccessor: FunctionCallBlackboardAccessor, onExecuteStart: () => Promise<ExecuteStartResult>, onExecuteEnd: (errors: ExecutionError[], blackboardAccessor: FunctionCallBlackboardAccessor) => Promise<void>) => Promise<void>;

declare const load_blackboard_from_file: (filename: string) => FunctionCallBlackboardAccessor | null;
declare const save_blackboard_to_file: (blackboard: FunctionCallBlackboardAccessor, filename: string) => void;
declare const list_blackboard_files: (blackboard: FunctionCallBlackboardAccessor | null) => void;

/**
 *
 * @param agentDefinitions - The available Agent Definitions to use to plan and generate.
 * @param chatAgentDescription - Describes the 'fallback' chat agent: if no suitable agents are recommended, this chat agent will be recommended, if the user's prompt is supported. The description should include the purpose and domain of this chat system.
 * @param functionRegistry - The function call registry, which maps function calls to handlers.
 * @param baseurl - The URL of the gpt-multi-atomic-agents server.
 * @param onExecuteStart - Called at the start of execution, allowing client to prepare. If this returns with isOkToContinue=false, then the execution is cancelled.
 * @param onExecuteEnd - Called at the end of execution, allowing client to do any final operations or clean up.
 *                       errors: Any errors that occured during execution.
 *                       blackboardAccessor: Normally, the client has applied all new mutations, and want to continue from that state:
 *                       -> The client needs to update the blackboard, marking all new functions as 'previous' ->  const new_user_data = context.blackboardAccessor.get_new_functions(); context.blackboardAccessor.set_user_data(new_user_data);
 *                       -> BUT for clients where execution is always on a 'fresh copy', then they would NOT want to mark new functions as 'previous' (so they can iterate over them again).
 *
 */
declare const chatWithAgentsRepl: (agentDefinitions: FunctionAgentDefinitionMinimal[], chatAgentDescription: string, functionRegistry: FunctionRegistry, baseurl: string, onExecuteStart: () => Promise<ExecuteStartResult>, onExecuteEnd: (errors: ExecutionError[], blackboardAccessor: FunctionCallBlackboardAccessor) => Promise<void>) => Promise<void>;

declare enum CommandAction {
    no_action = "no_action",
    handled_already = "handled_already",
    quit = "quit"
}
declare abstract class ReplCommandBase {
    isDebugOnly: () => boolean;
    abstract get_name(): string;
    abstract get_description(): string;
    abstract get_aliases(): string[];
    do(context: IReplCommandContext): Promise<CommandAction>;
}
interface IReplCommandContext {
    blackboardAccessor: FunctionCallBlackboardAccessor | null;
    agentDefinitions: FunctionAgentDefinitionMinimal[];
    customAgents: SerializableAgentWithCategories[];
    getPlanMessages(): Message[];
}
declare const check_user_prompt: (user_prompt: string, context: IReplCommandContext) => Promise<CommandAction>;
declare const print_help: (options?: {
    hideWelcome: boolean;
}) => void;

/**
 * Allow States to manipulate the Context, but NOT to change state.
 */
interface IReplStateContext {
    getClient(): PostsClient;
    getUserPrompt(): string;
    getChatAgentDescription(): string;
    getPlanMessages(): Message[];
    resetPlanMessages(): void;
    executionPlan: AgentExecutionPlanSchema | undefined;
    blackboardAccessor: FunctionCallBlackboardAccessor | null;
    getCombinedAgents(): FunctionAgentDefinitionMinimal[];
}
declare abstract class ReplState {
    abstract getName(): string;
    abstract handleRequest(context: IReplStateContext): Promise<void>;
}
declare class PlanReplState extends ReplState {
    getName: () => string;
    handleRequest(context: IReplStateContext): Promise<void>;
}
declare class GenerateReplState extends ReplState {
    getName: () => string;
    handleRequest(context: IReplStateContext): Promise<void>;
}
declare class ExecuteReplState extends ReplState {
    private functionRegistry;
    private onExecuteStart;
    private onExecuteEnd;
    constructor(functionRegistry: FunctionRegistry, onExecuteStart: () => Promise<ExecuteStartResult>, onExecuteEnd: (errors: ExecutionError[], blackboardAccessor: FunctionCallBlackboardAccessor) => Promise<void>);
    getName: () => string;
    handleRequest(context: IReplStateContext): Promise<void>;
}
declare class ReplContext implements IReplStateContext, IReplCommandContext {
    private state;
    private readonly client;
    private readonly chatAgentDescription;
    userPrompt: string | null;
    previousPrompt: string | null;
    private planMessages;
    executionPlan: AgentExecutionPlanSchema | undefined;
    blackboardAccessor: FunctionCallBlackboardAccessor | null;
    functionRegistry: FunctionRegistry;
    agentDefinitions: FunctionAgentDefinitionMinimal[];
    customAgents: SerializableAgentWithCategories[];
    generateNeedsApproval: boolean;
    constructor(client: PostsClient, chatAgentDescription: string, functionRegistry: FunctionRegistry, agentDefinitions: FunctionAgentDefinitionMinimal[], customAgents: SerializableAgentWithCategories[]);
    getClient: () => PostsClient;
    getChatAgentDescription: () => string;
    getCombinedAgents: () => FunctionAgentDefinitionMinimal[];
    addPlanMessage: (message: Message) => void;
    getPlanMessages: () => Message[];
    resetPlanMessages: () => never[];
    getState: () => ReplState | null;
    getUserPrompt(): string;
    reset(): void;
    setState(state: ReplState): void;
    request(): Promise<void>;
}

declare const handlePlanStateResult: (context: ReplContext) => Promise<void>;
declare const handleGenerateStateResult: (context: ReplContext, onExecuteStart: () => Promise<ExecuteStartResult>, onExecuteEnd: (errors: ExecutionError[], blackboardAccessor: FunctionCallBlackboardAccessor) => Promise<void>) => Promise<void>;
declare const handleExecuteStateResult: (context: ReplContext) => Promise<void>;

interface Config {
    baseurl: string;
    isDebug: boolean;
    localAgentsDirPath: string;
    localBlackboardsDirPath: string;
}
declare const getConfig: () => Config;
declare const isDebugActive: () => boolean;
declare const toggleIsDebugActive: () => boolean;

declare const changeExtension: (inputFilepath: string, newExtensionWithDot: string) => string;
declare const readJsonFromFile: (filepath: string, encoding?: BufferEncoding) => any;
declare const writeJsonToFile: (filepath: string, data: any, encoding?: BufferEncoding) => any;
declare const findFilesByExtension: (dirpath: string, extensionWithDot: string) => string[];

interface YesOrNoOptions {
    yes: string;
    no: string;
}
declare const askUserIfOk: (prompt: string, options: YesOrNoOptions) => Promise<{
    yes: boolean;
    message: string | null;
}>;
interface AskUserOption {
    name: string;
    description: string;
    needsUserInput: boolean;
}
interface AskUserOptions {
    prompt: string;
    options: AskUserOption[];
}
interface AskUserChosen {
    chosen: AskUserOption;
    userInput: string | null;
}
declare const askUserWithOptions: (options: AskUserOptions) => Promise<AskUserChosen>;
declare const readInputFromUser: (prompt: string) => Promise<string | null>;

declare const print: (...args: any[]) => void;
declare const printWarning: (...args: any[]) => void;
declare const printError: (...args: any[]) => void;
declare const EMOJI_USER = "\uD83D\uDE15";
declare const printAssistant: (...args: any[]) => void;
declare const printUser: (...args: any[]) => void;
declare const printUserNoNewline: (...args: any[]) => void;
declare const printDetail: (...args: any[]) => void;
declare const dumpJson: (json: any, name: string) => void;
declare const dumpJsonAlways: (json: any) => void;
declare const printMessages: (messages: Message[]) => void;
declare const startTimer: (name: string) => string;
declare const printTimeTaken: (name: string) => void;
declare const showSpinner: () => Spinner;
declare const stopSpinner: (spinner: Spinner) => void;

declare const handleUserPrompt: (userPrompt: string, agentDefinitions: FunctionAgentDefinitionMinimal[], chatAgentDescription: string, baseurl?: string | null) => Promise<FunctionCallBlackboardAccessor | null>;

export { type AgentDescription, type AgentExecutionPlanSchema, AreaHandlerBase, type BlackboardFormat, BlackboardFormatObject, CommandAction, type Config, DefaultAreaHandler, EMOJI_USER, EMPTY_USER_PROMPT_TO_ENABLE_PLAN, ExecuteReplState, type ExecuteStartResult, type ExecutionError, type FunctionAgentDefinitionMinimal, type FunctionAgentDefinitionMinimal_agent_parameters, FunctionCallBlackboardAccessor, type FunctionCallBlackboardInput, type FunctionCallBlackboardOutput, type FunctionCallGenerateRequest, type FunctionCallSchema, type FunctionCallSchema_parameters, FunctionRegistry, type FunctionSpecSchema, type GeneratePlanRequest, GenerateReplState, type HTTPValidationError, type IAgentStore, type IDictionary, type IFunctionCallHandler, type IReplCommandContext, type Message, type MessageRole, MessageRoleObject, type ParameterSpec, type ParameterType, ParameterTypeObject, PlanReplState, type RecommendedAgent, type RecommendedAgent_agent_parameters, ReplCommandBase, ReplContext, ReplState, type SerializableAgentWithCategories, TypeScriptBlackboardFormat, type ValidationError, askUserIfOk, askUserWithOptions, changeExtension, chatWithAgentsRepl, check_user_prompt, convertSerializableAgentToContractAgent, createAgentDescriptionFromDiscriminatorValue, createAgentExecutionPlanSchemaFromDiscriminatorValue, createClient, createFunctionAgentDefinitionMinimalFromDiscriminatorValue, createFunctionAgentDefinitionMinimal_agent_parametersFromDiscriminatorValue, createFunctionCallBlackboardInputFromDiscriminatorValue, createFunctionCallBlackboardOutputFromDiscriminatorValue, createFunctionCallGenerateRequestFromDiscriminatorValue, createFunctionCallSchemaFromDiscriminatorValue, createFunctionCallSchema_parametersFromDiscriminatorValue, createFunctionSpecSchemaFromDiscriminatorValue, createGeneratePlanRequestFromDiscriminatorValue, createHTTPValidationErrorFromDiscriminatorValue, createMessageFromDiscriminatorValue, createParameterSpecFromDiscriminatorValue, createRecommendedAgentFromDiscriminatorValue, createRecommendedAgent_agent_parametersFromDiscriminatorValue, createValidationErrorFromDiscriminatorValue, deserializeIntoAgentDescription, deserializeIntoAgentExecutionPlanSchema, deserializeIntoFunctionAgentDefinitionMinimal, deserializeIntoFunctionAgentDefinitionMinimal_agent_parameters, deserializeIntoFunctionCallBlackboardInput, deserializeIntoFunctionCallBlackboardOutput, deserializeIntoFunctionCallGenerateRequest, deserializeIntoFunctionCallSchema, deserializeIntoFunctionCallSchema_parameters, deserializeIntoFunctionSpecSchema, deserializeIntoGeneratePlanRequest, deserializeIntoHTTPValidationError, deserializeIntoMessage, deserializeIntoParameterSpec, deserializeIntoRecommendedAgent, deserializeIntoRecommendedAgent_agent_parameters, deserializeIntoValidationError, dumpJson, dumpJsonAlways, execute, findFilesByExtension, generate_mutations, generate_mutations_from_function_calls, generate_mutations_with_existing_plan, generate_plan, getAgentStores, getConfig, handleExecuteStateResult, handleGenerateStateResult, handlePlanStateResult, handleUserPrompt, instanceOfSerializableAgentWithCategories, isDebugActive, list_blackboard_files, loadCustomAgents, load_blackboard_from_file, print, printAssistant, printDetail, printError, printMessages, printTimeTaken, printUser, printUserNoNewline, printWarning, print_help, readInputFromUser, readJsonFromFile, save_blackboard_to_file, serializeAgentDescription, serializeAgentExecutionPlanSchema, serializeFunctionAgentDefinitionMinimal, serializeFunctionAgentDefinitionMinimal_agent_parameters, serializeFunctionCallBlackboardInput, serializeFunctionCallBlackboardOutput, serializeFunctionCallGenerateRequest, serializeFunctionCallSchema, serializeFunctionCallSchema_parameters, serializeFunctionSpecSchema, serializeGeneratePlanRequest, serializeHTTPValidationError, serializeMessage, serializeParameterSpec, serializeRecommendedAgent, serializeRecommendedAgent_agent_parameters, serializeValidationError, showSpinner, startTimer, stopSpinner, toggleIsDebugActive, writeJsonToFile };
