/**
 * Agent Tools Factory - Creates and configures agent tools
 *
 * Centralizes tool creation logic to keep service.ts focused on orchestration.
 *
 * TTS: auto TTS is applied at the ChannelManager via maybeApplyTtsToPayload().
 * Optional \`text_to_speech\` tool sends explicit voice when TTS is enabled.
 */
import type { AgentTool } from '@earendil-works/pi-agent-core';
import type { Model, Api } from '@earendil-works/pi-ai';
import type { Config } from '../../config/schema.js';
import type { MessageBus } from '../../infra/bus/index.js';
import type { BuiltinMemoryStore } from '../memory/builtin-memory-store.js';
import type { MemoryManager } from '../memory/manager.js';
import type { SessionStore } from '../../session/store.js';
import type { GatewayClarifyRequestFn } from './clarify-tool.js';
import type { CronService } from '../../cron/index.js';
import type { SkillManager } from '../skills/skill-manager.js';
import { type ToolExecutorConfig } from './executor.js';
export interface ToolFactoryDeps {
    workspace: string;
    extensionRegistry?: any;
    getCurrentContext: () => {
        channel: string;
        chatId: string;
        sessionKey: string;
    } | null;
    hookRunner?: import('../../extensions/index.js').ExtensionHookRunner;
    bus: MessageBus;
    toolExecutorConfig?: Partial<ToolExecutorConfig>;
    /** Agent defaults (image tools, etc.); use getter so hot-reloaded config applies. */
    getConfig?: () => Config | undefined;
    /** Session / default chat model for vision tool description. */
    getPrimaryModel?: () => Model<Api>;
    /** Built-in curated memory store (agent home `memories/`). */
    getBuiltinMemoryStore?: () => BuiltinMemoryStore;
    /** Memory orchestration (prefetch/sync + external tools). */
    getMemoryManager?: () => MemoryManager;
    /** Session store for `session_search`. */
    getSessionStore?: () => SessionStore;
    /** When set (gateway webchat), enables the `clarify` tool. */
    gatewayClarify?: {
        requestClarification: GatewayClarifyRequestFn;
    };
    /** Gateway: enables the `cronjob` tool. */
    getCronService?: () => CronService | undefined;
    /** Current session skill indexing (tool gating + allowlist); used by skills_list / skill_view. */
    getSkillIndexingContext?: () => {
        registeredToolNames: string[];
        skillAllowlist?: string[];
    } | undefined;
    /** After skill_manage mutates disk, reload skills + refresh agent prompts (optional). */
    onSkillsFilesystemMutate?: () => void;
    /** Names registered via skill_view for shell env passthrough. */
    getSkillPassthroughEnvVarNames?: () => string[];
    /** Add declared env names for the current session (no values stored). */
    registerSkillEnvPassthrough?: (names: string[]) => void;
}
export interface CreateCoreToolsOptions {
    /** Workspace root for file/shell tools (defaults to factory workspace). */
    workspace?: string;
    /** Canonical `agents/<id>/profile/`: bare SOUL.md / IDENTITY.md resolve here after the workspace. */
    profileMarkdownRoot?: string;
    /** Tool `name` values to omit (e.g. `shell`, `extensions` for extension tools). */
    disabledTools?: Set<string>;
    /** Optional primary model for image tool heuristics. */
    getPrimaryModel?: () => Model<Api>;
    getBuiltinMemoryStore?: () => BuiltinMemoryStore;
    getMemoryManager?: () => MemoryManager;
    /** When set, registers `skills_list` and `skill_view` bound to this workspace\'s skills. */
    getSkillManager?: () => SkillManager;
}
export declare class AgentToolsFactory {
    private deps;
    private browserManager;
    /** One dialog/console supervisor per chat session (browser tab). */
    private readonly browserTaskSupervisors;
    /** Cached readiness probe — keyed by backend mode + extension host:port. */
    private browserReadinessCache;
    constructor(deps: ToolFactoryDeps);
    private browserReadinessKey;
    private checkBrowserReadinessCached;
    /** Invalidate the readiness cache (config hot-reload, settings-page save, etc.). */
    invalidateBrowserReadinessCache(): void;
    private browserSupervisorForTask;
    private acquireBrowserPage;
    private ensureBrowserManager;
    /** Close Playwright and all pages (gateway stop, agent manager dispose, or config hot-reload). */
    shutdownBrowser(): Promise<void>;
    /** Drop the tab for a session when its agent instance is removed. */
    closeBrowserPageForSession(sessionKey: string): Promise<void>;
    createCoreTools(options?: CreateCoreToolsOptions): AgentTool<any, any>[];
    createAllTools(coreOptions?: CreateCoreToolsOptions): AgentTool<any, any>[];
}
