import upperFirst from 'lodash/upperFirst.js';
import * as agentMessagePayload from "./agent-message-payload.js";
import * as agentSessionPayload from "./agent-session-payload.js";
export const schema = {
    type: 'object',
    properties: {
        session: {
            ...agentSessionPayload.schema
        },
        // `history` is chat-only despite the name: chat and generate tracks are stored
        // separately on the session, and `history` predates the split. Generate-state
        // history is intentionally not exposed in the GraphQL API.
        history: {
            type: 'array',
            items: {
                type: 'object'
            },
            description: 'Chat-state history for the agent session.'
        },
        messages: {
            type: 'array',
            items: {
                ...agentMessagePayload.schema
            },
            description: 'A list of messages exchanged in the agent session, which may include user inputs and agent responses.'
        }
    },
    required: ['history', 'session', 'messages'],
    additionalProperties: false
};
export function createUserShapeSchema() {
    return {
        ...schema,
        properties: {
            ...schema.properties,
            session: {
                '@ref': agentSessionPayload.shapeName
            },
            messages: {
                ...schema.properties.messages,
                items: {
                    '@ref': agentMessagePayload.shapeName
                }
            }
        },
        additionalProperties: false
    };
}
export function createUserShapeName(agentName) {
    return `${upperFirst(agentName)}InspectAgentResponse`;
}
