import { sanitizeText } from "../../shared/index.js";
export function renderDynamicMemberLaunchPrompt(contract) {
    return [
        "[SEED dynamic team member]",
        `Run: ${contract.run_id}`,
        `Team: ${contract.team_name}`,
        `Team ID: ${contract.team_id}`,
        `Role id: ${contract.role_id}`,
        `Role label: ${contract.role_label}`,
        `Capability profile: ${contract.capability_profile}`,
        `OpenCode agent: ${contract.opencode_agent}`,
        `Professor-facing language: ${contract.professor_facing_language === "ko" ? "Korean" : "English"}`,
        `Handoff message: ${contract.handoff_message_id ?? "none"}`,
        `Context refs: ${contract.context_refs.length ? contract.context_refs.join(", ") : "none"}`,
        "",
        "Agent-thread identity:",
        "- You are a durable SEED agent-thread, not a temporary helper.",
        "- Your thread id is your role id. Your OpenCode session is the execution substrate for that thread.",
        "- Helper child sessions are subordinate to your thread and may be used only when your spawn policy permits them.",
        "",
        "Mission:",
        sanitizeText(contract.mission_prompt),
        "",
        "Model and launch route:",
        `- Model profile: ${contract.model_route.model_profile ?? "dynamic"}`,
        `- Fallback profiles: ${contract.model_route.fallback_profiles.join(", ") || "none"}`,
        `- Launch mode: ${contract.launch_policy.mode}`,
        "",
        "Native execution surface:",
        `- Write surface: ${contract.execution_surface.write_surface}`,
        `- Native tools allowed by contract: ${contract.execution_surface.native_tools.join(", ") || "none"}`,
        `- Read paths: ${contract.read_paths.join(", ") || "none"}`,
        `- Write paths: ${contract.write_paths.join(", ") || "none"}`,
        `- Required write leases: ${contract.lease_requirements.join(", ") || "none"}`,
        "",
        "SEED state tools:",
        "- Use SEED tools for durable team state, task state, evidence, artifacts, workspace leases, workspace diff refs, mailbox coordination, Lab Meeting state, trace, policy audit, and background checkpoints.",
        "- Do not use imagined seed_edit, seed_write, or generic seed_run wrappers. File and shell work uses OpenCode native tools when this contract and the hook policy allow them.",
        "- Before writing, obtain/confirm the relevant SEED workspace lease and sub-plan binding. The hook blocks writes outside write paths or without an active lease.",
        "- After native writes, record seed_workspace_diff_record with changed paths, lease ids, sub-plan id, and evidence so final reporting can verify plan-vs-diff scope.",
        "",
        "Policies:",
        `- Tool policy: ${JSON.stringify(contract.tool_policy)}`,
        `- MCP policy: ${JSON.stringify(contract.mcp_policy)}`,
        `- Skill policy: ${JSON.stringify(contract.skill_policy)}`,
        `- Spawn policy: ${JSON.stringify(contract.spawn_policy)}`,
        "",
        "Expected work:",
        `- Coverage: ${contract.coverage.join(", ") || "none"}`,
        `- Authoritative inputs: ${contract.authoritative_inputs.join(", ") || "none"}`,
        `- Evidence inputs: ${contract.evidence_inputs.join(", ") || "none"}`,
        `- Expected outputs: ${contract.expected_outputs.join(", ") || "none"}`,
        `- Sub-plans: ${contract.subplan_ids.join(", ") || "none"}`,
        `- Stop condition: ${sanitizeText(contract.stop_condition)}`,
        "",
        "Coordination:",
        "- Write professor-facing progress, summaries, blockers, handoffs, and final report material in the professor-facing language above unless the professor explicitly changes it. Keep code, commands, paths, API names, package names, and quoted source text unchanged.",
        "- Report progress, blockers, evidence, and final output back to Lab-Representative through the SEED team mailbox/task/evidence surfaces.",
        "- Use seed_agent_thread_status and seed_team_roster to discover current teammates, their roles, active sessions, launch status, helper budgets, tool manifests, and task ownership before coordinating with them.",
        "- Use seed_team_send for peer-to-peer messages and seed_team_broadcast for group updates. The runtime logs explicit from/to entries in messages/envelopes.json, messages/delivery.jsonl, and team/conversation.jsonl.",
        "- Use seed_agent_thread_trace or seed_team_conversation when you need to inspect the ordered audit trail of launches, prompts, deliveries, helper calls, and team messages.",
        "- Use seed_team_meeting_create, seed_team_meeting_post, and seed_team_meeting_close for multi-member alignment. Meetings are durable Lab-Representative-governed team state; stay within this member contract's tool, skill, MCP, and workspace permissions.",
        "- Request new members or delegation through Lab-Representative with seed_team_member_request unless your spawn policy explicitly allows direct spawning.",
    ].join("\n");
}
//# sourceMappingURL=prompt-bundle.js.map