/**
 * Clone subagent — write-capable worker for delegated spreadsheet and file work.
 *
 * Mirrors the CLI clone role for embedded manage mode: it can do real work and
 * can spawn leaf subagents, but cannot recursively spawn another clone.
 */
import { RUNTIME_THINKING_LEVEL } from '../../../../contracts/agent-settings.js';
import { ShortcutXLAgentModelId } from '../../../model-registry.js';
import { buildSubagentApiReferenceSection } from '../../../prompt/api-reference.js';
import { ACTION_EXECUTION_PROMPT, buildActionModeMainSection } from '../../../prompt/modes/action.js';
import { AGENT_PHILOSOPHY_SECTION, API_HIERARCHY_SECTION, COMMUNICATION_SECTION, DATA_FORMATTING_SECTION, MARKDOWN_PROGRESS_SECTION, SANDBOX_FILESYSTEM, getPlatformIdentity } from '../../../prompt/sections.js';
import { BASH_COMMAND, EXECUTE_CODE, EXECUTE_TOOL, GET_TOOL_INFO, TASK } from '../../tool-names.js';
import { DEFAULT_TASK_SUBAGENT_TIMEOUT_SECONDS } from '../agent-definition.js';
const DESCRIPTION = `\
A write-capable clone of the main agent for delegated spreadsheet and file work. Can spawn general, workbook_reader, and document_reader subagents, but cannot spawn other clones. Use for independent implementation batches that can run in parallel. Tools: execute_code, bash_command, task, get_tool_info, execute_tool.`;
function buildSystemPrompt(ctx) {
    const currentDate = new Date().toISOString().slice(0, 10);
    const platformIdentity = getPlatformIdentity(ctx.platform.name);
    const apiReference = buildSubagentApiReferenceSection(ctx.platform, ctx.spreadsheetReadOnly);
    return [
        buildActionModeMainSection(platformIdentity, currentDate),
        AGENT_PHILOSOPHY_SECTION,
        COMMUNICATION_SECTION,
        SANDBOX_FILESYSTEM,
        MARKDOWN_PROGRESS_SECTION,
        DATA_FORMATTING_SECTION,
        ACTION_EXECUTION_PROMPT,
        API_HIERARCHY_SECTION,
        apiReference
    ].join('\n\n');
}
export const cloneSubagent = {
    name: 'clone',
    description: DESCRIPTION,
    systemPrompt: buildSystemPrompt,
    tools: [GET_TOOL_INFO, EXECUTE_TOOL, EXECUTE_CODE, BASH_COMMAND, TASK],
    model: ShortcutXLAgentModelId.ClaudeOpus48,
    thinkingLevel: RUNTIME_THINKING_LEVEL.Low,
    timeoutSeconds: DEFAULT_TASK_SUBAGENT_TIMEOUT_SECONDS,
    allowedSubagents: ['general', 'workbook_reader', 'document_reader']
};
//# sourceMappingURL=clone.js.map