import type { RemoveIndex } from '@takeshape/util';
import type { FromSchema } from 'json-schema-to-ts';
import type { PropertySchema } from '../../project-schema/latest.ts';
import * as agentSessionPayload from './agent-session-payload.ts';
import type { CreateShapeSchemaParams } from './types.ts';
export declare const schema: {
    readonly type: "object";
    readonly properties: {
        readonly messageId: {
            readonly type: "string";
            readonly description: "The unique identifier for the agent run response message.";
        };
        readonly input: {
            readonly title: "TSAgentMessageInput";
            readonly description: "The input schema for agent messages.";
            readonly discriminator: {
                readonly propertyName: "type";
            };
            readonly oneOf: [{
                readonly title: "TSAgentMessageUnknownInput";
                readonly type: "object";
                readonly properties: {
                    readonly type: {
                        readonly const: "unknown";
                    };
                    readonly data: {};
                };
                readonly required: ["type", "data"];
                readonly additionalProperties: false;
            }, {
                readonly title: "TSAgentMessageStringInput";
                readonly type: "object";
                readonly properties: {
                    readonly type: {
                        readonly const: "string";
                    };
                    readonly content: {
                        readonly type: "string";
                    };
                };
                readonly required: ["type", "content"];
                readonly additionalProperties: false;
            }];
        };
        readonly output: {
            readonly title: "TSAgentMessageOutput";
            readonly description: "The output schema for agent messages.";
            readonly discriminator: {
                readonly propertyName: "type";
            };
            readonly oneOf: [{
                readonly title: "TSAgentGenerateStateOutput";
                readonly type: "object";
                readonly properties: {
                    readonly type: {
                        readonly const: "generate";
                    };
                    readonly data: {};
                };
                readonly required: ["type", "data"];
                readonly additionalProperties: false;
            }, {
                readonly title: "TSAgentGraphQLStateOutput";
                readonly type: "object";
                readonly properties: {
                    readonly type: {
                        readonly const: "graphql";
                    };
                    readonly data: {};
                };
                readonly required: ["type", "data"];
                readonly additionalProperties: false;
            }, {
                readonly title: "TSAgentChatStateOutput";
                readonly type: "object";
                readonly properties: {
                    readonly type: {
                        readonly const: "chat";
                    };
                    readonly data: {
                        readonly type: "object";
                        readonly properties: {
                            readonly content: {
                                readonly type: "string";
                            };
                            readonly artifact: {
                                readonly type: "object";
                            };
                            readonly references: {
                                readonly type: "array";
                                readonly items: {
                                    readonly type: "object";
                                    readonly properties: {
                                        readonly _tid: {
                                            readonly type: "string";
                                        };
                                    };
                                    readonly required: ["_tid"];
                                    readonly additionalProperties: false;
                                };
                            };
                        };
                        readonly required: ["content", "references"];
                        readonly additionalProperties: false;
                    };
                };
                readonly required: ["type", "data"];
                readonly additionalProperties: false;
            }, {
                readonly title: "TSAgentUnknownStateOutput";
                readonly type: "object";
                readonly properties: {
                    readonly type: {
                        readonly const: "unknown";
                    };
                    readonly data: {};
                };
                readonly required: ["type", "data"];
                readonly additionalProperties: false;
            }];
        };
        readonly session: {
            readonly properties: {
                readonly id: {
                    readonly type: "string";
                    readonly description: "The unique identifier for the agent session.";
                };
                readonly createdAt: {
                    readonly type: "string";
                    readonly description: "ISO8601 timestamp when the agent session was created";
                    readonly format: "date-time";
                };
                readonly updatedAt: {
                    readonly type: "string";
                    readonly description: "ISO8601 timestamp when the agent session was updated";
                    readonly format: "date-time";
                };
                readonly agentName: {
                    readonly type: "string";
                    readonly description: "The name of the agent associated with this session.";
                };
                readonly projectId: {
                    readonly type: "string";
                    readonly description: "The ID of the project to which this agent session belongs.";
                };
                readonly schemaId: {
                    readonly type: "string";
                    readonly description: "The schema ID associated with the agent session, typically in the format \"production~projectId\".";
                };
                readonly schemaHash: {
                    readonly type: "string";
                    readonly description: "The hash of the schema version associated with the agent session.";
                };
                readonly done: {
                    readonly type: "boolean";
                    readonly description: "Indicates whether the agent session is completed.";
                };
                readonly suspended: {
                    readonly type: "boolean";
                    readonly description: "Indicates whether the agent session is suspended.";
                };
                readonly previousStateId: {
                    readonly type: "string";
                    readonly description: "The ID of the previous state in the agent session, if any.";
                };
                readonly currentStateId: {
                    readonly type: "string";
                    readonly description: "The ID of the current state in the agent session.";
                };
                readonly chatSessionIds: {
                    readonly type: "object";
                    readonly description: "A mapping of chat session IDs to their corresponding state IDs.";
                };
                readonly sessionMemory: {
                    readonly type: "object";
                    readonly description: "Memory associated with the agent session, which can be used to store stateful information.";
                };
                readonly hasAgentHistory: {
                    readonly type: "boolean";
                    readonly description: "Indicates whether the agent session has an associated history of agent responses.";
                };
                readonly hasFeedback: {
                    readonly type: "boolean";
                    readonly description: "Indicates whether the agent session has any messages with feedback.";
                };
                readonly suspend: {
                    readonly type: "boolean";
                    readonly description: "Indicates whether the agent session is suspended.";
                };
                readonly suspendedTransitionIndices: {
                    readonly type: "array";
                    readonly description: "An array of indices of suspended transitions in the agent session.";
                    readonly items: {
                        readonly type: "integer";
                    };
                };
                readonly firstMessageInput: {
                    readonly title: "TSAgentMessageInput";
                    readonly description: "The input schema for agent messages.";
                    readonly discriminator: {
                        readonly propertyName: "type";
                    };
                    readonly oneOf: [{
                        readonly title: "TSAgentMessageUnknownInput";
                        readonly type: "object";
                        readonly properties: {
                            readonly type: {
                                readonly const: "unknown";
                            };
                            readonly data: {};
                        };
                        readonly required: ["type", "data"];
                        readonly additionalProperties: false;
                    }, {
                        readonly title: "TSAgentMessageStringInput";
                        readonly type: "object";
                        readonly properties: {
                            readonly type: {
                                readonly const: "string";
                            };
                            readonly content: {
                                readonly type: "string";
                            };
                        };
                        readonly required: ["type", "content"];
                        readonly additionalProperties: false;
                    }];
                };
                readonly lastMessageOutput: {
                    readonly title: "TSAgentMessageOutput";
                    readonly description: "The output schema for agent messages.";
                    readonly discriminator: {
                        readonly propertyName: "type";
                    };
                    readonly oneOf: [{
                        readonly title: "TSAgentGenerateStateOutput";
                        readonly type: "object";
                        readonly properties: {
                            readonly type: {
                                readonly const: "generate";
                            };
                            readonly data: {};
                        };
                        readonly required: ["type", "data"];
                        readonly additionalProperties: false;
                    }, {
                        readonly title: "TSAgentGraphQLStateOutput";
                        readonly type: "object";
                        readonly properties: {
                            readonly type: {
                                readonly const: "graphql";
                            };
                            readonly data: {};
                        };
                        readonly required: ["type", "data"];
                        readonly additionalProperties: false;
                    }, {
                        readonly title: "TSAgentChatStateOutput";
                        readonly type: "object";
                        readonly properties: {
                            readonly type: {
                                readonly const: "chat";
                            };
                            readonly data: {
                                readonly type: "object";
                                readonly properties: {
                                    readonly content: {
                                        readonly type: "string";
                                    };
                                    readonly artifact: {
                                        readonly type: "object";
                                    };
                                    readonly references: {
                                        readonly type: "array";
                                        readonly items: {
                                            readonly type: "object";
                                            readonly properties: {
                                                readonly _tid: {
                                                    readonly type: "string";
                                                };
                                            };
                                            readonly required: ["_tid"];
                                            readonly additionalProperties: false;
                                        };
                                    };
                                };
                                readonly required: ["content", "references"];
                                readonly additionalProperties: false;
                            };
                        };
                        readonly required: ["type", "data"];
                        readonly additionalProperties: false;
                    }, {
                        readonly title: "TSAgentUnknownStateOutput";
                        readonly type: "object";
                        readonly properties: {
                            readonly type: {
                                readonly const: "unknown";
                            };
                            readonly data: {};
                        };
                        readonly required: ["type", "data"];
                        readonly additionalProperties: false;
                    }];
                };
                readonly totalTokens: {
                    readonly type: "number";
                    readonly description: "The total number of tokens used in the agent session.";
                };
            };
            readonly required: ["id", "agentName", "createdAt", "updatedAt", "done", "currentStateId", "chatSessionIds", "sessionMemory", "hasAgentHistory", "hasFeedback", "suspend", "projectId", "schemaId", "schemaHash", "totalTokens"];
            readonly additionalProperties: false;
            readonly title: "TSAgentSession";
            readonly type: "object";
        };
        readonly runMode: {
            readonly enum: ["BACKGROUND", "IMMEDIATE"];
            readonly description: "Indicates how the agent message was run";
        };
    };
    readonly required: ["messageId", "session", "runMode"];
    readonly additionalProperties: true;
};
export type SendAgentMessageResponse = FromSchema<typeof schema>;
type SendAgentMessageUserResponseBase = RemoveIndex<Pick<SendAgentMessageResponse, 'messageId' | 'input' | 'runMode'>>;
export type SendAgentMessageUserResponse<Output = unknown> = SendAgentMessageUserResponseBase & {
    output?: Output;
    session: agentSessionPayload.AgentSessionShapePayload;
};
export declare function createUserShapeSchema(params?: CreateShapeSchemaParams): {
    properties: {
        output: PropertySchema | import("../../project-schema/latest.ts").RefSchema;
        input: {
            '@ref': string;
        };
        session: {
            '@ref': string;
        };
        messageId: {
            readonly type: "string";
            readonly description: "The unique identifier for the agent run response message.";
        };
        runMode: {
            readonly enum: ["BACKGROUND", "IMMEDIATE"];
            readonly description: "Indicates how the agent message was run";
        };
    };
    required: string[];
    additionalProperties: false;
    type: "object";
};
export declare function createUserShapeName(agentName: string): string;
export {};
