import type { KoiDefaultsConfig } from "./types.koi-defaults.js";
import type { HumanDelayConfig, IdentityConfig } from "./types.base.js";
import type { GroupChatConfig } from "./types.messages.js";
import type { SandboxBrowserSettings, SandboxDockerSettings, SandboxPruneSettings } from "./types.sandbox.js";
import type { KoiToolsConfig, MemorySearchConfig } from "./types.tools.js";
export type KoiModelConfig = string | {
    /** Primary model (provider/model). */
    primary?: string;
    /** Per-koi model fallbacks (provider/model). */
    fallbacks?: string[];
};
export type KoiConfig = {
    id: string;
    default?: boolean;
    name?: string;
    workspace?: string;
    koiDir?: string;
    model?: KoiModelConfig;
    /** Optional allowlist of skills for this koi (omit = all skills; empty = none). */
    skills?: string[];
    memorySearch?: MemorySearchConfig;
    /** Human-like delay between block replies for this koi. */
    humanDelay?: HumanDelayConfig;
    /** Optional per-koi heartbeat overrides. */
    heartbeat?: KoiDefaultsConfig["heartbeat"];
    identity?: IdentityConfig;
    groupChat?: GroupChatConfig;
    subkois?: {
        /** Allow spawning sub-kois under other koi ids. Use "*" to allow any. */
        allowKois?: string[];
        /** Per-koi default model for spawned sub-kois (string or {primary,fallbacks}). */
        model?: string | {
            primary?: string;
            fallbacks?: string[];
        };
    };
    sandbox?: {
        mode?: "off" | "non-main" | "all";
        /** Koi workspace access inside the sandbox. */
        workspaceAccess?: "none" | "ro" | "rw";
        /**
         * Session tools visibility for sandboxed sessions.
         * - "spawned": only allow session tools to target sessions spawned from this session (default)
         * - "all": allow session tools to target any session
         */
        sessionToolsVisibility?: "spawned" | "all";
        /** Container/workspace scope for sandbox isolation. */
        scope?: "session" | "koi" | "shared";
        /** Legacy alias for scope ("session" when true, "shared" when false). */
        perSession?: boolean;
        workspaceRoot?: string;
        /** Docker-specific sandbox overrides for this koi. */
        docker?: SandboxDockerSettings;
        /** Optional sandboxed browser overrides for this koi. */
        browser?: SandboxBrowserSettings;
        /** Auto-prune overrides for this koi. */
        prune?: SandboxPruneSettings;
    };
    tools?: KoiToolsConfig;
};
export type KoisConfig = {
    defaults?: KoiDefaultsConfig;
    list?: KoiConfig[];
};
export type KoiBinding = {
    koiId: string;
    match: {
        channel: string;
        accountId?: string;
        peer?: {
            kind: "dm" | "group" | "channel";
            id: string;
        };
        guildId?: string;
        teamId?: string;
    };
};
