main
 1# frozen_string_literal: true
 2
 3Elelem::Plugins.register(:task) do |agent|
 4  agent.toolbox.add("task",
 5    description: "Delegate subtask to focused agent (complex searches, multi-file analysis)",
 6    params: { prompt: { type: "string" } },
 7    required: ["prompt"]
 8  ) do |a|
 9    sub = Elelem::Agent.new(agent.client, toolbox: agent.toolbox, terminal: agent.terminal,
10      system_prompt: "Research agent. Search, analyze, report. Be concise.")
11    sub.turn(a["prompt"])
12    { result: sub.conversation.last[:content] }
13  end
14end