/**
 * Shared API response types for the Guild CLI.
 * These types match the responses from the guildcore API.
 *
 * All CLI commands should use these types for consistency.
 * Commands should passthrough API responses without transformation.
 */
export type AgentStatus = 'PENDING' | 'READY' | 'FAILED';
export type VersionStatus = 'DRAFT' | 'PUBLISHED';
export type ContextStatus = 'ACTIVE' | 'ARCHIVED';
/**
 * Agent entity from the API.
 * Used by: agent list, agent get, agent clone, agent fork
 */
export interface Agent {
    id: string;
    name: string;
    full_name?: string;
    owner_id: string;
    owner?: {
        id: string;
        name: string;
        type: string;
    };
    status: string;
    description: string | null;
    is_public?: boolean;
    is_archived?: boolean;
    git_url?: string;
    cached_likes_count?: number;
    created_at?: string;
    updated_at?: string;
}
/**
 * Owner entity from workspace responses.
 * Can be a user (personal) or organization (team).
 */
export interface WorkspaceOwner {
    id: string;
    type: 'user' | 'organization';
    name: string;
    avatar_url?: string;
}
/**
 * Workspace entity from the API.
 * Used by: workspace list, workspace get, workspace select
 */
export interface Workspace {
    id: string;
    name: string;
    full_name?: string;
    owner?: WorkspaceOwner;
}
/**
 * Workspace agent entity from the API.
 * Used by: workspace agent list, workspace agent add, workspace agent remove
 */
export interface WorkspaceAgent {
    id: string;
    agent: {
        id: string;
        name: string;
        full_name: string;
    };
    agent_version: {
        id: string;
        sha: string | null;
        version_number: string | null;
    };
    workspace?: {
        id: string;
        name: string;
    };
    is_default_chat_agent: boolean;
    should_autoupdate: boolean;
}
/**
 * Agent version entity from the API.
 * Used by: agent versions, agent save, agent fork
 *
 * Note: Some endpoints return versions with nested agent info,
 * others return just agent_id. Fields are optional to support both.
 */
export interface AgentVersion {
    id: string;
    agent_id?: string;
    author_id?: string;
    sha: string | null;
    summary: string;
    status: string;
    validation_status?: string;
    version_number?: string | null;
    version_type?: 'COMMITTED' | 'EPHEMERAL';
    published_at?: string | null;
    created_at: string;
    updated_at?: string;
    agent?: {
        id: string;
        name: string;
    };
}
/**
 * Validation step from the API.
 * Used by: agent publish (to show failure details)
 */
export interface ValidationStep {
    id: string;
    name: string;
    status: string;
    content?: string | null;
    started_at?: string | null;
    completed_at?: string | null;
}
/**
 * Response from /versions/{id}/validation/steps
 */
export interface ValidationStepsResponse {
    steps: ValidationStep[];
}
/**
 * Response from /versions/{id}/publish/steps
 */
export interface PublishStepsResponse {
    steps: ValidationStep[];
}
/**
 * Workspace context entity from the API.
 * Used by: workspace context list, get, edit
 */
export interface Context {
    id: string;
    status: string;
    summary: string | null;
    created_at: string;
    updated_at?: string;
    manual_context: string;
    generated_context: string;
    workspace_id: string;
    published_by_id: string | null;
    type: string;
    author_id?: string;
    task_id?: string;
    user_id?: string;
}
/**
 * Agent tags from the API.
 * Used by: agent tags list, add, remove, set
 */
export interface AgentTags {
    names: string[];
}
/**
 * Standard pagination metadata from the API.
 * All paginated endpoints return this structure.
 */
export interface Pagination {
    total_count: number;
    limit: number;
    offset: number;
    has_more: boolean;
}
/** Default page size for standard list endpoints (matches backend). */
export declare const DEFAULT_PAGE_LIMIT = 20;
/** Default page size for high-volume endpoints (events, tasks, operations). */
export declare const DEFAULT_PAGE_LIMIT_LARGE = 100;
/**
 * Generic paginated response wrapper.
 * All list endpoints return { items: T[], pagination: Pagination }
 */
export interface PaginatedResponse<T> {
    items: T[];
    pagination: Pagination;
}
/**
 * Simpler counted response for endpoints that just return count + items.
 * Used by some endpoints that don't need full pagination metadata.
 */
export interface CountedResponse<T> {
    count: number;
    items: T[];
}
export type AgentListResponse = PaginatedResponse<Agent>;
export type WorkspaceListResponse = PaginatedResponse<Workspace>;
export type VersionListResponse = PaginatedResponse<AgentVersion>;
export type ContextListResponse = PaginatedResponse<Context>;
export type WorkspaceAgentListResponse = PaginatedResponse<WorkspaceAgent>;
/**
 * Response from creating a new agent.
 */
export interface CreateAgentResponse {
    id: string;
    name: string;
    owner_id: string;
    status: string;
    description: string | null;
    git_url: string;
}
/**
 * Response from creating a new workspace.
 */
export interface CreateWorkspaceResponse {
    id: string;
    name: string;
}
/**
 * Single version response from GET /agents/:id/versions/:versionId
 * Includes nested agent info (different from list response).
 */
export interface AgentVersionDetail {
    id: string;
    sha: string;
    summary: string;
    agent: {
        id: string;
        name: string;
        description: string;
    };
}
export interface TriggerIntegrationWebhookConfig {
    id: string;
    enabled: boolean;
    events: Record<string, string[]>;
}
export interface TriggerIntegration {
    id: string;
    name: string;
    full_name: string;
    service?: string | null;
    webhook_config: TriggerIntegrationWebhookConfig | null;
}
export type TriggerType = 'webhook' | 'time';
import { WEBHOOK_SERVICES, type WebhookService, TIME_TRIGGER_FREQUENCIES, type TimeTriggerFrequency } from './generated-types.js';
export { WEBHOOK_SERVICES, type WebhookService, TIME_TRIGGER_FREQUENCIES, type TimeTriggerFrequency, };
export type TriggerDisabledReason = 'user_deactivated' | 'missing_credentials';
/**
 * Nested agent info in trigger responses.
 */
export interface TriggerAgent {
    id: string;
    name: string;
    full_name: string;
}
/**
 * Nested workspace agent info in trigger responses.
 */
export interface TriggerWorkspaceAgent {
    id: string;
    agent: {
        id: string;
        name: string;
        full_name: string;
    };
    agent_version: {
        id: string;
        sha: string | null;
        version_number: string | null;
    };
}
/**
 * Workspace owner as embedded in trigger API responses.
 */
export interface TriggerWorkspaceOwner {
    id: string;
    type: 'user' | 'organization';
    name: string;
}
/**
 * Workspace as embedded in trigger API responses.
 */
export interface TriggerWorkspace {
    id: string;
    name: string;
    owner: TriggerWorkspaceOwner;
}
/**
 * Webhook trigger - fires when a third-party service sends an event.
 * Used by: trigger list, trigger get, trigger create
 */
export interface TriggerWebhook {
    id: string;
    type: 'webhook';
    event_type: string | null;
    action: string | null;
    service_config?: {
        workspace_slug?: string;
        repo_slug?: string;
        project?: string;
        jql_filter?: string;
    } | Record<string, unknown>;
    integration: TriggerIntegration;
    created_at: string;
    deactivated_at: string | null;
    disabled_reason: TriggerDisabledReason | null;
    agent: TriggerAgent;
    workspace_agent: TriggerWorkspaceAgent | null;
    workspace: TriggerWorkspace;
}
/**
 * Time trigger - fires on a schedule.
 * Used by: trigger list, trigger get, trigger create
 */
export interface TriggerTime {
    id: string;
    type: 'time';
    frequency: TimeTriggerFrequency;
    time_of_day: string | null;
    days_of_week: string[] | null;
    days_of_month: number[] | null;
    agent_input: Record<string, unknown>;
    next_run_at: string;
    created_at: string;
    deactivated_at: string | null;
    disabled_reason: TriggerDisabledReason | null;
    agent: TriggerAgent;
    workspace_agent: TriggerWorkspaceAgent | null;
    workspace: TriggerWorkspace;
}
/**
 * Discriminated union of trigger types.
 */
export type Trigger = TriggerWebhook | TriggerTime;
/**
 * Session spawned by a trigger.
 * Used by: trigger sessions
 */
export interface TriggerSession {
    id: string;
    session_type: string;
    created_at: string;
    updated_at: string;
    workspace: {
        id: string;
        name: string;
    };
}
export type TriggerListResponse = PaginatedResponse<Trigger>;
export type TriggerSessionListResponse = PaginatedResponse<TriggerSession>;
/**
 * Current user info from GET /me.
 * Used by: agent owners, owner resolution
 */
export interface MeResponse {
    id: string;
    type: 'user';
    name: string;
    avatar_url: string | null;
}
/**
 * Organization the user belongs to.
 * Used by: agent owners, owner resolution
 */
export interface Organization {
    id: string;
    type: 'organization';
    name: string;
    avatar_url: string | null;
    viewer_role: 'ADMIN' | 'MEMBER' | null;
}
export type OrganizationListResponse = PaginatedResponse<Organization>;
/**
 * Skill entity from the API.
 * Used by: skill list, skill get, skill create, skill update
 */
export interface Skill {
    id: string;
    entity_type: string;
    type: 'skill';
    full_name: string;
    name: string;
    overview: string;
    is_public: boolean;
    avatar_url: string | null;
    owner: {
        id: string;
        name: string;
        type: string;
    };
    viewer_can_edit: boolean;
    created_at: string;
    updated_at: string;
    latest_version?: SkillVersion | null;
}
/**
 * Skill version entity from the API.
 * Used by: skill version list, skill version get, skill version create
 */
export interface SkillVersion {
    id: string;
    entity_type: string;
    type: 'skill_version';
    version_number: string;
    description: string;
    body?: string;
    skill?: Skill;
    author?: {
        id: string;
        name: string;
    };
    created_at: string;
    updated_at: string;
}
export type SkillListResponse = PaginatedResponse<Skill>;
export type SkillVersionListResponse = PaginatedResponse<SkillVersion>;
export interface Credentials {
    id: string;
    integration: {
        id: string;
        name: string;
        full_name: string;
    };
    creator: {
        id: string;
        name: string;
    };
    created_at: string;
    updated_at: string;
}
export type CredentialsListResponse = PaginatedResponse<Credentials>;
export interface CredentialsPolicy {
    id: string;
    decision: 'ALLOW' | 'DENY';
    operations: string[] | null;
    resources: Record<string, string[]> | null;
    workspaces: {
        id: string;
        name: string;
        full_name?: string;
    }[];
    agents: {
        id: string;
        name: string;
        full_name?: string;
    }[];
    created_at: string;
    updated_at: string;
}
export type CredentialsPolicyListResponse = PaginatedResponse<CredentialsPolicy>;
export type TaskStatus = 'CREATED' | 'DISPATCHED' | 'STARTED' | 'RUNNING' | 'WAITING' | 'ERROR' | 'DONE' | 'INTERRUPTED';
export interface TokenUsage {
    input_tokens: number;
    output_tokens: number;
    cache_read_tokens: number;
    cache_write_tokens: number;
    total_tokens: number;
    llm_call_count: number;
}
interface TaskBase {
    id: string;
    entity_type: string;
    status: TaskStatus;
    token_usage: TokenUsage | null;
    created_at: string;
    updated_at: string;
}
export interface TaskAgent extends TaskBase {
    entity_type: 'EntTaskAgent';
    agent: {
        name: string;
        full_name?: string;
    } | null;
    version: {
        id: string;
        version_number?: string;
    } | null;
}
export interface TaskTool extends TaskBase {
    entity_type: 'EntTaskTool';
    tool_name: string;
    tool_call_id: string;
    request_bytes: number;
    response_bytes: number;
    http_status_code: number;
}
export type Task = TaskAgent | TaskTool;
/**
 * Session entity from API responses.
 * Used by: session list
 */
export interface Session {
    id: string;
    session_type: 'chat' | 'agent_test' | 'time' | 'webhook';
    name?: string;
    workspace?: {
        id: string;
        name: string;
    };
    created_at: string;
    updated_at: string;
}
export type JobType = 'VALIDATION' | 'PUBLISH' | 'PUBLISH_PRE_CHECK';
export type JobStatus = 'PENDING' | 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'ERRORED' | 'CANCELLED';
export type JobStepStatus = 'PENDING' | 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'SKIPPED' | 'ERRORED';
/**
 * Job entity from the API.
 * Used by: job get
 */
export interface Job {
    id: string;
    target_id: string;
    job_type: JobType;
    status: JobStatus;
    started_at: string | null;
    completed_at: string | null;
    error_message: string | null;
    created_at: string;
    updated_at: string;
}
/**
 * Job step entity from the API.
 * Used by: job get (steps table)
 */
export interface JobStep {
    id: string;
    job: Job;
    name: string;
    status: JobStepStatus;
    started_at: string | null;
    completed_at: string | null;
    content: string | null;
    created_at: string;
    updated_at: string;
}
/**
 * Response from GET /jobs/:id/steps.
 */
export interface JobStepsResponse {
    job_id: string;
    steps: JobStep[];
}
export interface IntegrationOwner {
    id: string;
    name: string;
}
export interface IntegrationAuthConfig {
    id: string;
    entity_type: string;
    auth_scheme: 'API_KEY' | 'OAUTH';
    token_header_template?: string;
    install_url?: string;
    token_url?: string;
    client_id?: string;
    scopes?: string[];
}
export interface IntegrationProtocolConfig {
    protocol: 'REST';
    base_url: string;
}
export interface IntegrationWebhookConfig {
    enabled: boolean;
    events?: string[];
}
export interface IntegrationPublishedVersion {
    id: string;
    version_number: string;
    published_at: string;
}
export interface Integration {
    id: string;
    entity_type: string;
    created_at: string;
    updated_at: string;
    name: string;
    description: string | null;
    is_public: boolean;
    avatar_url: string | null;
    owner: IntegrationOwner;
    auth_config: IntegrationAuthConfig;
    protocol_config: IntegrationProtocolConfig;
    webhook_config: IntegrationWebhookConfig | null;
    params: unknown[];
    viewer_can_edit: boolean;
    latest_published_version?: IntegrationPublishedVersion | null;
}
export type IntegrationListResponse = PaginatedResponse<Integration>;
export interface IntegrationVersion {
    id: string;
    entity_type: string;
    created_at: string;
    updated_at: string;
    author: {
        id: string;
        name: string;
    };
    validation_status: string;
    published_at: string | null;
    publishing_started_at: string | null;
    version_number: string | null;
    integration?: {
        id: string;
        name: string;
        description: string;
    };
}
export type IntegrationVersionListResponse = PaginatedResponse<IntegrationVersion>;
/**
 * Contents of guild.json file in agent directories.
 */
export interface GuildConfig {
    agent_id: string;
    name: string;
}
//# sourceMappingURL=api-types.d.ts.map