/**
 * Mode-aware orchestration on top of `build-tool-list.ts`. Owns
 * `TOOLS_BY_MODE_NAMES` (action/ask/plan whitelist) and `createDefaultHostTools`,
 * which resolves the session's mode + overrides + skips and delegates.
 */
import { buildHostToolList } from './build-tool-list.js';
import { BASH_COMMAND, EXECUTE_CODE, EXECUTE_TOOL, GET_TOOL_INFO, MODIFY_SKILL, READ_SKILL, REFRESH_CONTEXT, SWITCH_MODE, TAKE_SCREENSHOT, TASK } from './tool-names.js';
/** First-class tool names exposed to the LLM per agent mode. */
export const TOOLS_BY_MODE_NAMES = {
    action: [
        GET_TOOL_INFO,
        EXECUTE_TOOL,
        EXECUTE_CODE,
        BASH_COMMAND,
        TAKE_SCREENSHOT,
        READ_SKILL,
        MODIFY_SKILL,
        REFRESH_CONTEXT,
        TASK,
        SWITCH_MODE
    ],
    ask: [GET_TOOL_INFO, EXECUTE_TOOL, EXECUTE_CODE, BASH_COMMAND, TAKE_SCREENSHOT, READ_SKILL, TASK],
    plan: [
        GET_TOOL_INFO,
        EXECUTE_TOOL,
        EXECUTE_CODE,
        BASH_COMMAND,
        TAKE_SCREENSHOT,
        READ_SKILL,
        TASK,
        SWITCH_MODE
        // Progress belongs in status.md/plan.md files.
    ],
    manage: [
        // Pure orchestration mode: no direct spreadsheet, shell, screenshot, or
        // user-gesture tools. The parent delegates through task and can discover
        // executable-tier tools through get_tool_info / execute_tool.
        TASK,
        GET_TOOL_INFO,
        EXECUTE_TOOL
    ],
    shorty: [
        // /btw side-chat: read-only, minimal. Just enough to answer quick
        // questions about the workbook without going on a tool-using rampage.
        EXECUTE_CODE
        // Sink mode — no switch_mode, no task, no bash.
    ],
    review: [
        // Background self-review: the agent reads memory, traces, skills via
        // bash + execute_code, then writes /memories/suggestions.md. Same agent
        // as the user's main loop — just an introspective prompt.
        GET_TOOL_INFO,
        EXECUTE_TOOL,
        EXECUTE_CODE,
        BASH_COMMAND,
        READ_SKILL,
        TASK
        // Sink mode — no switch_mode, no UI gestures.
    ]
};
export const SUBAGENTS_BY_MODE_NAMES = {
    manage: ['clone', 'workbook_reader', 'document_reader']
};
/** Build the first-class host tool list for the given agent mode. */
export function createDefaultHostTools(options) {
    const toolNames = options.toolNameOverride?.[options.agentMode] ?? TOOLS_BY_MODE_NAMES[options.agentMode];
    return buildHostToolList({
        pendingHostToolRequests: options.pendingHostToolRequests,
        sessionPolicy: options.sessionPolicy,
        agentMode: options.agentMode,
        executeCodeSurface: options.executeCodeSurface,
        streamFn: options.streamFn,
        resolveModel: options.resolveModel,
        getCurrentModel: options.getCurrentModel,
        getApiKey: options.getApiKey,
        getSpeed: options.getSpeed,
        preferCurrentModelForSubagents: options.preferCurrentModelForSubagents,
        emitChildAgentEvent: options.emitChildAgentEvent,
        sessionToolInfoState: options.sessionToolInfoState,
        disabledToolNames: options.disabledToolNames,
        toolNames,
        skipNames: options.skipTools,
        allowedSubagents: SUBAGENTS_BY_MODE_NAMES[options.agentMode],
        promptPlatform: options.promptPlatform,
        applyRuntimeHandoff: options.applyRuntimeHandoff,
        scheduleRefresh: options.scheduleRefresh
    });
}
//# sourceMappingURL=mode-host-tools.js.map