import * as react_jsx_runtime from 'react/jsx-runtime';
import { z } from 'zod';
import { ReactNode, ComponentType } from 'react';
import { EventSourceMessage } from '@microsoft/fetch-event-source';

/**
 * Serialized Registry Types
 *
 * Pre-computed JSON-safe types for API responses and Command View.
 * Serialization happens once at API startup, enabling instant response times.
 */

/**
 * Serialized agent definition (JSON-safe)
 * Result of serializeDefinition(AgentDefinition)
 */
interface SerializedAgentDefinition {
    config: {
        resourceId: string;
        name: string;
        description: string;
        version: string;
        type: 'agent';
        kind: 'orchestrator' | 'specialist' | 'utility' | 'system';
        status: 'dev' | 'prod';
        links?: ResourceLink[];
        category?: ResourceCategory;
        /** Whether this resource is archived and should be excluded from registration and deployment */
        archived?: boolean;
        systemPrompt: string;
        constraints?: {
            maxIterations?: number;
            timeout?: number;
            maxSessionMemoryKeys?: number;
            maxMemoryTokens?: number;
        };
        sessionCapable?: boolean;
        memoryPreferences?: string;
    };
    modelConfig: {
        provider: string;
        model: string;
        apiKey: string;
        temperature: number;
        maxOutputTokens: number;
        topP?: number;
        modelOptions?: Record<string, unknown>;
    };
    contract: {
        inputSchema: object;
        outputSchema?: object;
    };
    tools: Array<{
        name: string;
        description: string;
        inputSchema?: object;
        outputSchema?: object;
    }>;
    knowledgeMap?: {
        nodeCount: number;
        nodes: Array<{
            id: string;
            description: string;
            loaded: boolean;
            hasPrompt: boolean;
        }>;
    };
    metricsConfig?: object;
}
/**
 * Serialized workflow definition (JSON-safe)
 * Result of serializeDefinition(WorkflowDefinition)
 */
interface SerializedWorkflowDefinition {
    config: {
        resourceId: string;
        name: string;
        description: string;
        version: string;
        type: 'workflow';
        status: 'dev' | 'prod';
        links?: ResourceLink[];
        category?: ResourceCategory;
        /** Whether this resource is archived and should be excluded from registration and deployment */
        archived?: boolean;
    };
    entryPoint: string;
    steps: Array<{
        id: string;
        name: string;
        description: string;
        inputSchema?: object;
        outputSchema?: object;
        next: {
            type: 'linear' | 'conditional';
            target?: string;
            routes?: Array<{
                target: string;
            }>;
            default?: string;
        } | null;
    }>;
    contract: {
        inputSchema: object;
        outputSchema?: object;
    };
    metricsConfig?: object;
}

declare const ResourceKindSchema: z.ZodEnum<{
    agent: "agent";
    workflow: "workflow";
    integration: "integration";
    script: "script";
}>;
declare const ResourceGovernanceStatusSchema: z.ZodEnum<{
    active: "active";
    deprecated: "deprecated";
    archived: "archived";
}>;
declare const ResourceEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
    id: z.ZodString;
    order: z.ZodDefault<z.ZodNumber>;
    systemPath: z.ZodString;
    title: z.ZodOptional<z.ZodString>;
    description: z.ZodOptional<z.ZodString>;
    ownerRoleId: z.ZodOptional<z.ZodString>;
    status: z.ZodEnum<{
        active: "active";
        deprecated: "deprecated";
        archived: "archived";
    }>;
    ontology: z.ZodOptional<z.ZodObject<{
        actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
        primaryAction: z.ZodOptional<z.ZodString>;
        reads: z.ZodOptional<z.ZodArray<z.ZodString>>;
        writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
        usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
        emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
        contract: z.ZodOptional<z.ZodObject<{
            input: z.ZodOptional<z.ZodString>;
            output: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
    }, z.core.$strip>>;
    codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
        path: z.ZodString;
        role: z.ZodEnum<{
            entrypoint: "entrypoint";
            handler: "handler";
            schema: "schema";
            test: "test";
            docs: "docs";
            config: "config";
        }>;
        symbol: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>>;
    kind: z.ZodLiteral<"workflow">;
    emits: z.ZodOptional<z.ZodArray<z.ZodObject<{
        eventKey: z.ZodString;
        label: z.ZodString;
        payloadSchema: z.ZodOptional<z.ZodString>;
        lifecycle: z.ZodOptional<z.ZodEnum<{
            active: "active";
            deprecated: "deprecated";
            draft: "draft";
            beta: "beta";
            archived: "archived";
        }>>;
    }, z.core.$strip>>>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodString;
    order: z.ZodDefault<z.ZodNumber>;
    systemPath: z.ZodString;
    title: z.ZodOptional<z.ZodString>;
    description: z.ZodOptional<z.ZodString>;
    ownerRoleId: z.ZodOptional<z.ZodString>;
    status: z.ZodEnum<{
        active: "active";
        deprecated: "deprecated";
        archived: "archived";
    }>;
    ontology: z.ZodOptional<z.ZodObject<{
        actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
        primaryAction: z.ZodOptional<z.ZodString>;
        reads: z.ZodOptional<z.ZodArray<z.ZodString>>;
        writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
        usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
        emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
        contract: z.ZodOptional<z.ZodObject<{
            input: z.ZodOptional<z.ZodString>;
            output: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
    }, z.core.$strip>>;
    codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
        path: z.ZodString;
        role: z.ZodEnum<{
            entrypoint: "entrypoint";
            handler: "handler";
            schema: "schema";
            test: "test";
            docs: "docs";
            config: "config";
        }>;
        symbol: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>>;
    kind: z.ZodLiteral<"agent">;
    agentKind: z.ZodEnum<{
        platform: "platform";
        orchestrator: "orchestrator";
        specialist: "specialist";
        utility: "utility";
    }>;
    actsAsRoleId: z.ZodOptional<z.ZodString>;
    sessionCapable: z.ZodBoolean;
    invocations: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
        kind: z.ZodLiteral<"slash-command">;
        command: z.ZodString;
        toolFactory: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>, z.ZodObject<{
        kind: z.ZodLiteral<"mcp-tool">;
        server: z.ZodString;
        name: z.ZodString;
    }, z.core.$strip>, z.ZodObject<{
        kind: z.ZodLiteral<"api-endpoint">;
        method: z.ZodEnum<{
            GET: "GET";
            POST: "POST";
            PATCH: "PATCH";
            DELETE: "DELETE";
        }>;
        path: z.ZodString;
        requestSchema: z.ZodOptional<z.ZodString>;
        responseSchema: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>, z.ZodObject<{
        kind: z.ZodLiteral<"script-execution">;
        resourceId: z.ZodString;
    }, z.core.$strip>], "kind">>>;
    emits: z.ZodOptional<z.ZodArray<z.ZodObject<{
        eventKey: z.ZodString;
        label: z.ZodString;
        payloadSchema: z.ZodOptional<z.ZodString>;
        lifecycle: z.ZodOptional<z.ZodEnum<{
            active: "active";
            deprecated: "deprecated";
            draft: "draft";
            beta: "beta";
            archived: "archived";
        }>>;
    }, z.core.$strip>>>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodString;
    order: z.ZodDefault<z.ZodNumber>;
    systemPath: z.ZodString;
    title: z.ZodOptional<z.ZodString>;
    description: z.ZodOptional<z.ZodString>;
    ownerRoleId: z.ZodOptional<z.ZodString>;
    status: z.ZodEnum<{
        active: "active";
        deprecated: "deprecated";
        archived: "archived";
    }>;
    ontology: z.ZodOptional<z.ZodObject<{
        actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
        primaryAction: z.ZodOptional<z.ZodString>;
        reads: z.ZodOptional<z.ZodArray<z.ZodString>>;
        writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
        usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
        emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
        contract: z.ZodOptional<z.ZodObject<{
            input: z.ZodOptional<z.ZodString>;
            output: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
    }, z.core.$strip>>;
    codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
        path: z.ZodString;
        role: z.ZodEnum<{
            entrypoint: "entrypoint";
            handler: "handler";
            schema: "schema";
            test: "test";
            docs: "docs";
            config: "config";
        }>;
        symbol: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>>;
    kind: z.ZodLiteral<"integration">;
    provider: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodString;
    order: z.ZodDefault<z.ZodNumber>;
    systemPath: z.ZodString;
    title: z.ZodOptional<z.ZodString>;
    description: z.ZodOptional<z.ZodString>;
    ownerRoleId: z.ZodOptional<z.ZodString>;
    status: z.ZodEnum<{
        active: "active";
        deprecated: "deprecated";
        archived: "archived";
    }>;
    ontology: z.ZodOptional<z.ZodObject<{
        actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
        primaryAction: z.ZodOptional<z.ZodString>;
        reads: z.ZodOptional<z.ZodArray<z.ZodString>>;
        writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
        usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
        emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
        contract: z.ZodOptional<z.ZodObject<{
            input: z.ZodOptional<z.ZodString>;
            output: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
    }, z.core.$strip>>;
    codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
        path: z.ZodString;
        role: z.ZodEnum<{
            entrypoint: "entrypoint";
            handler: "handler";
            schema: "schema";
            test: "test";
            docs: "docs";
            config: "config";
        }>;
        symbol: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>>;
    kind: z.ZodLiteral<"script">;
    language: z.ZodEnum<{
        shell: "shell";
        sql: "sql";
        typescript: "typescript";
        python: "python";
    }>;
    source: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
        file: z.ZodString;
    }, z.core.$strip>]>;
}, z.core.$strip>], "kind">;
type ResourceKind = z.infer<typeof ResourceKindSchema>;
type ResourceGovernanceStatus = z.infer<typeof ResourceGovernanceStatusSchema>;
type ResourceEntry = z.infer<typeof ResourceEntrySchema>;

/**
 * Memory type definitions
 * Types for agent memory management with semantic entry types
 */
/**
 * Semantic memory entry types
 * Use-case agnostic types that describe the purpose of each entry
 * Memory types mirror action types for clarity and filtering
 */
type MemoryEntryType = 'context' | 'input' | 'reasoning' | 'tool-result' | 'delegation-result' | 'error';
/**
 * Memory entry - represents a single entry in agent memory
 * Stored in agent memory, translated by adapters to vendor-specific formats
 */
interface MemoryEntry {
    type: MemoryEntryType;
    content: string;
    timestamp: number;
    turnNumber: number | null;
    iterationNumber: number | null;
}
/**
 * Agent memory - Self-orchestrated memory with session + working storage
 * Agent has full control over what persists, framework handles auto-compaction
 */
interface AgentMemory {
    /**
     * Session memory - Persists for session/conversation duration
     * Never auto-trimmed by framework
     * Agent-managed key-value store for critical information
     * Agent provides strings, framework wraps in MemoryEntry
     */
    sessionMemory: Record<string, MemoryEntry>;
    /**
     * Working memory - Execution history
     * Automatically compacted by framework when needed
     * Agent doesn't control compaction
     */
    history: MemoryEntry[];
}

declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
    objectTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        storage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.core.$loose>>>>;
    linkTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        from: z.ZodString;
        to: z.ZodString;
        cardinality: z.ZodOptional<z.ZodString>;
        via: z.ZodOptional<z.ZodString>;
    }, z.core.$loose>>>>;
    actionTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        actsOn: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
        input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        effects: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
    }, z.core.$loose>>>>;
    catalogTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        kind: z.ZodOptional<z.ZodString>;
        appliesTo: z.ZodOptional<z.ZodString>;
        entries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.core.$loose>>>>;
    eventTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.core.$loose>>>>;
    interfaceTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.core.$loose>>>>;
    valueTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        primitive: z.ZodOptional<z.ZodString>;
    }, z.core.$loose>>>>;
    sharedProperties: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        valueType: z.ZodOptional<z.ZodString>;
        searchable: z.ZodOptional<z.ZodBoolean>;
        pii: z.ZodOptional<z.ZodBoolean>;
    }, z.core.$loose>>>>;
    groups: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
    }, z.core.$loose>>>>;
    endpoints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        route: z.ZodOptional<z.ZodString>;
    }, z.core.$loose>>>>;
}, z.core.$strip>>;
type OntologyScope = z.infer<typeof OntologyScopeSchema>;

declare const SystemApiInterfaceSchema: z.ZodObject<{
    lifecycle: z.ZodDefault<z.ZodEnum<{
        active: "active";
        deprecated: "deprecated";
        draft: "draft";
        archived: "archived";
        disabled: "disabled";
    }>>;
    readinessProfile: z.ZodOptional<z.ZodEnum<{
        "sales.lead-gen.api": "sales.lead-gen.api";
        "sales.crm.api": "sales.crm.api";
        "sales.lead-gen.crm-handoff": "sales.lead-gen.crm-handoff";
    }>>;
    resourceIds: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
}, z.core.$strict>;
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonValue[] | {
    [key: string]: JsonValue;
};
/** Explicit interface needed to annotate the recursive SystemEntrySchema. */
interface SystemEntry {
    id: string;
    label?: string;
    title?: string;
    description?: string;
    kind?: 'product' | 'operational' | 'platform' | 'diagnostic';
    parentSystemId?: string;
    ui?: {
        path: string;
        surfaces: string[];
        icon?: string;
        order?: number;
    };
    lifecycle?: 'draft' | 'beta' | 'active' | 'deprecated' | 'archived';
    responsibleRoleId?: string;
    governedByKnowledge?: string[];
    actions?: {
        actionId: string;
        intent: 'exposes' | 'consumes';
        invocation?: unknown;
    }[];
    policies?: string[];
    drivesGoals?: string[];
    apiInterface?: z.infer<typeof SystemApiInterfaceSchema>;
    /** @deprecated Use lifecycle. Accepted for one publish cycle. */
    status?: 'active' | 'deprecated' | 'archived';
    path?: string;
    icon?: string;
    uiPosition?: 'sidebar-primary' | 'sidebar-bottom';
    enabled?: boolean;
    devOnly?: boolean;
    requiresAdmin?: boolean;
    order: number;
    config?: Record<string, JsonValue>;
    ontology?: OntologyScope;
    systems?: Record<string, SystemEntry>;
    subsystems?: Record<string, SystemEntry>;
}

declare const SurfaceTypeSchema: z.ZodEnum<{
    dashboard: "dashboard";
    settings: "settings";
    graph: "graph";
    page: "page";
    detail: "detail";
    list: "list";
}>;
interface SidebarSurfaceNode {
    type: 'surface';
    label: string;
    path: string;
    surfaceType: z.infer<typeof SurfaceTypeSchema>;
    description?: string;
    icon?: string;
    order?: number;
    targets?: {
        systems?: string[];
        entities?: string[];
        resources?: string[];
        actions?: string[];
    };
    devOnly?: boolean;
    requiresAdmin?: boolean;
}
interface SidebarGroupNode {
    type: 'group';
    label: string;
    description?: string;
    icon?: string;
    order?: number;
    children: Record<string, SidebarNode>;
}
type SidebarNode = SidebarSurfaceNode | SidebarGroupNode;

declare const LinkSchema: z.ZodObject<{
    nodeId: z.ZodString;
    kind: z.ZodEnum<{
        affects: "affects";
        actions: "actions";
        effects: "effects";
        links: "links";
        reads: "reads";
        writes: "writes";
        emits: "emits";
        triggers: "triggers";
        uses: "uses";
        approval: "approval";
        contains: "contains";
        references: "references";
        maps_to: "maps_to";
        governs: "governs";
        originates_from: "originates_from";
        applies_to: "applies_to";
        uses_catalog: "uses_catalog";
    }>;
}, z.core.$strip>;
type Link = z.infer<typeof LinkSchema>;

declare const OrganizationModelSchema: z.ZodObject<{
    version: z.ZodDefault<z.ZodLiteral<1>>;
    snapshotHash: z.ZodOptional<z.ZodString>;
    domainMetadata: z.ZodPipe<z.ZodDefault<z.ZodObject<{
        branding: z.ZodOptional<z.ZodObject<{
            version: z.ZodDefault<z.ZodLiteral<1>>;
            lastModified: z.ZodString;
        }, z.core.$strip>>;
        identity: z.ZodOptional<z.ZodObject<{
            version: z.ZodDefault<z.ZodLiteral<1>>;
            lastModified: z.ZodString;
        }, z.core.$strip>>;
        clients: z.ZodOptional<z.ZodObject<{
            version: z.ZodDefault<z.ZodLiteral<1>>;
            lastModified: z.ZodString;
        }, z.core.$strip>>;
        customers: z.ZodOptional<z.ZodObject<{
            version: z.ZodDefault<z.ZodLiteral<1>>;
            lastModified: z.ZodString;
        }, z.core.$strip>>;
        offerings: z.ZodOptional<z.ZodObject<{
            version: z.ZodDefault<z.ZodLiteral<1>>;
            lastModified: z.ZodString;
        }, z.core.$strip>>;
        roles: z.ZodOptional<z.ZodObject<{
            version: z.ZodDefault<z.ZodLiteral<1>>;
            lastModified: z.ZodString;
        }, z.core.$strip>>;
        goals: z.ZodOptional<z.ZodObject<{
            version: z.ZodDefault<z.ZodLiteral<1>>;
            lastModified: z.ZodString;
        }, z.core.$strip>>;
        systems: z.ZodOptional<z.ZodObject<{
            version: z.ZodDefault<z.ZodLiteral<1>>;
            lastModified: z.ZodString;
        }, z.core.$strip>>;
        ontology: z.ZodOptional<z.ZodObject<{
            version: z.ZodDefault<z.ZodLiteral<1>>;
            lastModified: z.ZodString;
        }, z.core.$strip>>;
        resources: z.ZodOptional<z.ZodObject<{
            version: z.ZodDefault<z.ZodLiteral<1>>;
            lastModified: z.ZodString;
        }, z.core.$strip>>;
        topology: z.ZodOptional<z.ZodObject<{
            version: z.ZodDefault<z.ZodLiteral<1>>;
            lastModified: z.ZodString;
        }, z.core.$strip>>;
        actions: z.ZodOptional<z.ZodObject<{
            version: z.ZodDefault<z.ZodLiteral<1>>;
            lastModified: z.ZodString;
        }, z.core.$strip>>;
        entities: z.ZodOptional<z.ZodObject<{
            version: z.ZodDefault<z.ZodLiteral<1>>;
            lastModified: z.ZodString;
        }, z.core.$strip>>;
        policies: z.ZodOptional<z.ZodObject<{
            version: z.ZodDefault<z.ZodLiteral<1>>;
            lastModified: z.ZodString;
        }, z.core.$strip>>;
        knowledge: z.ZodOptional<z.ZodObject<{
            version: z.ZodDefault<z.ZodLiteral<1>>;
            lastModified: z.ZodString;
        }, z.core.$strip>>;
    }, z.core.$strip>>, z.ZodTransform<{
        branding: {
            version: 1;
            lastModified: string;
        };
        identity: {
            version: 1;
            lastModified: string;
        };
        clients: {
            version: 1;
            lastModified: string;
        };
        customers: {
            version: 1;
            lastModified: string;
        };
        offerings: {
            version: 1;
            lastModified: string;
        };
        roles: {
            version: 1;
            lastModified: string;
        };
        goals: {
            version: 1;
            lastModified: string;
        };
        systems: {
            version: 1;
            lastModified: string;
        };
        ontology: {
            version: 1;
            lastModified: string;
        };
        resources: {
            version: 1;
            lastModified: string;
        };
        topology: {
            version: 1;
            lastModified: string;
        };
        actions: {
            version: 1;
            lastModified: string;
        };
        entities: {
            version: 1;
            lastModified: string;
        };
        policies: {
            version: 1;
            lastModified: string;
        };
        knowledge: {
            version: 1;
            lastModified: string;
        };
    }, {
        branding?: {
            version: 1;
            lastModified: string;
        } | undefined;
        identity?: {
            version: 1;
            lastModified: string;
        } | undefined;
        clients?: {
            version: 1;
            lastModified: string;
        } | undefined;
        customers?: {
            version: 1;
            lastModified: string;
        } | undefined;
        offerings?: {
            version: 1;
            lastModified: string;
        } | undefined;
        roles?: {
            version: 1;
            lastModified: string;
        } | undefined;
        goals?: {
            version: 1;
            lastModified: string;
        } | undefined;
        systems?: {
            version: 1;
            lastModified: string;
        } | undefined;
        ontology?: {
            version: 1;
            lastModified: string;
        } | undefined;
        resources?: {
            version: 1;
            lastModified: string;
        } | undefined;
        topology?: {
            version: 1;
            lastModified: string;
        } | undefined;
        actions?: {
            version: 1;
            lastModified: string;
        } | undefined;
        entities?: {
            version: 1;
            lastModified: string;
        } | undefined;
        policies?: {
            version: 1;
            lastModified: string;
        } | undefined;
        knowledge?: {
            version: 1;
            lastModified: string;
        } | undefined;
    }>>;
    branding: z.ZodDefault<z.ZodObject<{
        organizationName: z.ZodString;
        productName: z.ZodString;
        shortName: z.ZodString;
        description: z.ZodOptional<z.ZodString>;
        logos: z.ZodDefault<z.ZodObject<{
            light: z.ZodOptional<z.ZodString>;
            dark: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        voice: z.ZodOptional<z.ZodString>;
        tagline: z.ZodOptional<z.ZodString>;
        values: z.ZodOptional<z.ZodArray<z.ZodString>>;
        themePresetId: z.ZodOptional<z.ZodString>;
    }, z.core.$loose>>;
    navigation: z.ZodDefault<z.ZodObject<{
        sidebar: z.ZodDefault<z.ZodObject<{
            primary: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<SidebarNode, unknown, z.core.$ZodTypeInternals<SidebarNode, unknown>>>>;
            bottom: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<SidebarNode, unknown, z.core.$ZodTypeInternals<SidebarNode, unknown>>>>;
        }, z.core.$strip>>;
        topbar: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
            id: z.ZodString;
            label: z.ZodString;
            tooltip: z.ZodOptional<z.ZodString>;
            icon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
                message: "message";
                error: "error";
                agent: "agent";
                workflow: "workflow";
                "google-sheets": "google-sheets";
                dashboard: "dashboard";
                calendar: "calendar";
                sales: "sales";
                crm: "crm";
                "lead-gen": "lead-gen";
                projects: "projects";
                clients: "clients";
                operations: "operations";
                monitoring: "monitoring";
                knowledge: "knowledge";
                settings: "settings";
                admin: "admin";
                archive: "archive";
                business: "business";
                finance: "finance";
                platform: "platform";
                seo: "seo";
                playbook: "playbook";
                strategy: "strategy";
                reference: "reference";
                integration: "integration";
                database: "database";
                user: "user";
                team: "team";
                gmail: "gmail";
                attio: "attio";
                overview: "overview";
                "command-view": "command-view";
                "command-queue": "command-queue";
                pipeline: "pipeline";
                lists: "lists";
                resources: "resources";
                approve: "approve";
                reject: "reject";
                retry: "retry";
                edit: "edit";
                view: "view";
                launch: "launch";
                "message-plus": "message-plus";
                escalate: "escalate";
                promote: "promote";
                submit: "submit";
                email: "email";
                success: "success";
                warning: "warning";
                info: "info";
                pending: "pending";
                bolt: "bolt";
                building: "building";
                briefcase: "briefcase";
                apps: "apps";
                graph: "graph";
                shield: "shield";
                users: "users";
                "chart-bar": "chart-bar";
                search: "search";
            }>, z.ZodString]>>;
            order: z.ZodOptional<z.ZodNumber>;
            enabled: z.ZodDefault<z.ZodBoolean>;
            devOnly: z.ZodOptional<z.ZodBoolean>;
            requiresAdmin: z.ZodOptional<z.ZodBoolean>;
            targets: z.ZodOptional<z.ZodDefault<z.ZodObject<{
                systems: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
                entities: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
                resources: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
                actions: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
            }, z.core.$strip>>>;
        }, z.core.$strip>>>;
    }, z.core.$strip>>;
    identity: z.ZodDefault<z.ZodObject<{
        mission: z.ZodDefault<z.ZodString>;
        vision: z.ZodDefault<z.ZodString>;
        legalName: z.ZodDefault<z.ZodString>;
        entityType: z.ZodDefault<z.ZodString>;
        jurisdiction: z.ZodDefault<z.ZodString>;
        industryCategory: z.ZodDefault<z.ZodString>;
        geographicFocus: z.ZodDefault<z.ZodString>;
        timeZone: z.ZodDefault<z.ZodString>;
        businessHours: z.ZodDefault<z.ZodObject<{
            monday: z.ZodOptional<z.ZodObject<{
                open: z.ZodString;
                close: z.ZodString;
            }, z.core.$strip>>;
            tuesday: z.ZodOptional<z.ZodObject<{
                open: z.ZodString;
                close: z.ZodString;
            }, z.core.$strip>>;
            wednesday: z.ZodOptional<z.ZodObject<{
                open: z.ZodString;
                close: z.ZodString;
            }, z.core.$strip>>;
            thursday: z.ZodOptional<z.ZodObject<{
                open: z.ZodString;
                close: z.ZodString;
            }, z.core.$strip>>;
            friday: z.ZodOptional<z.ZodObject<{
                open: z.ZodString;
                close: z.ZodString;
            }, z.core.$strip>>;
            saturday: z.ZodOptional<z.ZodObject<{
                open: z.ZodString;
                close: z.ZodString;
            }, z.core.$strip>>;
            sunday: z.ZodOptional<z.ZodObject<{
                open: z.ZodString;
                close: z.ZodString;
            }, z.core.$strip>>;
        }, z.core.$strip>>;
        clientBrief: z.ZodDefault<z.ZodString>;
        organizationName: z.ZodOptional<z.ZodString>;
        productName: z.ZodOptional<z.ZodString>;
        shortName: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
    }, z.core.$loose>>;
    clients: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        slug: z.ZodString;
        name: z.ZodString;
        status: z.ZodDefault<z.ZodEnum<{
            active: "active";
            onboarding: "onboarding";
            paused: "paused";
            completed: "completed";
            churned: "churned";
        }>>;
        source: z.ZodOptional<z.ZodString>;
        identity: z.ZodDefault<z.ZodObject<{
            organizationName: z.ZodOptional<z.ZodString>;
            shortName: z.ZodOptional<z.ZodString>;
            clientBrief: z.ZodDefault<z.ZodString>;
            geographicFocus: z.ZodDefault<z.ZodArray<z.ZodString>>;
            timeZone: z.ZodDefault<z.ZodString>;
        }, z.core.$loose>>;
        branding: z.ZodDefault<z.ZodObject<{
            voice: z.ZodOptional<z.ZodString>;
            tagline: z.ZodOptional<z.ZodString>;
            values: z.ZodDefault<z.ZodArray<z.ZodString>>;
        }, z.core.$loose>>;
        workspace: z.ZodDefault<z.ZodObject<{
            kind: z.ZodOptional<z.ZodEnum<{
                "external-project": "external-project";
                "internal-project": "internal-project";
                none: "none";
            }>>;
            owner: z.ZodOptional<z.ZodEnum<{
                platform: "platform";
                client: "client";
                developer: "developer";
            }>>;
            projectId: z.ZodOptional<z.ZodString>;
            workspacePath: z.ZodOptional<z.ZodString>;
        }, z.core.$loose>>;
        links: z.ZodDefault<z.ZodObject<{
            projectIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
            primaryCompanyId: z.ZodOptional<z.ZodString>;
            primaryContactId: z.ZodOptional<z.ZodString>;
            sourceDealId: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        prompts: z.ZodDefault<z.ZodObject<{
            defaultContext: z.ZodDefault<z.ZodString>;
        }, z.core.$loose>>;
        config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
        customValues: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
    }, z.core.$strict>>>>;
    customers: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        order: z.ZodNumber;
        name: z.ZodDefault<z.ZodString>;
        description: z.ZodDefault<z.ZodString>;
        jobsToBeDone: z.ZodDefault<z.ZodString>;
        pains: z.ZodDefault<z.ZodArray<z.ZodString>>;
        gains: z.ZodDefault<z.ZodArray<z.ZodString>>;
        firmographics: z.ZodDefault<z.ZodObject<{
            industry: z.ZodOptional<z.ZodString>;
            companySize: z.ZodOptional<z.ZodString>;
            region: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        valueProp: z.ZodDefault<z.ZodString>;
    }, z.core.$strip>>>>;
    offerings: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        order: z.ZodNumber;
        name: z.ZodDefault<z.ZodString>;
        description: z.ZodDefault<z.ZodString>;
        pricingModel: z.ZodDefault<z.ZodEnum<{
            custom: "custom";
            "one-time": "one-time";
            subscription: "subscription";
            "usage-based": "usage-based";
        }>>;
        price: z.ZodDefault<z.ZodNumber>;
        currency: z.ZodDefault<z.ZodString>;
        targetSegmentIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
        deliveryFeatureId: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>>>;
    roles: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        order: z.ZodNumber;
        title: z.ZodString;
        responsibilities: z.ZodDefault<z.ZodArray<z.ZodString>>;
        reportsToId: z.ZodOptional<z.ZodString>;
        heldBy: z.ZodOptional<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
            kind: z.ZodLiteral<"human">;
            userId: z.ZodString;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"agent">;
            agentId: z.ZodString;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"team">;
            memberIds: z.ZodArray<z.ZodString>;
        }, z.core.$strip>], "kind">, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
            kind: z.ZodLiteral<"human">;
            userId: z.ZodString;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"agent">;
            agentId: z.ZodString;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"team">;
            memberIds: z.ZodArray<z.ZodString>;
        }, z.core.$strip>], "kind">>]>>;
        responsibleFor: z.ZodOptional<z.ZodArray<z.ZodString>>;
    }, z.core.$strip>>>>;
    goals: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        order: z.ZodNumber;
        description: z.ZodString;
        periodStart: z.ZodString;
        periodEnd: z.ZodString;
        keyResults: z.ZodDefault<z.ZodArray<z.ZodObject<{
            id: z.ZodString;
            description: z.ZodString;
            targetMetric: z.ZodString;
            currentValue: z.ZodDefault<z.ZodNumber>;
            targetValue: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
    }, z.core.$strip>>>>;
    systems: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<SystemEntry, unknown, z.core.$ZodTypeInternals<SystemEntry, unknown>>>>>;
    ontology: z.ZodDefault<z.ZodDefault<z.ZodObject<{
        objectTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
            id: z.ZodString;
            label: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodString>;
            ownerSystemId: z.ZodOptional<z.ZodString>;
            aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
            properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
            storage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        }, z.core.$loose>>>>;
        linkTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
            id: z.ZodString;
            label: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodString>;
            ownerSystemId: z.ZodOptional<z.ZodString>;
            aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
            from: z.ZodString;
            to: z.ZodString;
            cardinality: z.ZodOptional<z.ZodString>;
            via: z.ZodOptional<z.ZodString>;
        }, z.core.$loose>>>>;
        actionTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
            id: z.ZodString;
            label: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodString>;
            ownerSystemId: z.ZodOptional<z.ZodString>;
            aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
            actsOn: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
            input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
            effects: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
        }, z.core.$loose>>>>;
        catalogTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
            id: z.ZodString;
            label: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodString>;
            ownerSystemId: z.ZodOptional<z.ZodString>;
            aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
            kind: z.ZodOptional<z.ZodString>;
            appliesTo: z.ZodOptional<z.ZodString>;
            entries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        }, z.core.$loose>>>>;
        eventTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
            id: z.ZodString;
            label: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodString>;
            ownerSystemId: z.ZodOptional<z.ZodString>;
            aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
            payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        }, z.core.$loose>>>>;
        interfaceTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
            id: z.ZodString;
            label: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodString>;
            ownerSystemId: z.ZodOptional<z.ZodString>;
            aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
            properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        }, z.core.$loose>>>>;
        valueTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
            id: z.ZodString;
            label: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodString>;
            ownerSystemId: z.ZodOptional<z.ZodString>;
            aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
            primitive: z.ZodOptional<z.ZodString>;
        }, z.core.$loose>>>>;
        sharedProperties: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
            id: z.ZodString;
            label: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodString>;
            ownerSystemId: z.ZodOptional<z.ZodString>;
            aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
            valueType: z.ZodOptional<z.ZodString>;
            searchable: z.ZodOptional<z.ZodBoolean>;
            pii: z.ZodOptional<z.ZodBoolean>;
        }, z.core.$loose>>>>;
        groups: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
            id: z.ZodString;
            label: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodString>;
            ownerSystemId: z.ZodOptional<z.ZodString>;
            aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
            members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
        }, z.core.$loose>>>>;
        endpoints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
            id: z.ZodString;
            label: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodString>;
            ownerSystemId: z.ZodOptional<z.ZodString>;
            aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
            route: z.ZodOptional<z.ZodString>;
        }, z.core.$loose>>>>;
    }, z.core.$strip>>>;
    resources: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
        id: z.ZodString;
        order: z.ZodDefault<z.ZodNumber>;
        systemPath: z.ZodString;
        title: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerRoleId: z.ZodOptional<z.ZodString>;
        status: z.ZodEnum<{
            active: "active";
            deprecated: "deprecated";
            archived: "archived";
        }>;
        ontology: z.ZodOptional<z.ZodObject<{
            actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
            primaryAction: z.ZodOptional<z.ZodString>;
            reads: z.ZodOptional<z.ZodArray<z.ZodString>>;
            writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
            usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
            emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
            contract: z.ZodOptional<z.ZodObject<{
                input: z.ZodOptional<z.ZodString>;
                output: z.ZodOptional<z.ZodString>;
            }, z.core.$strip>>;
        }, z.core.$strip>>;
        codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
            path: z.ZodString;
            role: z.ZodEnum<{
                entrypoint: "entrypoint";
                handler: "handler";
                schema: "schema";
                test: "test";
                docs: "docs";
                config: "config";
            }>;
            symbol: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>>;
        kind: z.ZodLiteral<"workflow">;
        emits: z.ZodOptional<z.ZodArray<z.ZodObject<{
            eventKey: z.ZodString;
            label: z.ZodString;
            payloadSchema: z.ZodOptional<z.ZodString>;
            lifecycle: z.ZodOptional<z.ZodEnum<{
                active: "active";
                deprecated: "deprecated";
                draft: "draft";
                beta: "beta";
                archived: "archived";
            }>>;
        }, z.core.$strip>>>;
    }, z.core.$strip>, z.ZodObject<{
        id: z.ZodString;
        order: z.ZodDefault<z.ZodNumber>;
        systemPath: z.ZodString;
        title: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerRoleId: z.ZodOptional<z.ZodString>;
        status: z.ZodEnum<{
            active: "active";
            deprecated: "deprecated";
            archived: "archived";
        }>;
        ontology: z.ZodOptional<z.ZodObject<{
            actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
            primaryAction: z.ZodOptional<z.ZodString>;
            reads: z.ZodOptional<z.ZodArray<z.ZodString>>;
            writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
            usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
            emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
            contract: z.ZodOptional<z.ZodObject<{
                input: z.ZodOptional<z.ZodString>;
                output: z.ZodOptional<z.ZodString>;
            }, z.core.$strip>>;
        }, z.core.$strip>>;
        codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
            path: z.ZodString;
            role: z.ZodEnum<{
                entrypoint: "entrypoint";
                handler: "handler";
                schema: "schema";
                test: "test";
                docs: "docs";
                config: "config";
            }>;
            symbol: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>>;
        kind: z.ZodLiteral<"agent">;
        agentKind: z.ZodEnum<{
            platform: "platform";
            orchestrator: "orchestrator";
            specialist: "specialist";
            utility: "utility";
        }>;
        actsAsRoleId: z.ZodOptional<z.ZodString>;
        sessionCapable: z.ZodBoolean;
        invocations: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
            kind: z.ZodLiteral<"slash-command">;
            command: z.ZodString;
            toolFactory: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"mcp-tool">;
            server: z.ZodString;
            name: z.ZodString;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"api-endpoint">;
            method: z.ZodEnum<{
                GET: "GET";
                POST: "POST";
                PATCH: "PATCH";
                DELETE: "DELETE";
            }>;
            path: z.ZodString;
            requestSchema: z.ZodOptional<z.ZodString>;
            responseSchema: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"script-execution">;
            resourceId: z.ZodString;
        }, z.core.$strip>], "kind">>>;
        emits: z.ZodOptional<z.ZodArray<z.ZodObject<{
            eventKey: z.ZodString;
            label: z.ZodString;
            payloadSchema: z.ZodOptional<z.ZodString>;
            lifecycle: z.ZodOptional<z.ZodEnum<{
                active: "active";
                deprecated: "deprecated";
                draft: "draft";
                beta: "beta";
                archived: "archived";
            }>>;
        }, z.core.$strip>>>;
    }, z.core.$strip>, z.ZodObject<{
        id: z.ZodString;
        order: z.ZodDefault<z.ZodNumber>;
        systemPath: z.ZodString;
        title: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerRoleId: z.ZodOptional<z.ZodString>;
        status: z.ZodEnum<{
            active: "active";
            deprecated: "deprecated";
            archived: "archived";
        }>;
        ontology: z.ZodOptional<z.ZodObject<{
            actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
            primaryAction: z.ZodOptional<z.ZodString>;
            reads: z.ZodOptional<z.ZodArray<z.ZodString>>;
            writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
            usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
            emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
            contract: z.ZodOptional<z.ZodObject<{
                input: z.ZodOptional<z.ZodString>;
                output: z.ZodOptional<z.ZodString>;
            }, z.core.$strip>>;
        }, z.core.$strip>>;
        codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
            path: z.ZodString;
            role: z.ZodEnum<{
                entrypoint: "entrypoint";
                handler: "handler";
                schema: "schema";
                test: "test";
                docs: "docs";
                config: "config";
            }>;
            symbol: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>>;
        kind: z.ZodLiteral<"integration">;
        provider: z.ZodString;
    }, z.core.$strip>, z.ZodObject<{
        id: z.ZodString;
        order: z.ZodDefault<z.ZodNumber>;
        systemPath: z.ZodString;
        title: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerRoleId: z.ZodOptional<z.ZodString>;
        status: z.ZodEnum<{
            active: "active";
            deprecated: "deprecated";
            archived: "archived";
        }>;
        ontology: z.ZodOptional<z.ZodObject<{
            actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
            primaryAction: z.ZodOptional<z.ZodString>;
            reads: z.ZodOptional<z.ZodArray<z.ZodString>>;
            writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
            usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
            emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
            contract: z.ZodOptional<z.ZodObject<{
                input: z.ZodOptional<z.ZodString>;
                output: z.ZodOptional<z.ZodString>;
            }, z.core.$strip>>;
        }, z.core.$strip>>;
        codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
            path: z.ZodString;
            role: z.ZodEnum<{
                entrypoint: "entrypoint";
                handler: "handler";
                schema: "schema";
                test: "test";
                docs: "docs";
                config: "config";
            }>;
            symbol: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>>;
        kind: z.ZodLiteral<"script">;
        language: z.ZodEnum<{
            shell: "shell";
            sql: "sql";
            typescript: "typescript";
            python: "python";
        }>;
        source: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
            file: z.ZodString;
        }, z.core.$strip>]>;
    }, z.core.$strip>], "kind">>>>;
    topology: z.ZodDefault<z.ZodDefault<z.ZodObject<{
        version: z.ZodDefault<z.ZodLiteral<1>>;
        relationships: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
            from: z.ZodDiscriminatedUnion<[z.ZodObject<{
                kind: z.ZodLiteral<"system">;
                id: z.ZodString;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"resource">;
                id: z.ZodString;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"ontology">;
                id: z.ZodString;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"policy">;
                id: z.ZodString;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"role">;
                id: z.ZodString;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"trigger">;
                id: z.ZodString;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"humanCheckpoint">;
                id: z.ZodString;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"externalResource">;
                id: z.ZodString;
            }, z.core.$strip>], "kind">;
            kind: z.ZodEnum<{
                triggers: "triggers";
                uses: "uses";
                approval: "approval";
            }>;
            to: z.ZodDiscriminatedUnion<[z.ZodObject<{
                kind: z.ZodLiteral<"system">;
                id: z.ZodString;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"resource">;
                id: z.ZodString;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"ontology">;
                id: z.ZodString;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"policy">;
                id: z.ZodString;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"role">;
                id: z.ZodString;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"trigger">;
                id: z.ZodString;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"humanCheckpoint">;
                id: z.ZodString;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"externalResource">;
                id: z.ZodString;
            }, z.core.$strip>], "kind">;
            systemPath: z.ZodOptional<z.ZodString>;
            required: z.ZodOptional<z.ZodBoolean>;
            metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
        }, z.core.$strip>>>;
    }, z.core.$strip>>>;
    actions: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        order: z.ZodNumber;
        label: z.ZodString;
        description: z.ZodOptional<z.ZodString>;
        scope: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"global">, z.ZodObject<{
            domain: z.ZodString;
        }, z.core.$strip>]>>;
        resourceId: z.ZodOptional<z.ZodString>;
        affects: z.ZodOptional<z.ZodArray<z.ZodString>>;
        invocations: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
            kind: z.ZodLiteral<"slash-command">;
            command: z.ZodString;
            toolFactory: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"mcp-tool">;
            server: z.ZodString;
            name: z.ZodString;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"api-endpoint">;
            method: z.ZodEnum<{
                GET: "GET";
                POST: "POST";
                PATCH: "PATCH";
                DELETE: "DELETE";
            }>;
            path: z.ZodString;
            requestSchema: z.ZodOptional<z.ZodString>;
            responseSchema: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"script-execution">;
            resourceId: z.ZodString;
        }, z.core.$strip>], "kind">>>;
        knowledge: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
        lifecycle: z.ZodDefault<z.ZodEnum<{
            active: "active";
            deprecated: "deprecated";
            draft: "draft";
            beta: "beta";
            archived: "archived";
        }>>;
    }, z.core.$strip>>>>;
    entities: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        order: z.ZodNumber;
        label: z.ZodString;
        description: z.ZodOptional<z.ZodString>;
        ownedBySystemId: z.ZodString;
        table: z.ZodOptional<z.ZodString>;
        rowSchema: z.ZodOptional<z.ZodString>;
        stateCatalogId: z.ZodOptional<z.ZodString>;
        links: z.ZodOptional<z.ZodArray<z.ZodObject<{
            toEntity: z.ZodString;
            kind: z.ZodEnum<{
                "belongs-to": "belongs-to";
                "has-many": "has-many";
                "has-one": "has-one";
                "many-to-many": "many-to-many";
            }>;
            via: z.ZodOptional<z.ZodString>;
            label: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>>;
    }, z.core.$strip>>>>;
    policies: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        order: z.ZodNumber;
        label: z.ZodString;
        description: z.ZodOptional<z.ZodString>;
        trigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
            kind: z.ZodLiteral<"event">;
            eventId: z.ZodString;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"action-invocation">;
            actionId: z.ZodString;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"schedule">;
            cron: z.ZodString;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"manual">;
        }, z.core.$strip>], "kind">;
        predicate: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
            kind: z.ZodLiteral<"always">;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"expression">;
            expression: z.ZodString;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"threshold">;
            metric: z.ZodString;
            operator: z.ZodEnum<{
                lt: "lt";
                lte: "lte";
                eq: "eq";
                gte: "gte";
                gt: "gt";
            }>;
            value: z.ZodNumber;
        }, z.core.$strip>], "kind">>;
        actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
            kind: z.ZodLiteral<"require-approval">;
            roleId: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"invoke-action">;
            actionId: z.ZodString;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"notify-role">;
            roleId: z.ZodString;
        }, z.core.$strip>, z.ZodObject<{
            kind: z.ZodLiteral<"block">;
        }, z.core.$strip>], "kind">>;
        appliesTo: z.ZodDefault<z.ZodObject<{
            systemIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
            actionIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
            resourceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
            roleIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
        }, z.core.$strip>>;
        lifecycle: z.ZodDefault<z.ZodEnum<{
            active: "active";
            deprecated: "deprecated";
            draft: "draft";
            beta: "beta";
            archived: "archived";
        }>>;
    }, z.core.$strip>>>>;
    knowledge: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        kind: z.ZodEnum<{
            playbook: "playbook";
            strategy: "strategy";
            reference: "reference";
        }>;
        title: z.ZodString;
        summary: z.ZodString;
        icon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
            message: "message";
            error: "error";
            agent: "agent";
            workflow: "workflow";
            "google-sheets": "google-sheets";
            dashboard: "dashboard";
            calendar: "calendar";
            sales: "sales";
            crm: "crm";
            "lead-gen": "lead-gen";
            projects: "projects";
            clients: "clients";
            operations: "operations";
            monitoring: "monitoring";
            knowledge: "knowledge";
            settings: "settings";
            admin: "admin";
            archive: "archive";
            business: "business";
            finance: "finance";
            platform: "platform";
            seo: "seo";
            playbook: "playbook";
            strategy: "strategy";
            reference: "reference";
            integration: "integration";
            database: "database";
            user: "user";
            team: "team";
            gmail: "gmail";
            attio: "attio";
            overview: "overview";
            "command-view": "command-view";
            "command-queue": "command-queue";
            pipeline: "pipeline";
            lists: "lists";
            resources: "resources";
            approve: "approve";
            reject: "reject";
            retry: "retry";
            edit: "edit";
            view: "view";
            launch: "launch";
            "message-plus": "message-plus";
            escalate: "escalate";
            promote: "promote";
            submit: "submit";
            email: "email";
            success: "success";
            warning: "warning";
            info: "info";
            pending: "pending";
            bolt: "bolt";
            building: "building";
            briefcase: "briefcase";
            apps: "apps";
            graph: "graph";
            shield: "shield";
            users: "users";
            "chart-bar": "chart-bar";
            search: "search";
        }>, z.ZodString]>>;
        externalUrl: z.ZodOptional<z.ZodString>;
        sourceFilePath: z.ZodOptional<z.ZodString>;
        body: z.ZodString;
        links: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodUnion<readonly [z.ZodObject<{
            target: z.ZodObject<{
                kind: z.ZodEnum<{
                    knowledge: "knowledge";
                    system: "system";
                    resource: "resource";
                    action: "action";
                    ontology: "ontology";
                    role: "role";
                    client: "client";
                    stage: "stage";
                    goal: "goal";
                    "customer-segment": "customer-segment";
                    offering: "offering";
                }>;
                id: z.ZodString;
            }, z.core.$strip>;
        }, z.core.$strip>, z.ZodObject<{
            nodeId: z.ZodUnion<readonly [z.ZodString, z.ZodTemplateLiteral<`ontology:${string}`>]>;
        }, z.core.$strip>]>, z.ZodTransform<{
            target: {
                kind: "knowledge" | "system" | "resource" | "action" | "ontology" | "role" | "client" | "stage" | "goal" | "customer-segment" | "offering";
                id: string;
            };
            nodeId: string;
        }, {
            nodeId: string;
        } | {
            target: {
                kind: "knowledge" | "system" | "resource" | "action" | "ontology" | "role" | "client" | "stage" | "goal" | "customer-segment" | "offering";
                id: string;
            };
        }>>>>;
        ownerIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
        updatedAt: z.ZodString;
    }, z.core.$strip>>>>;
}, z.core.$strip>;

type OrganizationModel = z.infer<typeof OrganizationModelSchema>;

/**
 * Session Data Transfer Object (DTO)
 * Transform type for API responses (snake_case DB → camelCase frontend)
 * Used by frontend apps to display session data
 */
interface SessionDTO {
    sessionId: string;
    resourceId: string;
    organizationId: string;
    userId?: string | null;
    turnCount: number;
    isEnded: boolean;
    title?: string | null;
    memorySnapshot?: AgentMemory;
    metadata?: Record<string, unknown> | null;
    createdAt: Date;
    updatedAt: Date;
    endedAt?: Date | null;
}

/**
 * Time range selector for dashboard metrics
 */
type TimeRange = '1h' | '24h' | '7d' | '30d';
/**
 * Execution health metrics response
 * Success rate, P95 duration, execution counts, and trend data
 * trendData includes executionCount for throughput visualization (eliminates separate API call)
 */
interface ExecutionHealthMetrics {
    successRate: number;
    p95Duration: number;
    totalExecutions: number;
    trendData: Array<{
        time: string;
        rate: number;
        successCount: number;
        errorCount: number;
        warningCount: number;
        executionCount: number;
    }>;
    statusCounts: {
        success: number;
        failed: number;
        pending: number;
        warning: number;
    };
    peakPeriod: string;
    granularity: 'hour' | 'day';
}
/**
 * Business impact metrics response
 * ROI, labor savings, and cost analysis
 */
interface BusinessImpactMetrics {
    totalSavingsUsd: number;
    totalCostUsd: number;
    netSavingsUsd: number;
    roi: number;
}
/**
 * Cost breakdown metrics response
 * Per-resource cost analysis
 */
interface CostBreakdownMetrics {
    resources: Array<{
        resourceId: string;
        totalCostUsd: number;
        executionCount: number;
        avgCostUsd: number;
    }>;
}
/**
 * Dashboard metrics response
 * Aggregates core observability metrics in a single response
 * Note: Throughput data is now included in executionHealth.trendData.executionCount
 */
interface DashboardMetrics {
    executionHealth: ExecutionHealthMetrics;
    costBreakdown: CostBreakdownMetrics;
    businessImpact: BusinessImpactMetrics;
    /** ISO timestamp of the currently active deployment, or null if none */
    activeDeploymentDate: string | null;
    /** Deployment version of the active deployment, or null if none */
    activeDeploymentVersion: string | null;
}

/**
 * Base Execution Engine type definitions
 * Core types shared across all Execution Engine resources
 */

/**
 * NOTE: AIResource interface has been removed and replaced with ResourceDefinition
 * from registry/types.ts. All resources (executable and non-executable) now extend
 * the unified ResourceDefinition base interface.
 *
 * AgentConfig and WorkflowConfig now extend ResourceDefinition directly.
 * See packages/core/src/registry/types.ts for the base interface definition.
 */
type AIResourceDefinition = SerializedWorkflowDefinition | SerializedAgentDefinition;

/**
 * Resource Registry type definitions
 */

/**
 * Environment/deployment status for resources
 */
type ResourceStatus = 'dev' | 'prod';
/**
 * All resource types in the platform
 * Used as the discriminator field in ResourceDefinition
 */
type ResourceType = 'agent' | 'workflow' | 'trigger' | 'integration' | 'external' | 'human';
type ResourceSystemSummary = Pick<SystemEntry, 'id' | 'title' | 'description' | 'kind' | 'lifecycle'>;
/**
 * Base interface for ALL platform resources
 * Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
 */
interface ResourceDefinition {
    /** Unique resource identifier */
    resourceId: string;
    /** Display name */
    name: string;
    /** Purpose and functionality description */
    description: string;
    /** Version for change tracking and evolution */
    version: string;
    /** Resource type discriminator */
    type: ResourceType;
    /** Environment/deployment status */
    status: ResourceStatus;
    /** Graph links to Organization Model nodes */
    links?: ResourceLink[];
    /** Infrastructure category for filtering */
    category?: ResourceCategory;
    /** Whether the agent supports multi-turn sessions (agents only) */
    sessionCapable?: boolean;
    /** Whether the resource is local (monorepo) or remote (externally deployed) */
    origin?: 'local' | 'remote';
    /** OM System membership — dot-separated system path (e.g. "sys.lead-gen"), when backed by a Resource descriptor */
    systemPath?: string;
    /** Display metadata for the owning OM System */
    system?: ResourceSystemSummary;
    /** Governance lifecycle status from the OM Resource descriptor */
    governanceStatus?: ResourceGovernanceStatus;
    /** Whether this resource is archived and should be excluded from registration and deployment */
    archived?: boolean;
}

declare const ResourceCategorySchema: z.ZodEnum<{
    diagnostic: "diagnostic";
    production: "production";
    internal: "internal";
    testing: "testing";
}>;
type ResourceCategory = z.infer<typeof ResourceCategorySchema>;
type ResourceLink = Link;

interface ResourcesPageProps {
    /** Initial filter type from the URL search param (caller-managed) */
    initialFilter?: ResourceType;
    /** Called when the user changes the tab filter — caller should update its URL */
    onTypeChange: (type: ResourceType | undefined) => void;
    /** Current time range value — caller passes from its own store */
    timeRange: TimeRange;
    /** Called when the user clicks a resource row — caller handles navigation */
    onResourceClick: (resource: ResourceDefinition) => void;
    /** Items per page (defaults to 20) */
    pageSize?: number;
}
declare function ResourcesPage({ initialFilter, onTypeChange, timeRange, onResourceClick, pageSize }: ResourcesPageProps): react_jsx_runtime.JSX.Element;

interface OperationsOverviewProps {
    /**
     * Active time range for all metrics queries.
     */
    timeRange: TimeRange;
    /**
     * Business-impact metrics computed by the CC wrapper.
     * Stays CC-local per decision lock #4.
     * TODO(Wave 2): thread to HeroStatsRow once the CC wrapper wires it through.
     */
    businessImpact?: ReturnType<() => {
        data: BusinessImpactMetrics | undefined;
        isLoading: boolean;
    }>;
    /**
     * Cost breakdown metrics computed by the CC wrapper.
     * Stays CC-local per decision lock #4.
     * TODO(Wave 2): thread to HeroStatsRow once the CC wrapper wires it through.
     */
    costBreakdown?: ReturnType<() => {
        data: CostBreakdownMetrics | undefined;
        isLoading: boolean;
    }>;
    /**
     * Called when the user clicks a resource card.
     */
    onResourceClick?: (params: {
        resourceId: string;
        resourceType?: string;
    }) => void;
    /**
     * Called when the user wants to drill into the unresolved errors view.
     */
    onErrorsNavigate?: () => void;
    /**
     * Called when the user wants to navigate to the command queue.
     * Minor refinement over locked props shape — OperationalOverview has this link target.
     */
    onCommandQueueNavigate?: () => void;
    /**
     * Called when the user wants to navigate to the task scheduler.
     * Minor refinement over locked props shape — OperationalOverview has this link target.
     */
    onScheduledTasksNavigate?: () => void;
    /**
     * Custom render function for the execution trend chart.
     * The wrapper owns the chart implementation (CC uses its monitoring-local CombinedTrendChart).
     * Receives executionHealth data, loading state, and error from useDashboardMetrics.
     * If omitted, the trend chart section is not rendered.
     */
    renderTrendChart?: (data: DashboardMetrics['executionHealth'] | undefined, isLoading: boolean, error?: Error) => ReactNode;
    /**
     * Optional override for the lower operational summary panel.
     * Command Center uses this to place the operational tabs beside app-local
     * widgets while keeping the same data-fetching and navigation contract.
     */
    renderOperationalOverview?: (props: OperationalOverviewPanelProps) => ReactNode;
}
declare function OperationsOverview({ timeRange, onResourceClick, onErrorsNavigate, onCommandQueueNavigate, onScheduledTasksNavigate, renderTrendChart, renderOperationalOverview }: OperationsOverviewProps): react_jsx_runtime.JSX.Element;
interface OperationalOverviewPanelProps {
    timeRange: TimeRange;
    onErrorsNavigate?: () => void;
    onCommandQueueNavigate?: () => void;
    onScheduledTasksNavigate?: () => void;
}
declare function DashboardOperationsOverview({ timeRange, onErrorsNavigate, onCommandQueueNavigate, onScheduledTasksNavigate }: OperationalOverviewPanelProps): react_jsx_runtime.JSX.Element;

interface ResourcesSidebarProps {
    timeRange: TimeRange;
}
/**
 * Resources sidebar - shows execution health donut, domain filters and search
 */
declare function ResourcesSidebar({ timeRange }: ResourcesSidebarProps): react_jsx_runtime.JSX.Element;

interface ResourceDetailPageRenderExecutionPanelArgs {
    resourceId: string;
    resourceType: ResourceType;
    resourceName: string;
    resourceDefinition: AIResourceDefinition;
    onConnectionStatus: (connected: boolean, count: number) => void;
}
interface ResourceDetailPageRenderExecuteDialogArgs {
    opened: boolean;
    onClose: () => void;
    resourceId: string;
    resourceType: ResourceType;
    name: string;
}
interface ResourceDetailPageProps {
    /** Resource type (workflow, agent, etc.) */
    type: ResourceType;
    /** Resource identifier */
    resourceId: string;
    /** Current time range value — caller passes from its own store */
    timeRange: TimeRange;
    /**
     * Render-prop slot for the consumer's ExecutionPanel. The shared layout owns connection
     * state and passes it to the slot via `onConnectionStatus`. The resolved
     * `resourceDefinition` is threaded through so the execution panel does not refetch.
     */
    renderExecutionPanel: (args: ResourceDetailPageRenderExecutionPanelArgs) => ReactNode;
    /**
     * Render-prop for the "Run" dialog. Always required — callers supply either a
     * ZodFormRenderer-backed dialog (for registered workflows) or a minimal confirm
     * dialog (for unregistered workflows).
     */
    renderExecuteDialog: (args: ResourceDetailPageRenderExecuteDialogArgs) => ReactNode;
    /** Override "Resources" back-link in the header. Defaults to `/operations/resources`. */
    onNavigateToResources?: () => void;
    /** Override "Go to Sessions" link in the header. Defaults to `/operations/sessions?agent=<resourceId>`. */
    onNavigateToSessions?: () => void;
    /** Override "Back to Operations" in the not-found state. Defaults to `/operations`. */
    onNavigateBack?: () => void;
}
declare function ResourceDetailPage({ type, resourceId, timeRange, renderExecutionPanel, renderExecuteDialog, onNavigateToResources, onNavigateToSessions, onNavigateBack }: ResourceDetailPageProps): react_jsx_runtime.JSX.Element;

interface ExecuteAsyncResult {
    executionId: string;
    status: string;
    resourceId: string;
}

interface FetchEventSourceWithTokenRefreshOptions {
    url: string;
    getToken: () => Promise<string | undefined>;
    headers?: Record<string, string>;
    signal: AbortSignal;
    /** Delay in ms before reconnecting after token refresh. Defaults to 2000. */
    tokenRefreshDelayMs?: number;
    onopen?: (response: Response) => void | Promise<void>;
    onmessage?: (event: EventSourceMessage) => void;
    onerror?: (error: unknown) => void;
    onclose?: () => void;
}

interface SSEConnectionManagerLike {
    subscribe(key: string, subscriberId: string, options: Omit<FetchEventSourceWithTokenRefreshOptions, 'signal'>): () => void;
    closeConnection(key: string): void;
    getConnectionInfo(): Map<string, {
        url: string;
        subscribers: number;
    }>;
}

interface UseExecutionPanelStateOptions {
    resourceId: string;
    manager: SSEConnectionManagerLike;
    /**
     * Base URL of the API server (e.g. 'https://api.elevasis.io' or 'http://localhost:5170').
     * Provided by the consuming app -- the library does not read environment variables directly.
     */
    apiUrl: string;
    limit?: number;
    offset?: number;
    onConnectionStatus?: (connected: boolean, runningCount: number) => void;
    selectedId?: string | null;
    onSelectedIdChange?: (id: string | null) => void;
}

type TaskFilterStatus = 'all' | 'pending' | 'completed' | 'expired';

type SystemSidebarComponent = ComponentType;
type SystemIconComponent = ComponentType<{
    size?: number;
    stroke?: number;
}>;
type SystemSidebarWidthResolver = number | ((context: {
    currentPath: string;
}) => number);
interface SystemModule {
    /** Unique stable identifier for this UI system module. */
    key: string;
    /** Organization Model system id this module presents. Omit for navigation-only app surfaces. */
    systemId?: string;
    /** Route prefixes owned by navigation-only app surfaces. */
    routePrefixes?: string[];
    /** Capability identifiers contributed by this system module. */
    capabilityIds?: string[];
    /** Icon used when this system node appears in shell navigation. */
    icon?: SystemIconComponent;
    /** Sidebar component rendered when this system's subtree route is active. */
    sidebar?: SystemSidebarComponent;
    /** Optional shell sidebar width override. Defaults to 250px. */
    sidebarWidth?: SystemSidebarWidthResolver;
    /** Operations-only bridge connecting this system to the organization graph node. */
    organizationGraph?: OrganizationGraphSystemBridge;
}
interface OrganizationGraphSystemBridge {
    systemId?: string;
}

interface CommandQueuePageProps {
    timeRange?: TimeRange;
    pageSize?: number;
    onNavigateToTask: (taskId: string) => void;
    /** Filter props forwarded from the sidebar */
    selectedCheckpoint?: string;
    status?: TaskFilterStatus;
    priorityRange?: [number, number];
}
declare function CommandQueuePage({ timeRange, pageSize, onNavigateToTask, selectedCheckpoint, status, priorityRange }: CommandQueuePageProps): react_jsx_runtime.JSX.Element;

interface CommandQueueDetailPageRichTextArgs {
    content: string;
    onChange: (content: string) => void;
    placeholder?: string;
}
interface CommandQueueDetailPageProps {
    taskId: string;
    orgName: string;
    renderRichText?: (args: CommandQueueDetailPageRichTextArgs) => ReactNode;
    onNavigateToTask: (taskId: string) => void;
    onNavigateBack: () => void;
    onViewExecution: (type: string, resourceId: string, executionId: string) => void;
}
declare function CommandQueueDetailPage({ taskId, orgName, renderRichText, onNavigateBack, onViewExecution }: CommandQueueDetailPageProps): react_jsx_runtime.JSX.Element;

interface CommandViewPageProps {
    timeRange?: TimeRange;
}
declare function CommandViewPage({ timeRange }: CommandViewPageProps): react_jsx_runtime.JSX.Element;

type OrganizationGraphLens = 'default' | 'command-view';

interface OrganizationGraphPageProps {
    lens?: OrganizationGraphLens;
    timeRange?: TimeRange;
}
declare function OrganizationGraphPage({ lens, timeRange }: OrganizationGraphPageProps): react_jsx_runtime.JSX.Element;

type ExecutionSelectionControlProps$2 = Pick<UseExecutionPanelStateOptions, 'selectedId' | 'onSelectedIdChange'>;
interface ExecutionPanelProps extends ExecutionSelectionControlProps$2 {
    resourceId: string;
    resourceType: ResourceType;
    resourceName?: string;
    resourceDefinition: AIResourceDefinition;
    sseManager: SSEConnectionManagerLike;
    apiUrl: string;
    onConnectionStatus?: (connected: boolean, runningCount: number) => void;
}
declare function ExecutionPanel({ resourceId, resourceType, resourceName, resourceDefinition, sseManager, apiUrl, onConnectionStatus, selectedId, onSelectedIdChange }: ExecutionPanelProps): react_jsx_runtime.JSX.Element;

type ExecutionSelectionControlProps$1 = Pick<UseExecutionPanelStateOptions, 'selectedId' | 'onSelectedIdChange'>;
interface WorkflowExecutionPanelProps extends ExecutionSelectionControlProps$1 {
    resourceId: string;
    resourceName?: string;
    resourceDefinition: SerializedWorkflowDefinition;
    sseManager: SSEConnectionManagerLike;
    apiUrl: string;
    onConnectionStatus?: (connected: boolean, runningCount: number) => void;
}
declare function WorkflowExecutionPanel({ resourceId, resourceDefinition, sseManager, apiUrl, onConnectionStatus, selectedId: controlledSelectedId, onSelectedIdChange }: WorkflowExecutionPanelProps): react_jsx_runtime.JSX.Element;

type ExecutionSelectionControlProps = Pick<UseExecutionPanelStateOptions, 'selectedId' | 'onSelectedIdChange'>;
interface AgentExecutionPanelProps extends ExecutionSelectionControlProps {
    resourceId: string;
    resourceName?: string;
    resourceDefinition: SerializedAgentDefinition;
    sseManager: SSEConnectionManagerLike;
    apiUrl: string;
    onConnectionStatus?: (connected: boolean, runningCount: number) => void;
}
declare function AgentExecutionPanel({ resourceId, resourceDefinition, sseManager, apiUrl, onConnectionStatus, selectedId: controlledSelectedId, onSelectedIdChange }: AgentExecutionPanelProps): react_jsx_runtime.JSX.Element;

interface ExecuteWorkflowModalResource {
    resourceId: string;
    resourceType: ResourceType;
    name?: string;
}
interface ExecuteWorkflowModalProps {
    opened: boolean;
    onClose: () => void;
    resource: ExecuteWorkflowModalResource;
    isPending?: boolean;
    error?: Error | null;
    result?: ExecuteAsyncResult | null;
    onViewExecution?: (executionId: string) => void;
    onReset?: () => void;
    children?: ReactNode;
}
declare function ExecuteWorkflowModal({ opened, onClose, resource, isPending, error, result, onViewExecution, onReset, children }: ExecuteWorkflowModalProps): react_jsx_runtime.JSX.Element;

interface SessionsPageProps {
    /** Whether the organization context is ready; blocks render until true */
    isReady: boolean;
    /** The currently selected agent resource ID (from URL search param) */
    agentParam?: string;
    /** Builds the URL for a session detail page */
    buildSessionDetailUrl: (sessionId: string) => string;
    /** Builds the URL for the sessions list with an agent pre-selected */
    buildSessionListUrl: (agentId: string) => string;
    /** Imperative navigation handler; receives a fully-built URL string */
    onNavigate: (to: string) => void;
}
/**
 * Agent Sessions page — agent grid + selected-agent session list.
 * Agent card selection, new-session creation, and navigation are delegated
 * to DI props so this component has no CC router dependency.
 */
declare function SessionsPage({ isReady, agentParam, buildSessionDetailUrl, buildSessionListUrl, onNavigate }: SessionsPageProps): react_jsx_runtime.JSX.Element;

interface SessionListItem$1 {
    sessionId: string;
    resourceId: string;
    turnCount: number;
    isEnded: boolean;
    createdAt: Date;
    updatedAt: Date;
}
interface SessionGroup {
    resourceId: string;
    agentName: string;
    sessions: SessionListItem$1[];
    isExpanded: boolean;
}
/**
 * WebSocket connection state
 */
interface WebSocketState {
    isConnected: boolean;
    isProcessing: boolean;
    error: string | null;
}

interface ConversationViewSlotArgs {
    sessionId: string;
    onConnectionStateChange?: (state: WebSocketState) => void;
    emptyStateText?: string;
    emptyStateSubtext?: string;
    placeholder?: string;
}
interface SessionChatInterfaceProps {
    sessionId: string;
    onConnectionStateChange?: (state: WebSocketState) => void;
    renderConversationView: (args: ConversationViewSlotArgs) => ReactNode;
}
/**
 * Session chat interface for the session detail page.
 * Thin wrapper that delegates rendering to a render-prop slot,
 * allowing CC-local ConversationView (WebSocket-backed) to be injected
 * without coupling @repo/ui to CC-specific infrastructure.
 */
declare function SessionChatInterface({ sessionId, onConnectionStateChange, renderConversationView }: SessionChatInterfaceProps): react_jsx_runtime.JSX.Element;

interface SessionChatPageProps {
    /** Session ID sourced from the URL param; host extracts it from the router */
    sessionId: string;
    /** Whether the organization context is ready; blocks render until true */
    isReady: boolean;
    /** Render-prop that injects the CC-local WebSocket-backed ConversationView */
    renderConversationView: (args: ConversationViewSlotArgs) => ReactNode;
    /** Builds the URL for an execution detail page; forwarded to SessionExecutionLogs */
    buildExecutionUrl: (executionId: string) => string;
    /** Builds the URL to navigate back to the sessions list */
    buildSessionListUrl: () => string;
    /** Organization name used for CLI copy strings in the session sidebar */
    organizationName: string;
}
/**
 * Session chat detail page.
 * Guards on isReady + session load, then renders the full chat layout
 * (header, chat area, execution logs, memory snapshot).
 * WebSocket connectivity is injected via renderConversationView.
 */
declare function SessionChatPage({ sessionId, isReady, renderConversationView, buildExecutionUrl, buildSessionListUrl: _buildSessionListUrl, organizationName }: SessionChatPageProps): react_jsx_runtime.JSX.Element;

interface SessionChatAreaProps {
    sessionId: string;
    session: SessionDTO;
    organizationName: string;
    onDeleted?: () => void;
    renderConversationView: (args: {
        sessionId: string;
        onConnectionStateChange?: (state: WebSocketState) => void;
        emptyStateText?: string;
        emptyStateSubtext?: string;
        placeholder?: string;
    }) => ReactNode;
}
/**
 * Consolidated chat area component with header, chat interface, and sidebar.
 * Handles sidebar state and layout transitions.
 */
declare function SessionChatArea({ sessionId, session, organizationName, onDeleted, renderConversationView }: SessionChatAreaProps): react_jsx_runtime.JSX.Element;

interface SessionHeaderProps {
    session: SessionDTO;
    connectionState: WebSocketState;
    onToggleSidebar: () => void;
    isSidebarOpen: boolean;
    tokenUsage?: {
        used: number;
        total: number;
    };
}
/**
 * Header component for session chat page.
 * Displays session title, connection status, turn count, and sidebar toggle.
 */
declare function SessionHeader({ session: _session, connectionState, onToggleSidebar, isSidebarOpen, tokenUsage }: SessionHeaderProps): react_jsx_runtime.JSX.Element;

interface SessionDetailsSidebarProps {
    session: SessionDTO;
    isOpen: boolean;
    onClose: () => void;
    /** Organization name for CLI copy string */
    organizationName: string;
    /** Called after a successful session delete; wrapper should navigate away */
    onDeleted?: () => void;
}
/**
 * Floating sidebar that displays session details.
 * Slides in from the right, only as tall as the chat interface section.
 */
declare function SessionDetailsSidebar({ session, isOpen, onClose, organizationName, onDeleted }: SessionDetailsSidebarProps): react_jsx_runtime.JSX.Element;

interface SessionListItemProps {
    session: SessionListItem$1;
    /** Called when the session row is clicked; host is responsible for navigation */
    onClick: (sessionId: string) => void;
    /** Whether this session is the currently selected one (drives highlight styles) */
    isSelected?: boolean;
    /** Called after a successful delete; host should navigate away if needed */
    onDeleted?: (sessionId: string) => void;
}
/**
 * A single session row for use in session lists and sidebars.
 * Displays turn count, last activity time, and an inline delete action.
 * Navigation is delegated via the `onClick` DI prop.
 */
declare function SessionListItem({ session, onClick, isSelected, onDeleted }: SessionListItemProps): react_jsx_runtime.JSX.Element;

interface SessionExecutionLogsProps {
    sessionId: string;
    session: SessionDTO;
    /** Builds the URL for an execution detail page; opens in a new tab */
    buildExecutionUrl: (executionId: string) => string;
}
/**
 * Displays execution summary for all turns in a session.
 * Clicking an execution opens the full execution log page in a new tab.
 */
declare function SessionExecutionLogs({ sessionId, session, buildExecutionUrl }: SessionExecutionLogsProps): react_jsx_runtime.JSX.Element;

interface AgentSessionGroupProps {
    group: SessionGroup;
    /** Called when the agent header label is clicked; host is responsible for navigation */
    onAgentClick: (agentId: string) => void;
    /** Called when a session row is clicked; forwarded to SessionListItem */
    onSessionClick: (sessionId: string) => void;
    /** Currently selected session ID, forwarded to SessionListItem for highlight */
    selectedSessionId?: string;
    /** Called after a session is deleted; host should navigate away if the deleted session was selected */
    onSessionDeleted?: (sessionId: string) => void;
}
/**
 * Collapsible session group for the sessions sidebar.
 * Displays an agent header with a badge count, and a collapsible list of sessions beneath it.
 */
declare function AgentSessionGroup({ group, onAgentClick, onSessionClick, selectedSessionId, onSessionDeleted }: AgentSessionGroupProps): react_jsx_runtime.JSX.Element;

interface SessionsSidebarProps {
    /** Whether the organization context is ready; blocks render until true */
    isReady: boolean;
    /** Called when an agent list item is clicked; host is responsible for navigation */
    onAgentClick: (agentId: string) => void;
    /** Builds the URL for a session detail page; forwarded to SessionListItem */
    buildSessionDetailUrl: (sessionId: string) => string;
    /** Current session ID from URL params — undefined when on the list view */
    sessionId?: string;
    /** Current agent param from URL search — undefined when no agent is selected */
    agentParam?: string;
}
/**
 * Agent Sessions sidebar — context-aware navigation panel.
 * Shows an agents list on the list view, or a flat sessions list when viewing a specific session.
 * Router-state (sessionId, agentParam) is injected as DI props.
 */
declare function SessionsSidebar({ isReady, onAgentClick, buildSessionDetailUrl, sessionId, agentParam }: SessionsSidebarProps): react_jsx_runtime.JSX.Element;

declare const OperationsSidebar: () => react_jsx_runtime.JSX.Element;

declare const OperationsSidebarTop: () => null;

declare const OperationsSidebarMiddle: () => react_jsx_runtime.JSX.Element;

interface CommandQueueShellProps {
    /** @deprecated Sidebar is now rendered by OperationsSidebarMiddle via the SystemShell. */
    selectedCheckpoint?: string | undefined;
    /** @deprecated Sidebar is now rendered by OperationsSidebarMiddle via the SystemShell. */
    onSelectCheckpoint?: (checkpoint: string | undefined) => void;
    /** @deprecated Sidebar is now rendered by OperationsSidebarMiddle via the SystemShell. */
    status?: TaskFilterStatus;
    /** @deprecated Sidebar is now rendered by OperationsSidebarMiddle via the SystemShell. */
    onStatusChange?: (status: TaskFilterStatus) => void;
    /** @deprecated Sidebar is now rendered by OperationsSidebarMiddle via the SystemShell. */
    priorityRange?: [number, number];
    /** @deprecated Sidebar is now rendered by OperationsSidebarMiddle via the SystemShell. */
    onPriorityRangeChange?: (range: [number, number]) => void;
    children: ReactNode;
}
declare function CommandQueueShell({ children }: CommandQueueShellProps): react_jsx_runtime.JSX.Element;

declare const operationsManifest: SystemModule;

interface SystemOpsViewProps {
    model: OrganizationModel;
    systemPath: string;
    onNavigate: (path: string) => void;
}
declare function SystemOpsView({ model, systemPath, onNavigate }: SystemOpsViewProps): react_jsx_runtime.JSX.Element;

/**
 * v1 shape: resources-only. Queue / Executions / Sessions / Errors are deferred to v2.
 */
interface SystemMetrics {
    /** Total resources in this system branch (direct + descendant). */
    resourceCount: number;
    /** Resources owned directly by this system (not descendants). */
    directResourceCount: number;
    /** Resources owned by descendant systems only. */
    descendantResourceCount: number;
    /** Total direct + descendant resources by resource kind. */
    resourceKindCounts: Record<ResourceKind, number>;
    /** Direct resources by resource kind. */
    directResourceKindCounts: Record<ResourceKind, number>;
    /** Descendant resources by resource kind. */
    descendantResourceKindCounts: Record<ResourceKind, number>;
    /** Resources included in the active rollup. */
    resources: ResourceEntry[];
    /** Resources owned directly by this system. */
    directResources: ResourceEntry[];
    /** Resources owned by descendant systems. */
    descendantResources: ResourceEntry[];
}
/**
 * Compute resource rollup metrics for the given system path.
 *
 * Uses `getResourcesForSystem` with `{ includeDescendants: true }` for the
 * inclusive total and `{ includeDescendants: false }` for direct-only, then
 * derives the descendant count by subtraction.
 *
 * @param model - The full OrganizationModel.
 * @param systemPath - Dot-separated system path (e.g. `'sales.crm'`).
 *   Pass an empty string to aggregate across the entire model root.
 * @returns Metrics object with resource counts.
 */
declare function aggregateSystemMetrics(model: OrganizationModel, systemPath: string): SystemMetrics;
/**
 * Format the resource count attribution as a human-readable string.
 *
 * @example
 * formatResourceAttribution({ resourceCount: 12, directResourceCount: 3, descendantResourceCount: 9 })
 * // "12 total - 3 direct - 9 in subsystems"
 */
declare function formatResourceAttribution(metrics: SystemMetrics): string;

export { AgentExecutionPanel, AgentSessionGroup, CommandQueueDetailPage, CommandQueuePage, CommandQueueShell, CommandViewPage, DashboardOperationsOverview, ExecuteWorkflowModal, ExecutionPanel, OperationsOverview, OperationsSidebar, OperationsSidebarMiddle, OperationsSidebarTop, OrganizationGraphPage, ResourceDetailPage, ResourcesPage, ResourcesSidebar, SessionChatArea, SessionChatInterface, SessionChatPage, SessionDetailsSidebar, SessionExecutionLogs, SessionHeader, SessionListItem, SessionsPage, SessionsSidebar, SystemOpsView, WorkflowExecutionPanel, aggregateSystemMetrics, formatResourceAttribution, operationsManifest };
export type { AgentExecutionPanelProps, AgentSessionGroupProps, CommandQueueDetailPageProps, CommandQueueDetailPageRichTextArgs, CommandQueuePageProps, CommandQueueShellProps, CommandViewPageProps, ConversationViewSlotArgs, ExecuteWorkflowModalProps, ExecuteWorkflowModalResource, ExecutionPanelProps, OperationalOverviewPanelProps, OperationsOverviewProps, ResourceDetailPageProps, ResourceDetailPageRenderExecuteDialogArgs, ResourceDetailPageRenderExecutionPanelArgs, ResourcesPageProps, ResourcesSidebarProps, SessionChatAreaProps, SessionChatInterfaceProps, SessionChatPageProps, SessionDetailsSidebarProps, SessionExecutionLogsProps, SessionHeaderProps, SessionListItemProps, SessionsPageProps, SessionsSidebarProps, SystemMetrics, SystemOpsViewProps, TaskFilterStatus, WorkflowExecutionPanelProps };
