import { createTypedValidator } from '@takeshape/json-schema';
import omit from 'lodash/omit.js';
import * as agentRunMode from "./agent-run-mode.js";
export const schema = {
    type: 'object',
    properties: {
        sessionId: {
            type: 'string',
            description: 'Session ID to continue existing session with this agent'
        },
        runMode: {
            ...agentRunMode.schema,
            default: 'IMMEDIATE',
            description: 'The mode in which the agent should run. "ALLOW_BACKGROUND" allows runs that would timeout to run longer in the background, "BACKGROUND" only runs in the background and results will need to be polled for. "IMMEDIATE" runs immediately and will timeout if it takes too long.'
        },
        token: {
            type: 'string',
            description: 'Proof of work to verify the request is not a bot.'
        }
    },
    required: [],
    additionalProperties: true
};
export const validate = createTypedValidator(schema);
export const shapeSchema = {
    ...schema,
    properties: {
        ...schema.properties,
        runMode: {
            ...omit(schema.properties.runMode, 'enum'),
            '@ref': agentRunMode.shapeName
        }
    },
    required: [],
    additionalProperties: false
};
