import { z } from '@botpress/sdk';
import type { StatusVerdict } from '@botpress/runtime';
export type Environment = 'dev' | 'prod';
export type ResourceType = 'integration' | 'plugin' | 'interface';
export declare const integrationDependencyEntrySchema: z.ZodObject<{
    name: z.ZodString;
    version: z.ZodString;
    enabled: z.ZodBoolean;
    config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
    /**
     * Active configuration variant (`configurations[type]`), echoed from Cloud's
     * `getBot` response (WS0). Absent for the default configuration. Lets the
     * status resolver validate against the right variant schema without a cloud
     * roundtrip.
     */
    configurationType: z.ZodOptional<z.ZodString>;
    /**
     * Cloud's install-time verdict of which required fields were still missing
     * when the integration was last installed/enabled (WS0). Persisted only while
     * the integration stays disabled with unchanged config; the offline status
     * resolver reads it as authoritative (Cloud's actual validation beats the
     * catalog spec, and enumerates fields a client-side schema check can't — e.g.
     * OAuth/identifier credentials). A live (online) build trusts the current
     * cloud state over this snapshot instead.
     *
     * Both fields are additive-optional: old legacy locks omit them and still validate
     * against `version: 1` — no schema bump, no migration.
     */
    missingFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    /**
     * Last-known authorization state of an OAuth/connection-gated integration
     * (WS5/#7): set on every cloud refresh when the spec gates on an identifier
     * the cloud bot doesn't have yet; cleared the moment the identifier appears
     * (the user completed the connect flow). Lets the offline surfaces
     * (`adk integrations status`, `adk check`, the deploy gate) report the same
     * `unconfigured` verdict the codegen carrier bakes into the runtime, instead
     * of mapping enabled ⟹ available. Additive-optional like the fields above.
     */
    authorizationPending: z.ZodOptional<z.ZodBoolean>;
}, "strip", {
    name: string;
    version: string;
    enabled: boolean;
    config: Record<string, any>;
    configurationType?: string | undefined;
    missingFields?: string[] | undefined;
    authorizationPending?: boolean | undefined;
}, {
    name: string;
    version: string;
    enabled: boolean;
    configurationType?: string | undefined;
    config?: Record<string, any> | undefined;
    missingFields?: string[] | undefined;
    authorizationPending?: boolean | undefined;
}>;
export type IntegrationDependencyEntry = z.infer<typeof integrationDependencyEntrySchema>;
export declare const pluginDependencyMappingSchema: z.ZodObject<{
    integrationAlias: z.ZodString;
}, "strip", {
    integrationAlias: string;
}, {
    integrationAlias: string;
}>;
export type PluginDependencyMapping = z.infer<typeof pluginDependencyMappingSchema>;
export declare const pluginDependencyEntrySchema: z.ZodObject<{
    name: z.ZodString;
    version: z.ZodString;
    enabled: z.ZodDefault<z.ZodBoolean>;
    config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
    dependencies: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        integrationAlias: z.ZodString;
    }, "strip", {
        integrationAlias: string;
    }, {
        integrationAlias: string;
    }>>>;
    /**
     * Cloud's install-time verdict of which required fields were still missing when
     * the plugin was last installed/enabled (WS0/WS5) — the plugin counterpart of the
     * integration field above, with the same lifecycle: persisted only while the
     * plugin stays disabled with unchanged config, read as authoritative by the
     * offline status resolver, additive-optional (old legacy locks validate unchanged).
     */
    missingFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", {
    name: string;
    version: string;
    enabled: boolean;
    config: Record<string, any>;
    dependencies: Record<string, {
        integrationAlias: string;
    }>;
    missingFields?: string[] | undefined;
}, {
    name: string;
    version: string;
    enabled?: boolean | undefined;
    config?: Record<string, any> | undefined;
    dependencies?: Record<string, {
        integrationAlias: string;
    }> | undefined;
    missingFields?: string[] | undefined;
}>;
export type PluginDependencyEntry = z.infer<typeof pluginDependencyEntrySchema>;
export declare const integrationSnapshotEntrySchema: z.ZodObject<{
    name: z.ZodString;
    version: z.ZodString;
    enabled: z.ZodBoolean;
    configurationType: z.ZodOptional<z.ZodString>;
    config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
    missingFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    authorizationPending: z.ZodOptional<z.ZodBoolean>;
    cloudAlias: z.ZodOptional<z.ZodString>;
    cloudId: z.ZodOptional<z.ZodString>;
    updatedAt: z.ZodOptional<z.ZodString>;
}, "strip", {
    name: string;
    version: string;
    enabled: boolean;
    config: Record<string, any>;
    configurationType?: string | undefined;
    missingFields?: string[] | undefined;
    updatedAt?: string | undefined;
    authorizationPending?: boolean | undefined;
    cloudAlias?: string | undefined;
    cloudId?: string | undefined;
}, {
    name: string;
    version: string;
    enabled: boolean;
    configurationType?: string | undefined;
    config?: Record<string, any> | undefined;
    missingFields?: string[] | undefined;
    updatedAt?: string | undefined;
    authorizationPending?: boolean | undefined;
    cloudAlias?: string | undefined;
    cloudId?: string | undefined;
}>;
export type IntegrationSnapshotEntry = z.infer<typeof integrationSnapshotEntrySchema>;
export declare const pluginSnapshotEntrySchema: z.ZodObject<{
    name: z.ZodString;
    version: z.ZodString;
    enabled: z.ZodDefault<z.ZodBoolean>;
    config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
    dependencies: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        integrationAlias: z.ZodString;
    }, "strip", {
        integrationAlias: string;
    }, {
        integrationAlias: string;
    }>>>;
    missingFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    cloudAlias: z.ZodOptional<z.ZodString>;
    cloudId: z.ZodOptional<z.ZodString>;
    updatedAt: z.ZodOptional<z.ZodString>;
}, "strip", {
    name: string;
    version: string;
    enabled: boolean;
    config: Record<string, any>;
    dependencies: Record<string, {
        integrationAlias: string;
    }>;
    missingFields?: string[] | undefined;
    updatedAt?: string | undefined;
    cloudAlias?: string | undefined;
    cloudId?: string | undefined;
}, {
    name: string;
    version: string;
    enabled?: boolean | undefined;
    config?: Record<string, any> | undefined;
    dependencies?: Record<string, {
        integrationAlias: string;
    }> | undefined;
    missingFields?: string[] | undefined;
    updatedAt?: string | undefined;
    cloudAlias?: string | undefined;
    cloudId?: string | undefined;
}>;
export type PluginSnapshotEntry = z.infer<typeof pluginSnapshotEntrySchema>;
export declare const dependencyStateSchema: z.ZodObject<{
    $schema: z.ZodOptional<z.ZodString>;
    version: z.ZodLiteral<1>;
    env: z.ZodEnum<["dev", "prod"]>;
    integrations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        name: z.ZodString;
        version: z.ZodString;
        enabled: z.ZodBoolean;
        config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
        /**
         * Active configuration variant (`configurations[type]`), echoed from Cloud's
         * `getBot` response (WS0). Absent for the default configuration. Lets the
         * status resolver validate against the right variant schema without a cloud
         * roundtrip.
         */
        configurationType: z.ZodOptional<z.ZodString>;
        /**
         * Cloud's install-time verdict of which required fields were still missing
         * when the integration was last installed/enabled (WS0). Persisted only while
         * the integration stays disabled with unchanged config; the offline status
         * resolver reads it as authoritative (Cloud's actual validation beats the
         * catalog spec, and enumerates fields a client-side schema check can't — e.g.
         * OAuth/identifier credentials). A live (online) build trusts the current
         * cloud state over this snapshot instead.
         *
         * Both fields are additive-optional: old legacy locks omit them and still validate
         * against `version: 1` — no schema bump, no migration.
         */
        missingFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
        /**
         * Last-known authorization state of an OAuth/connection-gated integration
         * (WS5/#7): set on every cloud refresh when the spec gates on an identifier
         * the cloud bot doesn't have yet; cleared the moment the identifier appears
         * (the user completed the connect flow). Lets the offline surfaces
         * (`adk integrations status`, `adk check`, the deploy gate) report the same
         * `unconfigured` verdict the codegen carrier bakes into the runtime, instead
         * of mapping enabled ⟹ available. Additive-optional like the fields above.
         */
        authorizationPending: z.ZodOptional<z.ZodBoolean>;
    }, "strip", {
        name: string;
        version: string;
        enabled: boolean;
        config: Record<string, any>;
        configurationType?: string | undefined;
        missingFields?: string[] | undefined;
        authorizationPending?: boolean | undefined;
    }, {
        name: string;
        version: string;
        enabled: boolean;
        configurationType?: string | undefined;
        config?: Record<string, any> | undefined;
        missingFields?: string[] | undefined;
        authorizationPending?: boolean | undefined;
    }>>>;
    plugins: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        name: z.ZodString;
        version: z.ZodString;
        enabled: z.ZodDefault<z.ZodBoolean>;
        config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
        dependencies: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
            integrationAlias: z.ZodString;
        }, "strip", {
            integrationAlias: string;
        }, {
            integrationAlias: string;
        }>>>;
        /**
         * Cloud's install-time verdict of which required fields were still missing when
         * the plugin was last installed/enabled (WS0/WS5) — the plugin counterpart of the
         * integration field above, with the same lifecycle: persisted only while the
         * plugin stays disabled with unchanged config, read as authoritative by the
         * offline status resolver, additive-optional (old legacy locks validate unchanged).
         */
        missingFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    }, "strip", {
        name: string;
        version: string;
        enabled: boolean;
        config: Record<string, any>;
        dependencies: Record<string, {
            integrationAlias: string;
        }>;
        missingFields?: string[] | undefined;
    }, {
        name: string;
        version: string;
        enabled?: boolean | undefined;
        config?: Record<string, any> | undefined;
        dependencies?: Record<string, {
            integrationAlias: string;
        }> | undefined;
        missingFields?: string[] | undefined;
    }>>>;
}, "strip", {
    version: 1;
    integrations: Record<string, {
        name: string;
        version: string;
        enabled: boolean;
        config: Record<string, any>;
        configurationType?: string | undefined;
        missingFields?: string[] | undefined;
        authorizationPending?: boolean | undefined;
    }>;
    plugins: Record<string, {
        name: string;
        version: string;
        enabled: boolean;
        config: Record<string, any>;
        dependencies: Record<string, {
            integrationAlias: string;
        }>;
        missingFields?: string[] | undefined;
    }>;
    env: "dev" | "prod";
    $schema?: string | undefined;
}, {
    version: 1;
    env: "dev" | "prod";
    integrations?: Record<string, {
        name: string;
        version: string;
        enabled: boolean;
        configurationType?: string | undefined;
        config?: Record<string, any> | undefined;
        missingFields?: string[] | undefined;
        authorizationPending?: boolean | undefined;
    }> | undefined;
    plugins?: Record<string, {
        name: string;
        version: string;
        enabled?: boolean | undefined;
        config?: Record<string, any> | undefined;
        dependencies?: Record<string, {
            integrationAlias: string;
        }> | undefined;
        missingFields?: string[] | undefined;
    }> | undefined;
    $schema?: string | undefined;
}>;
export type DependencyStateData = z.infer<typeof dependencyStateSchema>;
export declare const dependencySnapshotSchema: z.ZodObject<{
    $schema: z.ZodOptional<z.ZodString>;
    version: z.ZodLiteral<1>;
    env: z.ZodEnum<["dev", "prod"]>;
    botId: z.ZodString;
    fetchedAt: z.ZodString;
    botUpdatedAt: z.ZodOptional<z.ZodString>;
    stale: z.ZodOptional<z.ZodBoolean>;
    integrations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        name: z.ZodString;
        version: z.ZodString;
        enabled: z.ZodBoolean;
        configurationType: z.ZodOptional<z.ZodString>;
        config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
        missingFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
        authorizationPending: z.ZodOptional<z.ZodBoolean>;
        cloudAlias: z.ZodOptional<z.ZodString>;
        cloudId: z.ZodOptional<z.ZodString>;
        updatedAt: z.ZodOptional<z.ZodString>;
    }, "strip", {
        name: string;
        version: string;
        enabled: boolean;
        config: Record<string, any>;
        configurationType?: string | undefined;
        missingFields?: string[] | undefined;
        updatedAt?: string | undefined;
        authorizationPending?: boolean | undefined;
        cloudAlias?: string | undefined;
        cloudId?: string | undefined;
    }, {
        name: string;
        version: string;
        enabled: boolean;
        configurationType?: string | undefined;
        config?: Record<string, any> | undefined;
        missingFields?: string[] | undefined;
        updatedAt?: string | undefined;
        authorizationPending?: boolean | undefined;
        cloudAlias?: string | undefined;
        cloudId?: string | undefined;
    }>>>;
    plugins: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        name: z.ZodString;
        version: z.ZodString;
        enabled: z.ZodDefault<z.ZodBoolean>;
        config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
        dependencies: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
            integrationAlias: z.ZodString;
        }, "strip", {
            integrationAlias: string;
        }, {
            integrationAlias: string;
        }>>>;
        missingFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
        cloudAlias: z.ZodOptional<z.ZodString>;
        cloudId: z.ZodOptional<z.ZodString>;
        updatedAt: z.ZodOptional<z.ZodString>;
    }, "strip", {
        name: string;
        version: string;
        enabled: boolean;
        config: Record<string, any>;
        dependencies: Record<string, {
            integrationAlias: string;
        }>;
        missingFields?: string[] | undefined;
        updatedAt?: string | undefined;
        cloudAlias?: string | undefined;
        cloudId?: string | undefined;
    }, {
        name: string;
        version: string;
        enabled?: boolean | undefined;
        config?: Record<string, any> | undefined;
        dependencies?: Record<string, {
            integrationAlias: string;
        }> | undefined;
        missingFields?: string[] | undefined;
        updatedAt?: string | undefined;
        cloudAlias?: string | undefined;
        cloudId?: string | undefined;
    }>>>;
}, "strip", {
    botId: string;
    version: 1;
    integrations: Record<string, {
        name: string;
        version: string;
        enabled: boolean;
        config: Record<string, any>;
        configurationType?: string | undefined;
        missingFields?: string[] | undefined;
        updatedAt?: string | undefined;
        authorizationPending?: boolean | undefined;
        cloudAlias?: string | undefined;
        cloudId?: string | undefined;
    }>;
    plugins: Record<string, {
        name: string;
        version: string;
        enabled: boolean;
        config: Record<string, any>;
        dependencies: Record<string, {
            integrationAlias: string;
        }>;
        missingFields?: string[] | undefined;
        updatedAt?: string | undefined;
        cloudAlias?: string | undefined;
        cloudId?: string | undefined;
    }>;
    env: "dev" | "prod";
    fetchedAt: string;
    $schema?: string | undefined;
    botUpdatedAt?: string | undefined;
    stale?: boolean | undefined;
}, {
    botId: string;
    version: 1;
    env: "dev" | "prod";
    fetchedAt: string;
    integrations?: Record<string, {
        name: string;
        version: string;
        enabled: boolean;
        configurationType?: string | undefined;
        config?: Record<string, any> | undefined;
        missingFields?: string[] | undefined;
        updatedAt?: string | undefined;
        authorizationPending?: boolean | undefined;
        cloudAlias?: string | undefined;
        cloudId?: string | undefined;
    }> | undefined;
    plugins?: Record<string, {
        name: string;
        version: string;
        enabled?: boolean | undefined;
        config?: Record<string, any> | undefined;
        dependencies?: Record<string, {
            integrationAlias: string;
        }> | undefined;
        missingFields?: string[] | undefined;
        updatedAt?: string | undefined;
        cloudAlias?: string | undefined;
        cloudId?: string | undefined;
    }> | undefined;
    $schema?: string | undefined;
    botUpdatedAt?: string | undefined;
    stale?: boolean | undefined;
}>;
export type DependencySnapshotData = z.infer<typeof dependencySnapshotSchema>;
export declare const dependencyMigrationMarkerSchema: z.ZodObject<{
    version: z.ZodLiteral<1>;
    migratedAt: z.ZodString;
    sources: z.ZodArray<z.ZodEnum<["lock", "agentConfig", "cloud"]>, "many">;
}, "strip", {
    version: 1;
    migratedAt: string;
    sources: ("lock" | "agentConfig" | "cloud")[];
}, {
    version: 1;
    migratedAt: string;
    sources: ("lock" | "agentConfig" | "cloud")[];
}>;
export type DependencyMigrationMarker = z.infer<typeof dependencyMigrationMarkerSchema>;
/**
 * A dependency's capability state plus its identity — the flat record surfaced
 * by `adk integrations status --format=json`, the deploy plan, and `adk check`.
 * Embeds the same {@link StatusVerdict} the runtime carrier uses so the build,
 * CLI, and runtime surfaces cannot disagree. Field names are a public contract.
 */
export interface DependencyStatus extends StatusVerdict {
    type: ResourceType;
    alias: string;
    name: string;
    version: string;
    enabled: boolean;
}
export interface AddSpec {
    name: string;
    version?: string;
    alias?: string;
    config?: Record<string, unknown>;
    dependencies?: Record<string, PluginDependencyMapping>;
}
export interface ConfigPatch {
    set?: Record<string, unknown>;
    unset?: string[];
    map?: Record<string, PluginDependencyMapping>;
}
export interface MutationResult {
    ok: boolean;
    noop?: boolean;
    resource?: {
        type: ResourceType;
        alias: string;
        name: string;
        version: string;
    };
    stateChange?: {
        before: unknown;
        after: unknown;
    };
    /** Populated when installing a plugin with auto-resolved interface dependencies. */
    autoResolved?: Array<{
        pluginInterfaceAlias: string;
        integrationAlias: string;
    }>;
    /**
     * Set when a dependency (integration or plugin) was installed but left disabled
     * because Cloud rejected the enable due to missing required configuration.
     * Mirrors the Integration Hub UI behavior.
     */
    installedDisabled?: {
        missingFields: string[];
    };
    /**
     * Set when an OAuth/connection-gated integration was installed disabled because
     * the user hasn't completed the connect flow yet (WS5/#7). The snapshot entry
     * carries `authorizationPending: true` until the cloud bot gains an identifier.
     */
    installedAwaitingAuthorization?: boolean;
}
export interface DiffResult {
    target: Environment;
    snapshotReflectsCloud: boolean;
    delta: {
        addedInSnapshot: Array<{
            type: ResourceType;
            alias: string;
            name: string;
            version: string;
        }>;
        removedInSnapshot: Array<{
            type: ResourceType;
            alias: string;
            name: string;
            version: string;
        }>;
        changedInSnapshot: Array<{
            type: ResourceType;
            alias: string;
            field: string;
        }>;
    };
}
export interface ApplyAction {
    type: ResourceType;
    alias: string;
    action: 'install' | 'upgrade' | 'downgrade' | 'reconfigure' | 'enable' | 'disable' | 'uninstall';
    details?: Record<string, unknown>;
}
export interface ApplyResult {
    target: Environment;
    applied: ApplyAction[];
    skipped: ApplyAction[];
    errors: Array<{
        action: ApplyAction;
        code: string;
        message: string;
        suggestion?: string;
    }>;
    dryRun: boolean;
}
export interface MigrationResult {
    migrated: Environment[];
    warnings: Array<{
        code: string;
        message: string;
    }>;
    skipped: Array<{
        env: Environment;
        reason: string;
    }>;
    legacySources?: Array<'lock' | 'agentConfig'>;
    snapshotWrites?: Environment[];
    cloudWrites?: Environment[];
}
//# sourceMappingURL=types.d.ts.map