'use client';

import { useBgAgents } from './use-bg-agents';
import { useStreamCommand } from './use-stream-command';

export function useMainAgentStream(opts) {
  const { bgAgentList, hasBgActivity } = useBgAgents({ refresh: opts.refresh, runs: opts.runs });
  const stream = useStreamCommand(opts);

  return {
    busy: stream.busy,
    liveText: stream.liveText,
    liveTool: stream.liveTool,
    liveExpanded: stream.liveExpanded,
    setLiveExpanded: stream.setLiveExpanded,
    liveSteps: stream.liveSteps,
    busyStartTime: stream.busyStartTime,
    agentPhase: stream.agentPhase,
    bgAgentList,
    hasBgActivity,
    feedRef: stream.feedRef,
    command: stream.command,
    stop: stream.stop,
    decideApproval: stream.decideApproval,
  };
}
