const LOBSTER_KEY_REQUIRED_MESSAGE = "请先绑定龙虾密钥";
const WORKSPACE_PATH_REQUIRED_MESSAGE = "请先设置工作目录";

export function buildWorkspaceEntryLobsterEnv(apiKey: string | undefined): Record<string, string> {
  const lobsterKey = apiKey?.trim();
  if (!lobsterKey) {
    throw new Error(LOBSTER_KEY_REQUIRED_MESSAGE);
  }

  return {
    QJCLAW_LOBSTER_KEY: lobsterKey,
    OPENCLAW_EMPLOYEE_API_KEY: lobsterKey
  };
}

export function buildWorkspaceEntryWorkspacePathEnv(workspacePathInput: string | undefined): Record<string, string> {
  const workspacePath = workspacePathInput?.trim();
  if (!workspacePath) {
    throw new Error(WORKSPACE_PATH_REQUIRED_MESSAGE);
  }

  return {
    QJCLAW_WORKSPACE_PATH: workspacePath
  };
}
