package agent

import "cursor-api-proxy/internal/config"

func BuildAgentFixedArgs(cfg config.BridgeConfig, workspaceDir, model string, stream bool) []string {
	args := []string{"--print"}
	if cfg.ApproveMcps {
		args = append(args, "--approve-mcps")
	}
	if cfg.Force {
		args = append(args, "--force")
	}
	if cfg.ChatOnlyWorkspace {
		args = append(args, "--trust")
	}
	args = append(args, "--workspace", workspaceDir)
	args = append(args, "--model", model)
	if stream {
		args = append(args, "--stream-partial-output", "--output-format", "stream-json")
	} else {
		args = append(args, "--output-format", "text")
	}
	return args
}

func BuildAgentCmdArgs(cfg config.BridgeConfig, workspaceDir, model, prompt string, stream bool) []string {
	return append(BuildAgentFixedArgs(cfg, workspaceDir, model, stream), prompt)
}
