/* tslint:disable */
/* eslint-disable */
/**
 * Fabro Run API
 * HTTP API for managing Fabro workflow run executions.
 *
 * The version of the OpenAPI document: 0.1.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */



/**
 * A single hook definition. The type discriminator and variant fields are flattened into this object.  Field-to-type mapping: - `command`: requires `command` - `http`: requires `url`; optional `headers`, `allowed_env_vars`, `tls` - `prompt`: requires `prompt`; optional `model` - `agent`: requires `prompt`; optional `model`, `max_tool_rounds`  Top-level `command` without `type` is shorthand for type=command. 
 */
export interface HookDefinition {
    /**
     * Human-readable hook name.
     */
    'name'?: string;
    /**
     * Event that triggers this hook.
     */
    'event': HookDefinitionEventEnum;
    /**
     * Shell command (shorthand for type=command).
     */
    'command'?: string;
    /**
     * Hook execution type.
     */
    'type'?: HookDefinitionTypeEnum;
    /**
     * URL for HTTP hooks.
     */
    'url'?: string;
    /**
     * Headers for HTTP hooks.
     */
    'headers'?: { [key: string]: string; };
    /**
     * Environment variables allowed in HTTP hook headers.
     */
    'allowed_env_vars'?: Array<string>;
    /**
     * TLS verification mode for HTTP hooks.
     */
    'tls'?: HookDefinitionTlsEnum;
    /**
     * Prompt text for prompt/agent hooks.
     */
    'prompt'?: string;
    /**
     * Model for prompt/agent hooks.
     */
    'model'?: string;
    /**
     * Max tool rounds for agent hooks.
     */
    'max_tool_rounds'?: number;
    /**
     * Regex matched against node_id or handler_type.
     */
    'matcher'?: string;
    /**
     * Whether this hook blocks execution.
     */
    'blocking'?: boolean;
    /**
     * Timeout in milliseconds.
     */
    'timeout_ms'?: number;
    /**
     * Whether hook runs in sandbox.
     */
    'sandbox'?: boolean;
}

export const HookDefinitionEventEnum = {
    RUN_START: 'run_start',
    RUN_COMPLETE: 'run_complete',
    STAGE_START: 'stage_start',
    STAGE_COMPLETE: 'stage_complete'
} as const;

export type HookDefinitionEventEnum = typeof HookDefinitionEventEnum[keyof typeof HookDefinitionEventEnum];
export const HookDefinitionTypeEnum = {
    COMMAND: 'command',
    HTTP: 'http',
    PROMPT: 'prompt',
    AGENT: 'agent'
} as const;

export type HookDefinitionTypeEnum = typeof HookDefinitionTypeEnum[keyof typeof HookDefinitionTypeEnum];
export const HookDefinitionTlsEnum = {
    VERIFY: 'verify',
    NO_VERIFY: 'no_verify',
    OFF: 'off'
} as const;

export type HookDefinitionTlsEnum = typeof HookDefinitionTlsEnum[keyof typeof HookDefinitionTlsEnum];


